LLVMFuzzerTestOneInput:
   60|  13.7k|extern "C" int LLVMFuzzerTestOneInput(const uint8_t* Data, size_t Size) {
   61|  13.7k|  assert(Data);
  ------------------
  |  Branch (61:3): [True: 13.7k, False: 0]
  ------------------
   62|       |
   63|  13.7k|  const rawspeed::Buffer buffer(
   64|  13.7k|      Data, rawspeed::implicit_cast<rawspeed::Buffer::size_type>(Size));
   65|       |
   66|  13.7k|  try {
   67|  13.7k|    rawspeed::PARSER parser(buffer);
   68|       |
   69|  13.7k|#if GETDECODER
   70|  13.7k|#if DECODE
   71|  13.7k|    auto decoder =
   72|  13.7k|#endif
   73|  13.7k|        parser.getDecoder();
   74|  13.7k|#endif
   75|       |
   76|  13.7k|#if DECODE
   77|  13.7k|    decoder->applyCrop = false;
   78|  13.7k|    decoder->interpolateBadPixels = false;
   79|  13.7k|    decoder->failOnUnknown = false;
   80|       |    // decoder->checkSupport(&metadata);
   81|       |
   82|  13.7k|    decoder->decodeRaw();
   83|  13.7k|    decoder->decodeMetaData(&metadata);
   84|  13.7k|#endif
   85|  13.7k|  } catch (const rawspeed::RawParserException&) {
   86|  1.22k|    return 0;
   87|  1.22k|#if GETDECODER
   88|  9.27k|  } catch (const rawspeed::RawDecoderException&) {
   89|  9.27k|    return 0;
   90|  9.27k|#endif
   91|  9.27k|  } catch (const rawspeed::IOException&) {
   92|    894|    return 0;
   93|    894|#if DECODE
   94|    894|  } catch (const rawspeed::RawspeedException&) {
   95|      0|    return 0;
   96|      0|#endif
   97|      0|  }
   98|       |
   99|  2.38k|  return 0;
  100|  13.7k|}

_ZNK8rawspeed16AlignedAllocatorIhLi16EE10deallocateEPhm:
   74|  7.93k|  void deallocate(T* p, std::size_t n) const noexcept {
   75|  7.93k|    invariant(p);
  ------------------
  |  |   27|  7.93k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (75:5): [True: 7.93k, False: 0]
  ------------------
   76|  7.93k|    invariant(n > 0);
  ------------------
  |  |   27|  7.93k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (76:5): [True: 7.93k, False: 0]
  ------------------
   77|  7.93k|    invariant(isAligned(p, alignment));
  ------------------
  |  |   27|  7.93k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (77:5): [True: 7.93k, False: 0]
  ------------------
   78|  7.93k|    operator delete(p, static_cast<std::align_val_t>(alignment));
   79|  7.93k|  }
_ZNK8rawspeed16AlignedAllocatorIhLi16EE8allocateEm:
   47|  7.93k|  [[nodiscard]] T* allocate(std::size_t numElts) const {
   48|  7.93k|    static_assert(size_t(alignment) >= alignof(T), "insufficient alignment");
   49|  7.93k|    invariant(numElts > 0 && "Should not be trying to allocate no elements");
  ------------------
  |  |   27|  7.93k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (49:5): [True: 7.93k, False: 0]
  |  Branch (49:5): [True: 7.93k, Folded]
  |  Branch (49:5): [True: 7.93k, False: 0]
  ------------------
   50|  7.93k|    assert(numElts <= allocator_traits::max_size(*this) &&
  ------------------
  |  Branch (50:5): [True: 7.93k, False: 0]
  |  Branch (50:5): [True: 7.93k, Folded]
  |  Branch (50:5): [True: 7.93k, False: 0]
  ------------------
   51|  7.93k|           "Can allocate this many elements.");
   52|  7.93k|    invariant(numElts <= SIZE_MAX / sizeof(T) &&
  ------------------
  |  |   27|  7.93k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (52:5): [True: 7.93k, False: 0]
  |  Branch (52:5): [True: 7.93k, Folded]
  |  Branch (52:5): [True: 7.93k, False: 0]
  ------------------
   53|  7.93k|              "Byte count calculation will not overflow");
   54|       |
   55|  7.93k|    std::size_t numBytes = sizeof(T) * numElts;
   56|       |
   57|  7.93k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
   58|       |    // workaround ASAN's broken allocator_may_return_null option
   59|       |    // plus, avoidance of libFuzzer's rss_limit_mb option
   60|       |    // if trying to alloc more than 2GB, just return null.
   61|       |    // else it would abort() the whole program...
   62|  7.93k|    if (numBytes > 2UL << 30UL)
  ------------------
  |  Branch (62:9): [True: 0, False: 7.93k]
  ------------------
   63|  7.93k|      ThrowRSE("FUZZ alloc bailout (%zu bytes)", numBytes);
  ------------------
  |  |   95|      0|  ThrowExceptionHelper(rawspeed::RawspeedException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   64|  7.93k|#endif
   65|       |
   66|  7.93k|    auto* r = static_cast<T*>(operator new(
   67|  7.93k|        numBytes, static_cast<std::align_val_t>(alignment)));
   68|  7.93k|    invariant(isAligned(r, alignment));
  ------------------
  |  |   27|  7.93k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (68:5): [True: 7.93k, False: 0]
  ------------------
   69|  7.93k|    if (!r)
  ------------------
  |  Branch (69:9): [True: 0, False: 7.93k]
  ------------------
   70|  7.93k|      ThrowRSE("Out of memory while trying to allocate %zu bytes", numBytes);
  ------------------
  |  |   95|      0|  ThrowExceptionHelper(rawspeed::RawspeedException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   71|  7.93k|    return r;
   72|  7.93k|  }

_ZN8rawspeed10Array1DRefIKhEC2EPS1_i:
  104|  83.0M|    : data(data_), numElts(numElts_) {
  105|  83.0M|  establishClassInvariants();
  106|  83.0M|}
_ZNK8rawspeed10Array1DRefIKhE24establishClassInvariantsEv:
   97|   777M|Array1DRef<T>::establishClassInvariants() const noexcept {
   98|   777M|  invariant(data);
  ------------------
  |  |   27|   777M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (98:3): [True: 777M, False: 18.4E]
  ------------------
   99|   777M|  invariant(numElts >= 0);
  ------------------
  |  |   27|   777M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (99:3): [True: 777M, False: 18.4E]
  ------------------
  100|   777M|}
_ZNK8rawspeed10Array1DRefIKhE5beginEv:
  159|  52.1M|template <class T> inline T* Array1DRef<T>::begin() const {
  160|  52.1M|  establishClassInvariants();
  161|  52.1M|  return addressOf(/*eltIdx=*/0);
  162|  52.1M|}
_ZNK8rawspeed10Array1DRefIKhE9addressOfEi:
  133|  85.6M|Array1DRef<T>::addressOf(const int eltIdx) const {
  134|  85.6M|  establishClassInvariants();
  135|  85.6M|  invariant(eltIdx >= 0);
  ------------------
  |  |   27|  85.6M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (135:3): [True: 85.6M, False: 18.4E]
  ------------------
  136|  85.6M|  invariant(eltIdx <= numElts);
  ------------------
  |  |   27|  85.6M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (136:3): [True: 85.6M, False: 18.4E]
  ------------------
  137|  85.6M|#pragma GCC diagnostic push
  138|  85.6M|#pragma GCC diagnostic ignored "-Wpragmas"
  139|  85.6M|#pragma GCC diagnostic ignored "-Wunknown-warning-option"
  140|  85.6M|#pragma GCC diagnostic ignored "-Wunsafe-buffer-usage"
  141|  85.6M|  return data + eltIdx;
  142|  85.6M|#pragma GCC diagnostic pop
  143|  85.6M|}
_ZNK8rawspeed10Array1DRefIKhE4sizeEv:
  154|   392M|template <class T> inline int Array1DRef<T>::size() const {
  155|   392M|  establishClassInvariants();
  156|   392M|  return numElts;
  157|   392M|}
_ZNK8rawspeed10Array1DRefIKSt4byteE4sizeEv:
  154|   202M|template <class T> inline int Array1DRef<T>::size() const {
  155|   202M|  establishClassInvariants();
  156|   202M|  return numElts;
  157|   202M|}
_ZNK8rawspeed10Array1DRefIKSt4byteE24establishClassInvariantsEv:
   97|   337M|Array1DRef<T>::establishClassInvariants() const noexcept {
   98|   337M|  invariant(data);
  ------------------
  |  |   27|   337M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (98:3): [True: 348M, False: 18.4E]
  ------------------
   99|   348M|  invariant(numElts >= 0);
  ------------------
  |  |   27|   348M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (99:3): [True: 364M, False: 18.4E]
  ------------------
  100|   348M|}
_ZNK8rawspeed10Array1DRefISt4byteE4sizeEv:
  154|   217M|template <class T> inline int Array1DRef<T>::size() const {
  155|   217M|  establishClassInvariants();
  156|   217M|  return numElts;
  157|   217M|}
_ZNK8rawspeed10Array1DRefISt4byteE24establishClassInvariantsEv:
   97|   393M|Array1DRef<T>::establishClassInvariants() const noexcept {
   98|   393M|  invariant(data);
  ------------------
  |  |   27|   393M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (98:3): [True: 395M, False: 18.4E]
  ------------------
   99|   395M|  invariant(numElts >= 0);
  ------------------
  |  |   27|   395M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (99:3): [True: 396M, False: 18.4E]
  ------------------
  100|   395M|}
_ZNK8rawspeed10Array1DRefIKSt4byteE5beginEv:
  159|  7.00M|template <class T> inline T* Array1DRef<T>::begin() const {
  160|  7.00M|  establishClassInvariants();
  161|  7.00M|  return addressOf(/*eltIdx=*/0);
  162|  7.00M|}
_ZNK8rawspeed10Array1DRefIKSt4byteE9addressOfEi:
  133|  13.2M|Array1DRef<T>::addressOf(const int eltIdx) const {
  134|  13.2M|  establishClassInvariants();
  135|  13.2M|  invariant(eltIdx >= 0);
  ------------------
  |  |   27|  13.2M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (135:3): [True: 13.0M, False: 174k]
  ------------------
  136|  13.0M|  invariant(eltIdx <= numElts);
  ------------------
  |  |   27|  13.0M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (136:3): [True: 13.0M, False: 44.5k]
  ------------------
  137|  13.0M|#pragma GCC diagnostic push
  138|  13.0M|#pragma GCC diagnostic ignored "-Wpragmas"
  139|  13.0M|#pragma GCC diagnostic ignored "-Wunknown-warning-option"
  140|  13.0M|#pragma GCC diagnostic ignored "-Wunsafe-buffer-usage"
  141|  13.0M|  return data + eltIdx;
  142|  13.0M|#pragma GCC diagnostic pop
  143|  13.0M|}
_ZNK8rawspeed10Array1DRefIKSt4byteE3endEv:
  163|  19.8k|template <class T> inline T* Array1DRef<T>::end() const {
  164|  19.8k|  establishClassInvariants();
  165|  19.8k|  return addressOf(/*eltIdx=*/numElts);
  166|  19.8k|}
_ZNK8rawspeed10Array1DRefISt4byteE5beginEv:
  159|  7.93M|template <class T> inline T* Array1DRef<T>::begin() const {
  160|  7.93M|  establishClassInvariants();
  161|  7.93M|  return addressOf(/*eltIdx=*/0);
  162|  7.93M|}
_ZNK8rawspeed10Array1DRefISt4byteE9addressOfEi:
  133|  30.7M|Array1DRef<T>::addressOf(const int eltIdx) const {
  134|  30.7M|  establishClassInvariants();
  135|  30.7M|  invariant(eltIdx >= 0);
  ------------------
  |  |   27|  30.7M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (135:3): [True: 30.6M, False: 112k]
  ------------------
  136|  30.6M|  invariant(eltIdx <= numElts);
  ------------------
  |  |   27|  30.6M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (136:3): [True: 30.6M, False: 19.9k]
  ------------------
  137|  30.6M|#pragma GCC diagnostic push
  138|  30.6M|#pragma GCC diagnostic ignored "-Wpragmas"
  139|  30.6M|#pragma GCC diagnostic ignored "-Wunknown-warning-option"
  140|  30.6M|#pragma GCC diagnostic ignored "-Wunsafe-buffer-usage"
  141|  30.6M|  return data + eltIdx;
  142|  30.6M|#pragma GCC diagnostic pop
  143|  30.6M|}
_ZNK8rawspeed10Array1DRefISt4byteE7getCropEii:
  110|  15.5M|Array1DRef<T>::getCrop(int offset, int size) const {
  111|  15.5M|  establishClassInvariants();
  112|  15.5M|  invariant(offset >= 0);
  ------------------
  |  |   27|  15.5M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (112:3): [True: 15.6M, False: 18.4E]
  ------------------
  113|  15.6M|  invariant(size >= 0);
  ------------------
  |  |   27|  15.6M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (113:3): [True: 15.6M, False: 493]
  ------------------
  114|  15.6M|  invariant(offset <= numElts);
  ------------------
  |  |   27|  15.6M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (114:3): [True: 15.6M, False: 18.4E]
  ------------------
  115|  15.6M|  invariant(size <= numElts);
  ------------------
  |  |   27|  15.6M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (115:3): [True: 15.6M, False: 18.4E]
  ------------------
  116|  15.6M|  invariant(offset + size <= numElts);
  ------------------
  |  |   27|  15.6M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (116:3): [True: 15.6M, False: 18.4E]
  ------------------
  117|  15.6M|  return {*this, offset, size};
  118|  15.6M|}
_ZNK8rawspeed10Array1DRefIKSt4byteE7getCropEii:
  110|  7.09M|Array1DRef<T>::getCrop(int offset, int size) const {
  111|  7.09M|  establishClassInvariants();
  112|  7.09M|  invariant(offset >= 0);
  ------------------
  |  |   27|  7.09M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (112:3): [True: 7.16M, False: 18.4E]
  ------------------
  113|  7.16M|  invariant(size >= 0);
  ------------------
  |  |   27|  7.16M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (113:3): [True: 7.16M, False: 18.4E]
  ------------------
  114|  7.16M|  invariant(offset <= numElts);
  ------------------
  |  |   27|  7.16M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (114:3): [True: 7.17M, False: 18.4E]
  ------------------
  115|  7.17M|  invariant(size <= numElts);
  ------------------
  |  |   27|  7.17M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (115:3): [True: 7.17M, False: 18.4E]
  ------------------
  116|  7.17M|  invariant(offset + size <= numElts);
  ------------------
  |  |   27|  7.17M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (116:3): [True: 7.17M, False: 18.4E]
  ------------------
  117|  7.17M|  return {*this, offset, size};
  118|  7.17M|}
_ZNK8rawspeed10Array1DRefIKhE7getCropEii:
  110|  29.4M|Array1DRef<T>::getCrop(int offset, int size) const {
  111|  29.4M|  establishClassInvariants();
  112|  29.4M|  invariant(offset >= 0);
  ------------------
  |  |   27|  29.4M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (112:3): [True: 29.4M, False: 18.4E]
  ------------------
  113|  29.4M|  invariant(size >= 0);
  ------------------
  |  |   27|  29.4M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (113:3): [True: 29.4M, False: 18.4E]
  ------------------
  114|  29.4M|  invariant(offset <= numElts);
  ------------------
  |  |   27|  29.4M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (114:3): [True: 29.4M, False: 18.4E]
  ------------------
  115|  29.4M|  invariant(size <= numElts);
  ------------------
  |  |   27|  29.4M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (115:3): [True: 29.4M, False: 18.4E]
  ------------------
  116|  29.4M|  invariant(offset + size <= numElts);
  ------------------
  |  |   27|  29.4M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (116:3): [True: 29.4M, False: 18.4E]
  ------------------
  117|  29.4M|  return {*this, offset, size};
  118|  29.4M|}
_ZNK8rawspeed10Array1DRefIKhEclEi:
  147|  2.73M|Array1DRef<T>::operator()(const int eltIdx) const {
  148|  2.73M|  establishClassInvariants();
  149|  2.73M|  invariant(eltIdx >= 0);
  ------------------
  |  |   27|  2.73M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (149:3): [True: 2.73M, False: 0]
  ------------------
  150|  2.73M|  invariant(eltIdx < numElts);
  ------------------
  |  |   27|  2.73M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (150:3): [True: 2.73M, False: 0]
  ------------------
  151|  2.73M|  return *addressOf(eltIdx);
  152|  2.73M|}
_ZNK8rawspeed10Array1DRefIKhE3endEv:
  163|  1.27M|template <class T> inline T* Array1DRef<T>::end() const {
  164|  1.27M|  establishClassInvariants();
  165|  1.27M|  return addressOf(/*eltIdx=*/numElts);
  166|  1.27M|}
_ZNK8rawspeed10Array1DRefItE24establishClassInvariantsEv:
   97|  1.21G|Array1DRef<T>::establishClassInvariants() const noexcept {
   98|  1.21G|  invariant(data);
  ------------------
  |  |   27|  1.21G|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (98:3): [True: 1.23G, False: 18.4E]
  ------------------
   99|  1.23G|  invariant(numElts >= 0);
  ------------------
  |  |   27|  1.23G|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (99:3): [True: 1.23G, False: 18.4E]
  ------------------
  100|  1.23G|}
_ZNK8rawspeed10Array1DRefItE4sizeEv:
  154|   611M|template <class T> inline int Array1DRef<T>::size() const {
  155|   611M|  establishClassInvariants();
  156|   611M|  return numElts;
  157|   611M|}
_ZNK8rawspeed10Array1DRefIfE24establishClassInvariantsEv:
   97|  18.5M|Array1DRef<T>::establishClassInvariants() const noexcept {
   98|  18.5M|  invariant(data);
  ------------------
  |  |   27|  18.5M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (98:3): [True: 18.5M, False: 6]
  ------------------
   99|  18.5M|  invariant(numElts >= 0);
  ------------------
  |  |   27|  18.5M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (99:3): [True: 18.5M, False: 1]
  ------------------
  100|  18.5M|}
_ZNK8rawspeed10Array1DRefIfE4sizeEv:
  154|  10.2M|template <class T> inline int Array1DRef<T>::size() const {
  155|  10.2M|  establishClassInvariants();
  156|  10.2M|  return numElts;
  157|  10.2M|}
_ZN8rawspeed10Array1DRefIhEC2EPhi:
  104|     19|    : data(data_), numElts(numElts_) {
  105|     19|  establishClassInvariants();
  106|     19|}
_ZNK8rawspeed10Array1DRefIhE24establishClassInvariantsEv:
   97|  2.78M|Array1DRef<T>::establishClassInvariants() const noexcept {
   98|  2.78M|  invariant(data);
  ------------------
  |  |   27|  2.78M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (98:3): [True: 2.78M, False: 0]
  ------------------
   99|  2.78M|  invariant(numElts >= 0);
  ------------------
  |  |   27|  2.78M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (99:3): [True: 2.78M, False: 0]
  ------------------
  100|  2.78M|}
_ZNK8rawspeed10Array1DRefIhE4sizeEv:
  154|  1.66M|template <class T> inline int Array1DRef<T>::size() const {
  155|  1.66M|  establishClassInvariants();
  156|  1.66M|  return numElts;
  157|  1.66M|}
_ZNK8rawspeed10Array1DRefIKhE8getBlockEii:
  122|   185k|Array1DRef<T>::getBlock(int size, int index) const {
  123|   185k|  establishClassInvariants();
  124|   185k|  invariant(index >= 0);
  ------------------
  |  |   27|   185k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (124:3): [True: 185k, False: 0]
  ------------------
  125|   185k|  invariant(size >= 0);
  ------------------
  |  |   27|   185k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (125:3): [True: 185k, False: 0]
  ------------------
  126|   185k|  invariant(index <= numElts);
  ------------------
  |  |   27|   185k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (126:3): [True: 185k, False: 0]
  ------------------
  127|   185k|  invariant(size <= numElts);
  ------------------
  |  |   27|   185k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (127:3): [True: 185k, False: 0]
  ------------------
  128|   185k|  return getCrop(size * index, size);
  129|   185k|}
_ZNK8rawspeed10Array1DRefIhE8getBlockEii:
  122|   185k|Array1DRef<T>::getBlock(int size, int index) const {
  123|   185k|  establishClassInvariants();
  124|   185k|  invariant(index >= 0);
  ------------------
  |  |   27|   185k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (124:3): [True: 185k, False: 0]
  ------------------
  125|   185k|  invariant(size >= 0);
  ------------------
  |  |   27|   185k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (125:3): [True: 185k, False: 0]
  ------------------
  126|   185k|  invariant(index <= numElts);
  ------------------
  |  |   27|   185k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (126:3): [True: 185k, False: 0]
  ------------------
  127|   185k|  invariant(size <= numElts);
  ------------------
  |  |   27|   185k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (127:3): [True: 185k, False: 0]
  ------------------
  128|   185k|  return getCrop(size * index, size);
  129|   185k|}
_ZNK8rawspeed10Array1DRefIhE7getCropEii:
  110|   185k|Array1DRef<T>::getCrop(int offset, int size) const {
  111|   185k|  establishClassInvariants();
  112|   185k|  invariant(offset >= 0);
  ------------------
  |  |   27|   185k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (112:3): [True: 185k, False: 0]
  ------------------
  113|   185k|  invariant(size >= 0);
  ------------------
  |  |   27|   185k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (113:3): [True: 185k, False: 0]
  ------------------
  114|   185k|  invariant(offset <= numElts);
  ------------------
  |  |   27|   185k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (114:3): [True: 185k, False: 0]
  ------------------
  115|   185k|  invariant(size <= numElts);
  ------------------
  |  |   27|   185k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (115:3): [True: 185k, False: 0]
  ------------------
  116|   185k|  invariant(offset + size <= numElts);
  ------------------
  |  |   27|   185k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (116:3): [True: 185k, False: 0]
  ------------------
  117|   185k|  return {*this, offset, size};
  118|   185k|}
_ZNK8rawspeed10Array1DRefIhE9addressOfEi:
  133|   185k|Array1DRef<T>::addressOf(const int eltIdx) const {
  134|   185k|  establishClassInvariants();
  135|   185k|  invariant(eltIdx >= 0);
  ------------------
  |  |   27|   185k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (135:3): [True: 185k, False: 0]
  ------------------
  136|   185k|  invariant(eltIdx <= numElts);
  ------------------
  |  |   27|   185k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (136:3): [True: 185k, False: 0]
  ------------------
  137|   185k|#pragma GCC diagnostic push
  138|   185k|#pragma GCC diagnostic ignored "-Wpragmas"
  139|   185k|#pragma GCC diagnostic ignored "-Wunknown-warning-option"
  140|   185k|#pragma GCC diagnostic ignored "-Wunsafe-buffer-usage"
  141|   185k|  return data + eltIdx;
  142|   185k|#pragma GCC diagnostic pop
  143|   185k|}
_ZN8rawspeed10Array1DRefIiEC2EPii:
  104|  4.11k|    : data(data_), numElts(numElts_) {
  105|  4.11k|  establishClassInvariants();
  106|  4.11k|}
_ZNK8rawspeed10Array1DRefIiE24establishClassInvariantsEv:
   97|  85.6k|Array1DRef<T>::establishClassInvariants() const noexcept {
   98|  85.6k|  invariant(data);
  ------------------
  |  |   27|  85.6k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (98:3): [True: 85.6k, False: 0]
  ------------------
   99|  85.6k|  invariant(numElts >= 0);
  ------------------
  |  |   27|  85.6k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (99:3): [True: 85.6k, False: 0]
  ------------------
  100|  85.6k|}
_ZNK8rawspeed10Array1DRefIiE4sizeEv:
  154|  41.9k|template <class T> inline int Array1DRef<T>::size() const {
  155|  41.9k|  establishClassInvariants();
  156|  41.9k|  return numElts;
  157|  41.9k|}
_ZNK8rawspeed10Array1DRefIiE7getCropEii:
  110|  2.11k|Array1DRef<T>::getCrop(int offset, int size) const {
  111|  2.11k|  establishClassInvariants();
  112|  2.11k|  invariant(offset >= 0);
  ------------------
  |  |   27|  2.11k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (112:3): [True: 2.11k, False: 0]
  ------------------
  113|  2.11k|  invariant(size >= 0);
  ------------------
  |  |   27|  2.11k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (113:3): [True: 2.11k, False: 0]
  ------------------
  114|  2.11k|  invariant(offset <= numElts);
  ------------------
  |  |   27|  2.11k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (114:3): [True: 2.11k, False: 0]
  ------------------
  115|  2.11k|  invariant(size <= numElts);
  ------------------
  |  |   27|  2.11k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (115:3): [True: 2.11k, False: 0]
  ------------------
  116|  2.11k|  invariant(offset + size <= numElts);
  ------------------
  |  |   27|  2.11k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (116:3): [True: 2.11k, False: 0]
  ------------------
  117|  2.11k|  return {*this, offset, size};
  118|  2.11k|}
_ZNK8rawspeed10Array1DRefIiE9addressOfEi:
  133|  7.26k|Array1DRef<T>::addressOf(const int eltIdx) const {
  134|  7.26k|  establishClassInvariants();
  135|  7.26k|  invariant(eltIdx >= 0);
  ------------------
  |  |   27|  7.26k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (135:3): [True: 7.26k, False: 0]
  ------------------
  136|  7.26k|  invariant(eltIdx <= numElts);
  ------------------
  |  |   27|  7.26k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (136:3): [True: 7.26k, False: 0]
  ------------------
  137|  7.26k|#pragma GCC diagnostic push
  138|  7.26k|#pragma GCC diagnostic ignored "-Wpragmas"
  139|  7.26k|#pragma GCC diagnostic ignored "-Wunknown-warning-option"
  140|  7.26k|#pragma GCC diagnostic ignored "-Wunsafe-buffer-usage"
  141|  7.26k|  return data + eltIdx;
  142|  7.26k|#pragma GCC diagnostic pop
  143|  7.26k|}
_ZNK8rawspeed10Array1DRefIiEclEi:
  147|  1.53k|Array1DRef<T>::operator()(const int eltIdx) const {
  148|  1.53k|  establishClassInvariants();
  149|  1.53k|  invariant(eltIdx >= 0);
  ------------------
  |  |   27|  1.53k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (149:3): [True: 1.53k, False: 0]
  ------------------
  150|  1.53k|  invariant(eltIdx < numElts);
  ------------------
  |  |   27|  1.53k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (150:3): [True: 1.53k, False: 0]
  ------------------
  151|  1.53k|  return *addressOf(eltIdx);
  152|  1.53k|}
_ZNK8rawspeed10Array1DRefISt4byteE3endEv:
  163|  8.01k|template <class T> inline T* Array1DRef<T>::end() const {
  164|  8.01k|  establishClassInvariants();
  165|  8.01k|  return addressOf(/*eltIdx=*/numElts);
  166|  8.01k|}
_ZNK8rawspeed10Array1DRefISt4byteEclEi:
  147|  7.58M|Array1DRef<T>::operator()(const int eltIdx) const {
  148|  7.58M|  establishClassInvariants();
  149|  7.58M|  invariant(eltIdx >= 0);
  ------------------
  |  |   27|  7.58M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (149:3): [True: 7.58M, False: 18.4E]
  ------------------
  150|  7.58M|  invariant(eltIdx < numElts);
  ------------------
  |  |   27|  7.58M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (150:3): [True: 7.58M, False: 1]
  ------------------
  151|  7.58M|  return *addressOf(eltIdx);
  152|  7.58M|}
_ZN8rawspeed10Array1DRefItEC2EPti:
  104|  46.5M|    : data(data_), numElts(numElts_) {
  105|  46.5M|  establishClassInvariants();
  106|  46.5M|}
_ZN8rawspeed10Array1DRefISt4byteEC2ItQaaaantaasr3stdE10is_const_vITL0__Entsr3stdE10is_const_vIT_Entsr3stdE9is_same_vIu14__remove_constIS5_Eu14__remove_constIS4_EEsr3stdE9is_same_vIS6_S1_EEENS0_IS5_EE:
   78|  10.4k|      : Array1DRef(reinterpret_cast<T*>(RHS.data), sizeof(T2) * RHS.numElts) {}
_ZN8rawspeed10Array1DRefISt4byteEC2EPS1_i:
  104|  21.3M|    : data(data_), numElts(numElts_) {
  105|  21.3M|  establishClassInvariants();
  106|  21.3M|}
_ZN8rawspeed10Array1DRefIfEC2EPfi:
  104|   552k|    : data(data_), numElts(numElts_) {
  105|   552k|  establishClassInvariants();
  106|   552k|}
_ZN8rawspeed10Array1DRefISt4byteEC2IfQaaaantaasr3stdE10is_const_vITL0__Entsr3stdE10is_const_vIT_Entsr3stdE9is_same_vIu14__remove_constIS5_Eu14__remove_constIS4_EEsr3stdE9is_same_vIS6_S1_EEENS0_IS5_EE:
   78|    545|      : Array1DRef(reinterpret_cast<T*>(RHS.data), sizeof(T2) * RHS.numElts) {}
_ZNK8rawspeed10Array1DRefItE9addressOfEi:
  133|   169M|Array1DRef<T>::addressOf(const int eltIdx) const {
  134|   169M|  establishClassInvariants();
  135|   169M|  invariant(eltIdx >= 0);
  ------------------
  |  |   27|   169M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (135:3): [True: 168M, False: 1.02M]
  ------------------
  136|   168M|  invariant(eltIdx <= numElts);
  ------------------
  |  |   27|   168M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (136:3): [True: 169M, False: 18.4E]
  ------------------
  137|   169M|#pragma GCC diagnostic push
  138|   169M|#pragma GCC diagnostic ignored "-Wpragmas"
  139|   169M|#pragma GCC diagnostic ignored "-Wunknown-warning-option"
  140|   169M|#pragma GCC diagnostic ignored "-Wunsafe-buffer-usage"
  141|   169M|  return data + eltIdx;
  142|   168M|#pragma GCC diagnostic pop
  143|   168M|}
_ZNK8rawspeed10Array1DRefItE7getCropEii:
  110|  43.2M|Array1DRef<T>::getCrop(int offset, int size) const {
  111|  43.2M|  establishClassInvariants();
  112|  43.2M|  invariant(offset >= 0);
  ------------------
  |  |   27|  43.2M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (112:3): [True: 47.3M, False: 18.4E]
  ------------------
  113|  47.3M|  invariant(size >= 0);
  ------------------
  |  |   27|  47.3M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (113:3): [True: 47.4M, False: 18.4E]
  ------------------
  114|  47.4M|  invariant(offset <= numElts);
  ------------------
  |  |   27|  47.4M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (114:3): [True: 47.4M, False: 18.4E]
  ------------------
  115|  47.4M|  invariant(size <= numElts);
  ------------------
  |  |   27|  47.4M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (115:3): [True: 47.5M, False: 18.4E]
  ------------------
  116|  47.5M|  invariant(offset + size <= numElts);
  ------------------
  |  |   27|  47.5M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (116:3): [True: 47.5M, False: 18.4E]
  ------------------
  117|  47.5M|  return {*this, offset, size};
  118|  47.5M|}
_ZNK8rawspeed10Array1DRefItEclEi:
  147|   129M|Array1DRef<T>::operator()(const int eltIdx) const {
  148|   129M|  establishClassInvariants();
  149|   129M|  invariant(eltIdx >= 0);
  ------------------
  |  |   27|   129M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (149:3): [True: 130M, False: 18.4E]
  ------------------
  150|   130M|  invariant(eltIdx < numElts);
  ------------------
  |  |   27|   130M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (150:3): [True: 129M, False: 1.15M]
  ------------------
  151|   129M|  return *addressOf(eltIdx);
  152|   130M|}
_ZN8rawspeed10Array1DRefIKSt4byteEC2IKhQaaaantaasr3stdE10is_const_vITL0__Entsr3stdE10is_const_vIT_Entsr3stdE9is_same_vIu14__remove_constIS7_Eu14__remove_constIS6_EEsr3stdE9is_same_vIS8_S1_EEENS0_IS7_EE:
   78|   415k|      : Array1DRef(reinterpret_cast<T*>(RHS.data), sizeof(T2) * RHS.numElts) {}
_ZN8rawspeed10Array1DRefIKSt4byteEC2EPS2_i:
  104|  7.14M|    : data(data_), numElts(numElts_) {
  105|  7.14M|  establishClassInvariants();
  106|  7.14M|}
_ZNK8rawspeed10Array1DRefISt4byteE8getBlockEii:
  122|  6.10M|Array1DRef<T>::getBlock(int size, int index) const {
  123|  6.10M|  establishClassInvariants();
  124|  6.10M|  invariant(index >= 0);
  ------------------
  |  |   27|  6.10M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (124:3): [True: 6.16M, False: 18.4E]
  ------------------
  125|  6.16M|  invariant(size >= 0);
  ------------------
  |  |   27|  6.16M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (125:3): [True: 6.16M, False: 18.4E]
  ------------------
  126|  6.16M|  invariant(index <= numElts);
  ------------------
  |  |   27|  6.16M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (126:3): [True: 6.16M, False: 18.4E]
  ------------------
  127|  6.16M|  invariant(size <= numElts);
  ------------------
  |  |   27|  6.16M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (127:3): [True: 6.16M, False: 18.4E]
  ------------------
  128|  6.16M|  return getCrop(size * index, size);
  129|  6.16M|}
_ZNK8rawspeed10Array1DRefIfE7getCropEii:
  110|   590k|Array1DRef<T>::getCrop(int offset, int size) const {
  111|   590k|  establishClassInvariants();
  112|   590k|  invariant(offset >= 0);
  ------------------
  |  |   27|   590k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (112:3): [True: 590k, False: 18.4E]
  ------------------
  113|   590k|  invariant(size >= 0);
  ------------------
  |  |   27|   590k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (113:3): [True: 590k, False: 0]
  ------------------
  114|   590k|  invariant(offset <= numElts);
  ------------------
  |  |   27|   590k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (114:3): [True: 590k, False: 0]
  ------------------
  115|   590k|  invariant(size <= numElts);
  ------------------
  |  |   27|   590k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (115:3): [True: 590k, False: 0]
  ------------------
  116|   590k|  invariant(offset + size <= numElts);
  ------------------
  |  |   27|   590k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (116:3): [True: 590k, False: 0]
  ------------------
  117|   590k|  return {*this, offset, size};
  118|   590k|}
_ZNK8rawspeed10Array1DRefIfE9addressOfEi:
  133|  1.10M|Array1DRef<T>::addressOf(const int eltIdx) const {
  134|  1.10M|  establishClassInvariants();
  135|  1.10M|  invariant(eltIdx >= 0);
  ------------------
  |  |   27|  1.10M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (135:3): [True: 1.10M, False: 0]
  ------------------
  136|  1.10M|  invariant(eltIdx <= numElts);
  ------------------
  |  |   27|  1.10M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (136:3): [True: 1.10M, False: 0]
  ------------------
  137|  1.10M|#pragma GCC diagnostic push
  138|  1.10M|#pragma GCC diagnostic ignored "-Wpragmas"
  139|  1.10M|#pragma GCC diagnostic ignored "-Wunknown-warning-option"
  140|  1.10M|#pragma GCC diagnostic ignored "-Wunsafe-buffer-usage"
  141|  1.10M|  return data + eltIdx;
  142|  1.10M|#pragma GCC diagnostic pop
  143|  1.10M|}
_ZNK8rawspeed10Array1DRefIfEclEi:
  147|   511k|Array1DRef<T>::operator()(const int eltIdx) const {
  148|   511k|  establishClassInvariants();
  149|   511k|  invariant(eltIdx >= 0);
  ------------------
  |  |   27|   511k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (149:3): [True: 511k, False: 0]
  ------------------
  150|   511k|  invariant(eltIdx < numElts);
  ------------------
  |  |   27|   511k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (150:3): [True: 511k, False: 0]
  ------------------
  151|   511k|  return *addressOf(eltIdx);
  152|   511k|}
_ZNK8rawspeed10Array1DRefIKtE24establishClassInvariantsEv:
   97|   103M|Array1DRef<T>::establishClassInvariants() const noexcept {
   98|   103M|  invariant(data);
  ------------------
  |  |   27|   103M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (98:3): [True: 103M, False: 18.4E]
  ------------------
   99|   103M|  invariant(numElts >= 0);
  ------------------
  |  |   27|   103M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (99:3): [True: 105M, False: 18.4E]
  ------------------
  100|   103M|}
_ZNK8rawspeed10Array1DRefIKtE4sizeEv:
  154|  60.4M|template <class T> inline int Array1DRef<T>::size() const {
  155|  60.4M|  establishClassInvariants();
  156|  60.4M|  return numElts;
  157|  60.4M|}
_ZNK8rawspeed10Array1DRefIKtE7getCropEii:
  110|  3.71M|Array1DRef<T>::getCrop(int offset, int size) const {
  111|  3.71M|  establishClassInvariants();
  112|  3.71M|  invariant(offset >= 0);
  ------------------
  |  |   27|  3.71M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (112:3): [True: 3.72M, False: 18.4E]
  ------------------
  113|  3.72M|  invariant(size >= 0);
  ------------------
  |  |   27|  3.72M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (113:3): [True: 3.72M, False: 18.4E]
  ------------------
  114|  3.72M|  invariant(offset <= numElts);
  ------------------
  |  |   27|  3.72M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (114:3): [True: 3.72M, False: 18.4E]
  ------------------
  115|  3.72M|  invariant(size <= numElts);
  ------------------
  |  |   27|  3.72M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (115:3): [True: 3.72M, False: 657]
  ------------------
  116|  3.72M|  invariant(offset + size <= numElts);
  ------------------
  |  |   27|  3.72M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (116:3): [True: 3.72M, False: 18.4E]
  ------------------
  117|  3.72M|  return {*this, offset, size};
  118|  3.72M|}
_ZNK8rawspeed10Array1DRefIKtE9addressOfEi:
  133|  7.41M|Array1DRef<T>::addressOf(const int eltIdx) const {
  134|  7.41M|  establishClassInvariants();
  135|  7.41M|  invariant(eltIdx >= 0);
  ------------------
  |  |   27|  7.41M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (135:3): [True: 7.40M, False: 5.61k]
  ------------------
  136|  7.40M|  invariant(eltIdx <= numElts);
  ------------------
  |  |   27|  7.40M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (136:3): [True: 7.40M, False: 18.4E]
  ------------------
  137|  7.40M|#pragma GCC diagnostic push
  138|  7.40M|#pragma GCC diagnostic ignored "-Wpragmas"
  139|  7.40M|#pragma GCC diagnostic ignored "-Wunknown-warning-option"
  140|  7.40M|#pragma GCC diagnostic ignored "-Wunsafe-buffer-usage"
  141|  7.40M|  return data + eltIdx;
  142|  7.40M|#pragma GCC diagnostic pop
  143|  7.40M|}
_ZN8rawspeed10Array1DRefIKtEC2EPS1_i:
  104|  4.98M|    : data(data_), numElts(numElts_) {
  105|  4.98M|  establishClassInvariants();
  106|  4.98M|}
_ZNK8rawspeed10Array1DRefIKtEclEi:
  147|  3.72M|Array1DRef<T>::operator()(const int eltIdx) const {
  148|  3.72M|  establishClassInvariants();
  149|  3.72M|  invariant(eltIdx >= 0);
  ------------------
  |  |   27|  3.72M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (149:3): [True: 3.72M, False: 18.4E]
  ------------------
  150|  3.72M|  invariant(eltIdx < numElts);
  ------------------
  |  |   27|  3.72M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (150:3): [True: 3.72M, False: 3.24k]
  ------------------
  151|  3.72M|  return *addressOf(eltIdx);
  152|  3.72M|}
_ZN8rawspeed10Array1DRefIKtEC2ItQaaaantsr3stdE10is_const_vITL0__Esr3stdE10is_const_vIT_Esr3stdE9is_same_vIu14__remove_constIS5_Eu14__remove_constIS4_EEEENS0_IS5_EE:
   69|  1.27M|      : Array1DRef(RHS.data, RHS.numElts) {}
_ZNK8rawspeed10Array1DRefItE8getBlockEii:
  122|   332k|Array1DRef<T>::getBlock(int size, int index) const {
  123|   332k|  establishClassInvariants();
  124|   332k|  invariant(index >= 0);
  ------------------
  |  |   27|   332k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (124:3): [True: 332k, False: 329]
  ------------------
  125|   332k|  invariant(size >= 0);
  ------------------
  |  |   27|   332k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (125:3): [True: 332k, False: 18.4E]
  ------------------
  126|   332k|  invariant(index <= numElts);
  ------------------
  |  |   27|   332k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (126:3): [True: 332k, False: 18.4E]
  ------------------
  127|   332k|  invariant(size <= numElts);
  ------------------
  |  |   27|   332k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (127:3): [True: 332k, False: 18.4E]
  ------------------
  128|   332k|  return getCrop(size * index, size);
  129|   332k|}
_ZNK8rawspeed10Array1DRefIiE5beginEv:
  159|  1.80k|template <class T> inline T* Array1DRef<T>::begin() const {
  160|  1.80k|  establishClassInvariants();
  161|  1.80k|  return addressOf(/*eltIdx=*/0);
  162|  1.80k|}
_ZNK8rawspeed10Array1DRefIiE3endEv:
  163|  1.80k|template <class T> inline T* Array1DRef<T>::end() const {
  164|  1.80k|  establishClassInvariants();
  165|  1.80k|  return addressOf(/*eltIdx=*/numElts);
  166|  1.80k|}
_ZN8rawspeed10Array1DRefIKNS_15DngSliceElementEEC2EPS2_i:
  104|  13.7k|    : data(data_), numElts(numElts_) {
  105|  13.7k|  establishClassInvariants();
  106|  13.7k|}
_ZNK8rawspeed10Array1DRefIKNS_15DngSliceElementEE24establishClassInvariantsEv:
   97|  67.7k|Array1DRef<T>::establishClassInvariants() const noexcept {
   98|  67.7k|  invariant(data);
  ------------------
  |  |   27|  67.7k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (98:3): [True: 67.7k, False: 18.4E]
  ------------------
   99|  67.7k|  invariant(numElts >= 0);
  ------------------
  |  |   27|  67.7k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (99:3): [True: 67.9k, False: 18.4E]
  ------------------
  100|  67.7k|}
_ZNK8rawspeed10Array1DRefIKNS_15DngSliceElementEE3endEv:
  163|  13.8k|template <class T> inline T* Array1DRef<T>::end() const {
  164|  13.8k|  establishClassInvariants();
  165|  13.8k|  return addressOf(/*eltIdx=*/numElts);
  166|  13.8k|}
_ZNK8rawspeed10Array1DRefIKNS_15DngSliceElementEE9addressOfEi:
  133|  27.5k|Array1DRef<T>::addressOf(const int eltIdx) const {
  134|  27.5k|  establishClassInvariants();
  135|  27.5k|  invariant(eltIdx >= 0);
  ------------------
  |  |   27|  27.5k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (135:3): [True: 27.3k, False: 162]
  ------------------
  136|  27.3k|  invariant(eltIdx <= numElts);
  ------------------
  |  |   27|  27.3k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (136:3): [True: 27.3k, False: 3]
  ------------------
  137|  27.3k|#pragma GCC diagnostic push
  138|  27.3k|#pragma GCC diagnostic ignored "-Wpragmas"
  139|  27.3k|#pragma GCC diagnostic ignored "-Wunknown-warning-option"
  140|  27.3k|#pragma GCC diagnostic ignored "-Wunsafe-buffer-usage"
  141|  27.3k|  return data + eltIdx;
  142|  27.3k|#pragma GCC diagnostic pop
  143|  27.3k|}
_ZNK8rawspeed10Array1DRefIKNS_15DngSliceElementEE5beginEv:
  159|  13.7k|template <class T> inline T* Array1DRef<T>::begin() const {
  160|  13.7k|  establishClassInvariants();
  161|  13.7k|  return addressOf(/*eltIdx=*/0);
  162|  13.7k|}
_ZNK8rawspeed10Array1DRefIKNS_8CFAColorEE24establishClassInvariantsEv:
   97|   141k|Array1DRef<T>::establishClassInvariants() const noexcept {
   98|   141k|  invariant(data);
  ------------------
  |  |   27|   141k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (98:3): [True: 142k, False: 18.4E]
  ------------------
   99|   142k|  invariant(numElts >= 0);
  ------------------
  |  |   27|   142k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (99:3): [True: 142k, False: 18.4E]
  ------------------
  100|   142k|}
_ZNK8rawspeed10Array1DRefIKNS_8CFAColorEE4sizeEv:
  154|  78.2k|template <class T> inline int Array1DRef<T>::size() const {
  155|  78.2k|  establishClassInvariants();
  156|  78.2k|  return numElts;
  157|  78.2k|}
_ZNK8rawspeed10Array1DRefIKNS_8CFAColorEE7getCropEii:
  110|  4.57k|Array1DRef<T>::getCrop(int offset, int size) const {
  111|  4.57k|  establishClassInvariants();
  112|  4.57k|  invariant(offset >= 0);
  ------------------
  |  |   27|  4.57k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (112:3): [True: 4.62k, False: 18.4E]
  ------------------
  113|  4.62k|  invariant(size >= 0);
  ------------------
  |  |   27|  4.62k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (113:3): [True: 4.62k, False: 18.4E]
  ------------------
  114|  4.62k|  invariant(offset <= numElts);
  ------------------
  |  |   27|  4.62k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (114:3): [True: 4.62k, False: 0]
  ------------------
  115|  4.62k|  invariant(size <= numElts);
  ------------------
  |  |   27|  4.62k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (115:3): [True: 4.63k, False: 18.4E]
  ------------------
  116|  4.63k|  invariant(offset + size <= numElts);
  ------------------
  |  |   27|  4.63k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (116:3): [True: 4.62k, False: 2]
  ------------------
  117|  4.62k|  return {*this, offset, size};
  118|  4.63k|}
_ZNK8rawspeed10Array1DRefIKNS_8CFAColorEE9addressOfEi:
  133|  9.17k|Array1DRef<T>::addressOf(const int eltIdx) const {
  134|  9.17k|  establishClassInvariants();
  135|  9.17k|  invariant(eltIdx >= 0);
  ------------------
  |  |   27|  9.17k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (135:3): [True: 9.13k, False: 31]
  ------------------
  136|  9.13k|  invariant(eltIdx <= numElts);
  ------------------
  |  |   27|  9.13k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (136:3): [True: 9.18k, False: 18.4E]
  ------------------
  137|  9.18k|#pragma GCC diagnostic push
  138|  9.18k|#pragma GCC diagnostic ignored "-Wpragmas"
  139|  9.18k|#pragma GCC diagnostic ignored "-Wunknown-warning-option"
  140|  9.18k|#pragma GCC diagnostic ignored "-Wunsafe-buffer-usage"
  141|  9.18k|  return data + eltIdx;
  142|  9.13k|#pragma GCC diagnostic pop
  143|  9.13k|}
_ZNK8rawspeed10Array1DRefIKNS_8CFAColorEEclEi:
  147|  4.62k|Array1DRef<T>::operator()(const int eltIdx) const {
  148|  4.62k|  establishClassInvariants();
  149|  4.62k|  invariant(eltIdx >= 0);
  ------------------
  |  |   27|  4.62k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (149:3): [True: 4.62k, False: 18.4E]
  ------------------
  150|  4.62k|  invariant(eltIdx < numElts);
  ------------------
  |  |   27|  4.62k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (150:3): [True: 4.63k, False: 18.4E]
  ------------------
  151|  4.63k|  return *addressOf(eltIdx);
  152|  4.62k|}
_ZNK8rawspeed10Array1DRefINS_8CFAColorEE24establishClassInvariantsEv:
   97|   220k|Array1DRef<T>::establishClassInvariants() const noexcept {
   98|   220k|  invariant(data);
  ------------------
  |  |   27|   220k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (98:3): [True: 221k, False: 18.4E]
  ------------------
   99|   221k|  invariant(numElts >= 0);
  ------------------
  |  |   27|   221k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (99:3): [True: 222k, False: 18.4E]
  ------------------
  100|   221k|}
_ZNK8rawspeed10Array1DRefINS_8CFAColorEE4sizeEv:
  154|   121k|template <class T> inline int Array1DRef<T>::size() const {
  155|   121k|  establishClassInvariants();
  156|   121k|  return numElts;
  157|   121k|}
_ZNK8rawspeed10Array1DRefINS_8CFAColorEE7getCropEii:
  110|  6.35k|Array1DRef<T>::getCrop(int offset, int size) const {
  111|  6.35k|  establishClassInvariants();
  112|  6.35k|  invariant(offset >= 0);
  ------------------
  |  |   27|  6.35k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (112:3): [True: 6.43k, False: 18.4E]
  ------------------
  113|  6.43k|  invariant(size >= 0);
  ------------------
  |  |   27|  6.43k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (113:3): [True: 6.44k, False: 18.4E]
  ------------------
  114|  6.44k|  invariant(offset <= numElts);
  ------------------
  |  |   27|  6.44k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (114:3): [True: 6.44k, False: 18.4E]
  ------------------
  115|  6.44k|  invariant(size <= numElts);
  ------------------
  |  |   27|  6.44k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (115:3): [True: 6.44k, False: 18.4E]
  ------------------
  116|  6.44k|  invariant(offset + size <= numElts);
  ------------------
  |  |   27|  6.44k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (116:3): [True: 6.44k, False: 0]
  ------------------
  117|  6.44k|  return {*this, offset, size};
  118|  6.44k|}
_ZNK8rawspeed10Array1DRefINS_8CFAColorEE9addressOfEi:
  133|  12.7k|Array1DRef<T>::addressOf(const int eltIdx) const {
  134|  12.7k|  establishClassInvariants();
  135|  12.7k|  invariant(eltIdx >= 0);
  ------------------
  |  |   27|  12.7k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (135:3): [True: 12.6k, False: 55]
  ------------------
  136|  12.6k|  invariant(eltIdx <= numElts);
  ------------------
  |  |   27|  12.6k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (136:3): [True: 12.7k, False: 18.4E]
  ------------------
  137|  12.7k|#pragma GCC diagnostic push
  138|  12.7k|#pragma GCC diagnostic ignored "-Wpragmas"
  139|  12.7k|#pragma GCC diagnostic ignored "-Wunknown-warning-option"
  140|  12.7k|#pragma GCC diagnostic ignored "-Wunsafe-buffer-usage"
  141|  12.7k|  return data + eltIdx;
  142|  12.6k|#pragma GCC diagnostic pop
  143|  12.6k|}
_ZNK8rawspeed10Array1DRefINS_8CFAColorEEclEi:
  147|  6.44k|Array1DRef<T>::operator()(const int eltIdx) const {
  148|  6.44k|  establishClassInvariants();
  149|  6.44k|  invariant(eltIdx >= 0);
  ------------------
  |  |   27|  6.44k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (149:3): [True: 6.46k, False: 18.4E]
  ------------------
  150|  6.46k|  invariant(eltIdx < numElts);
  ------------------
  |  |   27|  6.46k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (150:3): [True: 6.44k, False: 27]
  ------------------
  151|  6.44k|  return *addressOf(eltIdx);
  152|  6.46k|}
_ZN8rawspeed10Array1DRefINS_8CFAColorEEC2EPS1_i:
  104|  8.03k|    : data(data_), numElts(numElts_) {
  105|  8.03k|  establishClassInvariants();
  106|  8.03k|}
_ZN8rawspeed10Array1DRefIKNS_8CFAColorEEC2EPS2_i:
  104|  5.75k|    : data(data_), numElts(numElts_) {
  105|  5.75k|  establishClassInvariants();
  106|  5.75k|}
_ZN8rawspeed10Array1DRefIKNS_13PhaseOneStripEEC2EPS2_i:
  104|  15.4k|    : data(data_), numElts(numElts_) {
  105|  15.4k|  establishClassInvariants();
  106|  15.4k|}
_ZNK8rawspeed10Array1DRefIKNS_13PhaseOneStripEE24establishClassInvariantsEv:
   97|  74.9k|Array1DRef<T>::establishClassInvariants() const noexcept {
   98|  74.9k|  invariant(data);
  ------------------
  |  |   27|  74.9k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (98:3): [True: 75.0k, False: 18.4E]
  ------------------
   99|  75.0k|  invariant(numElts >= 0);
  ------------------
  |  |   27|  75.0k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (99:3): [True: 75.0k, False: 18.4E]
  ------------------
  100|  75.0k|}
_ZNK8rawspeed10Array1DRefIKNS_13PhaseOneStripEE3endEv:
  163|  15.3k|template <class T> inline T* Array1DRef<T>::end() const {
  164|  15.3k|  establishClassInvariants();
  165|  15.3k|  return addressOf(/*eltIdx=*/numElts);
  166|  15.3k|}
_ZNK8rawspeed10Array1DRefIKNS_13PhaseOneStripEE9addressOfEi:
  133|  30.2k|Array1DRef<T>::addressOf(const int eltIdx) const {
  134|  30.2k|  establishClassInvariants();
  135|  30.2k|  invariant(eltIdx >= 0);
  ------------------
  |  |   27|  30.2k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (135:3): [True: 30.0k, False: 240]
  ------------------
  136|  30.0k|  invariant(eltIdx <= numElts);
  ------------------
  |  |   27|  30.0k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (136:3): [True: 30.0k, False: 1]
  ------------------
  137|  30.0k|#pragma GCC diagnostic push
  138|  30.0k|#pragma GCC diagnostic ignored "-Wpragmas"
  139|  30.0k|#pragma GCC diagnostic ignored "-Wunknown-warning-option"
  140|  30.0k|#pragma GCC diagnostic ignored "-Wunsafe-buffer-usage"
  141|  30.0k|  return data + eltIdx;
  142|  30.0k|#pragma GCC diagnostic pop
  143|  30.0k|}
_ZNK8rawspeed10Array1DRefIKNS_13PhaseOneStripEE5beginEv:
  159|  15.1k|template <class T> inline T* Array1DRef<T>::begin() const {
  160|  15.1k|  establishClassInvariants();
  161|  15.1k|  return addressOf(/*eltIdx=*/0);
  162|  15.1k|}
_ZN8rawspeed10Array1DRefIKNS_23PanasonicV4Decompressor5BlockEEC2EPS3_i:
  104|  4.77k|    : data(data_), numElts(numElts_) {
  105|  4.77k|  establishClassInvariants();
  106|  4.77k|}
_ZNK8rawspeed10Array1DRefIKNS_23PanasonicV4Decompressor5BlockEE24establishClassInvariantsEv:
   97|  23.5k|Array1DRef<T>::establishClassInvariants() const noexcept {
   98|  23.5k|  invariant(data);
  ------------------
  |  |   27|  23.5k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (98:3): [True: 23.6k, False: 18.4E]
  ------------------
   99|  23.6k|  invariant(numElts >= 0);
  ------------------
  |  |   27|  23.6k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (99:3): [True: 23.6k, False: 15]
  ------------------
  100|  23.6k|}
_ZNK8rawspeed10Array1DRefIKNS_23PanasonicV4Decompressor5BlockEE3endEv:
  163|  4.76k|template <class T> inline T* Array1DRef<T>::end() const {
  164|  4.76k|  establishClassInvariants();
  165|  4.76k|  return addressOf(/*eltIdx=*/numElts);
  166|  4.76k|}
_ZNK8rawspeed10Array1DRefIKNS_23PanasonicV4Decompressor5BlockEE9addressOfEi:
  133|  9.49k|Array1DRef<T>::addressOf(const int eltIdx) const {
  134|  9.49k|  establishClassInvariants();
  135|  9.49k|  invariant(eltIdx >= 0);
  ------------------
  |  |   27|  9.49k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (135:3): [True: 9.49k, False: 3]
  ------------------
  136|  9.49k|  invariant(eltIdx <= numElts);
  ------------------
  |  |   27|  9.49k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (136:3): [True: 9.48k, False: 9]
  ------------------
  137|  9.48k|#pragma GCC diagnostic push
  138|  9.48k|#pragma GCC diagnostic ignored "-Wpragmas"
  139|  9.48k|#pragma GCC diagnostic ignored "-Wunknown-warning-option"
  140|  9.48k|#pragma GCC diagnostic ignored "-Wunsafe-buffer-usage"
  141|  9.48k|  return data + eltIdx;
  142|  9.49k|#pragma GCC diagnostic pop
  143|  9.49k|}
_ZNK8rawspeed10Array1DRefIKNS_23PanasonicV4Decompressor5BlockEE5beginEv:
  159|  4.74k|template <class T> inline T* Array1DRef<T>::begin() const {
  160|  4.74k|  establishClassInvariants();
  161|  4.74k|  return addressOf(/*eltIdx=*/0);
  162|  4.74k|}
_ZN8rawspeed10Array1DRefIKNS_23PanasonicV5Decompressor5BlockEEC2EPS3_i:
  104|  2.44k|    : data(data_), numElts(numElts_) {
  105|  2.44k|  establishClassInvariants();
  106|  2.44k|}
_ZNK8rawspeed10Array1DRefIKNS_23PanasonicV5Decompressor5BlockEE24establishClassInvariantsEv:
   97|  11.9k|Array1DRef<T>::establishClassInvariants() const noexcept {
   98|  11.9k|  invariant(data);
  ------------------
  |  |   27|  11.9k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (98:3): [True: 11.9k, False: 18.4E]
  ------------------
   99|  11.9k|  invariant(numElts >= 0);
  ------------------
  |  |   27|  11.9k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (99:3): [True: 11.9k, False: 18.4E]
  ------------------
  100|  11.9k|}
_ZNK8rawspeed10Array1DRefIKNS_23PanasonicV5Decompressor5BlockEE3endEv:
  163|  2.43k|template <class T> inline T* Array1DRef<T>::end() const {
  164|  2.43k|  establishClassInvariants();
  165|  2.43k|  return addressOf(/*eltIdx=*/numElts);
  166|  2.43k|}
_ZNK8rawspeed10Array1DRefIKNS_23PanasonicV5Decompressor5BlockEE9addressOfEi:
  133|  4.82k|Array1DRef<T>::addressOf(const int eltIdx) const {
  134|  4.82k|  establishClassInvariants();
  135|  4.82k|  invariant(eltIdx >= 0);
  ------------------
  |  |   27|  4.82k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (135:3): [True: 4.82k, False: 6]
  ------------------
  136|  4.82k|  invariant(eltIdx <= numElts);
  ------------------
  |  |   27|  4.82k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (136:3): [True: 4.81k, False: 4]
  ------------------
  137|  4.81k|#pragma GCC diagnostic push
  138|  4.81k|#pragma GCC diagnostic ignored "-Wpragmas"
  139|  4.81k|#pragma GCC diagnostic ignored "-Wunknown-warning-option"
  140|  4.81k|#pragma GCC diagnostic ignored "-Wunsafe-buffer-usage"
  141|  4.81k|  return data + eltIdx;
  142|  4.82k|#pragma GCC diagnostic pop
  143|  4.82k|}
_ZNK8rawspeed10Array1DRefIKNS_23PanasonicV5Decompressor5BlockEE5beginEv:
  159|  2.42k|template <class T> inline T* Array1DRef<T>::begin() const {
  160|  2.42k|  establishClassInvariants();
  161|  2.42k|  return addressOf(/*eltIdx=*/0);
  162|  2.42k|}

_ZNK8rawspeed10Array2DRefIKSt4byteE5widthEv:
  165|  22.2k|__attribute__((always_inline)) inline int Array2DRef<T>::width() const {
  166|  22.2k|  establishClassInvariants();
  167|  22.2k|  return _width;
  168|  22.2k|}
_ZNK8rawspeed10Array2DRefIKSt4byteE24establishClassInvariantsEv:
  127|  86.5k|Array2DRef<T>::establishClassInvariants() const noexcept {
  128|  86.5k|  data.establishClassInvariants();
  129|  86.5k|  invariant(_width >= 0);
  ------------------
  |  |   27|  86.5k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (129:3): [True: 86.5k, False: 3]
  ------------------
  130|  86.5k|  invariant(_height >= 0);
  ------------------
  |  |   27|  86.5k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (130:3): [True: 86.5k, False: 0]
  ------------------
  131|  86.5k|  invariant(_pitch != 0);
  ------------------
  |  |   27|  86.5k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (131:3): [True: 86.5k, False: 0]
  ------------------
  132|  86.5k|  invariant(_pitch >= 0);
  ------------------
  |  |   27|  86.5k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (132:3): [True: 86.5k, False: 18.4E]
  ------------------
  133|  86.5k|  invariant(_pitch >= _width);
  ------------------
  |  |   27|  86.5k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (133:3): [True: 86.5k, False: 0]
  ------------------
  134|  86.5k|  invariant((_width == 0) == (_height == 0));
  ------------------
  |  |   27|  86.5k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (134:3): [True: 86.5k, False: 0]
  ------------------
  135|  86.5k|  invariant(data.size() == _pitch * _height);
  ------------------
  |  |   27|  86.5k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (135:3): [True: 86.5k, False: 5]
  ------------------
  136|  86.5k|}
_ZNK8rawspeed10Array2DRefIKSt4byteE6heightEv:
  171|  42.5k|__attribute__((always_inline)) inline int Array2DRef<T>::height() const {
  172|  42.5k|  establishClassInvariants();
  173|  42.5k|  return _height;
  174|  42.5k|}
_ZNK8rawspeed10Array2DRefISt4byteE5widthEv:
  165|  18.7M|__attribute__((always_inline)) inline int Array2DRef<T>::width() const {
  166|  18.7M|  establishClassInvariants();
  167|  18.7M|  return _width;
  168|  18.7M|}
_ZNK8rawspeed10Array2DRefISt4byteE24establishClassInvariantsEv:
  127|  46.9M|Array2DRef<T>::establishClassInvariants() const noexcept {
  128|  46.9M|  data.establishClassInvariants();
  129|  46.9M|  invariant(_width >= 0);
  ------------------
  |  |   27|  46.9M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (129:3): [True: 46.9M, False: 18.4E]
  ------------------
  130|  46.9M|  invariant(_height >= 0);
  ------------------
  |  |   27|  46.9M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (130:3): [True: 46.9M, False: 0]
  ------------------
  131|  46.9M|  invariant(_pitch != 0);
  ------------------
  |  |   27|  46.9M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (131:3): [True: 46.9M, False: 0]
  ------------------
  132|  46.9M|  invariant(_pitch >= 0);
  ------------------
  |  |   27|  46.9M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (132:3): [True: 46.9M, False: 1]
  ------------------
  133|  46.9M|  invariant(_pitch >= _width);
  ------------------
  |  |   27|  46.9M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (133:3): [True: 46.9M, False: 0]
  ------------------
  134|  46.9M|  invariant((_width == 0) == (_height == 0));
  ------------------
  |  |   27|  46.9M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (134:3): [True: 46.9M, False: 18.4E]
  ------------------
  135|  46.9M|  invariant(data.size() == _pitch * _height);
  ------------------
  |  |   27|  46.9M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (135:3): [True: 46.9M, False: 18.4E]
  ------------------
  136|  46.9M|}
_ZNK8rawspeed10Array2DRefISt4byteE6heightEv:
  171|  13.0M|__attribute__((always_inline)) inline int Array2DRef<T>::height() const {
  172|  13.0M|  establishClassInvariants();
  173|  13.0M|  return _height;
  174|  13.0M|}
_ZNK8rawspeed10Array2DRefISt4byteE15getAsArray1DRefEv:
  178|    706|Array2DRef<T>::getAsArray1DRef() const {
  179|    706|  establishClassInvariants();
  180|    706|  if (height() == 1 || _pitch == width())
  ------------------
  |  Branch (180:7): [True: 164, False: 542]
  |  Branch (180:24): [True: 32, False: 510]
  ------------------
  181|    196|    return data.getCrop(/*offset=*/0, width() * height()).getAsArray1DRef();
  182|    510|  return std::nullopt;
  183|    706|}
_ZNK8rawspeed10Array2DRefIKSt4byteE15getAsArray1DRefEv:
  178|    706|Array2DRef<T>::getAsArray1DRef() const {
  179|    706|  establishClassInvariants();
  180|    706|  if (height() == 1 || _pitch == width())
  ------------------
  |  Branch (180:7): [True: 166, False: 540]
  |  Branch (180:24): [True: 534, False: 6]
  ------------------
  181|    700|    return data.getCrop(/*offset=*/0, width() * height()).getAsArray1DRef();
  182|      6|  return std::nullopt;
  183|    706|}
_ZNK8rawspeed10Array2DRefISt4byteEixEi:
  186|  7.53M|inline Array1DRef<T> Array2DRef<T>::operator[](const int row) const {
  187|  7.53M|  establishClassInvariants();
  188|  7.53M|  invariant(row >= 0);
  ------------------
  |  |   27|  7.53M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (188:3): [True: 7.53M, False: 18.4E]
  ------------------
  189|  7.53M|  invariant(row < height());
  ------------------
  |  |   27|  7.53M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (189:3): [True: 7.53M, False: 2]
  ------------------
  190|  7.53M|  return data.getCrop(row * _pitch, width()).getAsArray1DRef();
  191|  7.53M|}
_ZNK8rawspeed10Array2DRefIKSt4byteEixEi:
  186|  19.6k|inline Array1DRef<T> Array2DRef<T>::operator[](const int row) const {
  187|  19.6k|  establishClassInvariants();
  188|  19.6k|  invariant(row >= 0);
  ------------------
  |  |   27|  19.6k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (188:3): [True: 19.6k, False: 2]
  ------------------
  189|  19.6k|  invariant(row < height());
  ------------------
  |  |   27|  19.6k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (189:3): [True: 19.6k, False: 18.4E]
  ------------------
  190|  19.6k|  return data.getCrop(row * _pitch, width()).getAsArray1DRef();
  191|  19.6k|}
_ZNK8rawspeed10Array2DRefItE24establishClassInvariantsEv:
  127|   200M|Array2DRef<T>::establishClassInvariants() const noexcept {
  128|   200M|  data.establishClassInvariants();
  129|   200M|  invariant(_width >= 0);
  ------------------
  |  |   27|   200M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (129:3): [True: 207M, False: 18.4E]
  ------------------
  130|   207M|  invariant(_height >= 0);
  ------------------
  |  |   27|   207M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (130:3): [True: 209M, False: 18.4E]
  ------------------
  131|   209M|  invariant(_pitch != 0);
  ------------------
  |  |   27|   209M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (131:3): [True: 209M, False: 18.4E]
  ------------------
  132|   209M|  invariant(_pitch >= 0);
  ------------------
  |  |   27|   209M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (132:3): [True: 209M, False: 18.4E]
  ------------------
  133|   209M|  invariant(_pitch >= _width);
  ------------------
  |  |   27|   209M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (133:3): [True: 209M, False: 255k]
  ------------------
  134|   209M|  invariant((_width == 0) == (_height == 0));
  ------------------
  |  |   27|   209M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (134:3): [True: 212M, False: 18.4E]
  ------------------
  135|   212M|  invariant(data.size() == _pitch * _height);
  ------------------
  |  |   27|   212M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (135:3): [True: 211M, False: 650k]
  ------------------
  136|   212M|}
_ZNK8rawspeed10Array2DRefItE5widthEv:
  165|  92.9M|__attribute__((always_inline)) inline int Array2DRef<T>::width() const {
  166|  92.9M|  establishClassInvariants();
  167|  92.9M|  return _width;
  168|  92.9M|}
_ZNK8rawspeed10Array2DRefItE6heightEv:
  171|  57.5M|__attribute__((always_inline)) inline int Array2DRef<T>::height() const {
  172|  57.5M|  establishClassInvariants();
  173|  57.5M|  return _height;
  174|  57.5M|}
_ZNK8rawspeed10Array2DRefIfE24establishClassInvariantsEv:
  127|  3.23M|Array2DRef<T>::establishClassInvariants() const noexcept {
  128|  3.23M|  data.establishClassInvariants();
  129|  3.23M|  invariant(_width >= 0);
  ------------------
  |  |   27|  3.23M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (129:3): [True: 3.23M, False: 0]
  ------------------
  130|  3.23M|  invariant(_height >= 0);
  ------------------
  |  |   27|  3.23M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (130:3): [True: 3.23M, False: 0]
  ------------------
  131|  3.23M|  invariant(_pitch != 0);
  ------------------
  |  |   27|  3.23M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (131:3): [True: 3.23M, False: 0]
  ------------------
  132|  3.23M|  invariant(_pitch >= 0);
  ------------------
  |  |   27|  3.23M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (132:3): [True: 3.23M, False: 0]
  ------------------
  133|  3.23M|  invariant(_pitch >= _width);
  ------------------
  |  |   27|  3.23M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (133:3): [True: 3.23M, False: 0]
  ------------------
  134|  3.23M|  invariant((_width == 0) == (_height == 0));
  ------------------
  |  |   27|  3.23M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (134:3): [True: 3.23M, False: 0]
  ------------------
  135|  3.23M|  invariant(data.size() == _pitch * _height);
  ------------------
  |  |   27|  3.23M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (135:3): [True: 3.23M, False: 18.4E]
  ------------------
  136|  3.23M|}
_ZNK8rawspeed10Array2DRefIfE5widthEv:
  165|  1.29M|__attribute__((always_inline)) inline int Array2DRef<T>::width() const {
  166|  1.29M|  establishClassInvariants();
  167|  1.29M|  return _width;
  168|  1.29M|}
_ZNK8rawspeed10Array2DRefIfE6heightEv:
  171|   788k|__attribute__((always_inline)) inline int Array2DRef<T>::height() const {
  172|   788k|  establishClassInvariants();
  173|   788k|  return _height;
  174|   788k|}
_ZN8rawspeed10Array2DRefIiEC2EPiii:
  154|  1.99k|    : Array2DRef(data_, width_, height_, /*pitch=*/width_) {
  155|  1.99k|  establishClassInvariants();
  156|  1.99k|}
_ZN8rawspeed10Array2DRefIiEC2EPiiii:
  148|  1.99k|    : Array2DRef({data_, pitch_ * height_}, width_, height_, pitch_) {
  149|  1.99k|  establishClassInvariants();
  150|  1.99k|}
_ZN8rawspeed10Array2DRefIiEC2ENS_10Array1DRefIiEEiii:
  141|  1.99k|    : data(data_), _pitch(pitch_), _width(width_), _height(height_) {
  142|  1.99k|  establishClassInvariants();
  143|  1.99k|}
_ZNK8rawspeed10Array2DRefIiE24establishClassInvariantsEv:
  127|  16.5k|Array2DRef<T>::establishClassInvariants() const noexcept {
  128|  16.5k|  data.establishClassInvariants();
  129|  16.5k|  invariant(_width >= 0);
  ------------------
  |  |   27|  16.5k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (129:3): [True: 16.5k, False: 0]
  ------------------
  130|  16.5k|  invariant(_height >= 0);
  ------------------
  |  |   27|  16.5k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (130:3): [True: 16.5k, False: 0]
  ------------------
  131|  16.5k|  invariant(_pitch != 0);
  ------------------
  |  |   27|  16.5k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (131:3): [True: 16.5k, False: 0]
  ------------------
  132|  16.5k|  invariant(_pitch >= 0);
  ------------------
  |  |   27|  16.5k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (132:3): [True: 16.5k, False: 0]
  ------------------
  133|  16.5k|  invariant(_pitch >= _width);
  ------------------
  |  |   27|  16.5k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (133:3): [True: 16.5k, False: 0]
  ------------------
  134|  16.5k|  invariant((_width == 0) == (_height == 0));
  ------------------
  |  |   27|  16.5k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (134:3): [True: 16.5k, False: 0]
  ------------------
  135|  16.5k|  invariant(data.size() == _pitch * _height);
  ------------------
  |  |   27|  16.5k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (135:3): [True: 16.5k, False: 0]
  ------------------
  136|  16.5k|}
_ZNK8rawspeed10Array2DRefIiE15getAsArray1DRefEv:
  178|  2.11k|Array2DRef<T>::getAsArray1DRef() const {
  179|  2.11k|  establishClassInvariants();
  180|  2.11k|  if (height() == 1 || _pitch == width())
  ------------------
  |  Branch (180:7): [True: 0, False: 2.11k]
  |  Branch (180:24): [True: 2.11k, False: 0]
  ------------------
  181|  2.11k|    return data.getCrop(/*offset=*/0, width() * height()).getAsArray1DRef();
  182|      0|  return std::nullopt;
  183|  2.11k|}
_ZNK8rawspeed10Array2DRefIiE6heightEv:
  171|  4.23k|__attribute__((always_inline)) inline int Array2DRef<T>::height() const {
  172|  4.23k|  establishClassInvariants();
  173|  4.23k|  return _height;
  174|  4.23k|}
_ZNK8rawspeed10Array2DRefIiE5widthEv:
  165|  4.23k|__attribute__((always_inline)) inline int Array2DRef<T>::width() const {
  166|  4.23k|  establishClassInvariants();
  167|  4.23k|  return _width;
  168|  4.23k|}
_ZN8rawspeed10Array2DRefItEC2EPtiii:
  148|  4.07M|    : Array2DRef({data_, pitch_ * height_}, width_, height_, pitch_) {
  149|  4.07M|  establishClassInvariants();
  150|  4.07M|}
_ZN8rawspeed10Array2DRefItEC2ENS_10Array1DRefItEEiii:
  141|  4.08M|    : data(data_), _pitch(pitch_), _width(width_), _height(height_) {
  142|  4.08M|  establishClassInvariants();
  143|  4.08M|}
_ZN8rawspeed10Array2DRefISt4byteEC2ItQaaaantaasr3stdE10is_const_vITL0__Entsr3stdE10is_const_vIT_Entsr3stdE9is_same_vIu14__remove_constIS5_Eu14__remove_constIS4_EEsr3stdE9is_same_vIS6_S1_EEENS0_IS5_EE:
   92|  10.4k|      : Array2DRef(RHS.data, sizeof(T2) * RHS._width, RHS._height,
   93|  10.4k|                   sizeof(T2) * RHS._pitch) {}
_ZN8rawspeed10Array2DRefISt4byteEC2ENS_10Array1DRefIS1_EEiii:
  141|  11.7k|    : data(data_), _pitch(pitch_), _width(width_), _height(height_) {
  142|  11.7k|  establishClassInvariants();
  143|  11.7k|}
_ZN8rawspeed10Array2DRefIfEC2EPfiii:
  148|  1.70k|    : Array2DRef({data_, pitch_ * height_}, width_, height_, pitch_) {
  149|  1.70k|  establishClassInvariants();
  150|  1.70k|}
_ZN8rawspeed10Array2DRefIfEC2ENS_10Array1DRefIfEEiii:
  141|  1.70k|    : data(data_), _pitch(pitch_), _width(width_), _height(height_) {
  142|  1.70k|  establishClassInvariants();
  143|  1.70k|}
_ZN8rawspeed10Array2DRefISt4byteEC2IfQaaaantaasr3stdE10is_const_vITL0__Entsr3stdE10is_const_vIT_Entsr3stdE9is_same_vIu14__remove_constIS5_Eu14__remove_constIS4_EEsr3stdE9is_same_vIS6_S1_EEENS0_IS5_EE:
   92|    545|      : Array2DRef(RHS.data, sizeof(T2) * RHS._width, RHS._height,
   93|    545|                   sizeof(T2) * RHS._pitch) {}
_ZNK8rawspeed10Array2DRefISt4byteEclEii:
  195|  5.66M|Array2DRef<T>::operator()(const int row, const int col) const {
  196|  5.66M|  establishClassInvariants();
  197|  5.66M|  invariant(col >= 0);
  ------------------
  |  |   27|  5.66M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (197:3): [True: 5.66M, False: 0]
  ------------------
  198|  5.66M|  invariant(col < width());
  ------------------
  |  |   27|  5.66M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (198:3): [True: 5.66M, False: 0]
  ------------------
  199|  5.66M|  return (operator[](row))(col);
  200|  5.66M|}
_ZNK8rawspeed10Array2DRefItEixEi:
  186|  44.0M|inline Array1DRef<T> Array2DRef<T>::operator[](const int row) const {
  187|  44.0M|  establishClassInvariants();
  188|  44.0M|  invariant(row >= 0);
  ------------------
  |  |   27|  44.0M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (188:3): [True: 45.3M, False: 18.4E]
  ------------------
  189|  45.3M|  invariant(row < height());
  ------------------
  |  |   27|  45.3M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (189:3): [True: 42.3M, False: 3.00M]
  ------------------
  190|  42.3M|  return data.getCrop(row * _pitch, width()).getAsArray1DRef();
  191|  45.3M|}
_ZN8rawspeed10Array2DRefItEC2EPtii:
  154|  2.85k|    : Array2DRef(data_, width_, height_, /*pitch=*/width_) {
  155|  2.85k|  establishClassInvariants();
  156|  2.85k|}
_ZNK8rawspeed10Array2DRefItEclEii:
  195|  41.8M|Array2DRef<T>::operator()(const int row, const int col) const {
  196|  41.8M|  establishClassInvariants();
  197|  41.8M|  invariant(col >= 0);
  ------------------
  |  |   27|  41.8M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (197:3): [True: 41.2M, False: 642k]
  ------------------
  198|  41.2M|  invariant(col < width());
  ------------------
  |  |   27|  41.2M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (198:3): [True: 41.9M, False: 18.4E]
  ------------------
  199|  41.9M|  return (operator[](row))(col);
  200|  41.2M|}
_ZN8rawspeed10Array2DRefIKhEC2EPS1_ii:
  154|    331|    : Array2DRef(data_, width_, height_, /*pitch=*/width_) {
  155|    331|  establishClassInvariants();
  156|    331|}
_ZN8rawspeed10Array2DRefIKhEC2EPS1_iii:
  148|    331|    : Array2DRef({data_, pitch_ * height_}, width_, height_, pitch_) {
  149|    331|  establishClassInvariants();
  150|    331|}
_ZN8rawspeed10Array2DRefIKhEC2ENS_10Array1DRefIS1_EEiii:
  141|    331|    : data(data_), _pitch(pitch_), _width(width_), _height(height_) {
  142|    331|  establishClassInvariants();
  143|    331|}
_ZNK8rawspeed10Array2DRefIKhE24establishClassInvariantsEv:
  127|  13.6M|Array2DRef<T>::establishClassInvariants() const noexcept {
  128|  13.6M|  data.establishClassInvariants();
  129|  13.6M|  invariant(_width >= 0);
  ------------------
  |  |   27|  13.6M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (129:3): [True: 13.6M, False: 0]
  ------------------
  130|  13.6M|  invariant(_height >= 0);
  ------------------
  |  |   27|  13.6M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (130:3): [True: 13.6M, False: 0]
  ------------------
  131|  13.6M|  invariant(_pitch != 0);
  ------------------
  |  |   27|  13.6M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (131:3): [True: 13.6M, False: 0]
  ------------------
  132|  13.6M|  invariant(_pitch >= 0);
  ------------------
  |  |   27|  13.6M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (132:3): [True: 13.6M, False: 0]
  ------------------
  133|  13.6M|  invariant(_pitch >= _width);
  ------------------
  |  |   27|  13.6M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (133:3): [True: 13.6M, False: 0]
  ------------------
  134|  13.6M|  invariant((_width == 0) == (_height == 0));
  ------------------
  |  |   27|  13.6M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (134:3): [True: 13.6M, False: 0]
  ------------------
  135|  13.6M|  invariant(data.size() == _pitch * _height);
  ------------------
  |  |   27|  13.6M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (135:3): [True: 13.6M, False: 0]
  ------------------
  136|  13.6M|}
_ZNK8rawspeed10Array2DRefIKhEclEii:
  195|  2.72M|Array2DRef<T>::operator()(const int row, const int col) const {
  196|  2.72M|  establishClassInvariants();
  197|  2.72M|  invariant(col >= 0);
  ------------------
  |  |   27|  2.72M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (197:3): [True: 2.72M, False: 0]
  ------------------
  198|  2.72M|  invariant(col < width());
  ------------------
  |  |   27|  2.72M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (198:3): [True: 2.72M, False: 0]
  ------------------
  199|  2.72M|  return (operator[](row))(col);
  200|  2.72M|}
_ZNK8rawspeed10Array2DRefIKhE5widthEv:
  165|  5.44M|__attribute__((always_inline)) inline int Array2DRef<T>::width() const {
  166|  5.44M|  establishClassInvariants();
  167|  5.44M|  return _width;
  168|  5.44M|}
_ZNK8rawspeed10Array2DRefIKhEixEi:
  186|  2.72M|inline Array1DRef<T> Array2DRef<T>::operator[](const int row) const {
  187|  2.72M|  establishClassInvariants();
  188|  2.72M|  invariant(row >= 0);
  ------------------
  |  |   27|  2.72M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (188:3): [True: 2.72M, False: 0]
  ------------------
  189|  2.72M|  invariant(row < height());
  ------------------
  |  |   27|  2.72M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (189:3): [True: 2.72M, False: 0]
  ------------------
  190|  2.72M|  return data.getCrop(row * _pitch, width()).getAsArray1DRef();
  191|  2.72M|}
_ZNK8rawspeed10Array2DRefIKhE6heightEv:
  171|  2.72M|__attribute__((always_inline)) inline int Array2DRef<T>::height() const {
  172|  2.72M|  establishClassInvariants();
  173|  2.72M|  return _height;
  174|  2.72M|}
_ZN8rawspeed10Array2DRefISt4byteEC2EPS1_iii:
  148|    706|    : Array2DRef({data_, pitch_ * height_}, width_, height_, pitch_) {
  149|    706|  establishClassInvariants();
  150|    706|}
_ZN8rawspeed10Array2DRefIKSt4byteEC2EPS2_iii:
  148|    707|    : Array2DRef({data_, pitch_ * height_}, width_, height_, pitch_) {
  149|    707|  establishClassInvariants();
  150|    707|}
_ZN8rawspeed10Array2DRefIKSt4byteEC2ENS_10Array1DRefIS2_EEiii:
  141|    707|    : data(data_), _pitch(pitch_), _width(width_), _height(height_) {
  142|    707|  establishClassInvariants();
  143|    707|}
_ZNK8rawspeed10Array2DRefIfEclEii:
  195|   511k|Array2DRef<T>::operator()(const int row, const int col) const {
  196|   511k|  establishClassInvariants();
  197|   511k|  invariant(col >= 0);
  ------------------
  |  |   27|   511k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (197:3): [True: 511k, False: 1]
  ------------------
  198|   511k|  invariant(col < width());
  ------------------
  |  |   27|   511k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (198:3): [True: 511k, False: 0]
  ------------------
  199|   511k|  return (operator[](row))(col);
  200|   511k|}
_ZNK8rawspeed10Array2DRefIfEixEi:
  186|   551k|inline Array1DRef<T> Array2DRef<T>::operator[](const int row) const {
  187|   551k|  establishClassInvariants();
  188|   551k|  invariant(row >= 0);
  ------------------
  |  |   27|   551k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (188:3): [True: 551k, False: 0]
  ------------------
  189|   551k|  invariant(row < height());
  ------------------
  |  |   27|   551k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (189:3): [True: 551k, False: 0]
  ------------------
  190|   551k|  return data.getCrop(row * _pitch, width()).getAsArray1DRef();
  191|   551k|}
_ZNK8rawspeed10Array2DRefItE5pitchEv:
  159|  1.29M|__attribute__((always_inline)) inline int Array2DRef<T>::pitch() const {
  160|  1.29M|  establishClassInvariants();
  161|  1.29M|  return _pitch;
  162|  1.29M|}
_ZNK8rawspeed10Array2DRefIKtE5widthEv:
  165|  7.43M|__attribute__((always_inline)) inline int Array2DRef<T>::width() const {
  166|  7.43M|  establishClassInvariants();
  167|  7.43M|  return _width;
  168|  7.43M|}
_ZNK8rawspeed10Array2DRefIKtE24establishClassInvariantsEv:
  127|  19.4M|Array2DRef<T>::establishClassInvariants() const noexcept {
  128|  19.4M|  data.establishClassInvariants();
  129|  19.4M|  invariant(_width >= 0);
  ------------------
  |  |   27|  19.4M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (129:3): [True: 19.5M, False: 18.4E]
  ------------------
  130|  19.5M|  invariant(_height >= 0);
  ------------------
  |  |   27|  19.5M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (130:3): [True: 19.5M, False: 18.4E]
  ------------------
  131|  19.5M|  invariant(_pitch != 0);
  ------------------
  |  |   27|  19.5M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (131:3): [True: 19.5M, False: 18.4E]
  ------------------
  132|  19.5M|  invariant(_pitch >= 0);
  ------------------
  |  |   27|  19.5M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (132:3): [True: 19.5M, False: 18.4E]
  ------------------
  133|  19.5M|  invariant(_pitch >= _width);
  ------------------
  |  |   27|  19.5M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (133:3): [True: 19.6M, False: 18.4E]
  ------------------
  134|  19.6M|  invariant((_width == 0) == (_height == 0));
  ------------------
  |  |   27|  19.6M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (134:3): [True: 19.5M, False: 62.1k]
  ------------------
  135|  19.5M|  invariant(data.size() == _pitch * _height);
  ------------------
  |  |   27|  19.5M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (135:3): [True: 19.4M, False: 67.3k]
  ------------------
  136|  19.5M|}
_ZNK8rawspeed10Array2DRefIKtE6heightEv:
  171|  3.74M|__attribute__((always_inline)) inline int Array2DRef<T>::height() const {
  172|  3.74M|  establishClassInvariants();
  173|  3.74M|  return _height;
  174|  3.74M|}
_ZNK8rawspeed10Array2DRefIKtEclEii:
  195|  3.71M|Array2DRef<T>::operator()(const int row, const int col) const {
  196|  3.71M|  establishClassInvariants();
  197|  3.71M|  invariant(col >= 0);
  ------------------
  |  |   27|  3.71M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (197:3): [True: 3.71M, False: 3.71k]
  ------------------
  198|  3.71M|  invariant(col < width());
  ------------------
  |  |   27|  3.71M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (198:3): [True: 3.71M, False: 283]
  ------------------
  199|  3.71M|  return (operator[](row))(col);
  200|  3.71M|}
_ZNK8rawspeed10Array2DRefIKtEixEi:
  186|  3.71M|inline Array1DRef<T> Array2DRef<T>::operator[](const int row) const {
  187|  3.71M|  establishClassInvariants();
  188|  3.71M|  invariant(row >= 0);
  ------------------
  |  |   27|  3.71M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (188:3): [True: 3.72M, False: 18.4E]
  ------------------
  189|  3.72M|  invariant(row < height());
  ------------------
  |  |   27|  3.72M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (189:3): [True: 3.71M, False: 7.46k]
  ------------------
  190|  3.71M|  return data.getCrop(row * _pitch, width()).getAsArray1DRef();
  191|  3.72M|}
_ZN8rawspeed10Array2DRefIKtEC2ItQaaaantsr3stdE10is_const_vITL0__Esr3stdE10is_const_vIT_Esr3stdE9is_same_vIu14__remove_constIS5_Eu14__remove_constIS4_EEEENS0_IS5_EE:
   83|  1.27M|      : Array2DRef(RHS.data, RHS._width, RHS._height, RHS._pitch) {}
_ZN8rawspeed10Array2DRefIKtEC2ENS_10Array1DRefIS1_EEiii:
  141|  1.27M|    : data(data_), _pitch(pitch_), _width(width_), _height(height_) {
  142|  1.27M|  establishClassInvariants();
  143|  1.27M|}
_ZNK8rawspeed10Array2DRefIKNS_8CFAColorEE24establishClassInvariantsEv:
  127|  25.8k|Array2DRef<T>::establishClassInvariants() const noexcept {
  128|  25.8k|  data.establishClassInvariants();
  129|  25.8k|  invariant(_width >= 0);
  ------------------
  |  |   27|  25.8k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (129:3): [True: 25.9k, False: 18.4E]
  ------------------
  130|  25.9k|  invariant(_height >= 0);
  ------------------
  |  |   27|  25.9k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (130:3): [True: 25.8k, False: 54]
  ------------------
  131|  25.8k|  invariant(_pitch != 0);
  ------------------
  |  |   27|  25.8k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (131:3): [True: 25.8k, False: 18.4E]
  ------------------
  132|  25.8k|  invariant(_pitch >= 0);
  ------------------
  |  |   27|  25.8k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (132:3): [True: 25.9k, False: 18.4E]
  ------------------
  133|  25.9k|  invariant(_pitch >= _width);
  ------------------
  |  |   27|  25.9k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (133:3): [True: 25.9k, False: 18.4E]
  ------------------
  134|  25.9k|  invariant((_width == 0) == (_height == 0));
  ------------------
  |  |   27|  25.9k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (134:3): [True: 25.9k, False: 18.4E]
  ------------------
  135|  25.9k|  invariant(data.size() == _pitch * _height);
  ------------------
  |  |   27|  25.9k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (135:3): [True: 25.9k, False: 18.4E]
  ------------------
  136|  25.9k|}
_ZNK8rawspeed10Array2DRefIKNS_8CFAColorEEclEii:
  195|  4.63k|Array2DRef<T>::operator()(const int row, const int col) const {
  196|  4.63k|  establishClassInvariants();
  197|  4.63k|  invariant(col >= 0);
  ------------------
  |  |   27|  4.63k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (197:3): [True: 4.59k, False: 46]
  ------------------
  198|  4.59k|  invariant(col < width());
  ------------------
  |  |   27|  4.59k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (198:3): [True: 4.60k, False: 18.4E]
  ------------------
  199|  4.60k|  return (operator[](row))(col);
  200|  4.59k|}
_ZNK8rawspeed10Array2DRefIKNS_8CFAColorEE5widthEv:
  165|  9.12k|__attribute__((always_inline)) inline int Array2DRef<T>::width() const {
  166|  9.12k|  establishClassInvariants();
  167|  9.12k|  return _width;
  168|  9.12k|}
_ZNK8rawspeed10Array2DRefIKNS_8CFAColorEEixEi:
  186|  4.59k|inline Array1DRef<T> Array2DRef<T>::operator[](const int row) const {
  187|  4.59k|  establishClassInvariants();
  188|  4.59k|  invariant(row >= 0);
  ------------------
  |  |   27|  4.59k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (188:3): [True: 4.63k, False: 18.4E]
  ------------------
  189|  4.63k|  invariant(row < height());
  ------------------
  |  |   27|  4.63k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (189:3): [True: 4.59k, False: 44]
  ------------------
  190|  4.59k|  return data.getCrop(row * _pitch, width()).getAsArray1DRef();
  191|  4.63k|}
_ZNK8rawspeed10Array2DRefIKNS_8CFAColorEE6heightEv:
  171|  4.63k|__attribute__((always_inline)) inline int Array2DRef<T>::height() const {
  172|  4.63k|  establishClassInvariants();
  173|  4.63k|  return _height;
  174|  4.63k|}
_ZNK8rawspeed10Array2DRefINS_8CFAColorEE24establishClassInvariantsEv:
  127|  49.5k|Array2DRef<T>::establishClassInvariants() const noexcept {
  128|  49.5k|  data.establishClassInvariants();
  129|  49.5k|  invariant(_width >= 0);
  ------------------
  |  |   27|  49.5k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (129:3): [True: 49.8k, False: 18.4E]
  ------------------
  130|  49.8k|  invariant(_height >= 0);
  ------------------
  |  |   27|  49.8k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (130:3): [True: 49.8k, False: 18.4E]
  ------------------
  131|  49.8k|  invariant(_pitch != 0);
  ------------------
  |  |   27|  49.8k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (131:3): [True: 49.9k, False: 18.4E]
  ------------------
  132|  49.9k|  invariant(_pitch >= 0);
  ------------------
  |  |   27|  49.9k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (132:3): [True: 49.9k, False: 18.4E]
  ------------------
  133|  49.9k|  invariant(_pitch >= _width);
  ------------------
  |  |   27|  49.9k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (133:3): [True: 49.9k, False: 18.4E]
  ------------------
  134|  49.9k|  invariant((_width == 0) == (_height == 0));
  ------------------
  |  |   27|  49.9k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (134:3): [True: 49.9k, False: 18.4E]
  ------------------
  135|  49.9k|  invariant(data.size() == _pitch * _height);
  ------------------
  |  |   27|  49.9k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (135:3): [True: 49.9k, False: 63]
  ------------------
  136|  49.9k|}
_ZNK8rawspeed10Array2DRefINS_8CFAColorEE6heightEv:
  171|  11.2k|__attribute__((always_inline)) inline int Array2DRef<T>::height() const {
  172|  11.2k|  establishClassInvariants();
  173|  11.2k|  return _height;
  174|  11.2k|}
_ZNK8rawspeed10Array2DRefINS_8CFAColorEE5widthEv:
  165|  22.1k|__attribute__((always_inline)) inline int Array2DRef<T>::width() const {
  166|  22.1k|  establishClassInvariants();
  167|  22.1k|  return _width;
  168|  22.1k|}
_ZNK8rawspeed10Array2DRefINS_8CFAColorEEclEii:
  195|  6.46k|Array2DRef<T>::operator()(const int row, const int col) const {
  196|  6.46k|  establishClassInvariants();
  197|  6.46k|  invariant(col >= 0);
  ------------------
  |  |   27|  6.46k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (197:3): [True: 6.43k, False: 39]
  ------------------
  198|  6.43k|  invariant(col < width());
  ------------------
  |  |   27|  6.43k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (198:3): [True: 6.38k, False: 41]
  ------------------
  199|  6.38k|  return (operator[](row))(col);
  200|  6.43k|}
_ZNK8rawspeed10Array2DRefINS_8CFAColorEEixEi:
  186|  6.39k|inline Array1DRef<T> Array2DRef<T>::operator[](const int row) const {
  187|  6.39k|  establishClassInvariants();
  188|  6.39k|  invariant(row >= 0);
  ------------------
  |  |   27|  6.39k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (188:3): [True: 6.45k, False: 18.4E]
  ------------------
  189|  6.45k|  invariant(row < height());
  ------------------
  |  |   27|  6.45k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (189:3): [True: 6.37k, False: 75]
  ------------------
  190|  6.37k|  return data.getCrop(row * _pitch, width()).getAsArray1DRef();
  191|  6.45k|}
_ZN8rawspeed10Array2DRefINS_8CFAColorEEC2EPS1_ii:
  154|  1.62k|    : Array2DRef(data_, width_, height_, /*pitch=*/width_) {
  155|  1.62k|  establishClassInvariants();
  156|  1.62k|}
_ZN8rawspeed10Array2DRefINS_8CFAColorEEC2EPS1_iii:
  148|  1.62k|    : Array2DRef({data_, pitch_ * height_}, width_, height_, pitch_) {
  149|  1.62k|  establishClassInvariants();
  150|  1.62k|}
_ZN8rawspeed10Array2DRefINS_8CFAColorEEC2ENS_10Array1DRefIS1_EEiii:
  141|  1.62k|    : data(data_), _pitch(pitch_), _width(width_), _height(height_) {
  142|  1.62k|  establishClassInvariants();
  143|  1.62k|}
_ZN8rawspeed10Array2DRefIKNS_8CFAColorEEC2EPS2_ii:
  154|  1.16k|    : Array2DRef(data_, width_, height_, /*pitch=*/width_) {
  155|  1.16k|  establishClassInvariants();
  156|  1.16k|}
_ZN8rawspeed10Array2DRefIKNS_8CFAColorEEC2EPS2_iii:
  148|  1.15k|    : Array2DRef({data_, pitch_ * height_}, width_, height_, pitch_) {
  149|  1.15k|  establishClassInvariants();
  150|  1.15k|}
_ZN8rawspeed10Array2DRefIKNS_8CFAColorEEC2ENS_10Array1DRefIS2_EEiii:
  141|  1.16k|    : data(data_), _pitch(pitch_), _width(width_), _height(height_) {
  142|  1.16k|  establishClassInvariants();
  143|  1.16k|}
_ZN8rawspeed10Array2DRefIfE6createINSt3__19allocatorIfEEEES1_RNS3_6vectorIfT_EEii:
   99|    266|         int height) {
  100|    266|    using VectorTy = std::remove_reference_t<decltype(storage)>;
  101|    266|    storage = VectorTy(width * height);
  102|    266|    return {storage.data(), width, height};
  103|    266|  }
_ZN8rawspeed10Array2DRefIfEC2EPfii:
  154|    532|    : Array2DRef(data_, width_, height_, /*pitch=*/width_) {
  155|    532|  establishClassInvariants();
  156|    532|}

_ZN8rawspeed8bitwidthIjEEjT_:
   43|  15.6M|constexpr unsigned RAWSPEED_READNONE bitwidth([[maybe_unused]] T unused = {}) {
   44|       |  return CHAR_BIT * sizeof(T);
   45|  15.6M|}
_ZN8rawspeed8bitwidthImEEjT_:
   43|  21.6M|constexpr unsigned RAWSPEED_READNONE bitwidth([[maybe_unused]] T unused = {}) {
   44|       |  return CHAR_BIT * sizeof(T);
   45|  21.6M|}
_ZN8rawspeed12isPowerOfTwoIiEEbT_:
   38|     36|template <typename T> constexpr bool RAWSPEED_READNONE isPowerOfTwo(T val) {
   39|     36|  return (val & (~val + 1)) == val;
   40|     36|}
_ZN8rawspeed14extractLowBitsIjQsr3stdE17unsigned_integralIT_EEES1_S1_j:
   96|  10.1M|constexpr RAWSPEED_READNONE T extractLowBits(T value, unsigned nBits) {
   97|       |  // invariant(nBits >= 0);
   98|  10.1M|  invariant(nBits != 0);             // Would result in out-of-bound shift.
  ------------------
  |  |   27|  10.1M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (98:3): [True: 10.1M, False: 0]
  ------------------
   99|  10.1M|  invariant(nBits <= bitwidth<T>()); // No-op is fine.
  ------------------
  |  |   27|  10.1M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (99:3): [True: 10.3M, False: 18.4E]
  ------------------
  100|  10.3M|  unsigned numHighPaddingBits = bitwidth<T>() - nBits;
  101|       |  // invariant(numHighPaddingBits >= 0);
  102|  10.3M|  invariant(numHighPaddingBits < bitwidth<T>()); // Shift is in-bounds.
  ------------------
  |  |   27|  10.3M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (102:3): [True: 10.3M, False: 0]
  ------------------
  103|  10.3M|  value <<= numHighPaddingBits;
  104|  10.3M|  value >>= numHighPaddingBits;
  105|  10.3M|  return value;
  106|  10.3M|}
_ZN8rawspeed15extractHighBitsImQsr3stdE13is_unsigned_vIT_EEES1_S1_jj:
  121|  21.1M|    T value, unsigned nBits, unsigned effectiveBitwidth = bitwidth<T>()) {
  122|  21.1M|  invariant(effectiveBitwidth <= bitwidth<T>());
  ------------------
  |  |   27|  21.1M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (122:3): [True: 21.1M, False: 0]
  ------------------
  123|  21.1M|  invariant(nBits <= effectiveBitwidth);
  ------------------
  |  |   27|  21.1M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (123:3): [True: 21.1M, False: 18.4E]
  ------------------
  124|  21.1M|  auto numLowBitsToSkip = effectiveBitwidth - nBits;
  125|  21.1M|  invariant(numLowBitsToSkip < bitwidth<T>());
  ------------------
  |  |   27|  21.1M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (125:3): [True: 21.1M, False: 0]
  ------------------
  126|  21.1M|  return value >> numLowBitsToSkip;
  127|  21.1M|}
_ZN8rawspeed8bitwidthIiEEjT_:
   43|  9.85M|constexpr unsigned RAWSPEED_READNONE bitwidth([[maybe_unused]] T unused = {}) {
   44|       |  return CHAR_BIT * sizeof(T);
   45|  9.85M|}
_ZN8rawspeed8bitwidthItEEjT_:
   43|  1.53M|constexpr unsigned RAWSPEED_READNONE bitwidth([[maybe_unused]] T unused = {}) {
   44|       |  return CHAR_BIT * sizeof(T);
   45|  1.53M|}
_ZN8rawspeed15extractHighBitsItQsr3stdE13is_unsigned_vIT_EEES1_S1_jj:
  121|  1.25M|    T value, unsigned nBits, unsigned effectiveBitwidth = bitwidth<T>()) {
  122|  1.25M|  invariant(effectiveBitwidth <= bitwidth<T>());
  ------------------
  |  |   27|  1.25M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (122:3): [True: 1.25M, False: 3]
  ------------------
  123|  1.25M|  invariant(nBits <= effectiveBitwidth);
  ------------------
  |  |   27|  1.25M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (123:3): [True: 1.25M, False: 18.4E]
  ------------------
  124|  1.25M|  auto numLowBitsToSkip = effectiveBitwidth - nBits;
  125|  1.25M|  invariant(numLowBitsToSkip < bitwidth<T>());
  ------------------
  |  |   27|  1.25M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (125:3): [True: 1.25M, False: 1]
  ------------------
  126|  1.25M|  return value >> numLowBitsToSkip;
  127|  1.25M|}
_ZN8rawspeed9clampBitsIiQsr3stdE15is_arithmetic_vIT_EEEDaS1_j:
   75|  9.19M|constexpr auto RAWSPEED_READNONE clampBits(T value, unsigned int nBits) {
   76|       |  // We expect to produce uint16_t.
   77|  9.19M|  invariant(nBits <= 16);
  ------------------
  |  |   27|  9.19M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (77:3): [True: 9.19M, False: 0]
  ------------------
   78|       |  // Check that the clamp is not a no-op. Not of uint16_t to 16 bits e.g.
   79|       |  // (Well, not really, if we are called from clampBits<signed>, it's ok..).
   80|  9.19M|  invariant(bitwidth<T>() > nBits); // If nBits >= bitwidth, then shift is UB.
  ------------------
  |  |   27|  9.19M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (80:3): [True: 9.19M, False: 0]
  ------------------
   81|  9.19M|  const auto maxVal = implicit_cast<T>((T(1) << nBits) - T(1));
   82|  9.19M|  return implicit_cast<uint16_t>(std::clamp(value, T(0), maxVal));
   83|  9.19M|}
_ZN8rawspeed6isIntNIiQsr3stdE15is_arithmetic_vIT_EEEbS1_j:
   87|   655k|constexpr bool RAWSPEED_READNONE isIntN(T value, unsigned int nBits) {
   88|   655k|  invariant(nBits < bitwidth<T>() && "Check must not be tautological.");
  ------------------
  |  |   27|   655k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (88:3): [True: 655k, False: 0]
  |  Branch (88:3): [True: 655k, Folded]
  |  Branch (88:3): [True: 655k, False: 0]
  ------------------
   89|   655k|  using UnsignedT = std::make_unsigned_t<T>;
   90|   655k|  const auto highBits = static_cast<UnsignedT>(value) >> nBits;
   91|   655k|  return highBits == 0;
   92|   655k|}
_ZN8rawspeed9clampBitsIjQsr3stdE15is_arithmetic_vIT_EEEDaS1_j:
   75|   287k|constexpr auto RAWSPEED_READNONE clampBits(T value, unsigned int nBits) {
   76|       |  // We expect to produce uint16_t.
   77|   287k|  invariant(nBits <= 16);
  ------------------
  |  |   27|   287k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (77:3): [True: 287k, False: 0]
  ------------------
   78|       |  // Check that the clamp is not a no-op. Not of uint16_t to 16 bits e.g.
   79|       |  // (Well, not really, if we are called from clampBits<signed>, it's ok..).
   80|   287k|  invariant(bitwidth<T>() > nBits); // If nBits >= bitwidth, then shift is UB.
  ------------------
  |  |   27|   287k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (80:3): [True: 299k, False: 18.4E]
  ------------------
   81|   299k|  const auto maxVal = implicit_cast<T>((T(1) << nBits) - T(1));
   82|   299k|  return implicit_cast<uint16_t>(std::clamp(value, T(0), maxVal));
   83|   287k|}
_ZN8rawspeed15extractHighBitsIjQsr3stdE13is_unsigned_vIT_EEES1_S1_jj:
  121|  3.35M|    T value, unsigned nBits, unsigned effectiveBitwidth = bitwidth<T>()) {
  122|  3.35M|  invariant(effectiveBitwidth <= bitwidth<T>());
  ------------------
  |  |   27|  3.35M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (122:3): [True: 3.35M, False: 0]
  ------------------
  123|  3.35M|  invariant(nBits <= effectiveBitwidth);
  ------------------
  |  |   27|  3.35M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (123:3): [True: 3.36M, False: 18.4E]
  ------------------
  124|  3.36M|  auto numLowBitsToSkip = effectiveBitwidth - nBits;
  125|  3.36M|  invariant(numLowBitsToSkip < bitwidth<T>());
  ------------------
  |  |   27|  3.36M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (125:3): [True: 3.36M, False: 0]
  ------------------
  126|  3.36M|  return value >> numLowBitsToSkip;
  127|  3.36M|}
_ZN8rawspeed13numActiveBitsImQaasr3stdE17unsigned_integralIT_Egecl8bitwidthIS1_EEclL_ZNS_8bitwidthIjEEjS1_EilEEEEjS1_:
   56|   544k|unsigned numActiveBits(const T v) {
   57|   544k|  return bitwidth(v) - std::countl_zero(v);
   58|   544k|}
_ZN8rawspeed13numActiveBitsItQaasr3stdE17unsigned_integralIT_Eltcl8bitwidthIS1_EEclL_ZNS_8bitwidthIjEEjS1_EilEEEEjS1_:
   62|  1.45M|unsigned numActiveBits(const T v) {
   63|  1.45M|  return numActiveBits(static_cast<uint32_t>(v));
   64|  1.45M|}
_ZN8rawspeed13numActiveBitsIjQaasr3stdE17unsigned_integralIT_Egecl8bitwidthIS1_EEclL_ZNS_8bitwidthIjEEjS1_EilEEEEjS1_:
   56|  1.45M|unsigned numActiveBits(const T v) {
   57|  1.45M|  return bitwidth(v) - std::countl_zero(v);
   58|  1.45M|}
_ZN8rawspeed10signExtendIjQsr3stdE13is_unsigned_vIT_EEEu13__make_signedIS1_ES1_j:
  132|   182k|    RAWSPEED_READNONE signExtend(T value, unsigned int nBits) {
  133|   182k|  invariant(nBits != 0 && "Only valid for non-zero bit count.");
  ------------------
  |  |   27|   182k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (133:3): [True: 182k, False: 0]
  |  Branch (133:3): [True: 182k, Folded]
  |  Branch (133:3): [True: 182k, False: 0]
  ------------------
  134|   182k|  const T SpareSignBits = bitwidth<T>() - nBits;
  135|   182k|  using SignedT = std::make_signed_t<T>;
  136|   182k|  return static_cast<SignedT>(value << SpareSignBits) >> SpareSignBits;
  137|   182k|}

_ZN8rawspeed13implicit_castIjmQaaaaoosr3stdE13is_integral_vIT0_Esr3stdE19is_floating_point_vIS1_Eoosr3stdE13is_integral_vIT_Esr3stdE19is_floating_point_vIS2_Entsr3stdE9is_same_vIS1_S2_EEES2_S1_:
   32|  23.6M|constexpr RAWSPEED_READNONE Ttgt implicit_cast(Tsrc value) {
   33|  23.6M|#pragma GCC diagnostic push
   34|  23.6M|#pragma GCC diagnostic ignored "-Wconversion"
   35|  23.6M|#pragma GCC diagnostic ignored "-Wdouble-promotion"
   36|  23.6M|  return value;
   37|  23.6M|#pragma GCC diagnostic pop
   38|  23.6M|}
_ZN8rawspeed13implicit_castIijQaaaaoosr3stdE13is_integral_vIT0_Esr3stdE19is_floating_point_vIS1_Eoosr3stdE13is_integral_vIT_Esr3stdE19is_floating_point_vIS2_Entsr3stdE9is_same_vIS1_S2_EEES2_S1_:
   32|  60.8M|constexpr RAWSPEED_READNONE Ttgt implicit_cast(Tsrc value) {
   33|  60.8M|#pragma GCC diagnostic push
   34|  60.8M|#pragma GCC diagnostic ignored "-Wconversion"
   35|  60.8M|#pragma GCC diagnostic ignored "-Wdouble-promotion"
   36|  60.8M|  return value;
   37|  60.8M|#pragma GCC diagnostic pop
   38|  60.8M|}
_ZN8rawspeed13implicit_castItjQaaaaoosr3stdE13is_integral_vIT0_Esr3stdE19is_floating_point_vIS1_Eoosr3stdE13is_integral_vIT_Esr3stdE19is_floating_point_vIS2_Entsr3stdE9is_same_vIS1_S2_EEES2_S1_:
   32|  33.0M|constexpr RAWSPEED_READNONE Ttgt implicit_cast(Tsrc value) {
   33|  33.0M|#pragma GCC diagnostic push
   34|  33.0M|#pragma GCC diagnostic ignored "-Wconversion"
   35|  33.0M|#pragma GCC diagnostic ignored "-Wdouble-promotion"
   36|  33.0M|  return value;
   37|  33.0M|#pragma GCC diagnostic pop
   38|  33.0M|}
_ZN8rawspeed13implicit_castIfdQaaaaoosr3stdE13is_integral_vIT0_Esr3stdE19is_floating_point_vIS1_Eoosr3stdE13is_integral_vIT_Esr3stdE19is_floating_point_vIS2_Entsr3stdE9is_same_vIS1_S2_EEES2_S1_:
   32|    244|constexpr RAWSPEED_READNONE Ttgt implicit_cast(Tsrc value) {
   33|    244|#pragma GCC diagnostic push
   34|    244|#pragma GCC diagnostic ignored "-Wconversion"
   35|    244|#pragma GCC diagnostic ignored "-Wdouble-promotion"
   36|    244|  return value;
   37|    244|#pragma GCC diagnostic pop
   38|    244|}
_ZN8rawspeed13implicit_castItiQaaaaoosr3stdE13is_integral_vIT0_Esr3stdE19is_floating_point_vIS1_Eoosr3stdE13is_integral_vIT_Esr3stdE19is_floating_point_vIS2_Entsr3stdE9is_same_vIS1_S2_EEES2_S1_:
   32|  28.3M|constexpr RAWSPEED_READNONE Ttgt implicit_cast(Tsrc value) {
   33|  28.3M|#pragma GCC diagnostic push
   34|  28.3M|#pragma GCC diagnostic ignored "-Wconversion"
   35|  28.3M|#pragma GCC diagnostic ignored "-Wdouble-promotion"
   36|  28.3M|  return value;
   37|  28.3M|#pragma GCC diagnostic pop
   38|  28.3M|}
_ZN8rawspeed13implicit_castIhiQaaaaoosr3stdE13is_integral_vIT0_Esr3stdE19is_floating_point_vIS1_Eoosr3stdE13is_integral_vIT_Esr3stdE19is_floating_point_vIS2_Entsr3stdE9is_same_vIS1_S2_EEES2_S1_:
   32|  82.4k|constexpr RAWSPEED_READNONE Ttgt implicit_cast(Tsrc value) {
   33|  82.4k|#pragma GCC diagnostic push
   34|  82.4k|#pragma GCC diagnostic ignored "-Wconversion"
   35|  82.4k|#pragma GCC diagnostic ignored "-Wdouble-promotion"
   36|  82.4k|  return value;
   37|  82.4k|#pragma GCC diagnostic pop
   38|  82.4k|}
_ZN8rawspeed13implicit_castIimQaaaaoosr3stdE13is_integral_vIT0_Esr3stdE19is_floating_point_vIS1_Eoosr3stdE13is_integral_vIT_Esr3stdE19is_floating_point_vIS2_Entsr3stdE9is_same_vIS1_S2_EEES2_S1_:
   32|  13.7M|constexpr RAWSPEED_READNONE Ttgt implicit_cast(Tsrc value) {
   33|  13.7M|#pragma GCC diagnostic push
   34|  13.7M|#pragma GCC diagnostic ignored "-Wconversion"
   35|  13.7M|#pragma GCC diagnostic ignored "-Wdouble-promotion"
   36|  13.7M|  return value;
   37|  13.7M|#pragma GCC diagnostic pop
   38|  13.7M|}
_ZN8rawspeed13implicit_castImmQaaaaoosr3stdE13is_integral_vIT0_Esr3stdE19is_floating_point_vIS1_Eoosr3stdE13is_integral_vIT_Esr3stdE19is_floating_point_vIS2_Esr3stdE9is_same_vIS1_S2_EEES2_S1_:
   46|    953|constexpr RAWSPEED_READNONE Ttgt implicit_cast(Tsrc value) {
   47|    953|  return value;
   48|    953|}
_ZN8rawspeed13implicit_castIiiQaaaaoosr3stdE13is_integral_vIT0_Esr3stdE19is_floating_point_vIS1_Eoosr3stdE13is_integral_vIT_Esr3stdE19is_floating_point_vIS2_Esr3stdE9is_same_vIS1_S2_EEES2_S1_:
   46|  9.19M|constexpr RAWSPEED_READNONE Ttgt implicit_cast(Tsrc value) {
   47|  9.19M|  return value;
   48|  9.19M|}
_ZN8rawspeed13implicit_castIjiQaaaaoosr3stdE13is_integral_vIT0_Esr3stdE19is_floating_point_vIS1_Eoosr3stdE13is_integral_vIT_Esr3stdE19is_floating_point_vIS2_Entsr3stdE9is_same_vIS1_S2_EEES2_S1_:
   32|  1.74k|constexpr RAWSPEED_READNONE Ttgt implicit_cast(Tsrc value) {
   33|  1.74k|#pragma GCC diagnostic push
   34|  1.74k|#pragma GCC diagnostic ignored "-Wconversion"
   35|  1.74k|#pragma GCC diagnostic ignored "-Wdouble-promotion"
   36|  1.74k|  return value;
   37|  1.74k|#pragma GCC diagnostic pop
   38|  1.74k|}
_ZN8rawspeed13implicit_castIliQaaaaoosr3stdE13is_integral_vIT0_Esr3stdE19is_floating_point_vIS1_Eoosr3stdE13is_integral_vIT_Esr3stdE19is_floating_point_vIS2_Entsr3stdE9is_same_vIS1_S2_EEES2_S1_:
   32|    405|constexpr RAWSPEED_READNONE Ttgt implicit_cast(Tsrc value) {
   33|    405|#pragma GCC diagnostic push
   34|    405|#pragma GCC diagnostic ignored "-Wconversion"
   35|    405|#pragma GCC diagnostic ignored "-Wdouble-promotion"
   36|    405|  return value;
   37|    405|#pragma GCC diagnostic pop
   38|    405|}
_ZN8rawspeed13implicit_castImiQaaaaoosr3stdE13is_integral_vIT0_Esr3stdE19is_floating_point_vIS1_Eoosr3stdE13is_integral_vIT_Esr3stdE19is_floating_point_vIS2_Entsr3stdE9is_same_vIS1_S2_EEES2_S1_:
   32|    360|constexpr RAWSPEED_READNONE Ttgt implicit_cast(Tsrc value) {
   33|    360|#pragma GCC diagnostic push
   34|    360|#pragma GCC diagnostic ignored "-Wconversion"
   35|    360|#pragma GCC diagnostic ignored "-Wdouble-promotion"
   36|    360|  return value;
   37|    360|#pragma GCC diagnostic pop
   38|    360|}
_ZN8rawspeed13implicit_castIjjQaaaaoosr3stdE13is_integral_vIT0_Esr3stdE19is_floating_point_vIS1_Eoosr3stdE13is_integral_vIT_Esr3stdE19is_floating_point_vIS2_Esr3stdE9is_same_vIS1_S2_EEES2_S1_:
   46|   302k|constexpr RAWSPEED_READNONE Ttgt implicit_cast(Tsrc value) {
   47|   302k|  return value;
   48|   302k|}
_ZN8rawspeed13implicit_castIifQaaaaoosr3stdE13is_integral_vIT0_Esr3stdE19is_floating_point_vIS1_Eoosr3stdE13is_integral_vIT_Esr3stdE19is_floating_point_vIS2_Entsr3stdE9is_same_vIS1_S2_EEES2_S1_:
   32|  1.09k|constexpr RAWSPEED_READNONE Ttgt implicit_cast(Tsrc value) {
   33|  1.09k|#pragma GCC diagnostic push
   34|  1.09k|#pragma GCC diagnostic ignored "-Wconversion"
   35|  1.09k|#pragma GCC diagnostic ignored "-Wdouble-promotion"
   36|  1.09k|  return value;
   37|  1.09k|#pragma GCC diagnostic pop
   38|  1.09k|}
_ZN8rawspeed13implicit_castIsiQaaaaoosr3stdE13is_integral_vIT0_Esr3stdE19is_floating_point_vIS1_Eoosr3stdE13is_integral_vIT_Esr3stdE19is_floating_point_vIS2_Entsr3stdE9is_same_vIS1_S2_EEES2_S1_:
   32|   275k|constexpr RAWSPEED_READNONE Ttgt implicit_cast(Tsrc value) {
   33|   275k|#pragma GCC diagnostic push
   34|   275k|#pragma GCC diagnostic ignored "-Wconversion"
   35|   275k|#pragma GCC diagnostic ignored "-Wdouble-promotion"
   36|   275k|  return value;
   37|   275k|#pragma GCC diagnostic pop
   38|   275k|}
_ZN8rawspeed13implicit_castIjyQaaaaoosr3stdE13is_integral_vIT0_Esr3stdE19is_floating_point_vIS1_Eoosr3stdE13is_integral_vIT_Esr3stdE19is_floating_point_vIS2_Entsr3stdE9is_same_vIS1_S2_EEES2_S1_:
   32|     69|constexpr RAWSPEED_READNONE Ttgt implicit_cast(Tsrc value) {
   33|     69|#pragma GCC diagnostic push
   34|     69|#pragma GCC diagnostic ignored "-Wconversion"
   35|     69|#pragma GCC diagnostic ignored "-Wdouble-promotion"
   36|     69|  return value;
   37|     69|#pragma GCC diagnostic pop
   38|     69|}
_ZN8rawspeed13implicit_castItmQaaaaoosr3stdE13is_integral_vIT0_Esr3stdE19is_floating_point_vIS1_Eoosr3stdE13is_integral_vIT_Esr3stdE19is_floating_point_vIS2_Entsr3stdE9is_same_vIS1_S2_EEES2_S1_:
   32|  1.14M|constexpr RAWSPEED_READNONE Ttgt implicit_cast(Tsrc value) {
   33|  1.14M|#pragma GCC diagnostic push
   34|  1.14M|#pragma GCC diagnostic ignored "-Wconversion"
   35|  1.14M|#pragma GCC diagnostic ignored "-Wdouble-promotion"
   36|  1.14M|  return value;
   37|  1.14M|#pragma GCC diagnostic pop
   38|  1.14M|}
_ZN8rawspeed13implicit_castIdmQaaaaoosr3stdE13is_integral_vIT0_Esr3stdE19is_floating_point_vIS1_Eoosr3stdE13is_integral_vIT_Esr3stdE19is_floating_point_vIS2_Entsr3stdE9is_same_vIS1_S2_EEES2_S1_:
   32|  5.24M|constexpr RAWSPEED_READNONE Ttgt implicit_cast(Tsrc value) {
   33|  5.24M|#pragma GCC diagnostic push
   34|  5.24M|#pragma GCC diagnostic ignored "-Wconversion"
   35|  5.24M|#pragma GCC diagnostic ignored "-Wdouble-promotion"
   36|  5.24M|  return value;
   37|  5.24M|#pragma GCC diagnostic pop
   38|  5.24M|}
_ZN8rawspeed13implicit_castItdQaaaaoosr3stdE13is_integral_vIT0_Esr3stdE19is_floating_point_vIS1_Eoosr3stdE13is_integral_vIT_Esr3stdE19is_floating_point_vIS2_Entsr3stdE9is_same_vIS1_S2_EEES2_S1_:
   32|  8.52M|constexpr RAWSPEED_READNONE Ttgt implicit_cast(Tsrc value) {
   33|  8.52M|#pragma GCC diagnostic push
   34|  8.52M|#pragma GCC diagnostic ignored "-Wconversion"
   35|  8.52M|#pragma GCC diagnostic ignored "-Wdouble-promotion"
   36|  8.52M|  return value;
   37|  8.52M|#pragma GCC diagnostic pop
   38|  8.52M|}
_ZN8rawspeed13implicit_castIdfQaaaaoosr3stdE13is_integral_vIT0_Esr3stdE19is_floating_point_vIS1_Eoosr3stdE13is_integral_vIT_Esr3stdE19is_floating_point_vIS2_Entsr3stdE9is_same_vIS1_S2_EEES2_S1_:
   32|   599k|constexpr RAWSPEED_READNONE Ttgt implicit_cast(Tsrc value) {
   33|   599k|#pragma GCC diagnostic push
   34|   599k|#pragma GCC diagnostic ignored "-Wconversion"
   35|   599k|#pragma GCC diagnostic ignored "-Wdouble-promotion"
   36|   599k|  return value;
   37|   599k|#pragma GCC diagnostic pop
   38|   599k|}
_ZN8rawspeed13implicit_castIjfQaaaaoosr3stdE13is_integral_vIT0_Esr3stdE19is_floating_point_vIS1_Eoosr3stdE13is_integral_vIT_Esr3stdE19is_floating_point_vIS2_Entsr3stdE9is_same_vIS1_S2_EEES2_S1_:
   32|  3.12k|constexpr RAWSPEED_READNONE Ttgt implicit_cast(Tsrc value) {
   33|  3.12k|#pragma GCC diagnostic push
   34|  3.12k|#pragma GCC diagnostic ignored "-Wconversion"
   35|  3.12k|#pragma GCC diagnostic ignored "-Wdouble-promotion"
   36|  3.12k|  return value;
   37|  3.12k|#pragma GCC diagnostic pop
   38|  3.12k|}
_ZN8rawspeed13implicit_castIfjQaaaaoosr3stdE13is_integral_vIT0_Esr3stdE19is_floating_point_vIS1_Eoosr3stdE13is_integral_vIT_Esr3stdE19is_floating_point_vIS2_Entsr3stdE9is_same_vIS1_S2_EEES2_S1_:
   32|    167|constexpr RAWSPEED_READNONE Ttgt implicit_cast(Tsrc value) {
   33|    167|#pragma GCC diagnostic push
   34|    167|#pragma GCC diagnostic ignored "-Wconversion"
   35|    167|#pragma GCC diagnostic ignored "-Wdouble-promotion"
   36|    167|  return value;
   37|    167|#pragma GCC diagnostic pop
   38|    167|}
_ZN8rawspeed13implicit_castIhjQaaaaoosr3stdE13is_integral_vIT0_Esr3stdE19is_floating_point_vIS1_Eoosr3stdE13is_integral_vIT_Esr3stdE19is_floating_point_vIS2_Entsr3stdE9is_same_vIS1_S2_EEES2_S1_:
   32|    493|constexpr RAWSPEED_READNONE Ttgt implicit_cast(Tsrc value) {
   33|    493|#pragma GCC diagnostic push
   34|    493|#pragma GCC diagnostic ignored "-Wconversion"
   35|    493|#pragma GCC diagnostic ignored "-Wdouble-promotion"
   36|    493|  return value;
   37|    493|#pragma GCC diagnostic pop
   38|    493|}

_ZNK8rawspeed17CroppedArray1DRefISt4byteE24establishClassInvariantsEv:
   94|  53.6M|CroppedArray1DRef<T>::establishClassInvariants() const noexcept {
   95|  53.6M|  base.establishClassInvariants();
   96|  53.6M|  invariant(offset >= 0);
  ------------------
  |  |   27|  53.6M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (96:3): [True: 53.9M, False: 18.4E]
  ------------------
   97|  53.9M|  invariant(numElts >= 0);
  ------------------
  |  |   27|  53.9M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (97:3): [True: 53.9M, False: 18.4E]
  ------------------
   98|  53.9M|  invariant(offset <= base.size());
  ------------------
  |  |   27|  53.9M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (98:3): [True: 53.7M, False: 159k]
  ------------------
   99|  53.7M|  invariant(numElts <= base.size());
  ------------------
  |  |   27|  53.7M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (99:3): [True: 53.5M, False: 242k]
  ------------------
  100|  53.5M|  invariant(offset + numElts <= base.size());
  ------------------
  |  |   27|  53.5M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (100:3): [True: 53.4M, False: 120k]
  ------------------
  101|  53.5M|}
_ZNK8rawspeed17CroppedArray1DRefISt4byteE15getAsArray1DRefEv:
   71|  7.54M|  [[nodiscard]] Array1DRef<T> getAsArray1DRef() const {
   72|  7.54M|    return {begin(), size()};
   73|  7.54M|  }
_ZNK8rawspeed17CroppedArray1DRefISt4byteE5beginEv:
  137|  15.4M|template <class T> inline T* CroppedArray1DRef<T>::begin() const {
  138|  15.4M|  establishClassInvariants();
  139|  15.4M|  return addressOf(/*eltIdx=*/0);
  140|  15.4M|}
_ZNK8rawspeed17CroppedArray1DRefISt4byteE9addressOfEi:
  152|  15.4M|inline T* CroppedArray1DRef<T>::addressOf(const int eltIdx) const {
  153|  15.4M|  establishClassInvariants();
  154|  15.4M|  invariant(eltIdx >= 0);
  ------------------
  |  |   27|  15.4M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (154:3): [True: 15.4M, False: 18.4E]
  ------------------
  155|  15.4M|  invariant(eltIdx <= numElts);
  ------------------
  |  |   27|  15.4M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (155:3): [True: 15.4M, False: 18.4E]
  ------------------
  156|  15.4M|  return base.addressOf(offset + eltIdx);
  157|  15.4M|}
_ZNK8rawspeed17CroppedArray1DRefISt4byteE4sizeEv:
  146|  7.54M|template <class T> inline int CroppedArray1DRef<T>::size() const {
  147|  7.54M|  establishClassInvariants();
  148|  7.54M|  return numElts;
  149|  7.54M|}
_ZNK8rawspeed17CroppedArray1DRefIKSt4byteE24establishClassInvariantsEv:
   94|  25.3M|CroppedArray1DRef<T>::establishClassInvariants() const noexcept {
   95|  25.3M|  base.establishClassInvariants();
   96|  25.3M|  invariant(offset >= 0);
  ------------------
  |  |   27|  25.3M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (96:3): [True: 26.5M, False: 18.4E]
  ------------------
   97|  26.5M|  invariant(numElts >= 0);
  ------------------
  |  |   27|  26.5M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (97:3): [True: 26.5M, False: 18.4E]
  ------------------
   98|  26.5M|  invariant(offset <= base.size());
  ------------------
  |  |   27|  26.5M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (98:3): [True: 26.0M, False: 530k]
  ------------------
   99|  26.0M|  invariant(numElts <= base.size());
  ------------------
  |  |   27|  26.0M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (99:3): [True: 25.2M, False: 786k]
  ------------------
  100|  25.2M|  invariant(offset + numElts <= base.size());
  ------------------
  |  |   27|  25.2M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (100:3): [True: 24.8M, False: 414k]
  ------------------
  101|  25.2M|}
_ZNK8rawspeed17CroppedArray1DRefIKSt4byteE15getAsArray1DRefEv:
   71|  6.81M|  [[nodiscard]] Array1DRef<T> getAsArray1DRef() const {
   72|  6.81M|    return {begin(), size()};
   73|  6.81M|  }
_ZNK8rawspeed17CroppedArray1DRefIKSt4byteE5beginEv:
  137|  6.82M|template <class T> inline T* CroppedArray1DRef<T>::begin() const {
  138|  6.82M|  establishClassInvariants();
  139|  6.82M|  return addressOf(/*eltIdx=*/0);
  140|  6.82M|}
_ZNK8rawspeed17CroppedArray1DRefIKSt4byteE9addressOfEi:
  152|  6.75M|inline T* CroppedArray1DRef<T>::addressOf(const int eltIdx) const {
  153|  6.75M|  establishClassInvariants();
  154|  6.75M|  invariant(eltIdx >= 0);
  ------------------
  |  |   27|  6.75M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (154:3): [True: 6.74M, False: 11.2k]
  ------------------
  155|  6.74M|  invariant(eltIdx <= numElts);
  ------------------
  |  |   27|  6.74M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (155:3): [True: 6.75M, False: 18.4E]
  ------------------
  156|  6.75M|  return base.addressOf(offset + eltIdx);
  157|  6.74M|}
_ZNK8rawspeed17CroppedArray1DRefIKSt4byteE4sizeEv:
  146|  6.71M|template <class T> inline int CroppedArray1DRef<T>::size() const {
  147|  6.71M|  establishClassInvariants();
  148|  6.71M|  return numElts;
  149|  6.71M|}
_ZNK8rawspeed17CroppedArray1DRefIKhE24establishClassInvariantsEv:
   94|   117M|CroppedArray1DRef<T>::establishClassInvariants() const noexcept {
   95|   117M|  base.establishClassInvariants();
   96|   117M|  invariant(offset >= 0);
  ------------------
  |  |   27|   117M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (96:3): [True: 117M, False: 3.80k]
  ------------------
   97|   117M|  invariant(numElts >= 0);
  ------------------
  |  |   27|   117M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (97:3): [True: 117M, False: 18.4E]
  ------------------
   98|   117M|  invariant(offset <= base.size());
  ------------------
  |  |   27|   117M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (98:3): [True: 117M, False: 19.4k]
  ------------------
   99|   117M|  invariant(numElts <= base.size());
  ------------------
  |  |   27|   117M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (99:3): [True: 117M, False: 43.6k]
  ------------------
  100|   117M|  invariant(offset + numElts <= base.size());
  ------------------
  |  |   27|   117M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (100:3): [True: 117M, False: 19.9k]
  ------------------
  101|   117M|}
_ZNK8rawspeed17CroppedArray1DRefIKhE15getAsArray1DRefEv:
   71|  29.2M|  [[nodiscard]] Array1DRef<T> getAsArray1DRef() const {
   72|  29.2M|    return {begin(), size()};
   73|  29.2M|  }
_ZNK8rawspeed17CroppedArray1DRefIKhE5beginEv:
  137|  29.4M|template <class T> inline T* CroppedArray1DRef<T>::begin() const {
  138|  29.4M|  establishClassInvariants();
  139|  29.4M|  return addressOf(/*eltIdx=*/0);
  140|  29.4M|}
_ZNK8rawspeed17CroppedArray1DRefIKhE9addressOfEi:
  152|  29.4M|inline T* CroppedArray1DRef<T>::addressOf(const int eltIdx) const {
  153|  29.4M|  establishClassInvariants();
  154|  29.4M|  invariant(eltIdx >= 0);
  ------------------
  |  |   27|  29.4M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (154:3): [True: 29.4M, False: 18.4E]
  ------------------
  155|  29.4M|  invariant(eltIdx <= numElts);
  ------------------
  |  |   27|  29.4M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (155:3): [True: 29.4M, False: 18.4E]
  ------------------
  156|  29.4M|  return base.addressOf(offset + eltIdx);
  157|  29.4M|}
_ZNK8rawspeed17CroppedArray1DRefIKhE4sizeEv:
  146|  29.3M|template <class T> inline int CroppedArray1DRef<T>::size() const {
  147|  29.3M|  establishClassInvariants();
  148|  29.3M|  return numElts;
  149|  29.3M|}
_ZN8rawspeed17CroppedArray1DRefIKhEC2ENS_10Array1DRefIS1_EEii:
  107|  29.4M|    : base(base_), offset(offset_), numElts(numElts_) {
  108|  29.4M|  establishClassInvariants();
  109|  29.4M|}
_ZN8rawspeed17CroppedArray1DRefIhEC2ENS_10Array1DRefIhEEii:
  107|   185k|    : base(base_), offset(offset_), numElts(numElts_) {
  108|   185k|  establishClassInvariants();
  109|   185k|}
_ZNK8rawspeed17CroppedArray1DRefIhE24establishClassInvariantsEv:
   94|   556k|CroppedArray1DRef<T>::establishClassInvariants() const noexcept {
   95|   556k|  base.establishClassInvariants();
   96|   556k|  invariant(offset >= 0);
  ------------------
  |  |   27|   556k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (96:3): [True: 556k, False: 0]
  ------------------
   97|   556k|  invariant(numElts >= 0);
  ------------------
  |  |   27|   556k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (97:3): [True: 556k, False: 0]
  ------------------
   98|   556k|  invariant(offset <= base.size());
  ------------------
  |  |   27|   556k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (98:3): [True: 556k, False: 0]
  ------------------
   99|   556k|  invariant(numElts <= base.size());
  ------------------
  |  |   27|   556k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (99:3): [True: 556k, False: 0]
  ------------------
  100|   556k|  invariant(offset + numElts <= base.size());
  ------------------
  |  |   27|   556k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (100:3): [True: 556k, False: 0]
  ------------------
  101|   556k|}
_ZNK8rawspeed17CroppedArray1DRefIhE5beginEv:
  137|   185k|template <class T> inline T* CroppedArray1DRef<T>::begin() const {
  138|   185k|  establishClassInvariants();
  139|   185k|  return addressOf(/*eltIdx=*/0);
  140|   185k|}
_ZNK8rawspeed17CroppedArray1DRefIhE9addressOfEi:
  152|   185k|inline T* CroppedArray1DRef<T>::addressOf(const int eltIdx) const {
  153|   185k|  establishClassInvariants();
  154|   185k|  invariant(eltIdx >= 0);
  ------------------
  |  |   27|   185k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (154:3): [True: 185k, False: 0]
  ------------------
  155|   185k|  invariant(eltIdx <= numElts);
  ------------------
  |  |   27|   185k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (155:3): [True: 185k, False: 0]
  ------------------
  156|   185k|  return base.addressOf(offset + eltIdx);
  157|   185k|}
_ZN8rawspeed17CroppedArray1DRefIiEC2ENS_10Array1DRefIiEEii:
  107|  2.11k|    : base(base_), offset(offset_), numElts(numElts_) {
  108|  2.11k|  establishClassInvariants();
  109|  2.11k|}
_ZNK8rawspeed17CroppedArray1DRefIiE24establishClassInvariantsEv:
   94|  8.46k|CroppedArray1DRef<T>::establishClassInvariants() const noexcept {
   95|  8.46k|  base.establishClassInvariants();
   96|  8.46k|  invariant(offset >= 0);
  ------------------
  |  |   27|  8.46k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (96:3): [True: 8.46k, False: 0]
  ------------------
   97|  8.46k|  invariant(numElts >= 0);
  ------------------
  |  |   27|  8.46k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (97:3): [True: 8.46k, False: 0]
  ------------------
   98|  8.46k|  invariant(offset <= base.size());
  ------------------
  |  |   27|  8.46k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (98:3): [True: 8.46k, False: 0]
  ------------------
   99|  8.46k|  invariant(numElts <= base.size());
  ------------------
  |  |   27|  8.46k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (99:3): [True: 8.46k, False: 0]
  ------------------
  100|  8.46k|  invariant(offset + numElts <= base.size());
  ------------------
  |  |   27|  8.46k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (100:3): [True: 8.46k, False: 0]
  ------------------
  101|  8.46k|}
_ZNK8rawspeed17CroppedArray1DRefIiE15getAsArray1DRefEv:
   71|  2.11k|  [[nodiscard]] Array1DRef<T> getAsArray1DRef() const {
   72|  2.11k|    return {begin(), size()};
   73|  2.11k|  }
_ZNK8rawspeed17CroppedArray1DRefIiE5beginEv:
  137|  2.11k|template <class T> inline T* CroppedArray1DRef<T>::begin() const {
  138|  2.11k|  establishClassInvariants();
  139|  2.11k|  return addressOf(/*eltIdx=*/0);
  140|  2.11k|}
_ZNK8rawspeed17CroppedArray1DRefIiE9addressOfEi:
  152|  2.11k|inline T* CroppedArray1DRef<T>::addressOf(const int eltIdx) const {
  153|  2.11k|  establishClassInvariants();
  154|  2.11k|  invariant(eltIdx >= 0);
  ------------------
  |  |   27|  2.11k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (154:3): [True: 2.11k, False: 0]
  ------------------
  155|  2.11k|  invariant(eltIdx <= numElts);
  ------------------
  |  |   27|  2.11k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (155:3): [True: 2.11k, False: 0]
  ------------------
  156|  2.11k|  return base.addressOf(offset + eltIdx);
  157|  2.11k|}
_ZNK8rawspeed17CroppedArray1DRefIiE4sizeEv:
  146|  2.11k|template <class T> inline int CroppedArray1DRef<T>::size() const {
  147|  2.11k|  establishClassInvariants();
  148|  2.11k|  return numElts;
  149|  2.11k|}
_ZN8rawspeed17CroppedArray1DRefISt4byteEC2ENS_10Array1DRefIS1_EEii:
  107|  15.6M|    : base(base_), offset(offset_), numElts(numElts_) {
  108|  15.6M|  establishClassInvariants();
  109|  15.6M|}
_ZNK8rawspeed17CroppedArray1DRefItE15getAsArray1DRefEv:
   71|  43.1M|  [[nodiscard]] Array1DRef<T> getAsArray1DRef() const {
   72|  43.1M|    return {begin(), size()};
   73|  43.1M|  }
_ZNK8rawspeed17CroppedArray1DRefItE5beginEv:
  137|  44.5M|template <class T> inline T* CroppedArray1DRef<T>::begin() const {
  138|  44.5M|  establishClassInvariants();
  139|  44.5M|  return addressOf(/*eltIdx=*/0);
  140|  44.5M|}
_ZNK8rawspeed17CroppedArray1DRefItE24establishClassInvariantsEv:
   94|   165M|CroppedArray1DRef<T>::establishClassInvariants() const noexcept {
   95|   165M|  base.establishClassInvariants();
   96|   165M|  invariant(offset >= 0);
  ------------------
  |  |   27|   165M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (96:3): [True: 171M, False: 18.4E]
  ------------------
   97|   171M|  invariant(numElts >= 0);
  ------------------
  |  |   27|   171M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (97:3): [True: 171M, False: 18.4E]
  ------------------
   98|   171M|  invariant(offset <= base.size());
  ------------------
  |  |   27|   171M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (98:3): [True: 171M, False: 111k]
  ------------------
   99|   171M|  invariant(numElts <= base.size());
  ------------------
  |  |   27|   171M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (99:3): [True: 167M, False: 4.50M]
  ------------------
  100|   167M|  invariant(offset + numElts <= base.size());
  ------------------
  |  |   27|   167M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (100:3): [True: 163M, False: 3.82M]
  ------------------
  101|   167M|}
_ZNK8rawspeed17CroppedArray1DRefItE9addressOfEi:
  152|  46.1M|inline T* CroppedArray1DRef<T>::addressOf(const int eltIdx) const {
  153|  46.1M|  establishClassInvariants();
  154|  46.1M|  invariant(eltIdx >= 0);
  ------------------
  |  |   27|  46.1M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (154:3): [True: 46.0M, False: 40.1k]
  ------------------
  155|  46.0M|  invariant(eltIdx <= numElts);
  ------------------
  |  |   27|  46.0M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (155:3): [True: 46.1M, False: 18.4E]
  ------------------
  156|  46.1M|  return base.addressOf(offset + eltIdx);
  157|  46.0M|}
_ZNK8rawspeed17CroppedArray1DRefItE4sizeEv:
  146|  42.2M|template <class T> inline int CroppedArray1DRef<T>::size() const {
  147|  42.2M|  establishClassInvariants();
  148|  42.2M|  return numElts;
  149|  42.2M|}
_ZN8rawspeed17CroppedArray1DRefItEC2ENS_10Array1DRefItEEii:
  107|  47.5M|    : base(base_), offset(offset_), numElts(numElts_) {
  108|  47.5M|  establishClassInvariants();
  109|  47.5M|}
_ZNK8rawspeed17CroppedArray1DRefItEclEi:
  160|  2.01M|inline T& CroppedArray1DRef<T>::operator()(const int eltIdx) const {
  161|  2.01M|  establishClassInvariants();
  162|  2.01M|  invariant(eltIdx >= 0);
  ------------------
  |  |   27|  2.01M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (162:3): [True: 1.94M, False: 75.0k]
  ------------------
  163|  1.94M|  invariant(eltIdx < numElts);
  ------------------
  |  |   27|  1.94M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (163:3): [True: 1.95M, False: 18.4E]
  ------------------
  164|  1.95M|  return *addressOf(eltIdx);
  165|  1.94M|}
_ZN8rawspeed17CroppedArray1DRefIKSt4byteEC2ENS_10Array1DRefIS2_EEii:
  107|  7.17M|    : base(base_), offset(offset_), numElts(numElts_) {
  108|  7.17M|  establishClassInvariants();
  109|  7.17M|}
_ZN8rawspeed17CroppedArray1DRefIfEC2ENS_10Array1DRefIfEEii:
  107|   590k|    : base(base_), offset(offset_), numElts(numElts_) {
  108|   590k|  establishClassInvariants();
  109|   590k|}
_ZNK8rawspeed17CroppedArray1DRefIfE24establishClassInvariantsEv:
   94|  2.32M|CroppedArray1DRef<T>::establishClassInvariants() const noexcept {
   95|  2.32M|  base.establishClassInvariants();
   96|  2.32M|  invariant(offset >= 0);
  ------------------
  |  |   27|  2.32M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (96:3): [True: 2.32M, False: 0]
  ------------------
   97|  2.32M|  invariant(numElts >= 0);
  ------------------
  |  |   27|  2.32M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (97:3): [True: 2.32M, False: 0]
  ------------------
   98|  2.32M|  invariant(offset <= base.size());
  ------------------
  |  |   27|  2.32M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (98:3): [True: 2.32M, False: 1]
  ------------------
   99|  2.32M|  invariant(numElts <= base.size());
  ------------------
  |  |   27|  2.32M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (99:3): [True: 2.32M, False: 18.4E]
  ------------------
  100|  2.32M|  invariant(offset + numElts <= base.size());
  ------------------
  |  |   27|  2.32M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (100:3): [True: 2.32M, False: 0]
  ------------------
  101|  2.32M|}
_ZNK8rawspeed17CroppedArray1DRefIfE15getAsArray1DRefEv:
   71|   551k|  [[nodiscard]] Array1DRef<T> getAsArray1DRef() const {
   72|   551k|    return {begin(), size()};
   73|   551k|  }
_ZNK8rawspeed17CroppedArray1DRefIfE5beginEv:
  137|   551k|template <class T> inline T* CroppedArray1DRef<T>::begin() const {
  138|   551k|  establishClassInvariants();
  139|   551k|  return addressOf(/*eltIdx=*/0);
  140|   551k|}
_ZNK8rawspeed17CroppedArray1DRefIfE9addressOfEi:
  152|   590k|inline T* CroppedArray1DRef<T>::addressOf(const int eltIdx) const {
  153|   590k|  establishClassInvariants();
  154|   590k|  invariant(eltIdx >= 0);
  ------------------
  |  |   27|   590k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (154:3): [True: 590k, False: 0]
  ------------------
  155|   590k|  invariant(eltIdx <= numElts);
  ------------------
  |  |   27|   590k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (155:3): [True: 590k, False: 0]
  ------------------
  156|   590k|  return base.addressOf(offset + eltIdx);
  157|   590k|}
_ZNK8rawspeed17CroppedArray1DRefIfE4sizeEv:
  146|   551k|template <class T> inline int CroppedArray1DRef<T>::size() const {
  147|   551k|  establishClassInvariants();
  148|   551k|  return numElts;
  149|   551k|}
_ZN8rawspeed17CroppedArray1DRefIKtEC2ENS_10Array1DRefIS1_EEii:
  107|  3.72M|    : base(base_), offset(offset_), numElts(numElts_) {
  108|  3.72M|  establishClassInvariants();
  109|  3.72M|}
_ZNK8rawspeed17CroppedArray1DRefIKtE24establishClassInvariantsEv:
   94|  14.7M|CroppedArray1DRef<T>::establishClassInvariants() const noexcept {
   95|  14.7M|  base.establishClassInvariants();
   96|  14.7M|  invariant(offset >= 0);
  ------------------
  |  |   27|  14.7M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (96:3): [True: 14.8M, False: 18.4E]
  ------------------
   97|  14.8M|  invariant(numElts >= 0);
  ------------------
  |  |   27|  14.8M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (97:3): [True: 14.8M, False: 18.4E]
  ------------------
   98|  14.8M|  invariant(offset <= base.size());
  ------------------
  |  |   27|  14.8M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (98:3): [True: 14.8M, False: 6.18k]
  ------------------
   99|  14.8M|  invariant(numElts <= base.size());
  ------------------
  |  |   27|  14.8M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (99:3): [True: 14.7M, False: 24.2k]
  ------------------
  100|  14.7M|  invariant(offset + numElts <= base.size());
  ------------------
  |  |   27|  14.7M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (100:3): [True: 14.7M, False: 20.7k]
  ------------------
  101|  14.7M|}
_ZNK8rawspeed17CroppedArray1DRefIKtE15getAsArray1DRefEv:
   71|  3.71M|  [[nodiscard]] Array1DRef<T> getAsArray1DRef() const {
   72|  3.71M|    return {begin(), size()};
   73|  3.71M|  }
_ZNK8rawspeed17CroppedArray1DRefIKtE5beginEv:
  137|  3.71M|template <class T> inline T* CroppedArray1DRef<T>::begin() const {
  138|  3.71M|  establishClassInvariants();
  139|  3.71M|  return addressOf(/*eltIdx=*/0);
  140|  3.71M|}
_ZNK8rawspeed17CroppedArray1DRefIKtE9addressOfEi:
  152|  3.71M|inline T* CroppedArray1DRef<T>::addressOf(const int eltIdx) const {
  153|  3.71M|  establishClassInvariants();
  154|  3.71M|  invariant(eltIdx >= 0);
  ------------------
  |  |   27|  3.71M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (154:3): [True: 3.71M, False: 18.4E]
  ------------------
  155|  3.71M|  invariant(eltIdx <= numElts);
  ------------------
  |  |   27|  3.71M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (155:3): [True: 3.71M, False: 18.4E]
  ------------------
  156|  3.71M|  return base.addressOf(offset + eltIdx);
  157|  3.71M|}
_ZNK8rawspeed17CroppedArray1DRefIKtE4sizeEv:
  146|  3.71M|template <class T> inline int CroppedArray1DRef<T>::size() const {
  147|  3.71M|  establishClassInvariants();
  148|  3.71M|  return numElts;
  149|  3.71M|}
_ZNK8rawspeed17CroppedArray1DRefIfEclEi:
  160|  39.4k|inline T& CroppedArray1DRef<T>::operator()(const int eltIdx) const {
  161|  39.4k|  establishClassInvariants();
  162|  39.4k|  invariant(eltIdx >= 0);
  ------------------
  |  |   27|  39.4k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (162:3): [True: 39.4k, False: 0]
  ------------------
  163|  39.4k|  invariant(eltIdx < numElts);
  ------------------
  |  |   27|  39.4k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (163:3): [True: 39.4k, False: 0]
  ------------------
  164|  39.4k|  return *addressOf(eltIdx);
  165|  39.4k|}
_ZNK8rawspeed17CroppedArray1DRefIKNS_8CFAColorEE24establishClassInvariantsEv:
   94|  18.2k|CroppedArray1DRef<T>::establishClassInvariants() const noexcept {
   95|  18.2k|  base.establishClassInvariants();
   96|  18.2k|  invariant(offset >= 0);
  ------------------
  |  |   27|  18.2k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (96:3): [True: 18.2k, False: 18.4E]
  ------------------
   97|  18.2k|  invariant(numElts >= 0);
  ------------------
  |  |   27|  18.2k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (97:3): [True: 18.3k, False: 18.4E]
  ------------------
   98|  18.3k|  invariant(offset <= base.size());
  ------------------
  |  |   27|  18.3k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (98:3): [True: 18.2k, False: 39]
  ------------------
   99|  18.2k|  invariant(numElts <= base.size());
  ------------------
  |  |   27|  18.2k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (99:3): [True: 18.2k, False: 71]
  ------------------
  100|  18.2k|  invariant(offset + numElts <= base.size());
  ------------------
  |  |   27|  18.2k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (100:3): [True: 18.1k, False: 52]
  ------------------
  101|  18.2k|}
_ZNK8rawspeed17CroppedArray1DRefIKNS_8CFAColorEE15getAsArray1DRefEv:
   71|  4.60k|  [[nodiscard]] Array1DRef<T> getAsArray1DRef() const {
   72|  4.60k|    return {begin(), size()};
   73|  4.60k|  }
_ZNK8rawspeed17CroppedArray1DRefIKNS_8CFAColorEE5beginEv:
  137|  4.60k|template <class T> inline T* CroppedArray1DRef<T>::begin() const {
  138|  4.60k|  establishClassInvariants();
  139|  4.60k|  return addressOf(/*eltIdx=*/0);
  140|  4.60k|}
_ZNK8rawspeed17CroppedArray1DRefIKNS_8CFAColorEE9addressOfEi:
  152|  4.59k|inline T* CroppedArray1DRef<T>::addressOf(const int eltIdx) const {
  153|  4.59k|  establishClassInvariants();
  154|  4.59k|  invariant(eltIdx >= 0);
  ------------------
  |  |   27|  4.59k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (154:3): [True: 4.61k, False: 18.4E]
  ------------------
  155|  4.61k|  invariant(eltIdx <= numElts);
  ------------------
  |  |   27|  4.61k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (155:3): [True: 4.61k, False: 18.4E]
  ------------------
  156|  4.61k|  return base.addressOf(offset + eltIdx);
  157|  4.61k|}
_ZNK8rawspeed17CroppedArray1DRefIKNS_8CFAColorEE4sizeEv:
  146|  4.61k|template <class T> inline int CroppedArray1DRef<T>::size() const {
  147|  4.61k|  establishClassInvariants();
  148|  4.61k|  return numElts;
  149|  4.61k|}
_ZNK8rawspeed17CroppedArray1DRefINS_8CFAColorEE24establishClassInvariantsEv:
   94|  25.2k|CroppedArray1DRef<T>::establishClassInvariants() const noexcept {
   95|  25.2k|  base.establishClassInvariants();
   96|  25.2k|  invariant(offset >= 0);
  ------------------
  |  |   27|  25.2k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (96:3): [True: 25.4k, False: 18.4E]
  ------------------
   97|  25.4k|  invariant(numElts >= 0);
  ------------------
  |  |   27|  25.4k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (97:3): [True: 25.4k, False: 18.4E]
  ------------------
   98|  25.4k|  invariant(offset <= base.size());
  ------------------
  |  |   27|  25.4k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (98:3): [True: 25.4k, False: 23]
  ------------------
   99|  25.4k|  invariant(numElts <= base.size());
  ------------------
  |  |   27|  25.4k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (99:3): [True: 25.2k, False: 175]
  ------------------
  100|  25.2k|  invariant(offset + numElts <= base.size());
  ------------------
  |  |   27|  25.2k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (100:3): [True: 25.1k, False: 71]
  ------------------
  101|  25.2k|}
_ZNK8rawspeed17CroppedArray1DRefINS_8CFAColorEE15getAsArray1DRefEv:
   71|  6.42k|  [[nodiscard]] Array1DRef<T> getAsArray1DRef() const {
   72|  6.42k|    return {begin(), size()};
   73|  6.42k|  }
_ZNK8rawspeed17CroppedArray1DRefINS_8CFAColorEE5beginEv:
  137|  6.43k|template <class T> inline T* CroppedArray1DRef<T>::begin() const {
  138|  6.43k|  establishClassInvariants();
  139|  6.43k|  return addressOf(/*eltIdx=*/0);
  140|  6.43k|}
_ZNK8rawspeed17CroppedArray1DRefINS_8CFAColorEE9addressOfEi:
  152|  6.42k|inline T* CroppedArray1DRef<T>::addressOf(const int eltIdx) const {
  153|  6.42k|  establishClassInvariants();
  154|  6.42k|  invariant(eltIdx >= 0);
  ------------------
  |  |   27|  6.42k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (154:3): [True: 6.44k, False: 18.4E]
  ------------------
  155|  6.44k|  invariant(eltIdx <= numElts);
  ------------------
  |  |   27|  6.44k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (155:3): [True: 6.43k, False: 1]
  ------------------
  156|  6.43k|  return base.addressOf(offset + eltIdx);
  157|  6.44k|}
_ZNK8rawspeed17CroppedArray1DRefINS_8CFAColorEE4sizeEv:
  146|  6.41k|template <class T> inline int CroppedArray1DRef<T>::size() const {
  147|  6.41k|  establishClassInvariants();
  148|  6.41k|  return numElts;
  149|  6.41k|}
_ZN8rawspeed17CroppedArray1DRefINS_8CFAColorEEC2ENS_10Array1DRefIS1_EEii:
  107|  6.44k|    : base(base_), offset(offset_), numElts(numElts_) {
  108|  6.44k|  establishClassInvariants();
  109|  6.44k|}
_ZN8rawspeed17CroppedArray1DRefIKNS_8CFAColorEEC2ENS_10Array1DRefIS2_EEii:
  107|  4.62k|    : base(base_), offset(offset_), numElts(numElts_) {
  108|  4.62k|  establishClassInvariants();
  109|  4.62k|}

_ZNK8rawspeed17CroppedArray2DRefItE24establishClassInvariantsEv:
   98|  4.27M|CroppedArray2DRef<T>::establishClassInvariants() const noexcept {
   99|  4.27M|  base.establishClassInvariants();
  100|  4.27M|  invariant(offsetCols >= 0);
  ------------------
  |  |   27|  4.27M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (100:3): [True: 4.28M, False: 18.4E]
  ------------------
  101|  4.28M|  invariant(offsetRows >= 0);
  ------------------
  |  |   27|  4.28M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (101:3): [True: 4.28M, False: 18.4E]
  ------------------
  102|  4.28M|  invariant(croppedWidth >= 0);
  ------------------
  |  |   27|  4.28M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (102:3): [True: 4.28M, False: 18.4E]
  ------------------
  103|  4.28M|  invariant(croppedHeight >= 0);
  ------------------
  |  |   27|  4.28M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (103:3): [True: 4.28M, False: 18.4E]
  ------------------
  104|  4.28M|  invariant(offsetCols <= base.width());
  ------------------
  |  |   27|  4.28M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (104:3): [True: 4.27M, False: 12.4k]
  ------------------
  105|  4.27M|  invariant(offsetRows <= base.height());
  ------------------
  |  |   27|  4.27M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (105:3): [True: 4.26M, False: 4.91k]
  ------------------
  106|  4.26M|  invariant(croppedWidth <= base.width());
  ------------------
  |  |   27|  4.26M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (106:3): [True: 4.26M, False: 1.21k]
  ------------------
  107|  4.26M|  invariant(croppedHeight <= base.height());
  ------------------
  |  |   27|  4.26M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (107:3): [True: 4.26M, False: 690]
  ------------------
  108|  4.26M|  invariant(offsetCols + croppedWidth <= base.width());
  ------------------
  |  |   27|  4.26M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (108:3): [True: 4.26M, False: 18.4E]
  ------------------
  109|  4.26M|  invariant(offsetRows + croppedHeight <= base.height());
  ------------------
  |  |   27|  4.26M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (109:3): [True: 4.26M, False: 18.4E]
  ------------------
  110|  4.26M|  invariant((croppedWidth == 0) == (croppedHeight == 0));
  ------------------
  |  |   27|  4.26M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (110:3): [True: 4.26M, False: 18.4E]
  ------------------
  111|  4.26M|}
_ZNK8rawspeed17CroppedArray2DRefIfE24establishClassInvariantsEv:
   98|  79.1k|CroppedArray2DRef<T>::establishClassInvariants() const noexcept {
   99|  79.1k|  base.establishClassInvariants();
  100|  79.1k|  invariant(offsetCols >= 0);
  ------------------
  |  |   27|  79.1k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (100:3): [True: 79.1k, False: 0]
  ------------------
  101|  79.1k|  invariant(offsetRows >= 0);
  ------------------
  |  |   27|  79.1k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (101:3): [True: 79.1k, False: 0]
  ------------------
  102|  79.1k|  invariant(croppedWidth >= 0);
  ------------------
  |  |   27|  79.1k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (102:3): [True: 79.1k, False: 0]
  ------------------
  103|  79.1k|  invariant(croppedHeight >= 0);
  ------------------
  |  |   27|  79.1k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (103:3): [True: 79.1k, False: 0]
  ------------------
  104|  79.1k|  invariant(offsetCols <= base.width());
  ------------------
  |  |   27|  79.1k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (104:3): [True: 79.1k, False: 0]
  ------------------
  105|  79.1k|  invariant(offsetRows <= base.height());
  ------------------
  |  |   27|  79.1k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (105:3): [True: 79.1k, False: 0]
  ------------------
  106|  79.1k|  invariant(croppedWidth <= base.width());
  ------------------
  |  |   27|  79.1k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (106:3): [True: 79.1k, False: 0]
  ------------------
  107|  79.1k|  invariant(croppedHeight <= base.height());
  ------------------
  |  |   27|  79.1k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (107:3): [True: 79.1k, False: 0]
  ------------------
  108|  79.1k|  invariant(offsetCols + croppedWidth <= base.width());
  ------------------
  |  |   27|  79.1k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (108:3): [True: 79.1k, False: 0]
  ------------------
  109|  79.1k|  invariant(offsetRows + croppedHeight <= base.height());
  ------------------
  |  |   27|  79.1k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (109:3): [True: 79.1k, False: 0]
  ------------------
  110|  79.1k|  invariant((croppedWidth == 0) == (croppedHeight == 0));
  ------------------
  |  |   27|  79.1k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (110:3): [True: 79.1k, False: 0]
  ------------------
  111|  79.1k|}
_ZN8rawspeed17CroppedArray2DRefItEC2ENS_10Array2DRefItEEiiii:
  118|  1.29M|    : base(base_), offsetCols(offsetCols_), offsetRows(offsetRows_),
  119|  1.29M|      croppedWidth(croppedWidth_), croppedHeight(croppedHeight_) {
  120|  1.29M|  establishClassInvariants();
  121|  1.29M|}
_ZNK8rawspeed17CroppedArray2DRefItEclEii:
  134|   204k|inline T& CroppedArray2DRef<T>::operator()(const int row, const int col) const {
  135|   204k|  establishClassInvariants();
  136|   204k|  invariant(col >= 0);
  ------------------
  |  |   27|   204k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (136:3): [True: 204k, False: 0]
  ------------------
  137|   204k|  invariant(col < croppedWidth);
  ------------------
  |  |   27|   204k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (137:3): [True: 204k, False: 0]
  ------------------
  138|   204k|  return (operator[](row))(col);
  139|   204k|}
_ZNK8rawspeed17CroppedArray2DRefItEixEi:
  125|  1.49M|CroppedArray2DRef<T>::operator[](const int row) const {
  126|  1.49M|  establishClassInvariants();
  127|  1.49M|  invariant(row >= 0);
  ------------------
  |  |   27|  1.49M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (127:3): [True: 1.49M, False: 18.4E]
  ------------------
  128|  1.49M|  invariant(row < croppedHeight);
  ------------------
  |  |   27|  1.49M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (128:3): [True: 1.49M, False: 18.4E]
  ------------------
  129|  1.49M|  const Array1DRef<T> fullLine = base.operator[](offsetRows + row);
  130|  1.49M|  return fullLine.getCrop(offsetCols, croppedWidth);
  131|  1.49M|}
_ZNK8rawspeed17CroppedArray2DRefItE15getAsArray2DRefEv:
   79|  1.28M|  [[nodiscard]] Array2DRef<T> getAsArray2DRef() const {
   80|  1.28M|    establishClassInvariants();
   81|  1.28M|    return {operator[](0).begin(), croppedWidth, croppedHeight, base.pitch()};
   82|  1.28M|  }
_ZNK8rawspeed17CroppedArray2DRefISt4byteEixEi:
  125|  1.84M|CroppedArray2DRef<T>::operator[](const int row) const {
  126|  1.84M|  establishClassInvariants();
  127|  1.84M|  invariant(row >= 0);
  ------------------
  |  |   27|  1.84M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (127:3): [True: 1.84M, False: 0]
  ------------------
  128|  1.84M|  invariant(row < croppedHeight);
  ------------------
  |  |   27|  1.84M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (128:3): [True: 1.84M, False: 0]
  ------------------
  129|  1.84M|  const Array1DRef<T> fullLine = base.operator[](offsetRows + row);
  130|  1.84M|  return fullLine.getCrop(offsetCols, croppedWidth);
  131|  1.84M|}
_ZNK8rawspeed17CroppedArray2DRefISt4byteE24establishClassInvariantsEv:
   98|  1.85M|CroppedArray2DRef<T>::establishClassInvariants() const noexcept {
   99|  1.85M|  base.establishClassInvariants();
  100|  1.85M|  invariant(offsetCols >= 0);
  ------------------
  |  |   27|  1.85M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (100:3): [True: 1.85M, False: 0]
  ------------------
  101|  1.85M|  invariant(offsetRows >= 0);
  ------------------
  |  |   27|  1.85M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (101:3): [True: 1.85M, False: 0]
  ------------------
  102|  1.85M|  invariant(croppedWidth >= 0);
  ------------------
  |  |   27|  1.85M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (102:3): [True: 1.85M, False: 0]
  ------------------
  103|  1.85M|  invariant(croppedHeight >= 0);
  ------------------
  |  |   27|  1.85M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (103:3): [True: 1.85M, False: 0]
  ------------------
  104|  1.85M|  invariant(offsetCols <= base.width());
  ------------------
  |  |   27|  1.85M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (104:3): [True: 1.85M, False: 0]
  ------------------
  105|  1.85M|  invariant(offsetRows <= base.height());
  ------------------
  |  |   27|  1.85M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (105:3): [True: 1.85M, False: 0]
  ------------------
  106|  1.85M|  invariant(croppedWidth <= base.width());
  ------------------
  |  |   27|  1.85M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (106:3): [True: 1.85M, False: 0]
  ------------------
  107|  1.85M|  invariant(croppedHeight <= base.height());
  ------------------
  |  |   27|  1.85M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (107:3): [True: 1.85M, False: 0]
  ------------------
  108|  1.85M|  invariant(offsetCols + croppedWidth <= base.width());
  ------------------
  |  |   27|  1.85M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (108:3): [True: 1.85M, False: 0]
  ------------------
  109|  1.85M|  invariant(offsetRows + croppedHeight <= base.height());
  ------------------
  |  |   27|  1.85M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (109:3): [True: 1.85M, False: 0]
  ------------------
  110|  1.85M|  invariant((croppedWidth == 0) == (croppedHeight == 0));
  ------------------
  |  |   27|  1.85M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (110:3): [True: 1.85M, False: 0]
  ------------------
  111|  1.85M|}
_ZN8rawspeed17CroppedArray2DRefISt4byteEC2ENS_10Array2DRefIS1_EE:
   64|  3.07k|      : CroppedArray2DRef(RHS, /*offsetCols=*/0, /*offsetRows=*/0, RHS.width(),
   65|  3.07k|                          RHS.height()) {}
_ZN8rawspeed17CroppedArray2DRefISt4byteEC2ENS_10Array2DRefIS1_EEiiii:
  118|  3.07k|    : base(base_), offsetCols(offsetCols_), offsetRows(offsetRows_),
  119|  3.07k|      croppedWidth(croppedWidth_), croppedHeight(croppedHeight_) {
  120|  3.07k|  establishClassInvariants();
  121|  3.07k|}
_ZN8rawspeed17CroppedArray2DRefIfEC2ENS_10Array2DRefIfEEiiii:
  118|    285|    : base(base_), offsetCols(offsetCols_), offsetRows(offsetRows_),
  119|    285|      croppedWidth(croppedWidth_), croppedHeight(croppedHeight_) {
  120|    285|  establishClassInvariants();
  121|    285|}
_ZNK8rawspeed17CroppedArray2DRefIfEclEii:
  134|  39.4k|inline T& CroppedArray2DRef<T>::operator()(const int row, const int col) const {
  135|  39.4k|  establishClassInvariants();
  136|  39.4k|  invariant(col >= 0);
  ------------------
  |  |   27|  39.4k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (136:3): [True: 39.4k, False: 0]
  ------------------
  137|  39.4k|  invariant(col < croppedWidth);
  ------------------
  |  |   27|  39.4k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (137:3): [True: 39.4k, False: 0]
  ------------------
  138|  39.4k|  return (operator[](row))(col);
  139|  39.4k|}
_ZNK8rawspeed17CroppedArray2DRefIfEixEi:
  125|  39.4k|CroppedArray2DRef<T>::operator[](const int row) const {
  126|  39.4k|  establishClassInvariants();
  127|  39.4k|  invariant(row >= 0);
  ------------------
  |  |   27|  39.4k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (127:3): [True: 39.4k, False: 0]
  ------------------
  128|  39.4k|  invariant(row < croppedHeight);
  ------------------
  |  |   27|  39.4k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (128:3): [True: 39.4k, False: 0]
  ------------------
  129|  39.4k|  const Array1DRef<T> fullLine = base.operator[](offsetRows + row);
  130|  39.4k|  return fullLine.getCrop(offsetCols, croppedWidth);
  131|  39.4k|}

_ZN8rawspeed27DefaultInitAllocatorAdaptorIhNS_16AlignedAllocatorIhLi16EEEE10deallocateEPhm:
   69|  7.93k|  void deallocate(T* p, std::size_t n) noexcept {
   70|  7.93k|    allocator_traits::deallocate(allocator, p, n);
   71|  7.93k|  }
_ZNK8rawspeed27DefaultInitAllocatorAdaptorIhNS_16AlignedAllocatorIhLi16EEEE9constructIhEEvPT_:
   75|  31.8G|      noexcept(std::is_nothrow_default_constructible_v<U>) {
   76|  31.8G|    ::new (static_cast<void*>(ptr)) U; // start the life-time, but do not init.
   77|  31.8G|  }
_ZN8rawspeed27DefaultInitAllocatorAdaptorIhNS_16AlignedAllocatorIhLi16EEEE8allocateEm:
   65|  7.93k|  T* allocate(std::size_t n) {
   66|  7.93k|    return allocator_traits::allocate(allocator, n);
   67|  7.93k|  }

_ZN8rawspeed5MutexC2Ev:
   40|  30.8k|  explicit Mutex() { omp_init_lock(&mutex); }
_ZN8rawspeed5MutexD2Ev:
   47|  30.8k|  ~Mutex() { omp_destroy_lock(&mutex); }
_ZN8rawspeed5Mutex4LockEv:
   52|  25.1k|  void Lock() ACQUIRE() { omp_set_lock(&mutex); }
_ZN8rawspeed5Mutex6UnlockEv:
   55|  25.2k|  void Unlock() RELEASE() { omp_unset_lock(&mutex); }
_ZN8rawspeed11MutexLockerC2EPNS_5MutexE:
  107|  25.1k|  explicit MutexLocker(Mutex* mu) ACQUIRE(mu) : mut(mu) { mu->Lock(); }
_ZN8rawspeed11MutexLockerD2Ev:
  114|  25.2k|  ~MutexLocker() RELEASE() { mut->Unlock(); }

_ZN8rawspeed11NORangesSetINS_6BufferEE6insertERKS1_:
   61|  27.0k|  bool insert(const T& newElt) {
   62|  27.0k|    if (rangeIsOverlappingExistingElementOfSortedSet(newElt))
  ------------------
  |  Branch (62:9): [True: 2.34k, False: 24.7k]
  ------------------
   63|  2.34k|      return false;
   64|       |
   65|  24.7k|    auto i = elts.insert(newElt);
   66|  24.7k|    assert(i.second && "Did not insert after all?");
  ------------------
  |  Branch (66:5): [True: 24.7k, False: 0]
  |  Branch (66:5): [True: 24.7k, Folded]
  |  Branch (66:5): [True: 24.7k, False: 0]
  ------------------
   67|  24.7k|    (void)i;
   68|  24.7k|    return true;
   69|  24.7k|  }
_ZNK8rawspeed11NORangesSetINS_6BufferEE44rangeIsOverlappingExistingElementOfSortedSetERKS1_:
   36|  27.0k|  rangeIsOverlappingExistingElementOfSortedSet(const T& newElt) const {
   37|       |    // If there are no elements in set, then the new element
   38|       |    // does not overlap any existing elements.
   39|  27.0k|    if (elts.empty())
  ------------------
  |  Branch (39:9): [True: 17.3k, False: 9.70k]
  ------------------
   40|  17.3k|      return false;
   41|       |
   42|       |    // Find the first element that is not less than the new element.
   43|  9.70k|    auto p =
   44|  9.70k|        std::partition_point(elts.begin(), elts.end(),
   45|  9.70k|                             [newElt](const T& elt) { return elt < newElt; });
   46|       |
   47|       |    // If there is such an element, we must not overlap with it.
   48|  9.70k|    if (p != elts.end() && RangesOverlap(newElt, *p))
  ------------------
  |  Branch (48:9): [True: 3.93k, False: 5.76k]
  |  Branch (48:9): [True: 1.31k, False: 8.39k]
  |  Branch (48:28): [True: 1.31k, False: 2.62k]
  ------------------
   49|  1.31k|      return true;
   50|       |
   51|       |    // Now, is there an element before the element we found?
   52|  8.39k|    if (p == elts.begin())
  ------------------
  |  Branch (52:9): [True: 393, False: 7.99k]
  ------------------
   53|    393|      return false;
   54|       |
   55|       |    // There is. We *also* must not overlap with that element too.
   56|  7.99k|    auto prevBeforeP = std::prev(p);
   57|  7.99k|    return RangesOverlap(newElt, *prevBeforeP);
   58|  8.39k|  }
_ZZNK8rawspeed11NORangesSetINS_6BufferEE44rangeIsOverlappingExistingElementOfSortedSetERKS1_ENKUlS4_E_clES4_:
   45|  17.5k|                             [newElt](const T& elt) { return elt < newElt; });

_ZN8rawspeed12NotARationalIjEC2Ejj:
   35|  3.54k|  NotARational(T num_, T den_) : num(num_), den(den_) {}
_ZN8rawspeed12NotARationalIiEC2Eii:
   35|  74.0k|  NotARational(T num_, T den_) : num(num_), den(den_) {}
_ZNK8rawspeed12NotARationalIjEcvT_IfQsr3stdE19is_floating_point_vITL0__EEEv:
   39|  2.15k|  explicit operator T2() const {
   40|  2.15k|    return T2(num) / T2(den);
   41|  2.15k|  }
_ZNK8rawspeed12NotARationalIiEcvT_IfQsr3stdE19is_floating_point_vITL0__EEEv:
   39|  1.45k|  explicit operator T2() const {
   40|  1.45k|    return T2(num) / T2(den);
   41|  1.45k|  }
_ZNK8rawspeed12NotARationalIjEcvT_IdQsr3stdE19is_floating_point_vITL0__EEEv:
   39|     96|  explicit operator T2() const {
   40|     96|    return T2(num) / T2(den);
   41|     96|  }

_ZNK8rawspeed8OptionalINS_10Array1DRefISt4byteEEEcvbEv:
   89|    705|  explicit operator bool() const { return has_value(); }
_ZNK8rawspeed8OptionalINS_10Array1DRefISt4byteEEE9has_valueEv:
   85|    899|  [[nodiscard]] bool has_value() const RAWSPEED_READNONE {
   86|    899|    return impl.has_value();
   87|    899|  }
_ZNK8rawspeed8OptionalINS_10Array1DRefIKSt4byteEEEcvbEv:
   89|    196|  explicit operator bool() const { return has_value(); }
_ZNK8rawspeed8OptionalINS_10Array1DRefIKSt4byteEEE9has_valueEv:
   85|    390|  [[nodiscard]] bool has_value() const RAWSPEED_READNONE {
   86|    390|    return impl.has_value();
   87|    390|  }
_ZNR8rawspeed8OptionalINS_10Array1DRefISt4byteEEEdeEv:
   70|    194|  T& operator*() & {
   71|    194|    invariant(has_value());
  ------------------
  |  |   27|    194|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (71:5): [True: 194, False: 0]
  ------------------
   72|    194|    return impl.value();
   73|    194|  }
_ZNR8rawspeed8OptionalINS_10Array1DRefIKSt4byteEEEdeEv:
   70|    194|  T& operator*() & {
   71|    194|    invariant(has_value());
  ------------------
  |  |   27|    194|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (71:5): [True: 194, False: 0]
  ------------------
   72|    194|    return impl.value();
   73|    194|  }
_ZN8rawspeed8OptionalINS_10ByteStreamEEC2Ev:
   35|    175|  Optional() = default;
_ZN8rawspeed8OptionalINS_10ByteStreamEEaSIS1_Qsr3stdE7same_asITL0__T_EEERS2_OS5_:
   46|     50|  Optional<T>& operator=(U&& value) {
   47|     50|    impl = std::forward<U>(value);
   48|     50|    return *this;
   49|     50|  }
_ZNR8rawspeed8OptionalINS_10ByteStreamEEdeEv:
   70|  6.93k|  T& operator*() & {
   71|  6.93k|    invariant(has_value());
  ------------------
  |  |   27|  6.93k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (71:5): [True: 6.93k, False: 0]
  ------------------
   72|  6.93k|    return impl.value();
   73|  6.93k|  }
_ZNK8rawspeed8OptionalINS_10ByteStreamEE9has_valueEv:
   85|  14.4k|  [[nodiscard]] bool has_value() const RAWSPEED_READNONE {
   86|  14.4k|    return impl.has_value();
   87|  14.4k|  }
_ZN8rawspeed8OptionalINSt3__15arrayIfLm4EEEEC2IRS3_Qaaaaaantsr3stdE7same_asITL0__NS0_IT_EEEntsr3stdE7same_asIS7_RSA_Entsr3stdE7same_asIS7_OSA_Entsr3stdE7same_asIS7_NS1_8optionalIS8_EEEEEOS8_:
   42|    471|  Optional(U&& value) : impl(std::forward<U>(value)) {}
_ZNK8rawspeed8OptionalIiEcvbEv:
   89|    208|  explicit operator bool() const { return has_value(); }
_ZNK8rawspeed8OptionalIiE9has_valueEv:
   85|  19.3k|  [[nodiscard]] bool has_value() const RAWSPEED_READNONE {
   86|  19.3k|    return impl.has_value();
   87|  19.3k|  }
_ZNR8rawspeed8OptionalIiEdeEv:
   70|  12.5k|  T& operator*() & {
   71|  12.5k|    invariant(has_value());
  ------------------
  |  |   27|  12.5k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (71:5): [True: 12.5k, False: 18.4E]
  ------------------
   72|  12.5k|    return impl.value();
   73|  12.5k|  }
_ZN8rawspeed8OptionalIiEaSIiQsr3stdE7same_asITL0__T_EEERS1_OS4_:
   46|  3.53k|  Optional<T>& operator=(U&& value) {
   47|  3.53k|    impl = std::forward<U>(value);
   48|  3.53k|    return *this;
   49|  3.53k|  }
_ZN8rawspeed8OptionalINS_10Array2DRefIiEEEaSIS2_Qsr3stdE7same_asITL0__T_EEERS3_OS6_:
   46|  1.99k|  Optional<T>& operator=(U&& value) {
   47|  1.99k|    impl = std::forward<U>(value);
   48|  1.99k|    return *this;
   49|  1.99k|  }
_ZN8rawspeed8OptionalINS_10Array2DRefIiEEEptEv:
   60|  2.11k|  T* operator->() {
   61|  2.11k|    invariant(has_value());
  ------------------
  |  |   27|  2.11k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (61:5): [True: 2.11k, False: 0]
  ------------------
   62|  2.11k|    return &impl.value();
   63|  2.11k|  }
_ZNK8rawspeed8OptionalINS_10Array2DRefIiEEE9has_valueEv:
   85|  2.11k|  [[nodiscard]] bool has_value() const RAWSPEED_READNONE {
   86|  2.11k|    return impl.has_value();
   87|  2.11k|  }
_ZN8rawspeed8OptionalINS_10Array1DRefIiEEEC2IS2_Qaaaaaantsr3stdE7same_asITL0__NS0_IT_EEEntsr3stdE7same_asIS5_RS8_Entsr3stdE7same_asIS5_OS8_Entsr3stdE7same_asIS5_NSt3__18optionalIS6_EEEEEOS6_:
   42|  2.11k|  Optional(U&& value) : impl(std::forward<U>(value)) {}
_ZNO8rawspeed8OptionalINS_10Array1DRefIiEEEdeEv:
   75|  2.11k|  T&& operator*() && {
   76|  2.11k|    invariant(has_value());
  ------------------
  |  |   27|  2.11k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (76:5): [True: 2.11k, False: 0]
  ------------------
   77|  2.11k|    return std::move(impl.value());
   78|  2.11k|  }
_ZNK8rawspeed8OptionalINS_10Array1DRefIiEEE9has_valueEv:
   85|  2.11k|  [[nodiscard]] bool has_value() const RAWSPEED_READNONE {
   86|  2.11k|    return impl.has_value();
   87|  2.11k|  }
_ZNK8rawspeed8OptionalINS_10JpegMarkerEEcvbEv:
   89|  4.20M|  explicit operator bool() const { return has_value(); }
_ZNK8rawspeed8OptionalINS_10JpegMarkerEE9has_valueEv:
   85|  4.21M|  [[nodiscard]] bool has_value() const RAWSPEED_READNONE {
   86|  4.21M|    return impl.has_value();
   87|  4.21M|  }
_ZN8rawspeed8OptionalINS_10Array2DRefIiEEEC2Ev:
   35|  15.4k|  Optional() = default;
_ZN8rawspeed8OptionalIiEC2Ev:
   35|  19.3k|  Optional() = default;
_ZN8rawspeed8OptionalINSt3__15arrayIfLm4EEEEC2Ev:
   35|  15.4k|  Optional() = default;
_ZN8rawspeed8OptionalINSt3__117basic_string_viewIcNS1_11char_traitsIcEEEEEC2IRA4_KcQaaaaaantsr3stdE7same_asITL0__NS0_IT_EEEntsr3stdE7same_asISB_RSE_Entsr3stdE7same_asISB_OSE_Entsr3stdE7same_asISB_NS1_8optionalISC_EEEEEOSC_:
   42|     26|  Optional(U&& value) : impl(std::forward<U>(value)) {}
_ZN8rawspeed8OptionalINSt3__117basic_string_viewIcNS1_11char_traitsIcEEEEEC2IRA6_KcQaaaaaantsr3stdE7same_asITL0__NS0_IT_EEEntsr3stdE7same_asISB_RSE_Entsr3stdE7same_asISB_OSE_Entsr3stdE7same_asISB_NS1_8optionalISC_EEEEEOSC_:
   42|     38|  Optional(U&& value) : impl(std::forward<U>(value)) {}
_ZN8rawspeed8OptionalINSt3__117basic_string_viewIcNS1_11char_traitsIcEEEEEC2IRA5_KcQaaaaaantsr3stdE7same_asITL0__NS0_IT_EEEntsr3stdE7same_asISB_RSE_Entsr3stdE7same_asISB_OSE_Entsr3stdE7same_asISB_NS1_8optionalISC_EEEEEOSC_:
   42|     30|  Optional(U&& value) : impl(std::forward<U>(value)) {}
_ZN8rawspeed8OptionalINSt3__117basic_string_viewIcNS1_11char_traitsIcEEEEEC2IRA8_KcQaaaaaantsr3stdE7same_asITL0__NS0_IT_EEEntsr3stdE7same_asISB_RSE_Entsr3stdE7same_asISB_OSE_Entsr3stdE7same_asISB_NS1_8optionalISC_EEEEEOSC_:
   42|     14|  Optional(U&& value) : impl(std::forward<U>(value)) {}
_ZN8rawspeed8OptionalINSt3__117basic_string_viewIcNS1_11char_traitsIcEEEEEC2IRA7_KcQaaaaaantsr3stdE7same_asITL0__NS0_IT_EEEntsr3stdE7same_asISB_RSE_Entsr3stdE7same_asISB_OSE_Entsr3stdE7same_asISB_NS1_8optionalISC_EEEEEOSC_:
   42|     18|  Optional(U&& value) : impl(std::forward<U>(value)) {}
_ZNK8rawspeed8OptionalINSt3__117basic_string_viewIcNS1_11char_traitsIcEEEEEcvbEv:
   89|    126|  explicit operator bool() const { return has_value(); }
_ZNK8rawspeed8OptionalINSt3__117basic_string_viewIcNS1_11char_traitsIcEEEEE9has_valueEv:
   85|    252|  [[nodiscard]] bool has_value() const RAWSPEED_READNONE {
   86|    252|    return impl.has_value();
   87|    252|  }
_ZNR8rawspeed8OptionalINSt3__117basic_string_viewIcNS1_11char_traitsIcEEEEEdeEv:
   70|    126|  T& operator*() & {
   71|    126|    invariant(has_value());
  ------------------
  |  |   27|    126|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (71:5): [True: 126, False: 0]
  ------------------
   72|    126|    return impl.value();
   73|    126|  }
_ZN8rawspeed8OptionalINS_10Array1DRefISt4byteEEEC2IS3_Qaaaaaantsr3stdE7same_asITL0__NS0_IT_EEEntsr3stdE7same_asIS6_RS9_Entsr3stdE7same_asIS6_OS9_Entsr3stdE7same_asIS6_NSt3__18optionalIS7_EEEEEOS7_:
   42|    196|  Optional(U&& value) : impl(std::forward<U>(value)) {}
_ZN8rawspeed8OptionalINS_10Array1DRefISt4byteEEEC2IRKNSt3__19nullopt_tEQaaaaaantsr3stdE7same_asITL0__NS0_IT_EEEntsr3stdE7same_asISA_RSD_Entsr3stdE7same_asISA_OSD_Entsr3stdE7same_asISA_NS6_8optionalISB_EEEEEOSB_:
   42|    510|  Optional(U&& value) : impl(std::forward<U>(value)) {}
_ZN8rawspeed8OptionalINS_10Array1DRefIKSt4byteEEEC2IS4_Qaaaaaantsr3stdE7same_asITL0__NS0_IT_EEEntsr3stdE7same_asIS7_RSA_Entsr3stdE7same_asIS7_OSA_Entsr3stdE7same_asIS7_NSt3__18optionalIS8_EEEEEOS8_:
   42|    700|  Optional(U&& value) : impl(std::forward<U>(value)) {}
_ZN8rawspeed8OptionalINS_10Array1DRefIKSt4byteEEEC2IRKNSt3__19nullopt_tEQaaaaaantsr3stdE7same_asITL0__NS0_IT_EEEntsr3stdE7same_asISB_RSE_Entsr3stdE7same_asISB_OSE_Entsr3stdE7same_asISB_NS7_8optionalISC_EEEEEOSC_:
   42|      6|  Optional(U&& value) : impl(std::forward<U>(value)) {}
_ZN8rawspeed8OptionalINS_10ByteStreamEEC2IS1_Qaaaaaantsr3stdE7same_asITL0__NS0_IT_EEEntsr3stdE7same_asIS4_RS7_Entsr3stdE7same_asIS4_OS7_Entsr3stdE7same_asIS4_NSt3__18optionalIS5_EEEEEOS5_:
   42|  6.88k|  Optional(U&& value) : impl(std::forward<U>(value)) {}
_ZN8rawspeed8OptionalINS_10ByteStreamEEC2IRKNSt3__19nullopt_tEQaaaaaantsr3stdE7same_asITL0__NS0_IT_EEEntsr3stdE7same_asIS8_RSB_Entsr3stdE7same_asIS8_OSB_Entsr3stdE7same_asIS8_NS4_8optionalIS9_EEEEEOS9_:
   42|    513|  Optional(U&& value) : impl(std::forward<U>(value)) {}
_ZNK8rawspeed8OptionalINS_10ByteStreamEEcvbEv:
   89|  7.57k|  explicit operator bool() const { return has_value(); }
_ZN8rawspeed8OptionalINS_10JpegMarkerEEC2IS1_Qaaaaaantsr3stdE7same_asITL0__NS0_IT_EEEntsr3stdE7same_asIS4_RS7_Entsr3stdE7same_asIS4_OS7_Entsr3stdE7same_asIS4_NSt3__18optionalIS5_EEEEEOS5_:
   42|  13.7k|  Optional(U&& value) : impl(std::forward<U>(value)) {}
_ZN8rawspeed8OptionalINS_10JpegMarkerEEC2Ev:
   35|  4.19M|  Optional() = default;
_ZNO8rawspeed8OptionalINS_10JpegMarkerEEdeEv:
   75|  6.88k|  T&& operator*() && {
   76|  6.88k|    invariant(has_value());
  ------------------
  |  |   27|  6.88k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (76:5): [True: 6.88k, False: 0]
  ------------------
   77|  6.88k|    return std::move(impl.value());
   78|  6.88k|  }
_ZN8rawspeed8OptionalIiEC2IiQaaaaaantsr3stdE7same_asITL0__NS0_IT_EEEntsr3stdE7same_asIS3_RS6_Entsr3stdE7same_asIS3_OS6_Entsr3stdE7same_asIS3_NSt3__18optionalIS4_EEEEEOS4_:
   42|      7|  Optional(U&& value) : impl(std::forward<U>(value)) {}
_ZN8rawspeed8OptionalIiEC2IRKNSt3__19nullopt_tEQaaaaaantsr3stdE7same_asITL0__NS0_IT_EEEntsr3stdE7same_asIS7_RSA_Entsr3stdE7same_asIS7_OSA_Entsr3stdE7same_asIS7_NS3_8optionalIS8_EEEEEOS8_:
   42|      1|  Optional(U&& value) : impl(std::forward<U>(value)) {}
_ZNR8rawspeed8OptionalINS_10JpegMarkerEEdeEv:
   70|      8|  T& operator*() & {
   71|      8|    invariant(has_value());
  ------------------
  |  |   27|      8|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (71:5): [True: 8, False: 0]
  ------------------
   72|      8|    return impl.value();
   73|      8|  }
Cr2Decoder.cpp:_ZN8rawspeed8OptionalINSt3__14pairINS_12_GLOBAL__N_115ColorDataFormatENS0_IiEEEEEC2IS6_Qaaaaaantsr3stdE7same_asITL0__NS0_IT_EEEntsr3stdE7same_asIS9_RSC_Entsr3stdE7same_asIS9_OSC_Entsr3stdE7same_asIS9_NS1_8optionalISA_EEEEEOSA_:
   42|     16|  Optional(U&& value) : impl(std::forward<U>(value)) {}
_ZN8rawspeed8OptionalIiEC2IRiQaaaaaantsr3stdE7same_asITL0__NS0_IT_EEEntsr3stdE7same_asIS4_RS7_Entsr3stdE7same_asIS4_OS7_Entsr3stdE7same_asIS4_NSt3__18optionalIS5_EEEEEOS5_:
   42|     16|  Optional(U&& value) : impl(std::forward<U>(value)) {}
Cr2Decoder.cpp:_ZN8rawspeed8OptionalINSt3__14pairINS_12_GLOBAL__N_115ColorDataFormatENS0_IiEEEEEC2IRKNS1_9nullopt_tEQaaaaaantsr3stdE7same_asITL0__NS0_IT_EEEntsr3stdE7same_asISC_RSF_Entsr3stdE7same_asISC_OSF_Entsr3stdE7same_asISC_NS1_8optionalISD_EEEEEOSD_:
   42|      6|  Optional(U&& value) : impl(std::forward<U>(value)) {}
Cr2Decoder.cpp:_ZNK8rawspeed8OptionalINSt3__14pairINS_12_GLOBAL__N_115ColorDataFormatENS0_IiEEEEEcvbEv:
   89|     22|  explicit operator bool() const { return has_value(); }
Cr2Decoder.cpp:_ZNK8rawspeed8OptionalINSt3__14pairINS_12_GLOBAL__N_115ColorDataFormatENS0_IiEEEEE9has_valueEv:
   85|     38|  [[nodiscard]] bool has_value() const RAWSPEED_READNONE {
   86|     38|    return impl.has_value();
   87|     38|  }
Cr2Decoder.cpp:_ZNR8rawspeed8OptionalINSt3__14pairINS_12_GLOBAL__N_115ColorDataFormatENS0_IiEEEEEdeEv:
   70|     16|  T& operator*() & {
   71|     16|    invariant(has_value());
  ------------------
  |  |   27|     16|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (71:5): [True: 16, False: 0]
  ------------------
   72|     16|    return impl.value();
   73|     16|  }
_ZN8rawspeed8OptionalINSt3__14pairIiiEEEC2IRKNS1_9nullopt_tEQaaaaaantsr3stdE7same_asITL0__NS0_IT_EEEntsr3stdE7same_asIS9_RSC_Entsr3stdE7same_asIS9_OSC_Entsr3stdE7same_asIS9_NS1_8optionalISA_EEEEEOSA_:
   42|      3|  Optional(U&& value) : impl(std::forward<U>(value)) {}
_ZN8rawspeed8OptionalINSt3__14pairIiiEEEC2IS3_Qaaaaaantsr3stdE7same_asITL0__NS0_IT_EEEntsr3stdE7same_asIS6_RS9_Entsr3stdE7same_asIS6_OS9_Entsr3stdE7same_asIS6_NS1_8optionalIS7_EEEEEOS7_:
   42|      1|  Optional(U&& value) : impl(std::forward<U>(value)) {}
_ZNK8rawspeed8OptionalINSt3__14pairIiiEEEcvbEv:
   89|      4|  explicit operator bool() const { return has_value(); }
_ZNK8rawspeed8OptionalINSt3__14pairIiiEEE9has_valueEv:
   85|      5|  [[nodiscard]] bool has_value() const RAWSPEED_READNONE {
   86|      5|    return impl.has_value();
   87|      5|  }
_ZN8rawspeed8OptionalINSt3__14pairIiiEEEptEv:
   60|      1|  T* operator->() {
   61|      1|    invariant(has_value());
  ------------------
  |  |   27|      1|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (61:5): [True: 1, False: 0]
  ------------------
   62|      1|    return &impl.value();
   63|      1|  }
_ZNKR8rawspeed8OptionalIiEdeEv:
   65|  6.59k|  const T& operator*() const& {
   66|  6.59k|    invariant(has_value());
  ------------------
  |  |   27|  6.59k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (66:5): [True: 6.59k, False: 0]
  ------------------
   67|  6.59k|    return impl.value();
   68|  6.59k|  }
_ZN8rawspeed8OptionalIiEC2IjQaaaaaantsr3stdE7same_asITL0__NS0_IT_EEEntsr3stdE7same_asIS3_RS6_Entsr3stdE7same_asIS3_OS6_Entsr3stdE7same_asIS3_NSt3__18optionalIS4_EEEEEOS4_:
   42|  4.03k|  Optional(U&& value) : impl(std::forward<U>(value)) {}
_ZN8rawspeed8OptionalINS_12iRectangle2DEEC2Ev:
   35|  3.12k|  Optional() = default;
_ZNK8rawspeed8OptionalINS_12iRectangle2DEEcvbEv:
   89|  79.6k|  explicit operator bool() const { return has_value(); }
_ZNK8rawspeed8OptionalINS_12iRectangle2DEE9has_valueEv:
   85|   156k|  [[nodiscard]] bool has_value() const RAWSPEED_READNONE {
   86|   156k|    return impl.has_value();
   87|   156k|  }
_ZNR8rawspeed8OptionalINS_12iRectangle2DEEdeEv:
   70|  75.9k|  T& operator*() & {
   71|  75.9k|    invariant(has_value());
  ------------------
  |  |   27|  75.9k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (71:5): [True: 75.9k, False: 0]
  ------------------
   72|  75.9k|    return impl.value();
   73|  75.9k|  }
_ZN8rawspeed8OptionalINS_12iRectangle2DEEC2IRS1_Qaaaaaantsr3stdE7same_asITL0__NS0_IT_EEEntsr3stdE7same_asIS5_RS8_Entsr3stdE7same_asIS5_OS8_Entsr3stdE7same_asIS5_NSt3__18optionalIS6_EEEEEOS6_:
   42|  75.9k|  Optional(U&& value) : impl(std::forward<U>(value)) {}
_ZN8rawspeed8OptionalINS_12iRectangle2DEEptEv:
   60|    558|  T* operator->() {
   61|    558|    invariant(has_value());
  ------------------
  |  |   27|    558|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (61:5): [True: 558, False: 0]
  ------------------
   62|    558|    return &impl.value();
   63|    558|  }
_ZN8rawspeed8OptionalINS_12iRectangle2DEEC2IS1_Qaaaaaantsr3stdE7same_asITL0__NS0_IT_EEEntsr3stdE7same_asIS4_RS7_Entsr3stdE7same_asIS4_OS7_Entsr3stdE7same_asIS4_NSt3__18optionalIS5_EEEEEOS5_:
   42|     16|  Optional(U&& value) : impl(std::forward<U>(value)) {}
_ZN8rawspeed8OptionalINS_8CFAColorEEC2IS1_Qaaaaaantsr3stdE7same_asITL0__NS0_IT_EEEntsr3stdE7same_asIS4_RS7_Entsr3stdE7same_asIS4_OS7_Entsr3stdE7same_asIS4_NSt3__18optionalIS5_EEEEEOS5_:
   42|  1.18k|  Optional(U&& value) : impl(std::forward<U>(value)) {}
_ZN8rawspeed8OptionalINS_8CFAColorEEC2IRKNSt3__19nullopt_tEQaaaaaantsr3stdE7same_asITL0__NS0_IT_EEEntsr3stdE7same_asIS8_RSB_Entsr3stdE7same_asIS8_OSB_Entsr3stdE7same_asIS8_NS4_8optionalIS9_EEEEEOS9_:
   42|     14|  Optional(U&& value) : impl(std::forward<U>(value)) {}
_ZNK8rawspeed8OptionalINS_8CFAColorEEcvbEv:
   89|  1.19k|  explicit operator bool() const { return has_value(); }
_ZNK8rawspeed8OptionalINS_8CFAColorEE9has_valueEv:
   85|  2.37k|  [[nodiscard]] bool has_value() const RAWSPEED_READNONE {
   86|  2.37k|    return impl.has_value();
   87|  2.37k|  }
_ZNR8rawspeed8OptionalINS_8CFAColorEEdeEv:
   70|  1.18k|  T& operator*() & {
   71|  1.18k|    invariant(has_value());
  ------------------
  |  |   27|  1.18k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (71:5): [True: 1.18k, False: 0]
  ------------------
   72|  1.18k|    return impl.value();
   73|  1.18k|  }
_ZNK8rawspeed8OptionalINS_12iRectangle2DEEptEv:
   55|     16|  const T* operator->() const {
   56|     16|    invariant(has_value());
  ------------------
  |  |   27|     16|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (56:5): [True: 16, False: 0]
  ------------------
   57|     16|    return &impl.value();
   58|     16|  }
_ZNKR8rawspeed8OptionalINS_12iRectangle2DEEdeEv:
   65|      8|  const T& operator*() const& {
   66|      8|    invariant(has_value());
  ------------------
  |  |   27|      8|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (66:5): [True: 8, False: 0]
  ------------------
   67|      8|    return impl.value();
   68|      8|  }
_ZN8rawspeed8OptionalINS_20PrefixCodeLUTDecoderINS_10VC5CodeTagENS_23PrefixCodeVectorDecoderIS2_EEEEEC2Ev:
   35|    572|  Optional() = default;
_ZN8rawspeed8OptionalItEC2Ev:
   35|  1.13k|  Optional() = default;
_ZN8rawspeed8OptionalIsEC2Ev:
   35|    568|  Optional() = default;
_ZN8rawspeed8OptionalINS_10BayerPhaseEEC2Ev:
   35|    104|  Optional() = default;
_ZN8rawspeed8OptionalINS_10BayerPhaseEEC2IS1_Qaaaaaantsr3stdE7same_asITL0__NS0_IT_EEEntsr3stdE7same_asIS4_RS7_Entsr3stdE7same_asIS4_OS7_Entsr3stdE7same_asIS4_NSt3__18optionalIS5_EEEEEOS5_:
   42|    387|  Optional(U&& value) : impl(std::forward<U>(value)) {}
_ZNK8rawspeed8OptionalINS_10BayerPhaseEEcvbEv:
   89|    490|  explicit operator bool() const { return has_value(); }
_ZNK8rawspeed8OptionalINS_10BayerPhaseEE9has_valueEv:
   85|    871|  [[nodiscard]] bool has_value() const RAWSPEED_READNONE {
   86|    871|    return impl.has_value();
   87|    871|  }
_ZNR8rawspeed8OptionalINS_10BayerPhaseEEdeEv:
   70|    379|  T& operator*() & {
   71|    379|    invariant(has_value());
  ------------------
  |  |   27|    379|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (71:5): [True: 379, False: 0]
  ------------------
   72|    379|    return impl.value();
   73|    379|  }
_ZN8rawspeed8OptionalItEC2IRtQaaaaaantsr3stdE7same_asITL0__NS0_IT_EEEntsr3stdE7same_asIS4_RS7_Entsr3stdE7same_asIS4_OS7_Entsr3stdE7same_asIS4_NSt3__18optionalIS5_EEEEEOS5_:
   42|     60|  Optional(U&& value) : impl(std::forward<U>(value)) {}
_ZN8rawspeed8OptionalIsEaSIsQsr3stdE7same_asITL0__T_EEERS1_OS4_:
   46|    300|  Optional<T>& operator=(U&& value) {
   47|    300|    impl = std::forward<U>(value);
   48|    300|    return *this;
   49|    300|  }
_ZN8rawspeed8OptionalINS_15VC5Decompressor8BandDataEEC2Ev:
   35|     24|  Optional() = default;
_ZNK8rawspeed8OptionalItE9has_valueEv:
   85|    147|  [[nodiscard]] bool has_value() const RAWSPEED_READNONE {
   86|    147|    return impl.has_value();
   87|    147|  }
_ZNR8rawspeed8OptionalItEdeEv:
   70|     58|  T& operator*() & {
   71|     58|    invariant(has_value());
  ------------------
  |  |   27|     58|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (71:5): [True: 58, False: 0]
  ------------------
   72|     58|    return impl.value();
   73|     58|  }
_ZN8rawspeedeqItiEEbRKNS_8OptionalIT_EERKT0_:
   99|     27|bool operator==(const Optional<T>& lhs, const U& rhs) {
  100|     27|  return lhs && *lhs == rhs;
  ------------------
  |  Branch (100:10): [True: 27, False: 0]
  |  Branch (100:17): [True: 4, False: 23]
  ------------------
  101|     27|}
_ZNK8rawspeed8OptionalItEcvbEv:
   89|     27|  explicit operator bool() const { return has_value(); }
_ZNKR8rawspeed8OptionalItEdeEv:
   65|     27|  const T& operator*() const& {
   66|     27|    invariant(has_value());
  ------------------
  |  |   27|     27|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (66:5): [True: 27, False: 0]
  ------------------
   67|     27|    return impl.value();
   68|     27|  }
_ZN8rawspeed8OptionalItE5resetEv:
   95|     24|  void reset() { impl.reset(); }
_ZNK8rawspeed8OptionalIsE9has_valueEv:
   85|     45|  [[nodiscard]] bool has_value() const RAWSPEED_READNONE {
   86|     45|    return impl.has_value();
   87|     45|  }
_ZNR8rawspeed8OptionalIsEdeEv:
   70|     22|  T& operator*() & {
   71|     22|    invariant(has_value());
  ------------------
  |  |   27|     22|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (71:5): [True: 22, False: 0]
  ------------------
   72|     22|    return impl.value();
   73|     22|  }
_ZN8rawspeed8OptionalIsE5resetEv:
   95|     22|  void reset() { impl.reset(); }
_ZNK8rawspeed8OptionalINSt3__14pairIPKcPFNS1_10unique_ptrINS_10DngOpcodes9DngOpcodeENS1_14default_deleteIS7_EEEERKNS_8RawImageERNS_10ByteStreamERNS_12iRectangle2DEEEEEcvbEv:
   89|  1.34k|  explicit operator bool() const { return has_value(); }
_ZNK8rawspeed8OptionalINSt3__14pairIPKcPFNS1_10unique_ptrINS_10DngOpcodes9DngOpcodeENS1_14default_deleteIS7_EEEERKNS_8RawImageERNS_10ByteStreamERNS_12iRectangle2DEEEEE9has_valueEv:
   85|  2.66k|  [[nodiscard]] bool has_value() const RAWSPEED_READNONE {
   86|  2.66k|    return impl.has_value();
   87|  2.66k|  }
_ZNR8rawspeed8OptionalINSt3__14pairIPKcPFNS1_10unique_ptrINS_10DngOpcodes9DngOpcodeENS1_14default_deleteIS7_EEEERKNS_8RawImageERNS_10ByteStreamERNS_12iRectangle2DEEEEEdeEv:
   70|  1.32k|  T& operator*() & {
   71|  1.32k|    invariant(has_value());
  ------------------
  |  |   27|  1.32k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (71:5): [True: 1.32k, False: 0]
  ------------------
   72|  1.32k|    return impl.value();
   73|  1.32k|  }
_ZN8rawspeed8OptionalINSt3__14pairIPKcPFNS1_10unique_ptrINS_10DngOpcodes9DngOpcodeENS1_14default_deleteIS7_EEEERKNS_8RawImageERNS_10ByteStreamERNS_12iRectangle2DEEEEEC2INS2_IS4_DnEEQaaaaaantsr3stdE7same_asITL0__NS0_IT_EEEntsr3stdE7same_asISO_RSR_Entsr3stdE7same_asISO_OSR_Entsr3stdE7same_asISO_NS1_8optionalISP_EEEEEOSP_:
   42|     50|  Optional(U&& value) : impl(std::forward<U>(value)) {}
_ZN8rawspeed8OptionalINSt3__14pairIPKcPFNS1_10unique_ptrINS_10DngOpcodes9DngOpcodeENS1_14default_deleteIS7_EEEERKNS_8RawImageERNS_10ByteStreamERNS_12iRectangle2DEEEEEC2ISK_Qaaaaaantsr3stdE7same_asITL0__NS0_IT_EEEntsr3stdE7same_asISN_RSQ_Entsr3stdE7same_asISN_OSQ_Entsr3stdE7same_asISN_NS1_8optionalISO_EEEEEOSO_:
   42|  1.27k|  Optional(U&& value) : impl(std::forward<U>(value)) {}
_ZN8rawspeed8OptionalINSt3__14pairIPKcPFNS1_10unique_ptrINS_10DngOpcodes9DngOpcodeENS1_14default_deleteIS7_EEEERKNS_8RawImageERNS_10ByteStreamERNS_12iRectangle2DEEEEEC2IRKNS1_9nullopt_tEQaaaaaantsr3stdE7same_asITL0__NS0_IT_EEEntsr3stdE7same_asISQ_RST_Entsr3stdE7same_asISQ_OST_Entsr3stdE7same_asISQ_NS1_8optionalISR_EEEEEOSR_:
   42|     20|  Optional(U&& value) : impl(std::forward<U>(value)) {}
IiqDecoder.cpp:_ZN8rawspeed8OptionalINS_12_GLOBAL__N_19IIQFormatEEC2Ev:
   35|  1.12k|  Optional() = default;
_ZN8rawspeed8OptionalINS_6BufferEEC2Ev:
   35|  1.12k|  Optional() = default;
IiqDecoder.cpp:_ZNK8rawspeed8OptionalINS_12_GLOBAL__N_19IIQFormatEEcvbEv:
   89|  2.83k|  explicit operator bool() const { return has_value(); }
IiqDecoder.cpp:_ZNK8rawspeed8OptionalINS_12_GLOBAL__N_19IIQFormatEE9has_valueEv:
   85|  3.76k|  [[nodiscard]] bool has_value() const RAWSPEED_READNONE {
   86|  3.76k|    return impl.has_value();
   87|  3.76k|  }
IiqDecoder.cpp:_ZN8rawspeed8OptionalINS_12_GLOBAL__N_19IIQFormatEEC2IS2_Qaaaaaantsr3stdE7same_asITL0__NS0_IT_EEEntsr3stdE7same_asIS5_RS8_Entsr3stdE7same_asIS5_OS8_Entsr3stdE7same_asIS5_NSt3__18optionalIS6_EEEEEOS6_:
   42|    931|  Optional(U&& value) : impl(std::forward<U>(value)) {}
IiqDecoder.cpp:_ZN8rawspeed8OptionalINS_12_GLOBAL__N_19IIQFormatEEC2IRKNSt3__19nullopt_tEQaaaaaantsr3stdE7same_asITL0__NS0_IT_EEEntsr3stdE7same_asIS9_RSC_Entsr3stdE7same_asIS9_OSC_Entsr3stdE7same_asIS9_NS5_8optionalISA_EEEEEOSA_:
   42|     27|  Optional(U&& value) : impl(std::forward<U>(value)) {}
IiqDecoder.cpp:_ZNR8rawspeed8OptionalINS_12_GLOBAL__N_19IIQFormatEEdeEv:
   70|    931|  T& operator*() & {
   71|    931|    invariant(has_value());
  ------------------
  |  |   27|    931|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (71:5): [True: 931, False: 0]
  ------------------
   72|    931|    return impl.value();
   73|    931|  }
_ZN8rawspeed8OptionalINS_6BufferEEaSIS1_Qsr3stdE7same_asITL0__T_EEERS2_OS5_:
   46|  1.09k|  Optional<T>& operator=(U&& value) {
   47|  1.09k|    impl = std::forward<U>(value);
   48|  1.09k|    return *this;
   49|  1.09k|  }
_ZNK8rawspeed8OptionalINS_6BufferEEcvbEv:
   89|    907|  explicit operator bool() const { return has_value(); }
_ZNK8rawspeed8OptionalINS_6BufferEE9has_valueEv:
   85|  2.64k|  [[nodiscard]] bool has_value() const RAWSPEED_READNONE {
   86|  2.64k|    return impl.has_value();
   87|  2.64k|  }
_ZN8rawspeed8OptionalINS_6BufferEEptEv:
   60|    870|  T* operator->() {
   61|    870|    invariant(has_value());
  ------------------
  |  |   27|    870|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (61:5): [True: 870, False: 0]
  ------------------
   62|    870|    return &impl.value();
   63|    870|  }
_ZNR8rawspeed8OptionalINS_6BufferEEdeEv:
   70|    870|  T& operator*() & {
   71|    870|    invariant(has_value());
  ------------------
  |  |   27|    870|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (71:5): [True: 870, False: 0]
  ------------------
   72|    870|    return impl.value();
   73|    870|  }
_ZN8rawspeed8OptionalINS_11HuffmanCodeINS_15BaselineCodeTagEEEEC2Ev:
   35|    174|  Optional() = default;
_ZN8rawspeed8OptionalINS_11HuffmanCodeINS_15BaselineCodeTagEEEEaSIS3_Qsr3stdE7same_asITL0__T_EEERS4_OS7_:
   46|    162|  Optional<T>& operator=(U&& value) {
   47|    162|    impl = std::forward<U>(value);
   48|    162|    return *this;
   49|    162|  }
_ZNR8rawspeed8OptionalINS_11HuffmanCodeINS_15BaselineCodeTagEEEEdeEv:
   70|    162|  T& operator*() & {
   71|    162|    invariant(has_value());
  ------------------
  |  |   27|    162|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (71:5): [True: 162, False: 0]
  ------------------
   72|    162|    return impl.value();
   73|    162|  }
_ZNK8rawspeed8OptionalINS_11HuffmanCodeINS_15BaselineCodeTagEEEE9has_valueEv:
   85|    162|  [[nodiscard]] bool has_value() const RAWSPEED_READNONE {
   86|    162|    return impl.has_value();
   87|    162|  }
_ZN8rawspeedeqINS_10BayerPhaseES1_EEbRKNS_8OptionalIT_EERKT0_:
   99|      5|bool operator==(const Optional<T>& lhs, const U& rhs) {
  100|      5|  return lhs && *lhs == rhs;
  ------------------
  |  Branch (100:10): [True: 5, False: 0]
  |  Branch (100:17): [True: 2, False: 3]
  ------------------
  101|      5|}
_ZNKR8rawspeed8OptionalINS_10BayerPhaseEEdeEv:
   65|      5|  const T& operator*() const& {
   66|      5|    invariant(has_value());
  ------------------
  |  |   27|      5|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (66:5): [True: 5, False: 0]
  ------------------
   67|      5|    return impl.value();
   68|      5|  }

_ZN8rawspeed8iPoint2DC2Eii:
   41|  1.80M|  constexpr iPoint2D(value_type a, value_type b) : x(a), y(b) {}
_ZNK8rawspeed8iPoint2DplERKS0_:
   43|   517k|  constexpr iPoint2D operator+(const iPoint2D& rhs) const {
   44|   517k|    return {x + rhs.x, y + rhs.y};
   45|   517k|  }
_ZNK8rawspeed8iPoint2DmiERKS0_:
   46|  3.14k|  constexpr iPoint2D operator-(const iPoint2D& rhs) const {
   47|  3.14k|    return {x - rhs.x, y - rhs.y};
   48|  3.14k|  }
_ZN8rawspeed8iPoint2DpLERKS0_:
   50|    169|  iPoint2D& operator+=(const iPoint2D& rhs) {
   51|    169|    *this = operator+(rhs);
   52|    169|    return *this;
   53|    169|  }
_ZNK8rawspeed8iPoint2DeqERKS0_:
   59|   182k|  constexpr bool RAWSPEED_READONLY operator==(const iPoint2D& rhs) const {
   60|   182k|    return x == rhs.x && y == rhs.y;
  ------------------
  |  Branch (60:12): [True: 46.1k, False: 136k]
  |  Branch (60:26): [True: 45.8k, False: 360]
  ------------------
   61|   182k|  }
_ZNK8rawspeed8iPoint2DgtERKS0_:
   63|  19.9k|  constexpr bool RAWSPEED_READONLY operator>(const iPoint2D& rhs) const {
   64|  19.9k|    return x > rhs.x && y > rhs.y;
  ------------------
  |  Branch (64:12): [True: 19.7k, False: 128]
  |  Branch (64:25): [True: 19.6k, False: 136]
  ------------------
   65|  19.9k|  }
_ZNK8rawspeed8iPoint2DltERKS0_:
   66|  2.33k|  constexpr bool RAWSPEED_READONLY operator<(const iPoint2D& rhs) const {
   67|  2.33k|    return x < rhs.x && y < rhs.y;
  ------------------
  |  Branch (67:12): [True: 1.76k, False: 569]
  |  Branch (67:25): [True: 1.73k, False: 34]
  ------------------
   68|  2.33k|  }
_ZNK8rawspeed8iPoint2DgeERKS0_:
   70|  12.2k|  constexpr bool RAWSPEED_READONLY operator>=(const iPoint2D& rhs) const {
   71|  12.2k|    return x >= rhs.x && y >= rhs.y;
  ------------------
  |  Branch (71:12): [True: 12.0k, False: 199]
  |  Branch (71:26): [True: 11.8k, False: 167]
  ------------------
   72|  12.2k|  }
_ZNK8rawspeed8iPoint2DleERKS0_:
   73|  84.8k|  constexpr bool RAWSPEED_READONLY operator<=(const iPoint2D& rhs) const {
   74|  84.8k|    return x <= rhs.x && y <= rhs.y;
  ------------------
  |  Branch (74:12): [True: 83.9k, False: 896]
  |  Branch (74:26): [True: 83.6k, False: 272]
  ------------------
   75|  84.8k|  }
_ZNK8rawspeed8iPoint2D15hasPositiveAreaEv:
   77|  19.9k|  [[nodiscard]] bool RAWSPEED_READONLY hasPositiveArea() const {
   78|  19.9k|    return *this > iPoint2D(0, 0);
   79|  19.9k|  }
_ZNK8rawspeed8iPoint2D4areaEv:
   81|  30.9k|  [[nodiscard]] area_type RAWSPEED_READONLY area() const {
   82|  30.9k|    using signed_area = std::make_signed_t<area_type>;
   83|       |
   84|  30.9k|    area_type x_abs = std::abs(static_cast<signed_area>(x));
   85|  30.9k|    area_type y_abs = std::abs(static_cast<signed_area>(y));
   86|       |
   87|  30.9k|    return x_abs * y_abs;
   88|  30.9k|  }
_ZNK8rawspeed8iPoint2D12isThisInsideERKS0_:
   91|    394|  isThisInside(const iPoint2D& rhs) const {
   92|    394|    return *this <= rhs;
   93|    394|  }
_ZN8rawspeed12iRectangle2DC2ERKNS_8iPoint2DES3_:
  111|   401k|      : pos(pos_), dim(dim_) {}
_ZN8rawspeed12iRectangle2DC2Eiiii:
  115|    713|      : pos({x_pos, y_pos}), dim({w, h}) {}
_ZNK8rawspeed12iRectangle2D6getTopEv:
  117|  1.48M|  [[nodiscard]] constexpr int getTop() const { return pos.y; }
_ZNK8rawspeed12iRectangle2D9getBottomEv:
  118|  1.66k|  [[nodiscard]] constexpr int getBottom() const { return pos.y + dim.y; }
_ZNK8rawspeed12iRectangle2D7getLeftEv:
  119|  1.10M|  [[nodiscard]] constexpr int getLeft() const { return pos.x; }
_ZNK8rawspeed12iRectangle2D8getRightEv:
  120|  68.9k|  [[nodiscard]] constexpr int getRight() const { return pos.x + dim.x; }
_ZNK8rawspeed12iRectangle2D8getWidthEv:
  121|  1.17M|  [[nodiscard]] constexpr int getWidth() const { return dim.x; }
_ZNK8rawspeed12iRectangle2D9getHeightEv:
  122|   641k|  [[nodiscard]] constexpr int getHeight() const { return dim.y; }
_ZNK8rawspeed12iRectangle2D10getTopLeftEv:
  123|  92.7k|  [[nodiscard]] constexpr iPoint2D getTopLeft() const { return pos; }
_ZNK8rawspeed12iRectangle2D14getBottomRightEv:
  124|   185k|  [[nodiscard]] constexpr iPoint2D getBottomRight() const { return pos + dim; }
_ZNK8rawspeed12iRectangle2D11getTopRightEv:
  125|  19.6k|  [[nodiscard]] constexpr iPoint2D getTopRight() const {
  126|  19.6k|    return pos + iPoint2D(dim.x, 0);
  127|  19.6k|  }
_ZNK8rawspeed12iRectangle2D13getBottomLeftEv:
  128|   312k|  [[nodiscard]] constexpr iPoint2D getBottomLeft() const {
  129|   312k|    return pos + iPoint2D(0, dim.y);
  130|   312k|  }
_ZNK8rawspeed12iRectangle2D15hasPositiveAreaEv:
  131|    572|  [[nodiscard]] constexpr bool RAWSPEED_READONLY hasPositiveArea() const {
  132|    572|    return (dim.x > 0) && (dim.y > 0);
  ------------------
  |  Branch (132:12): [True: 521, False: 51]
  |  Branch (132:27): [True: 498, False: 23]
  ------------------
  133|    572|  }
_ZNK8rawspeed12iRectangle2D13isPointInsideERKNS_8iPoint2DE:
  136|  1.21k|  isPointInside(const iPoint2D& subPoint) const {
  137|  1.21k|    return subPoint >= getTopLeft() && subPoint < getBottomRight();
  ------------------
  |  Branch (137:12): [True: 1.18k, False: 26]
  |  Branch (137:40): [True: 1.14k, False: 45]
  ------------------
  138|  1.21k|  }
_ZNK8rawspeed12iRectangle2D22isPointInsideInclusiveERKNS_8iPoint2DE:
  141|  5.55k|  isPointInsideInclusive(const iPoint2D& subPoint) const {
  142|  5.55k|    return subPoint >= getTopLeft() && subPoint <= getBottomRight();
  ------------------
  |  Branch (142:12): [True: 5.22k, False: 338]
  |  Branch (142:40): [True: 4.73k, False: 485]
  ------------------
  143|  5.55k|  }
_ZNK8rawspeed12iRectangle2D12isThisInsideERKS0_:
  146|  2.68k|  isThisInside(const iRectangle2D& superRect) const {
  147|  2.68k|    return getTopLeft() >= superRect.getTopLeft() &&
  ------------------
  |  Branch (147:12): [True: 2.68k, False: 0]
  ------------------
  148|  2.68k|           getBottomRight() <= superRect.getBottomRight();
  ------------------
  |  Branch (148:12): [True: 2.68k, False: 0]
  ------------------
  149|  2.68k|  }
_ZN8rawspeed12iRectangle2D10setTopLeftERKNS_8iPoint2DE:
  158|  1.62k|  void setTopLeft(const iPoint2D& top_left) { pos = top_left; }
_ZN8rawspeed12iRectangle2D22setBottomRightAbsoluteERKNS_8iPoint2DE:
  161|  1.62k|  void setBottomRightAbsolute(const iPoint2D& bottom_right) {
  162|  1.62k|    dim = bottom_right - pos;
  163|  1.62k|  }
_ZN8rawspeedeqERKNS_12iRectangle2DES0_:
  225|  1.62k|                                         const iRectangle2D b) {
  226|  1.62k|  return std::tie(a.pos, a.dim) == std::tie(b.pos, b.dim);
  227|  1.62k|}
_ZN8rawspeed8iPoint2DC2Ev:
   40|  63.1k|  constexpr iPoint2D() = default;
_ZN8rawspeed12iRectangle2DC2Ev:
  109|  4.48k|  constexpr iRectangle2D() = default;

_ZN8rawspeed13RangesOverlapINS_6BufferEEEbRKT_S4_:
   62|  11.9k|constexpr bool RAWSPEED_READNONE RangesOverlap(const T& lhs, const T& rhs) {
   63|  11.9k|  if (&lhs == &rhs)
  ------------------
  |  Branch (63:7): [True: 0, False: 11.9k]
  ------------------
   64|      0|    return true;
   65|       |
   66|  11.9k|  if (std::begin(lhs) == std::begin(rhs))
  ------------------
  |  Branch (66:7): [True: 829, False: 11.1k]
  ------------------
   67|    829|    return true;
   68|       |
   69|  11.1k|  const std::pair<const T&, const T&> ordered =
   70|  11.1k|      std::minmax(lhs, rhs, [](const T& r0, const T& r1) {
   71|  11.1k|        assert(std::begin(r0) != std::begin(r1));
   72|  11.1k|        return std::begin(r0) < std::begin(r1);
   73|  11.1k|      });
   74|       |
   75|  11.1k|  assert(std::begin(ordered.first) < std::begin(ordered.second));
  ------------------
  |  Branch (75:3): [True: 11.1k, False: 0]
  ------------------
   76|  11.1k|  return RangeContains(ordered.first, std::begin(ordered.second));
   77|  11.1k|}
_ZZN8rawspeed13RangesOverlapINS_6BufferEEEbRKT_S4_ENKUlRKS1_S6_E_clES6_S6_:
   70|  11.1k|      std::minmax(lhs, rhs, [](const T& r0, const T& r1) {
   71|  11.1k|        assert(std::begin(r0) != std::begin(r1));
  ------------------
  |  Branch (71:9): [True: 11.1k, False: 0]
  ------------------
   72|  11.1k|        return std::begin(r0) < std::begin(r1);
   73|  11.1k|      });
_ZN8rawspeed13RangeContainsINS_6BufferEPKhEEbRKT_T0_:
   53|  11.1k|constexpr bool RAWSPEED_READNONE RangeContains(const Tr& r, Tv pos) {
   54|  11.1k|  if (pos < std::begin(r))
  ------------------
  |  Branch (54:7): [True: 0, False: 11.1k]
  ------------------
   55|      0|    return false;
   56|       |
   57|  11.1k|  assert(pos >= std::begin(r));
  ------------------
  |  Branch (57:3): [True: 11.1k, False: 0]
  ------------------
   58|  11.1k|  return std::end(r) > pos;
   59|  11.1k|}

_ZN8rawspeed32variableLengthLoadNaiveViaMemcpyENS_10Array1DRefISt4byteEENS0_IKS1_EEi:
  150|  8.02k|                                             int inPos) {
  151|  8.02k|  invariant(out.size() != 0);
  ------------------
  |  |   27|  8.02k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (151:3): [True: 8.02k, False: 0]
  ------------------
  152|  8.02k|  invariant(in.size() != 0);
  ------------------
  |  |   27|  8.02k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (152:3): [True: 8.02k, False: 1]
  ------------------
  153|  8.02k|  invariant(out.size() <= in.size());
  ------------------
  |  |   27|  8.02k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (153:3): [True: 8.01k, False: 7]
  ------------------
  154|  8.01k|  invariant(inPos >= 0);
  ------------------
  |  |   27|  8.01k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (154:3): [True: 8.01k, False: 0]
  ------------------
  155|       |
  156|  8.01k|  std::fill(out.begin(), out.end(), std::byte{0x00});
  157|       |
  158|  8.01k|  inPos = std::min(inPos, in.size());
  159|       |
  160|  8.01k|  int inPosEnd = inPos + out.size();
  161|  8.01k|  inPosEnd = std::min(inPosEnd, in.size());
  162|  8.01k|  invariant(inPos <= inPosEnd);
  ------------------
  |  |   27|  8.01k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (162:3): [True: 8.01k, False: 2]
  ------------------
  163|       |
  164|  8.01k|  const int copySize = inPosEnd - inPos;
  165|  8.01k|  invariant(copySize >= 0);
  ------------------
  |  |   27|  8.01k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (165:3): [True: 8.01k, False: 2]
  ------------------
  166|  8.01k|  invariant(copySize <= out.size());
  ------------------
  |  |   27|  8.01k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (166:3): [True: 8.01k, False: 0]
  ------------------
  167|       |
  168|  8.01k|  out = out.getCrop(/*offset=*/0, copySize).getAsArray1DRef();
  169|  8.01k|  in = in.getCrop(/*offset=*/inPos, copySize).getAsArray1DRef();
  170|  8.01k|  invariant(in.size() == out.size());
  ------------------
  |  |   27|  8.01k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (170:3): [True: 8.02k, False: 18.4E]
  ------------------
  171|       |
  172|  8.02k|  memcpy(out.begin(), in.begin(), copySize);
  173|  8.02k|}

_ZN8rawspeed14iterator_rangeINS_16Cr2SliceIteratorEEC2ES1_S1_:
   33|  1.08k|      : begin_iterator(std::move(begin_iterator_)),
   34|  1.08k|        end_iterator(std::move(end_iterator_)) {}
_ZNK8rawspeed14iterator_rangeINS_16Cr2SliceIteratorEE5beginEv:
   36|  1.08k|  [[nodiscard]] Iter begin() const { return begin_iterator; }
_ZNK8rawspeed14iterator_rangeINS_16Cr2SliceIteratorEE3endEv:
   37|  1.08k|  [[nodiscard]] Iter end() const { return end_iterator; }
_ZN8rawspeed14iterator_rangeINS_21Cr2OutputTileIteratorEEC2ES1_S1_:
   33|  1.59k|      : begin_iterator(std::move(begin_iterator_)),
   34|  1.59k|        end_iterator(std::move(end_iterator_)) {}
_ZNK8rawspeed14iterator_rangeINS_21Cr2OutputTileIteratorEE5beginEv:
   36|  1.59k|  [[nodiscard]] Iter begin() const { return begin_iterator; }
_ZNK8rawspeed14iterator_rangeINS_21Cr2OutputTileIteratorEE3endEv:
   37|  2.61k|  [[nodiscard]] Iter end() const { return end_iterator; }
_ZN8rawspeed14iterator_rangeINS_30Cr2VerticalOutputStripIteratorEEC2ES1_S1_:
   33|    512|      : begin_iterator(std::move(begin_iterator_)),
   34|    512|        end_iterator(std::move(end_iterator_)) {}
_ZNK8rawspeed14iterator_rangeINS_30Cr2VerticalOutputStripIteratorEE5beginEv:
   36|    512|  [[nodiscard]] Iter begin() const { return begin_iterator; }
_ZNK8rawspeed14iterator_rangeINS_30Cr2VerticalOutputStripIteratorEE3endEv:
   37|    512|  [[nodiscard]] Iter end() const { return end_iterator; }

_ZN8rawspeed28BitStreamCacheLeftInRightOut4pushEmi:
   60|  4.13M|  void push(uint64_t bits, int count) noexcept {
   61|  4.13M|    establishClassInvariants();
   62|  4.13M|    invariant(count >= 0);
  ------------------
  |  |   27|  4.13M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (62:5): [True: 4.19M, False: 18.4E]
  ------------------
   63|       |    // NOTE: count may be zero!
   64|  4.19M|    invariant(count <= Size);
  ------------------
  |  |   27|  4.19M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (64:5): [True: 4.19M, False: 18.4E]
  ------------------
   65|  4.19M|    invariant(count + fillLevel <= Size);
  ------------------
  |  |   27|  4.19M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (65:5): [True: 4.20M, False: 18.4E]
  ------------------
   66|  4.20M|    cache |= bits << fillLevel;
   67|  4.20M|    fillLevel += count;
   68|  4.20M|  }
_ZNK8rawspeed28BitStreamCacheLeftInRightOut4peekEi:
   70|  10.1M|  [[nodiscard]] uint32_t peek(int count) const noexcept {
   71|  10.1M|    establishClassInvariants();
   72|  10.1M|    invariant(count >= 0);
  ------------------
  |  |   27|  10.1M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (72:5): [True: 10.2M, False: 18.4E]
  ------------------
   73|  10.2M|    invariant(count <= MaxGetBits);
  ------------------
  |  |   27|  10.2M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (73:5): [True: 10.2M, False: 18.4E]
  ------------------
   74|  10.2M|    invariant(count != 0);
  ------------------
  |  |   27|  10.2M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (74:5): [True: 10.3M, False: 18.4E]
  ------------------
   75|  10.3M|    invariant(count <= Size);
  ------------------
  |  |   27|  10.3M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (75:5): [True: 10.3M, False: 0]
  ------------------
   76|  10.3M|    invariant(count <= fillLevel);
  ------------------
  |  |   27|  10.3M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (76:5): [True: 10.3M, False: 18.4E]
  ------------------
   77|  10.3M|    return extractLowBits(static_cast<uint32_t>(cache), count);
   78|  10.3M|  }
_ZN8rawspeed28BitStreamCacheLeftInRightOut4skipEi:
   80|  10.8M|  void skip(int count) noexcept {
   81|  10.8M|    establishClassInvariants();
   82|  10.8M|    invariant(count >= 0);
  ------------------
  |  |   27|  10.8M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (82:5): [True: 10.7M, False: 77.1k]
  ------------------
   83|       |    // `count` *could* be larger than `MaxGetBits`.
   84|       |    // `count` could be zero.
   85|  10.7M|    invariant(count <= Size);
  ------------------
  |  |   27|  10.7M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (85:5): [True: 10.7M, False: 18.4E]
  ------------------
   86|  10.7M|    invariant(count <= fillLevel);
  ------------------
  |  |   27|  10.7M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (86:5): [True: 10.8M, False: 18.4E]
  ------------------
   87|  10.8M|    cache >>= count;
   88|  10.8M|    fillLevel -= count;
   89|  10.8M|  }
_ZN8rawspeed28BitStreamCacheRightInLeftOut4pushEmi:
   93|  2.85M|  void push(uint64_t bits, int count) noexcept {
   94|  2.85M|    establishClassInvariants();
   95|  2.85M|    invariant(count >= 0);
  ------------------
  |  |   27|  2.85M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (95:5): [True: 2.85M, False: 18.4E]
  ------------------
   96|       |    // NOTE: count may be zero!
   97|  2.85M|    invariant(count <= Size);
  ------------------
  |  |   27|  2.85M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (97:5): [True: 2.85M, False: 18.4E]
  ------------------
   98|  2.85M|    invariant(count + fillLevel <= Size);
  ------------------
  |  |   27|  2.85M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (98:5): [True: 2.85M, False: 18.4E]
  ------------------
   99|       |    // If the maximal size of the cache is BitStreamCacheBase::Size, and we
  100|       |    // have fillLevel [high] bits set, how many empty [low] bits do we have?
  101|  2.85M|    const int vacantBits = BitStreamCacheBase::Size - fillLevel;
  102|  2.85M|    invariant(vacantBits >= 0);
  ------------------
  |  |   27|  2.85M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (102:5): [True: 2.85M, False: 2]
  ------------------
  103|  2.85M|    invariant(vacantBits <= Size);
  ------------------
  |  |   27|  2.85M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (103:5): [True: 2.85M, False: 18.4E]
  ------------------
  104|  2.85M|    invariant(vacantBits != 0);
  ------------------
  |  |   27|  2.85M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (104:5): [True: 2.85M, False: 0]
  ------------------
  105|  2.85M|    invariant(vacantBits >= count);
  ------------------
  |  |   27|  2.85M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (105:5): [True: 2.85M, False: 1]
  ------------------
  106|       |    // If we just directly 'or' these low bits into the cache right now,
  107|       |    // how many unfilled bits of a gap will there be in the middle of a cache?
  108|  2.85M|    const int emptyBitsGap = vacantBits - count;
  109|  2.85M|    invariant(emptyBitsGap >= 0);
  ------------------
  |  |   27|  2.85M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (109:5): [True: 2.85M, False: 0]
  ------------------
  110|  2.85M|    invariant(emptyBitsGap <= Size);
  ------------------
  |  |   27|  2.85M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (110:5): [True: 2.85M, False: 18.4E]
  ------------------
  111|  2.85M|    if (count != 0) {
  ------------------
  |  Branch (111:9): [True: 2.85M, False: 18.4E]
  ------------------
  112|  2.85M|      invariant(emptyBitsGap < Size);
  ------------------
  |  |   27|  2.85M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (112:7): [True: 2.85M, False: 18.4E]
  ------------------
  113|       |      // So just shift the new bits so that there is no gap in the middle.
  114|  2.85M|      cache |= bits << emptyBitsGap;
  115|  2.85M|    }
  116|  2.85M|    fillLevel += count;
  117|  2.85M|  }
_ZNK8rawspeed28BitStreamCacheRightInLeftOut4peekEi:
  119|  21.1M|  [[nodiscard]] auto peek(int count) const noexcept {
  120|  21.1M|    establishClassInvariants();
  121|  21.1M|    invariant(count >= 0);
  ------------------
  |  |   27|  21.1M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (121:5): [True: 21.1M, False: 21.6k]
  ------------------
  122|  21.1M|    invariant(count <= Size);
  ------------------
  |  |   27|  21.1M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (122:5): [True: 21.1M, False: 1]
  ------------------
  123|  21.1M|    invariant(count <= MaxGetBits);
  ------------------
  |  |   27|  21.1M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (123:5): [True: 21.1M, False: 18.4E]
  ------------------
  124|  21.1M|    invariant(count != 0);
  ------------------
  |  |   27|  21.1M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (124:5): [True: 21.1M, False: 0]
  ------------------
  125|  21.1M|    invariant(count <= fillLevel);
  ------------------
  |  |   27|  21.1M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (125:5): [True: 21.1M, False: 18.4E]
  ------------------
  126|  21.1M|    return implicit_cast<uint32_t>(
  127|  21.1M|        extractHighBits(cache, count,
  128|  21.1M|                        /*effectiveBitwidth=*/BitStreamCacheBase::Size));
  129|  21.1M|  }
_ZN8rawspeed28BitStreamCacheRightInLeftOut4skipEi:
  131|  21.3M|  void skip(int count) noexcept {
  132|  21.3M|    establishClassInvariants();
  133|  21.3M|    invariant(count >= 0);
  ------------------
  |  |   27|  21.3M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (133:5): [True: 21.3M, False: 1.26k]
  ------------------
  134|       |    // `count` *could* be larger than `MaxGetBits`.
  135|       |    // `count` could be zero.
  136|  21.3M|    invariant(count <= Size);
  ------------------
  |  |   27|  21.3M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (136:5): [True: 21.3M, False: 18.4E]
  ------------------
  137|  21.3M|    invariant(count <= fillLevel);
  ------------------
  |  |   27|  21.3M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (137:5): [True: 21.3M, False: 18.4E]
  ------------------
  138|  21.3M|    fillLevel -= count;
  139|  21.3M|    cache <<= count;
  140|  21.3M|  }
_ZNK8rawspeed18BitStreamCacheBase24establishClassInvariantsEv:
   54|   178M|BitStreamCacheBase::establishClassInvariants() const noexcept {
   55|   178M|  invariant(fillLevel >= 0);
  ------------------
  |  |   27|   178M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (55:3): [True: 178M, False: 18.4E]
  ------------------
   56|   178M|  invariant(fillLevel <= Size);
  ------------------
  |  |   27|   178M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (56:3): [True: 179M, False: 18.4E]
  ------------------
   57|   178M|}

_ZN8rawspeed11BitStreamerINS_14BitStreamerMSBENS_39BitStreamerForwardSequentialReplenisherIS1_EEEC2ENS_10Array1DRefIKSt4byteEE:
  192|  3.58k|  explicit BitStreamer(Array1DRef<const std::byte> input) : replenisher(input) {
  193|  3.58k|    establishClassInvariants();
  194|  3.58k|  }
_ZN8rawspeed26BitStreamerReplenisherBaseINS_14BitStreamerMSBEEC2ENS_10Array1DRefIKSt4byteEE:
   57|  3.58k|      : input(input_) {
   58|  3.58k|    if (input.size() < BitStreamerTraits<Tag>::MaxProcessBytes)
  ------------------
  |  Branch (58:9): [True: 70, False: 3.51k]
  ------------------
   59|  3.58k|      ThrowIOE("Bit stream size is smaller than MaxProcessBytes");
  ------------------
  |  |   37|     70|#define ThrowIOE(...) ThrowExceptionHelper(rawspeed::IOException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     70|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     70|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     70|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   60|  3.58k|  }
_ZNK8rawspeed11BitStreamerINS_14BitStreamerMSBENS_39BitStreamerForwardSequentialReplenisherIS1_EEE24establishClassInvariantsEv:
  185|  40.5M|  void establishClassInvariants() const noexcept {
  186|  40.5M|    cache.establishClassInvariants();
  187|  40.5M|    replenisher.establishClassInvariants();
  188|  40.5M|  }
_ZNK8rawspeed26BitStreamerReplenisherBaseINS_14BitStreamerMSBEE24establishClassInvariantsEv:
   65|  47.5M|BitStreamerReplenisherBase<Tag>::establishClassInvariants() const noexcept {
   66|  47.5M|  input.establishClassInvariants();
   67|  47.5M|  invariant(input.size() >= BitStreamerTraits<Tag>::MaxProcessBytes);
  ------------------
  |  |   27|  47.5M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (67:3): [True: 47.5M, False: 1]
  ------------------
   68|  47.5M|  invariant(pos >= 0);
  ------------------
  |  |   27|  47.5M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (68:3): [True: 47.5M, False: 0]
  ------------------
   69|  47.5M|  invariant(pos % StreamTraits::MinLoadStepByteMultiple == 0);
  ------------------
  |  |   27|  47.5M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (69:3): [True: 47.5M, False: 0]
  ------------------
   70|       |  // `pos` *could* be out-of-bounds of `input`.
   71|  47.5M|}
_ZN8rawspeed11BitStreamerINS_14BitStreamerMSBENS_39BitStreamerForwardSequentialReplenisherIS1_EEE4fillEi:
  216|  7.61M|  void fill(int nbits = Cache::MaxGetBits) {
  217|  7.61M|    establishClassInvariants();
  218|  7.61M|    invariant(nbits >= 0);
  ------------------
  |  |   27|  7.61M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (218:5): [True: 7.61M, False: 0]
  ------------------
  219|  7.61M|    invariant(nbits != 0);
  ------------------
  |  |   27|  7.61M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (219:5): [True: 7.61M, False: 0]
  ------------------
  220|  7.61M|    invariant(nbits <= Cache::MaxGetBits);
  ------------------
  |  |   27|  7.61M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (220:5): [True: 7.61M, False: 0]
  ------------------
  221|       |
  222|  7.61M|    if (cache.fillLevel >= nbits)
  ------------------
  |  Branch (222:9): [True: 5.85M, False: 1.76M]
  ------------------
  223|  5.85M|      return;
  224|       |
  225|  1.76M|    const auto input = replenisher.getInput();
  226|  1.76M|    const auto numBytes = static_cast<Derived*>(this)->fillCache(input);
  227|  1.76M|    replenisher.markNumBytesAsConsumed(numBytes);
  228|       |    invariant(cache.fillLevel >= nbits);
  ------------------
  |  |   27|  1.76M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (228:5): [True: 1.75M, False: 257]
  ------------------
  229|  1.76M|  }
_ZN8rawspeed39BitStreamerForwardSequentialReplenisherINS_14BitStreamerMSBEE8getInputEv:
  100|  1.76M|  std::array<std::byte, BitStreamerTraits<Tag>::MaxProcessBytes> getInput() {
  101|  1.76M|    Base::establishClassInvariants();
  102|       |
  103|  1.76M|    std::array<std::byte, BitStreamerTraits<Tag>::MaxProcessBytes> tmpStorage;
  104|  1.76M|    auto tmp = Array1DRef<std::byte>(tmpStorage.data(),
  105|  1.76M|                                     implicit_cast<int>(tmpStorage.size()));
  106|       |
  107|       |    // Do we have BitStreamerTraits<Tag>::MaxProcessBytes or more bytes left in
  108|       |    // the input buffer? If so, then we can just read from said buffer.
  109|  1.76M|    if (getPos() + BitStreamerTraits<Tag>::MaxProcessBytes <=
  ------------------
  |  Branch (109:9): [True: 1.75M, False: 3.15k]
  ------------------
  110|  1.76M|        Base::input.size()) [[likely]] {
  111|  1.75M|      auto currInput =
  112|  1.75M|          Base::input.getCrop(getPos(), BitStreamerTraits<Tag>::MaxProcessBytes)
  113|  1.75M|              .getAsArray1DRef();
  114|  1.75M|      invariant(currInput.size() == tmp.size());
  ------------------
  |  |   27|  1.75M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (114:7): [True: 1.75M, False: 0]
  ------------------
  115|  1.75M|      memcpy(tmp.begin(), currInput.begin(),
  116|  1.75M|             BitStreamerTraits<Tag>::MaxProcessBytes);
  117|  1.75M|      return tmpStorage;
  118|  1.75M|    }
  119|       |
  120|       |    // We have to use intermediate buffer, either because the input is running
  121|       |    // out of bytes, or because we want to enforce bounds checking.
  122|       |
  123|       |    // Note that in order to keep all fill-level invariants we must allow to
  124|       |    // over-read past-the-end a bit.
  125|  3.15k|    if (getPos() > Base::input.size() +
  ------------------
  |  Branch (125:9): [True: 257, False: 2.90k]
  ------------------
  126|  3.15k|                       2 * BitStreamerTraits<Tag>::MaxProcessBytes) [[unlikely]]
  127|    257|      ThrowIOE("Buffer overflow read in BitStreamer");
  ------------------
  |  |   37|    257|#define ThrowIOE(...) ThrowExceptionHelper(rawspeed::IOException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|    257|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|    257|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|    257|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  128|       |
  129|  2.90k|    variableLengthLoadNaiveViaMemcpy(tmp, Base::input, getPos());
  130|       |
  131|  2.90k|    return tmpStorage;
  132|  3.15k|  }
_ZNK8rawspeed39BitStreamerForwardSequentialReplenisherINS_14BitStreamerMSBEE6getPosEv:
   84|  3.52M|  [[nodiscard]] typename Base::size_type getPos() const {
   85|  3.52M|    Base::establishClassInvariants();
   86|  3.52M|    return Base::pos;
   87|  3.52M|  }
_ZN8rawspeed11BitStreamerINS_14BitStreamerMSBENS_39BitStreamerForwardSequentialReplenisherIS1_EEE9fillCacheENSt3__15arrayISt4byteLm4EEE:
  157|  1.75M|                inputStorage) {
  158|  1.75M|    static_assert(BitStreamCacheBase::MaxGetBits >= 32, "check implementation");
  159|  1.75M|    establishClassInvariants();
  160|  1.75M|    auto input = Array1DRef<std::byte>(inputStorage.data(),
  161|  1.75M|                                       implicit_cast<int>(inputStorage.size()));
  162|  1.75M|    invariant(input.size() == Traits::MaxProcessBytes);
  ------------------
  |  |   27|  1.75M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (162:5): [True: 1.75M, False: 0]
  ------------------
  163|       |
  164|  1.75M|    constexpr int StreamChunkBitwidth =
  165|  1.75M|        bitwidth<typename StreamTraits::ChunkType>();
  166|  1.75M|    static_assert(CHAR_BIT * Traits::MaxProcessBytes >= StreamChunkBitwidth);
  167|  1.75M|    static_assert(CHAR_BIT * Traits::MaxProcessBytes % StreamChunkBitwidth ==
  168|  1.75M|                  0);
  169|  1.75M|    constexpr int NumChunksNeeded =
  170|  1.75M|        (CHAR_BIT * Traits::MaxProcessBytes) / StreamChunkBitwidth;
  171|  1.75M|    static_assert(NumChunksNeeded >= 1);
  172|       |
  173|  3.51M|    for (int i = 0; i != NumChunksNeeded; ++i) {
  ------------------
  |  Branch (173:21): [True: 1.75M, False: 1.75M]
  ------------------
  174|  1.75M|      auto chunkInput =
  175|  1.75M|          input.getBlock(sizeof(typename StreamTraits::ChunkType), i);
  176|  1.75M|      auto chunk = getByteSwapped<typename StreamTraits::ChunkType>(
  177|  1.75M|          chunkInput.begin(),
  178|  1.75M|          StreamTraits::ChunkEndianness != getHostEndianness());
  179|  1.75M|      cache.push(chunk, StreamChunkBitwidth);
  180|  1.75M|    }
  181|  1.75M|    return Traits::MaxProcessBytes;
  182|  1.75M|  }
_ZN8rawspeed39BitStreamerForwardSequentialReplenisherINS_14BitStreamerMSBEE22markNumBytesAsConsumedEi:
   92|  1.75M|  void markNumBytesAsConsumed(typename Base::size_type numBytes) {
   93|  1.75M|    Base::establishClassInvariants();
   94|  1.75M|    invariant(numBytes >= 0);
  ------------------
  |  |   27|  1.75M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (94:5): [True: 1.75M, False: 0]
  ------------------
   95|  1.75M|    invariant(numBytes != 0);
  ------------------
  |  |   27|  1.75M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (95:5): [True: 1.75M, False: 0]
  ------------------
   96|  1.75M|    invariant(numBytes % StreamTraits::MinLoadStepByteMultiple == 0);
  ------------------
  |  |   27|  1.75M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (96:5): [True: 1.75M, False: 0]
  ------------------
   97|  1.75M|    Base::pos += numBytes;
   98|  1.75M|  }
_ZN8rawspeed11BitStreamerINS_14BitStreamerMSBENS_39BitStreamerForwardSequentialReplenisherIS1_EEE13getBitsNoFillEi:
  269|  7.01M|  uint32_t getBitsNoFill(int nbits) {
  270|  7.01M|    establishClassInvariants();
  271|  7.01M|    invariant(nbits >= 0);
  ------------------
  |  |   27|  7.01M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (271:5): [True: 7.01M, False: 0]
  ------------------
  272|  7.01M|    invariant(nbits != 0);
  ------------------
  |  |   27|  7.01M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (272:5): [True: 7.01M, False: 0]
  ------------------
  273|  7.01M|    invariant(nbits <= Cache::MaxGetBits);
  ------------------
  |  |   27|  7.01M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (273:5): [True: 7.01M, False: 0]
  ------------------
  274|  7.01M|    uint32_t ret = peekBitsNoFill(nbits);
  275|  7.01M|    skipBitsNoFill(nbits);
  276|  7.01M|    return ret;
  277|  7.01M|  }
_ZN8rawspeed11BitStreamerINS_14BitStreamerMSBENS_39BitStreamerForwardSequentialReplenisherIS1_EEE14peekBitsNoFillEi:
  253|  9.65M|  uint32_t RAWSPEED_READONLY peekBitsNoFill(int nbits) {
  254|  9.65M|    establishClassInvariants();
  255|  9.65M|    invariant(nbits >= 0);
  ------------------
  |  |   27|  9.65M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (255:5): [True: 9.65M, False: 0]
  ------------------
  256|  9.65M|    invariant(nbits != 0);
  ------------------
  |  |   27|  9.65M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (256:5): [True: 9.65M, False: 0]
  ------------------
  257|  9.65M|    invariant(nbits <= Cache::MaxGetBits);
  ------------------
  |  |   27|  9.65M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (257:5): [True: 9.65M, False: 0]
  ------------------
  258|  9.65M|    return cache.peek(nbits);
  259|  9.65M|  }
_ZN8rawspeed11BitStreamerINS_14BitStreamerMSBENS_39BitStreamerForwardSequentialReplenisherIS1_EEE14skipBitsNoFillEi:
  261|  9.89M|  void skipBitsNoFill(int nbits) {
  262|  9.89M|    establishClassInvariants();
  263|  9.89M|    invariant(nbits >= 0);
  ------------------
  |  |   27|  9.89M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (263:5): [True: 9.89M, False: 0]
  ------------------
  264|       |    // `nbits` could be zero.
  265|  9.89M|    invariant(nbits <= Cache::MaxGetBits);
  ------------------
  |  |   27|  9.89M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (265:5): [True: 9.89M, False: 0]
  ------------------
  266|  9.89M|    cache.skip(nbits);
  267|  9.89M|  }
_ZN8rawspeed11BitStreamerINS_14BitStreamerMSBENS_39BitStreamerForwardSequentialReplenisherIS1_EEE7getBitsEi:
  294|  4.40M|  uint32_t getBits(int nbits) {
  295|  4.40M|    establishClassInvariants();
  296|  4.40M|    invariant(nbits >= 0);
  ------------------
  |  |   27|  4.40M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (296:5): [True: 4.40M, False: 0]
  ------------------
  297|  4.40M|    invariant(nbits != 0);
  ------------------
  |  |   27|  4.40M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (297:5): [True: 4.40M, False: 0]
  ------------------
  298|  4.40M|    invariant(nbits <= Cache::MaxGetBits);
  ------------------
  |  |   27|  4.40M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (298:5): [True: 4.40M, False: 0]
  ------------------
  299|  4.40M|    fill(nbits);
  300|  4.40M|    return getBitsNoFill(nbits);
  301|  4.40M|  }
_ZN8rawspeed11BitStreamerINS_14BitStreamerMSBENS_39BitStreamerForwardSequentialReplenisherIS1_EEE9skipBytesEi:
  321|   104k|  void skipBytes(int nbytes) {
  322|   104k|    establishClassInvariants();
  323|   104k|    int nbits = 8 * nbytes;
  324|   104k|    skipManyBits(nbits);
  325|   104k|  }
_ZN8rawspeed11BitStreamerINS_14BitStreamerMSBENS_39BitStreamerForwardSequentialReplenisherIS1_EEE12skipManyBitsEi:
  305|   104k|  void skipManyBits(int nbits) {
  306|   104k|    establishClassInvariants();
  307|   104k|    int remainingBitsToSkip = nbits;
  308|   505k|    for (; remainingBitsToSkip >= Cache::MaxGetBits;
  ------------------
  |  Branch (308:12): [True: 400k, False: 104k]
  ------------------
  309|   400k|         remainingBitsToSkip -= Cache::MaxGetBits) {
  310|   400k|      fill(Cache::MaxGetBits);
  311|   400k|      skipBitsNoFill(Cache::MaxGetBits);
  312|   400k|    }
  313|   104k|    if (remainingBitsToSkip > 0) {
  ------------------
  |  Branch (313:9): [True: 426, False: 104k]
  ------------------
  314|    426|      fill(remainingBitsToSkip);
  315|    426|      skipBitsNoFill(remainingBitsToSkip);
  316|    426|    }
  317|   104k|  }
_ZN8rawspeed11BitStreamerINS_14BitStreamerLSBENS_39BitStreamerForwardSequentialReplenisherIS1_EEEC2ENS_10Array1DRefIKSt4byteEE:
  192|   397k|  explicit BitStreamer(Array1DRef<const std::byte> input) : replenisher(input) {
  193|   397k|    establishClassInvariants();
  194|   397k|  }
_ZN8rawspeed26BitStreamerReplenisherBaseINS_14BitStreamerLSBEEC2ENS_10Array1DRefIKSt4byteEE:
   57|   397k|      : input(input_) {
   58|   397k|    if (input.size() < BitStreamerTraits<Tag>::MaxProcessBytes)
  ------------------
  |  Branch (58:9): [True: 29, False: 397k]
  ------------------
   59|   397k|      ThrowIOE("Bit stream size is smaller than MaxProcessBytes");
  ------------------
  |  |   37|     29|#define ThrowIOE(...) ThrowExceptionHelper(rawspeed::IOException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     29|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     29|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     29|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   60|   397k|  }
_ZNK8rawspeed11BitStreamerINS_14BitStreamerLSBENS_39BitStreamerForwardSequentialReplenisherIS1_EEE24establishClassInvariantsEv:
  185|  41.5M|  void establishClassInvariants() const noexcept {
  186|  41.5M|    cache.establishClassInvariants();
  187|  41.5M|    replenisher.establishClassInvariants();
  188|  41.5M|  }
_ZNK8rawspeed26BitStreamerReplenisherBaseINS_14BitStreamerLSBEE24establishClassInvariantsEv:
   65|  50.9M|BitStreamerReplenisherBase<Tag>::establishClassInvariants() const noexcept {
   66|  50.9M|  input.establishClassInvariants();
   67|  50.9M|  invariant(input.size() >= BitStreamerTraits<Tag>::MaxProcessBytes);
  ------------------
  |  |   27|  50.9M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (67:3): [True: 48.7M, False: 2.15M]
  ------------------
   68|  48.7M|  invariant(pos >= 0);
  ------------------
  |  |   27|  48.7M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (68:3): [True: 29.5M, False: 19.1M]
  ------------------
   69|  29.5M|  invariant(pos % StreamTraits::MinLoadStepByteMultiple == 0);
  ------------------
  |  |   27|  29.5M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (69:3): [True: 28.8M, False: 750k]
  ------------------
   70|       |  // `pos` *could* be out-of-bounds of `input`.
   71|  29.5M|}
_ZN8rawspeed11BitStreamerINS_14BitStreamerLSBENS_39BitStreamerForwardSequentialReplenisherIS1_EEE7getBitsEi:
  294|  4.93M|  uint32_t getBits(int nbits) {
  295|  4.93M|    establishClassInvariants();
  296|  4.93M|    invariant(nbits >= 0);
  ------------------
  |  |   27|  4.93M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (296:5): [True: 4.65M, False: 278k]
  ------------------
  297|  4.65M|    invariant(nbits != 0);
  ------------------
  |  |   27|  4.65M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (297:5): [True: 4.65M, False: 18.4E]
  ------------------
  298|  4.65M|    invariant(nbits <= Cache::MaxGetBits);
  ------------------
  |  |   27|  4.65M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (298:5): [True: 4.87M, False: 18.4E]
  ------------------
  299|  4.87M|    fill(nbits);
  300|  4.87M|    return getBitsNoFill(nbits);
  301|  4.65M|  }
_ZN8rawspeed11BitStreamerINS_14BitStreamerLSBENS_39BitStreamerForwardSequentialReplenisherIS1_EEE4fillEi:
  216|  7.47M|  void fill(int nbits = Cache::MaxGetBits) {
  217|  7.47M|    establishClassInvariants();
  218|  7.47M|    invariant(nbits >= 0);
  ------------------
  |  |   27|  7.47M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (218:5): [True: 7.51M, False: 18.4E]
  ------------------
  219|  7.51M|    invariant(nbits != 0);
  ------------------
  |  |   27|  7.51M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (219:5): [True: 7.53M, False: 18.4E]
  ------------------
  220|  7.53M|    invariant(nbits <= Cache::MaxGetBits);
  ------------------
  |  |   27|  7.53M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (220:5): [True: 7.54M, False: 18.4E]
  ------------------
  221|       |
  222|  7.54M|    if (cache.fillLevel >= nbits)
  ------------------
  |  Branch (222:9): [True: 3.51M, False: 4.03M]
  ------------------
  223|  3.51M|      return;
  224|       |
  225|  4.03M|    const auto input = replenisher.getInput();
  226|  4.03M|    const auto numBytes = static_cast<Derived*>(this)->fillCache(input);
  227|  4.03M|    replenisher.markNumBytesAsConsumed(numBytes);
  228|       |    invariant(cache.fillLevel >= nbits);
  ------------------
  |  |   27|  4.03M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (228:5): [True: 4.18M, False: 18.4E]
  ------------------
  229|  4.03M|  }
_ZN8rawspeed39BitStreamerForwardSequentialReplenisherINS_14BitStreamerLSBEE8getInputEv:
  100|  4.28M|  std::array<std::byte, BitStreamerTraits<Tag>::MaxProcessBytes> getInput() {
  101|  4.28M|    Base::establishClassInvariants();
  102|       |
  103|  4.28M|    std::array<std::byte, BitStreamerTraits<Tag>::MaxProcessBytes> tmpStorage;
  104|  4.28M|    auto tmp = Array1DRef<std::byte>(tmpStorage.data(),
  105|  4.28M|                                     implicit_cast<int>(tmpStorage.size()));
  106|       |
  107|       |    // Do we have BitStreamerTraits<Tag>::MaxProcessBytes or more bytes left in
  108|       |    // the input buffer? If so, then we can just read from said buffer.
  109|  4.28M|    if (getPos() + BitStreamerTraits<Tag>::MaxProcessBytes <=
  ------------------
  |  Branch (109:9): [True: 4.29M, False: 18.4E]
  ------------------
  110|  4.29M|        Base::input.size()) [[likely]] {
  111|  4.29M|      auto currInput =
  112|  4.29M|          Base::input.getCrop(getPos(), BitStreamerTraits<Tag>::MaxProcessBytes)
  113|  4.29M|              .getAsArray1DRef();
  114|  4.29M|      invariant(currInput.size() == tmp.size());
  ------------------
  |  |   27|  4.29M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (114:7): [True: 4.10M, False: 189k]
  ------------------
  115|  4.10M|      memcpy(tmp.begin(), currInput.begin(),
  116|  4.10M|             BitStreamerTraits<Tag>::MaxProcessBytes);
  117|  4.10M|      return tmpStorage;
  118|  4.29M|    }
  119|       |
  120|       |    // We have to use intermediate buffer, either because the input is running
  121|       |    // out of bytes, or because we want to enforce bounds checking.
  122|       |
  123|       |    // Note that in order to keep all fill-level invariants we must allow to
  124|       |    // over-read past-the-end a bit.
  125|  18.4E|    if (getPos() > Base::input.size() +
  ------------------
  |  Branch (125:9): [True: 0, False: 18.4E]
  ------------------
  126|  18.4E|                       2 * BitStreamerTraits<Tag>::MaxProcessBytes) [[unlikely]]
  127|      0|      ThrowIOE("Buffer overflow read in BitStreamer");
  ------------------
  |  |   37|      0|#define ThrowIOE(...) ThrowExceptionHelper(rawspeed::IOException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  128|       |
  129|  18.4E|    variableLengthLoadNaiveViaMemcpy(tmp, Base::input, getPos());
  130|       |
  131|  18.4E|    return tmpStorage;
  132|  18.4E|  }
_ZNK8rawspeed39BitStreamerForwardSequentialReplenisherINS_14BitStreamerLSBEE6getPosEv:
   84|  8.13M|  [[nodiscard]] typename Base::size_type getPos() const {
   85|  8.13M|    Base::establishClassInvariants();
   86|  8.13M|    return Base::pos;
   87|  8.13M|  }
_ZN8rawspeed11BitStreamerINS_14BitStreamerLSBENS_39BitStreamerForwardSequentialReplenisherIS1_EEE9fillCacheENSt3__15arrayISt4byteLm4EEE:
  157|  4.13M|                inputStorage) {
  158|  4.13M|    static_assert(BitStreamCacheBase::MaxGetBits >= 32, "check implementation");
  159|  4.13M|    establishClassInvariants();
  160|  4.13M|    auto input = Array1DRef<std::byte>(inputStorage.data(),
  161|  4.13M|                                       implicit_cast<int>(inputStorage.size()));
  162|  4.13M|    invariant(input.size() == Traits::MaxProcessBytes);
  ------------------
  |  |   27|  4.13M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (162:5): [True: 4.20M, False: 18.4E]
  ------------------
  163|       |
  164|  4.20M|    constexpr int StreamChunkBitwidth =
  165|  4.20M|        bitwidth<typename StreamTraits::ChunkType>();
  166|  4.20M|    static_assert(CHAR_BIT * Traits::MaxProcessBytes >= StreamChunkBitwidth);
  167|  4.20M|    static_assert(CHAR_BIT * Traits::MaxProcessBytes % StreamChunkBitwidth ==
  168|  4.20M|                  0);
  169|  4.20M|    constexpr int NumChunksNeeded =
  170|  4.20M|        (CHAR_BIT * Traits::MaxProcessBytes) / StreamChunkBitwidth;
  171|  4.20M|    static_assert(NumChunksNeeded >= 1);
  172|       |
  173|  8.41M|    for (int i = 0; i != NumChunksNeeded; ++i) {
  ------------------
  |  Branch (173:21): [True: 4.20M, False: 4.20M]
  ------------------
  174|  4.20M|      auto chunkInput =
  175|  4.20M|          input.getBlock(sizeof(typename StreamTraits::ChunkType), i);
  176|  4.20M|      auto chunk = getByteSwapped<typename StreamTraits::ChunkType>(
  177|  4.20M|          chunkInput.begin(),
  178|  4.20M|          StreamTraits::ChunkEndianness != getHostEndianness());
  179|  4.20M|      cache.push(chunk, StreamChunkBitwidth);
  180|  4.20M|    }
  181|  4.20M|    return Traits::MaxProcessBytes;
  182|  4.13M|  }
_ZN8rawspeed39BitStreamerForwardSequentialReplenisherINS_14BitStreamerLSBEE22markNumBytesAsConsumedEi:
   92|  4.21M|  void markNumBytesAsConsumed(typename Base::size_type numBytes) {
   93|  4.21M|    Base::establishClassInvariants();
   94|  4.21M|    invariant(numBytes >= 0);
  ------------------
  |  |   27|  4.21M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (94:5): [True: 4.15M, False: 55.7k]
  ------------------
   95|  4.15M|    invariant(numBytes != 0);
  ------------------
  |  |   27|  4.15M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (95:5): [True: 4.17M, False: 18.4E]
  ------------------
   96|  4.17M|    invariant(numBytes % StreamTraits::MinLoadStepByteMultiple == 0);
  ------------------
  |  |   27|  4.17M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (96:5): [True: 4.17M, False: 0]
  ------------------
   97|  4.17M|    Base::pos += numBytes;
   98|  4.17M|  }
_ZN8rawspeed11BitStreamerINS_14BitStreamerLSBENS_39BitStreamerForwardSequentialReplenisherIS1_EEE13getBitsNoFillEi:
  269|  10.1M|  uint32_t getBitsNoFill(int nbits) {
  270|  10.1M|    establishClassInvariants();
  271|  10.1M|    invariant(nbits >= 0);
  ------------------
  |  |   27|  10.1M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (271:5): [True: 9.82M, False: 363k]
  ------------------
  272|  9.82M|    invariant(nbits != 0);
  ------------------
  |  |   27|  9.82M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (272:5): [True: 9.84M, False: 18.4E]
  ------------------
  273|  9.84M|    invariant(nbits <= Cache::MaxGetBits);
  ------------------
  |  |   27|  9.84M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (273:5): [True: 10.1M, False: 18.4E]
  ------------------
  274|  10.1M|    uint32_t ret = peekBitsNoFill(nbits);
  275|  10.1M|    skipBitsNoFill(nbits);
  276|  10.1M|    return ret;
  277|  9.84M|  }
_ZN8rawspeed11BitStreamerINS_14BitStreamerLSBENS_39BitStreamerForwardSequentialReplenisherIS1_EEE14peekBitsNoFillEi:
  253|  10.1M|  uint32_t RAWSPEED_READONLY peekBitsNoFill(int nbits) {
  254|  10.1M|    establishClassInvariants();
  255|  10.1M|    invariant(nbits >= 0);
  ------------------
  |  |   27|  10.1M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (255:5): [True: 9.84M, False: 314k]
  ------------------
  256|  9.84M|    invariant(nbits != 0);
  ------------------
  |  |   27|  9.84M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (256:5): [True: 9.85M, False: 18.4E]
  ------------------
  257|  9.85M|    invariant(nbits <= Cache::MaxGetBits);
  ------------------
  |  |   27|  9.85M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (257:5): [True: 10.1M, False: 18.4E]
  ------------------
  258|  10.1M|    return cache.peek(nbits);
  259|  9.85M|  }
_ZN8rawspeed11BitStreamerINS_14BitStreamerLSBENS_39BitStreamerForwardSequentialReplenisherIS1_EEE14skipBitsNoFillEi:
  261|  10.9M|  void skipBitsNoFill(int nbits) {
  262|  10.9M|    establishClassInvariants();
  263|  10.9M|    invariant(nbits >= 0);
  ------------------
  |  |   27|  10.9M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (263:5): [True: 10.2M, False: 757k]
  ------------------
  264|       |    // `nbits` could be zero.
  265|  10.2M|    invariant(nbits <= Cache::MaxGetBits);
  ------------------
  |  |   27|  10.2M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (265:5): [True: 10.2M, False: 18.4E]
  ------------------
  266|  10.2M|    cache.skip(nbits);
  267|  10.2M|  }
_ZN8rawspeed11BitStreamerINS_14BitStreamerLSBENS_39BitStreamerForwardSequentialReplenisherIS1_EEE9skipBytesEi:
  321|  23.3k|  void skipBytes(int nbytes) {
  322|  23.3k|    establishClassInvariants();
  323|  23.3k|    int nbits = 8 * nbytes;
  324|  23.3k|    skipManyBits(nbits);
  325|  23.3k|  }
_ZN8rawspeed11BitStreamerINS_14BitStreamerLSBENS_39BitStreamerForwardSequentialReplenisherIS1_EEE12skipManyBitsEi:
  305|  23.3k|  void skipManyBits(int nbits) {
  306|  23.3k|    establishClassInvariants();
  307|  23.3k|    int remainingBitsToSkip = nbits;
  308|   101k|    for (; remainingBitsToSkip >= Cache::MaxGetBits;
  ------------------
  |  Branch (308:12): [True: 78.3k, False: 23.3k]
  ------------------
  309|  78.3k|         remainingBitsToSkip -= Cache::MaxGetBits) {
  310|  78.3k|      fill(Cache::MaxGetBits);
  311|  78.3k|      skipBitsNoFill(Cache::MaxGetBits);
  312|  78.3k|    }
  313|  23.3k|    if (remainingBitsToSkip > 0) {
  ------------------
  |  Branch (313:9): [True: 878, False: 22.4k]
  ------------------
  314|    878|      fill(remainingBitsToSkip);
  315|    878|      skipBitsNoFill(remainingBitsToSkip);
  316|    878|    }
  317|  23.3k|  }
_ZN8rawspeed11BitStreamerINS_16BitStreamerMSB32ENS_39BitStreamerForwardSequentialReplenisherIS1_EEEC2ENS_10Array1DRefIKSt4byteEE:
  192|  11.3k|  explicit BitStreamer(Array1DRef<const std::byte> input) : replenisher(input) {
  193|  11.3k|    establishClassInvariants();
  194|  11.3k|  }
_ZN8rawspeed26BitStreamerReplenisherBaseINS_16BitStreamerMSB32EEC2ENS_10Array1DRefIKSt4byteEE:
   57|  11.3k|      : input(input_) {
   58|  11.3k|    if (input.size() < BitStreamerTraits<Tag>::MaxProcessBytes)
  ------------------
  |  Branch (58:9): [True: 230, False: 11.1k]
  ------------------
   59|  11.3k|      ThrowIOE("Bit stream size is smaller than MaxProcessBytes");
  ------------------
  |  |   37|    230|#define ThrowIOE(...) ThrowExceptionHelper(rawspeed::IOException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|    230|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|    230|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|    230|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   60|  11.3k|  }
_ZNK8rawspeed11BitStreamerINS_16BitStreamerMSB32ENS_39BitStreamerForwardSequentialReplenisherIS1_EEE24establishClassInvariantsEv:
  185|  3.08M|  void establishClassInvariants() const noexcept {
  186|  3.08M|    cache.establishClassInvariants();
  187|  3.08M|    replenisher.establishClassInvariants();
  188|  3.08M|  }
_ZNK8rawspeed26BitStreamerReplenisherBaseINS_16BitStreamerMSB32EE24establishClassInvariantsEv:
   65|  3.60M|BitStreamerReplenisherBase<Tag>::establishClassInvariants() const noexcept {
   66|  3.60M|  input.establishClassInvariants();
   67|  3.60M|  invariant(input.size() >= BitStreamerTraits<Tag>::MaxProcessBytes);
  ------------------
  |  |   27|  3.60M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (67:3): [True: 3.60M, False: 557]
  ------------------
   68|  3.60M|  invariant(pos >= 0);
  ------------------
  |  |   27|  3.60M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (68:3): [True: 3.60M, False: 18.4E]
  ------------------
   69|  3.60M|  invariant(pos % StreamTraits::MinLoadStepByteMultiple == 0);
  ------------------
  |  |   27|  3.60M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (69:3): [True: 3.60M, False: 18.4E]
  ------------------
   70|       |  // `pos` *could* be out-of-bounds of `input`.
   71|  3.60M|}
_ZN8rawspeed11BitStreamerINS_16BitStreamerMSB32ENS_39BitStreamerForwardSequentialReplenisherIS1_EEE7getBitsEi:
  294|   310k|  uint32_t getBits(int nbits) {
  295|   310k|    establishClassInvariants();
  296|   310k|    invariant(nbits >= 0);
  ------------------
  |  |   27|   310k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (296:5): [True: 310k, False: 0]
  ------------------
  297|   310k|    invariant(nbits != 0);
  ------------------
  |  |   27|   310k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (297:5): [True: 310k, False: 0]
  ------------------
  298|   310k|    invariant(nbits <= Cache::MaxGetBits);
  ------------------
  |  |   27|   310k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (298:5): [True: 310k, False: 0]
  ------------------
  299|   310k|    fill(nbits);
  300|   310k|    return getBitsNoFill(nbits);
  301|   310k|  }
_ZN8rawspeed11BitStreamerINS_16BitStreamerMSB32ENS_39BitStreamerForwardSequentialReplenisherIS1_EEE4fillEi:
  216|   524k|  void fill(int nbits = Cache::MaxGetBits) {
  217|   524k|    establishClassInvariants();
  218|   524k|    invariant(nbits >= 0);
  ------------------
  |  |   27|   524k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (218:5): [True: 524k, False: 18.4E]
  ------------------
  219|   524k|    invariant(nbits != 0);
  ------------------
  |  |   27|   524k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (219:5): [True: 524k, False: 18.4E]
  ------------------
  220|   524k|    invariant(nbits <= Cache::MaxGetBits);
  ------------------
  |  |   27|   524k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (220:5): [True: 524k, False: 0]
  ------------------
  221|       |
  222|   524k|    if (cache.fillLevel >= nbits)
  ------------------
  |  Branch (222:9): [True: 397k, False: 127k]
  ------------------
  223|   397k|      return;
  224|       |
  225|   127k|    const auto input = replenisher.getInput();
  226|   127k|    const auto numBytes = static_cast<Derived*>(this)->fillCache(input);
  227|   127k|    replenisher.markNumBytesAsConsumed(numBytes);
  228|       |    invariant(cache.fillLevel >= nbits);
  ------------------
  |  |   27|   127k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (228:5): [True: 126k, False: 475]
  ------------------
  229|   127k|  }
_ZN8rawspeed39BitStreamerForwardSequentialReplenisherINS_16BitStreamerMSB32EE8getInputEv:
  100|   127k|  std::array<std::byte, BitStreamerTraits<Tag>::MaxProcessBytes> getInput() {
  101|   127k|    Base::establishClassInvariants();
  102|       |
  103|   127k|    std::array<std::byte, BitStreamerTraits<Tag>::MaxProcessBytes> tmpStorage;
  104|   127k|    auto tmp = Array1DRef<std::byte>(tmpStorage.data(),
  105|   127k|                                     implicit_cast<int>(tmpStorage.size()));
  106|       |
  107|       |    // Do we have BitStreamerTraits<Tag>::MaxProcessBytes or more bytes left in
  108|       |    // the input buffer? If so, then we can just read from said buffer.
  109|   127k|    if (getPos() + BitStreamerTraits<Tag>::MaxProcessBytes <=
  ------------------
  |  Branch (109:9): [True: 124k, False: 2.67k]
  ------------------
  110|   127k|        Base::input.size()) [[likely]] {
  111|   124k|      auto currInput =
  112|   124k|          Base::input.getCrop(getPos(), BitStreamerTraits<Tag>::MaxProcessBytes)
  113|   124k|              .getAsArray1DRef();
  114|   124k|      invariant(currInput.size() == tmp.size());
  ------------------
  |  |   27|   124k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (114:7): [True: 124k, False: 87]
  ------------------
  115|   124k|      memcpy(tmp.begin(), currInput.begin(),
  116|   124k|             BitStreamerTraits<Tag>::MaxProcessBytes);
  117|   124k|      return tmpStorage;
  118|   124k|    }
  119|       |
  120|       |    // We have to use intermediate buffer, either because the input is running
  121|       |    // out of bytes, or because we want to enforce bounds checking.
  122|       |
  123|       |    // Note that in order to keep all fill-level invariants we must allow to
  124|       |    // over-read past-the-end a bit.
  125|  2.67k|    if (getPos() > Base::input.size() +
  ------------------
  |  Branch (125:9): [True: 400, False: 2.27k]
  ------------------
  126|  2.67k|                       2 * BitStreamerTraits<Tag>::MaxProcessBytes) [[unlikely]]
  127|    400|      ThrowIOE("Buffer overflow read in BitStreamer");
  ------------------
  |  |   37|    400|#define ThrowIOE(...) ThrowExceptionHelper(rawspeed::IOException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|    400|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|    400|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|    400|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  128|       |
  129|  2.27k|    variableLengthLoadNaiveViaMemcpy(tmp, Base::input, getPos());
  130|       |
  131|  2.27k|    return tmpStorage;
  132|  2.67k|  }
_ZNK8rawspeed39BitStreamerForwardSequentialReplenisherINS_16BitStreamerMSB32EE6getPosEv:
   84|   264k|  [[nodiscard]] typename Base::size_type getPos() const {
   85|   264k|    Base::establishClassInvariants();
   86|   264k|    return Base::pos;
   87|   264k|  }
_ZN8rawspeed11BitStreamerINS_16BitStreamerMSB32ENS_39BitStreamerForwardSequentialReplenisherIS1_EEE9fillCacheENSt3__15arrayISt4byteLm4EEE:
  157|   126k|                inputStorage) {
  158|   126k|    static_assert(BitStreamCacheBase::MaxGetBits >= 32, "check implementation");
  159|   126k|    establishClassInvariants();
  160|   126k|    auto input = Array1DRef<std::byte>(inputStorage.data(),
  161|   126k|                                       implicit_cast<int>(inputStorage.size()));
  162|   126k|    invariant(input.size() == Traits::MaxProcessBytes);
  ------------------
  |  |   27|   126k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (162:5): [True: 126k, False: 9]
  ------------------
  163|       |
  164|   126k|    constexpr int StreamChunkBitwidth =
  165|   126k|        bitwidth<typename StreamTraits::ChunkType>();
  166|   126k|    static_assert(CHAR_BIT * Traits::MaxProcessBytes >= StreamChunkBitwidth);
  167|   126k|    static_assert(CHAR_BIT * Traits::MaxProcessBytes % StreamChunkBitwidth ==
  168|   126k|                  0);
  169|   126k|    constexpr int NumChunksNeeded =
  170|   126k|        (CHAR_BIT * Traits::MaxProcessBytes) / StreamChunkBitwidth;
  171|   126k|    static_assert(NumChunksNeeded >= 1);
  172|       |
  173|   253k|    for (int i = 0; i != NumChunksNeeded; ++i) {
  ------------------
  |  Branch (173:21): [True: 126k, False: 126k]
  ------------------
  174|   126k|      auto chunkInput =
  175|   126k|          input.getBlock(sizeof(typename StreamTraits::ChunkType), i);
  176|   126k|      auto chunk = getByteSwapped<typename StreamTraits::ChunkType>(
  177|   126k|          chunkInput.begin(),
  178|   126k|          StreamTraits::ChunkEndianness != getHostEndianness());
  179|   126k|      cache.push(chunk, StreamChunkBitwidth);
  180|   126k|    }
  181|   126k|    return Traits::MaxProcessBytes;
  182|   126k|  }
_ZN8rawspeed39BitStreamerForwardSequentialReplenisherINS_16BitStreamerMSB32EE22markNumBytesAsConsumedEi:
   92|   126k|  void markNumBytesAsConsumed(typename Base::size_type numBytes) {
   93|   126k|    Base::establishClassInvariants();
   94|   126k|    invariant(numBytes >= 0);
  ------------------
  |  |   27|   126k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (94:5): [True: 126k, False: 8]
  ------------------
   95|   126k|    invariant(numBytes != 0);
  ------------------
  |  |   27|   126k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (95:5): [True: 126k, False: 18.4E]
  ------------------
   96|   126k|    invariant(numBytes % StreamTraits::MinLoadStepByteMultiple == 0);
  ------------------
  |  |   27|   126k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (96:5): [True: 126k, False: 18.4E]
  ------------------
   97|   126k|    Base::pos += numBytes;
   98|   126k|  }
_ZN8rawspeed11BitStreamerINS_16BitStreamerMSB32ENS_39BitStreamerForwardSequentialReplenisherIS1_EEE13getBitsNoFillEi:
  269|   686k|  uint32_t getBitsNoFill(int nbits) {
  270|   686k|    establishClassInvariants();
  271|   686k|    invariant(nbits >= 0);
  ------------------
  |  |   27|   686k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (271:5): [True: 686k, False: 18.4E]
  ------------------
  272|   686k|    invariant(nbits != 0);
  ------------------
  |  |   27|   686k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (272:5): [True: 686k, False: 1]
  ------------------
  273|   686k|    invariant(nbits <= Cache::MaxGetBits);
  ------------------
  |  |   27|   686k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (273:5): [True: 686k, False: 18.4E]
  ------------------
  274|   686k|    uint32_t ret = peekBitsNoFill(nbits);
  275|   686k|    skipBitsNoFill(nbits);
  276|   686k|    return ret;
  277|   686k|  }
_ZN8rawspeed11BitStreamerINS_16BitStreamerMSB32ENS_39BitStreamerForwardSequentialReplenisherIS1_EEE14peekBitsNoFillEi:
  253|   707k|  uint32_t RAWSPEED_READONLY peekBitsNoFill(int nbits) {
  254|   707k|    establishClassInvariants();
  255|   707k|    invariant(nbits >= 0);
  ------------------
  |  |   27|   707k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (255:5): [True: 707k, False: 18.4E]
  ------------------
  256|   707k|    invariant(nbits != 0);
  ------------------
  |  |   27|   707k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (256:5): [True: 707k, False: 18.4E]
  ------------------
  257|   707k|    invariant(nbits <= Cache::MaxGetBits);
  ------------------
  |  |   27|   707k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (257:5): [True: 707k, False: 18.4E]
  ------------------
  258|   707k|    return cache.peek(nbits);
  259|   707k|  }
_ZN8rawspeed11BitStreamerINS_16BitStreamerMSB32ENS_39BitStreamerForwardSequentialReplenisherIS1_EEE14skipBitsNoFillEi:
  261|   708k|  void skipBitsNoFill(int nbits) {
  262|   708k|    establishClassInvariants();
  263|   708k|    invariant(nbits >= 0);
  ------------------
  |  |   27|   708k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (263:5): [True: 708k, False: 35]
  ------------------
  264|       |    // `nbits` could be zero.
  265|   708k|    invariant(nbits <= Cache::MaxGetBits);
  ------------------
  |  |   27|   708k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (265:5): [True: 708k, False: 0]
  ------------------
  266|   708k|    cache.skip(nbits);
  267|   708k|  }
_ZN8rawspeed11BitStreamerINS_16BitStreamerMSB32ENS_39BitStreamerForwardSequentialReplenisherIS1_EEE9skipBytesEi:
  321|     38|  void skipBytes(int nbytes) {
  322|     38|    establishClassInvariants();
  323|     38|    int nbits = 8 * nbytes;
  324|     38|    skipManyBits(nbits);
  325|     38|  }
_ZN8rawspeed11BitStreamerINS_16BitStreamerMSB32ENS_39BitStreamerForwardSequentialReplenisherIS1_EEE12skipManyBitsEi:
  305|     38|  void skipManyBits(int nbits) {
  306|     38|    establishClassInvariants();
  307|     38|    int remainingBitsToSkip = nbits;
  308|     38|    for (; remainingBitsToSkip >= Cache::MaxGetBits;
  ------------------
  |  Branch (308:12): [True: 0, False: 38]
  ------------------
  309|     38|         remainingBitsToSkip -= Cache::MaxGetBits) {
  310|      0|      fill(Cache::MaxGetBits);
  311|      0|      skipBitsNoFill(Cache::MaxGetBits);
  312|      0|    }
  313|     38|    if (remainingBitsToSkip > 0) {
  ------------------
  |  Branch (313:9): [True: 0, False: 38]
  ------------------
  314|      0|      fill(remainingBitsToSkip);
  315|      0|      skipBitsNoFill(remainingBitsToSkip);
  316|      0|    }
  317|     38|  }
_ZN8rawspeed11BitStreamerINS_14BitStreamerLSBENS_39BitStreamerForwardSequentialReplenisherIS1_EEE8peekBitsEi:
  279|  18.1k|  uint32_t peekBits(int nbits) {
  280|  18.1k|    establishClassInvariants();
  281|  18.1k|    invariant(nbits >= 0);
  ------------------
  |  |   27|  18.1k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (281:5): [True: 17.6k, False: 526]
  ------------------
  282|  17.6k|    invariant(nbits != 0);
  ------------------
  |  |   27|  17.6k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (282:5): [True: 17.6k, False: 0]
  ------------------
  283|  17.6k|    invariant(nbits <= Cache::MaxGetBits);
  ------------------
  |  |   27|  17.6k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (283:5): [True: 18.1k, False: 18.4E]
  ------------------
  284|  18.1k|    fill(nbits);
  285|  18.1k|    return peekBitsNoFill(nbits);
  286|  17.6k|  }
_ZNK8rawspeed11BitStreamerINS_15BitStreamerJPEGENS_39BitStreamerForwardSequentialReplenisherIS1_EEE24establishClassInvariantsEv:
  185|  33.2M|  void establishClassInvariants() const noexcept {
  186|  33.2M|    cache.establishClassInvariants();
  187|  33.2M|    replenisher.establishClassInvariants();
  188|  33.2M|  }
_ZNK8rawspeed26BitStreamerReplenisherBaseINS_15BitStreamerJPEGEE24establishClassInvariantsEv:
   65|  37.0M|BitStreamerReplenisherBase<Tag>::establishClassInvariants() const noexcept {
   66|  37.0M|  input.establishClassInvariants();
   67|  37.0M|  invariant(input.size() >= BitStreamerTraits<Tag>::MaxProcessBytes);
  ------------------
  |  |   27|  37.0M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (67:3): [True: 37.0M, False: 6.30k]
  ------------------
   68|  37.0M|  invariant(pos >= 0);
  ------------------
  |  |   27|  37.0M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (68:3): [True: 37.0M, False: 13.2k]
  ------------------
   69|  37.0M|  invariant(pos % StreamTraits::MinLoadStepByteMultiple == 0);
  ------------------
  |  |   27|  37.0M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (69:3): [True: 37.0M, False: 0]
  ------------------
   70|       |  // `pos` *could* be out-of-bounds of `input`.
   71|  37.0M|}
_ZNK8rawspeed11BitStreamerINS_15BitStreamerJPEGENS_39BitStreamerForwardSequentialReplenisherIS1_EEE16getInputPositionEv:
  232|    452|  [[nodiscard]] size_type RAWSPEED_READONLY getInputPosition() const {
  233|    452|    establishClassInvariants();
  234|    452|    return replenisher.getPos();
  235|    452|  }
_ZNK8rawspeed39BitStreamerForwardSequentialReplenisherINS_15BitStreamerJPEGEE6getPosEv:
   84|  1.91M|  [[nodiscard]] typename Base::size_type getPos() const {
   85|  1.91M|    Base::establishClassInvariants();
   86|  1.91M|    return Base::pos;
   87|  1.91M|  }
_ZNK8rawspeed11BitStreamerINS_15BitStreamerJPEGENS_39BitStreamerForwardSequentialReplenisherIS1_EEE16getRemainingSizeEv:
  243|    301|  [[nodiscard]] size_type getRemainingSize() const {
  244|    301|    establishClassInvariants();
  245|    301|    return replenisher.getRemainingSize();
  246|    301|  }
_ZNK8rawspeed39BitStreamerForwardSequentialReplenisherINS_15BitStreamerJPEGEE16getRemainingSizeEv:
   88|    301|  [[nodiscard]] typename Base::size_type getRemainingSize() const {
   89|    301|    Base::establishClassInvariants();
   90|    301|    return Base::input.size() - getPos();
   91|    301|  }
_ZN8rawspeed11BitStreamerINS_15BitStreamerJPEGENS_39BitStreamerForwardSequentialReplenisherIS1_EEEC2ENS_10Array1DRefIKSt4byteEE:
  192|    918|  explicit BitStreamer(Array1DRef<const std::byte> input) : replenisher(input) {
  193|    918|    establishClassInvariants();
  194|    918|  }
_ZN8rawspeed26BitStreamerReplenisherBaseINS_15BitStreamerJPEGEEC2ENS_10Array1DRefIKSt4byteEE:
   57|    918|      : input(input_) {
   58|    918|    if (input.size() < BitStreamerTraits<Tag>::MaxProcessBytes)
  ------------------
  |  Branch (58:9): [True: 49, False: 869]
  ------------------
   59|    918|      ThrowIOE("Bit stream size is smaller than MaxProcessBytes");
  ------------------
  |  |   37|     49|#define ThrowIOE(...) ThrowExceptionHelper(rawspeed::IOException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     49|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     49|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     49|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   60|    918|  }
_ZN8rawspeed11BitStreamerINS_15BitStreamerJPEGENS_39BitStreamerForwardSequentialReplenisherIS1_EEE4fillEi:
  216|  10.7M|  void fill(int nbits = Cache::MaxGetBits) {
  217|  10.7M|    establishClassInvariants();
  218|  10.7M|    invariant(nbits >= 0);
  ------------------
  |  |   27|  10.7M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (218:5): [True: 10.7M, False: 18.4E]
  ------------------
  219|  10.7M|    invariant(nbits != 0);
  ------------------
  |  |   27|  10.7M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (219:5): [True: 10.7M, False: 0]
  ------------------
  220|  10.7M|    invariant(nbits <= Cache::MaxGetBits);
  ------------------
  |  |   27|  10.7M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (220:5): [True: 10.7M, False: 18.4E]
  ------------------
  221|       |
  222|  10.7M|    if (cache.fillLevel >= nbits)
  ------------------
  |  Branch (222:9): [True: 9.79M, False: 955k]
  ------------------
  223|  9.79M|      return;
  224|       |
  225|   955k|    const auto input = replenisher.getInput();
  226|   955k|    const auto numBytes = static_cast<Derived*>(this)->fillCache(input);
  227|   955k|    replenisher.markNumBytesAsConsumed(numBytes);
  228|       |    invariant(cache.fillLevel >= nbits);
  ------------------
  |  |   27|   955k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (228:5): [True: 956k, False: 18.4E]
  ------------------
  229|   955k|  }
_ZN8rawspeed39BitStreamerForwardSequentialReplenisherINS_15BitStreamerJPEGEE8getInputEv:
  100|   956k|  std::array<std::byte, BitStreamerTraits<Tag>::MaxProcessBytes> getInput() {
  101|   956k|    Base::establishClassInvariants();
  102|       |
  103|   956k|    std::array<std::byte, BitStreamerTraits<Tag>::MaxProcessBytes> tmpStorage;
  104|   956k|    auto tmp = Array1DRef<std::byte>(tmpStorage.data(),
  105|   956k|                                     implicit_cast<int>(tmpStorage.size()));
  106|       |
  107|       |    // Do we have BitStreamerTraits<Tag>::MaxProcessBytes or more bytes left in
  108|       |    // the input buffer? If so, then we can just read from said buffer.
  109|   956k|    if (getPos() + BitStreamerTraits<Tag>::MaxProcessBytes <=
  ------------------
  |  Branch (109:9): [True: 953k, False: 3.05k]
  ------------------
  110|   956k|        Base::input.size()) [[likely]] {
  111|   953k|      auto currInput =
  112|   953k|          Base::input.getCrop(getPos(), BitStreamerTraits<Tag>::MaxProcessBytes)
  113|   953k|              .getAsArray1DRef();
  114|   953k|      invariant(currInput.size() == tmp.size());
  ------------------
  |  |   27|   953k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (114:7): [True: 953k, False: 11]
  ------------------
  115|   953k|      memcpy(tmp.begin(), currInput.begin(),
  116|   953k|             BitStreamerTraits<Tag>::MaxProcessBytes);
  117|   953k|      return tmpStorage;
  118|   953k|    }
  119|       |
  120|       |    // We have to use intermediate buffer, either because the input is running
  121|       |    // out of bytes, or because we want to enforce bounds checking.
  122|       |
  123|       |    // Note that in order to keep all fill-level invariants we must allow to
  124|       |    // over-read past-the-end a bit.
  125|  3.05k|    if (getPos() > Base::input.size() +
  ------------------
  |  Branch (125:9): [True: 436, False: 2.61k]
  ------------------
  126|  3.05k|                       2 * BitStreamerTraits<Tag>::MaxProcessBytes) [[unlikely]]
  127|    436|      ThrowIOE("Buffer overflow read in BitStreamer");
  ------------------
  |  |   37|    436|#define ThrowIOE(...) ThrowExceptionHelper(rawspeed::IOException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|    436|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|    436|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|    436|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  128|       |
  129|  2.61k|    variableLengthLoadNaiveViaMemcpy(tmp, Base::input, getPos());
  130|       |
  131|  2.61k|    return tmpStorage;
  132|  3.05k|  }
_ZN8rawspeed39BitStreamerForwardSequentialReplenisherINS_15BitStreamerJPEGEE22markNumBytesAsConsumedEi:
   92|   956k|  void markNumBytesAsConsumed(typename Base::size_type numBytes) {
   93|   956k|    Base::establishClassInvariants();
   94|   956k|    invariant(numBytes >= 0);
  ------------------
  |  |   27|   956k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (94:5): [True: 956k, False: 18.4E]
  ------------------
   95|   956k|    invariant(numBytes != 0);
  ------------------
  |  |   27|   956k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (95:5): [True: 956k, False: 18.4E]
  ------------------
   96|   956k|    invariant(numBytes % StreamTraits::MinLoadStepByteMultiple == 0);
  ------------------
  |  |   27|   956k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (96:5): [True: 956k, False: 2]
  ------------------
   97|   956k|    Base::pos += numBytes;
   98|   956k|  }
_ZN8rawspeed11BitStreamerINS_15BitStreamerJPEGENS_39BitStreamerForwardSequentialReplenisherIS1_EEE14peekBitsNoFillEi:
  253|  10.7M|  uint32_t RAWSPEED_READONLY peekBitsNoFill(int nbits) {
  254|  10.7M|    establishClassInvariants();
  255|  10.7M|    invariant(nbits >= 0);
  ------------------
  |  |   27|  10.7M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (255:5): [True: 10.7M, False: 18.4E]
  ------------------
  256|  10.7M|    invariant(nbits != 0);
  ------------------
  |  |   27|  10.7M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (256:5): [True: 10.7M, False: 6]
  ------------------
  257|  10.7M|    invariant(nbits <= Cache::MaxGetBits);
  ------------------
  |  |   27|  10.7M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (257:5): [True: 10.7M, False: 18.4E]
  ------------------
  258|  10.7M|    return cache.peek(nbits);
  259|  10.7M|  }
_ZN8rawspeed11BitStreamerINS_15BitStreamerJPEGENS_39BitStreamerForwardSequentialReplenisherIS1_EEE14skipBitsNoFillEi:
  261|  10.7M|  void skipBitsNoFill(int nbits) {
  262|  10.7M|    establishClassInvariants();
  263|  10.7M|    invariant(nbits >= 0);
  ------------------
  |  |   27|  10.7M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (263:5): [True: 10.7M, False: 18.4E]
  ------------------
  264|       |    // `nbits` could be zero.
  265|  10.7M|    invariant(nbits <= Cache::MaxGetBits);
  ------------------
  |  |   27|  10.7M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (265:5): [True: 10.7M, False: 18.4E]
  ------------------
  266|  10.7M|    cache.skip(nbits);
  267|  10.7M|  }
_ZN8rawspeed11BitStreamerINS_15BitStreamerJPEGENS_39BitStreamerForwardSequentialReplenisherIS1_EEE13getBitsNoFillEi:
  269|  20.3k|  uint32_t getBitsNoFill(int nbits) {
  270|  20.3k|    establishClassInvariants();
  271|  20.3k|    invariant(nbits >= 0);
  ------------------
  |  |   27|  20.3k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (271:5): [True: 20.3k, False: 0]
  ------------------
  272|  20.3k|    invariant(nbits != 0);
  ------------------
  |  |   27|  20.3k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (272:5): [True: 20.3k, False: 0]
  ------------------
  273|  20.3k|    invariant(nbits <= Cache::MaxGetBits);
  ------------------
  |  |   27|  20.3k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (273:5): [True: 20.3k, False: 0]
  ------------------
  274|  20.3k|    uint32_t ret = peekBitsNoFill(nbits);
  275|  20.3k|    skipBitsNoFill(nbits);
  276|  20.3k|    return ret;
  277|  20.3k|  }
_ZN8rawspeed11BitStreamerINS_14BitStreamerMSBENS_39BitStreamerForwardSequentialReplenisherIS1_EEE8peekBitsEi:
  279|    128|  uint32_t peekBits(int nbits) {
  280|    128|    establishClassInvariants();
  281|    128|    invariant(nbits >= 0);
  ------------------
  |  |   27|    128|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (281:5): [True: 128, False: 0]
  ------------------
  282|    128|    invariant(nbits != 0);
  ------------------
  |  |   27|    128|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (282:5): [True: 128, False: 0]
  ------------------
  283|    128|    invariant(nbits <= Cache::MaxGetBits);
  ------------------
  |  |   27|    128|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (283:5): [True: 128, False: 0]
  ------------------
  284|    128|    fill(nbits);
  285|    128|    return peekBitsNoFill(nbits);
  286|    128|  }
_ZNK8rawspeed11BitStreamerINS_14BitStreamerLSBENS_39BitStreamerForwardSequentialReplenisherIS1_EEE12getFillLevelEv:
  248|  8.29M|  [[nodiscard]] size_type RAWSPEED_READONLY getFillLevel() const {
  249|  8.29M|    establishClassInvariants();
  250|  8.29M|    return cache.fillLevel;
  251|  8.29M|  }
_ZNK8rawspeed11BitStreamerINS_16BitStreamerMSB32ENS_39BitStreamerForwardSequentialReplenisherIS1_EEE16getInputPositionEv:
  232|  7.82k|  [[nodiscard]] size_type RAWSPEED_READONLY getInputPosition() const {
  233|  7.82k|    establishClassInvariants();
  234|  7.82k|    return replenisher.getPos();
  235|  7.82k|  }
_ZNK8rawspeed11BitStreamerINS_16BitStreamerMSB32ENS_39BitStreamerForwardSequentialReplenisherIS1_EEE16getRemainingSizeEv:
  243|    189|  [[nodiscard]] size_type getRemainingSize() const {
  244|    189|    establishClassInvariants();
  245|    189|    return replenisher.getRemainingSize();
  246|    189|  }
_ZNK8rawspeed39BitStreamerForwardSequentialReplenisherINS_16BitStreamerMSB32EE16getRemainingSizeEv:
   88|    189|  [[nodiscard]] typename Base::size_type getRemainingSize() const {
   89|    189|    Base::establishClassInvariants();
   90|    189|    return Base::input.size() - getPos();
   91|    189|  }
_ZNK8rawspeed11BitStreamerINS_16BitStreamerMSB32ENS_39BitStreamerForwardSequentialReplenisherIS1_EEE17getStreamPositionEv:
  238|  7.42k|  [[nodiscard]] size_type getStreamPosition() const {
  239|  7.42k|    establishClassInvariants();
  240|  7.42k|    return getInputPosition() - (cache.fillLevel >> 3);
  241|  7.42k|  }

_ZN8rawspeed15BitStreamerJPEG9fillCacheENSt3__15arrayISt4byteLm8EEE:
  108|   956k|        inputStorage) {
  109|   956k|  static_assert(BitStreamCacheBase::MaxGetBits >= 32, "check implementation");
  110|   956k|  establishClassInvariants();
  111|   956k|  auto input = Array1DRef<std::byte>(inputStorage.data(),
  112|   956k|                                     implicit_cast<int>(inputStorage.size()));
  113|   956k|  invariant(input.size() == Traits::MaxProcessBytes);
  ------------------
  |  |   27|   956k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (113:3): [True: 956k, False: 2]
  ------------------
  114|       |
  115|   956k|  constexpr int StreamChunkBitwidth =
  116|   956k|      bitwidth<typename StreamTraits::ChunkType>();
  117|       |
  118|   956k|  auto speculativeOptimisticCache = cache;
  119|   956k|  auto speculativeOptimisticChunk =
  120|   956k|      getByteSwapped<typename StreamTraits::ChunkType>(
  121|   956k|          input.begin(), StreamTraits::ChunkEndianness != getHostEndianness());
  122|   956k|  speculativeOptimisticCache.push(speculativeOptimisticChunk,
  123|   956k|                                  StreamChunkBitwidth);
  124|       |
  125|       |  // short-cut path for the most common case (no FF marker in the next 4 bytes)
  126|       |  // this is slightly faster than the else-case alone.
  127|   956k|  if (std::accumulate(&input(0), &input(4), true, [](bool b, std::byte byte) {
  ------------------
  |  Branch (127:7): [True: 954k, False: 2.25k]
  ------------------
  128|   956k|        return b && (byte != std::byte{0xFF});
  129|   956k|      })) {
  130|   954k|    cache = speculativeOptimisticCache;
  131|   954k|    return 4;
  132|   954k|  }
  133|       |
  134|  2.25k|  size_type p = 0;
  135|  10.4k|  for (size_type i = 0; i < 4; ++i) {
  ------------------
  |  Branch (135:25): [True: 8.51k, False: 1.95k]
  ------------------
  136|  8.51k|    const int numBytesNeeded = 4 - i;
  137|       |
  138|       |    // Pre-execute most common case, where next byte is 'normal'/non-FF
  139|  8.51k|    const std::byte c0 = input(p + 0);
  140|  8.51k|    cache.push(std::to_integer<uint8_t>(c0), 8);
  141|  8.51k|    if (c0 != std::byte{0xFF}) {
  ------------------
  |  Branch (141:9): [True: 5.90k, False: 2.61k]
  ------------------
  142|  5.90k|      p += 1;
  143|  5.90k|      continue; // Got normal byte.
  144|  5.90k|    }
  145|       |
  146|       |    // Found FF -> pre-execute case of FF/00, which represents an FF data byte
  147|  2.61k|    const std::byte c1 = input(p + 1);
  148|  2.61k|    if (c1 == std::byte{0x00}) {
  ------------------
  |  Branch (148:9): [True: 2.30k, False: 301]
  ------------------
  149|       |      // Got FF/00, where 0x00 is a stuffing byte (that should be ignored),
  150|       |      // so 0xFF is a normal byte. All good.
  151|  2.30k|      p += 2;
  152|  2.30k|      continue;
  153|  2.30k|    }
  154|       |
  155|       |    // Found FF/xx with xx != 00. This is the end of stream marker.
  156|    301|    endOfStreamPos = getInputPosition() + p;
  157|       |
  158|       |    // That means we shouldn't have pushed last 8 bits (0xFF, from c0).
  159|       |    // We need to "unpush" them, and fill the vacant cache bits with zeros.
  160|       |
  161|       |    // First, recover the cache fill level.
  162|    301|    cache.fillLevel -= 8;
  163|       |    // Now, this code is incredibly underencapsulated, and the
  164|       |    // implementation details are leaking into here. Thus, we know that
  165|       |    // all the fillLevel bits in cache are all high bits. So to "unpush"
  166|       |    // the last 8 bits, and fill the vacant cache bits with zeros, we only
  167|       |    // need to keep the high fillLevel bits. So just create a mask with only
  168|       |    // high fillLevel bits set, and 'and' the cache with it.
  169|       |    // Caution, we know fillLevel won't be 64, but it may be 0,
  170|       |    // so pick the mask-creation idiom accordingly.
  171|    301|    cache.cache &= ~((~0ULL) >> cache.fillLevel);
  172|    301|    cache.fillLevel = 64;
  173|       |
  174|       |    // No further reading from this buffer shall happen. Do signal that by
  175|       |    // claiming that we have consumed all the remaining bytes of the buffer.
  176|       |
  177|    301|    p = getRemainingSize() + numBytesNeeded;
  178|    301|    invariant(p >= 6);
  ------------------
  |  |   27|    301|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (178:5): [True: 301, False: 0]
  ------------------
  179|    301|    break;
  180|    301|  }
  181|  2.25k|  invariant(p >= 5);
  ------------------
  |  |   27|  2.25k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (181:3): [True: 2.24k, False: 14]
  ------------------
  182|  2.24k|  return p;
  183|  2.25k|}
_ZNK8rawspeed15BitStreamerJPEG17getStreamPositionEv:
  185|    151|inline BitStreamerJPEG::size_type BitStreamerJPEG::getStreamPosition() const {
  186|       |  // The current number of bytes we consumed.
  187|       |  // When at the end of the stream pos, it points to the JPEG marker FF
  188|    151|  return endOfStreamPos.value_or(getInputPosition());
  189|    151|}
_ZN8rawspeed12PosOrUnknownIiEaSIiQsr3stdE7same_asITL0__T_EEERS1_S4_:
   52|    301|  PosOrUnknown& operator=(U newValue) {
   53|    301|    invariant(!has_value());
  ------------------
  |  |   27|    301|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (53:5): [True: 301, False: 0]
  ------------------
   54|    301|    val = newValue;
   55|    301|    invariant(has_value());
  ------------------
  |  |   27|    301|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (55:5): [True: 301, False: 0]
  ------------------
   56|    301|    return *this;
   57|    301|  }
_ZNK8rawspeed12PosOrUnknownIiE9has_valueEv:
   48|    753|  [[nodiscard]] bool has_value() const RAWSPEED_READONLY { return val >= 0; }
_ZNK8rawspeed12PosOrUnknownIiE8value_orIiQsr3stdE7same_asITL0__T_EEEiS4_:
   61|    151|  [[nodiscard]] T value_or(U fallback) const {
   62|    151|    if (has_value())
  ------------------
  |  Branch (62:9): [True: 70, False: 81]
  ------------------
   63|     70|      return val;
   64|     81|    return fallback;
   65|    151|  }
_ZN8rawspeed12PosOrUnknownIiEC2Ev:
   46|    869|  PosOrUnknown() = default;
_ZZN8rawspeed15BitStreamerJPEG9fillCacheENSt3__15arrayISt4byteLm8EEEENKUlbS3_E_clEbS3_:
  127|  3.82M|  if (std::accumulate(&input(0), &input(4), true, [](bool b, std::byte byte) {
  128|  3.82M|        return b && (byte != std::byte{0xFF});
  ------------------
  |  Branch (128:16): [True: 3.82M, False: 3.48k]
  |  Branch (128:21): [True: 3.81M, False: 2.24k]
  ------------------
  129|  3.82M|      })) {

_ZN8rawspeed18AbstractPrefixCodeINS_15BaselineCodeTagEEC2Ev:
  178|  2.26k|  AbstractPrefixCode() = default;
_ZN8rawspeed18AbstractPrefixCodeINS_15BaselineCodeTagEE10CodeSymbolC2Eth:
  151|  11.2k|        : code(code_), code_len(code_len_) {
  152|  11.2k|      assert(code_len > 0);
  ------------------
  |  Branch (152:7): [True: 11.2k, False: 0]
  ------------------
  153|  11.2k|      assert(code_len <= Traits::MaxCodeLenghtBits);
  ------------------
  |  Branch (153:7): [True: 11.2k, False: 0]
  ------------------
  154|  11.2k|      assert(code <= ((1U << code_len) - 1U));
  ------------------
  |  Branch (154:7): [True: 11.2k, False: 0]
  ------------------
  155|  11.2k|    }
_ZN8rawspeed18AbstractPrefixCodeINS_15BaselineCodeTagEEC2ENSt3__16vectorIhNS3_9allocatorIhEEEE:
  181|  2.05k|      : codeValues(std::move(codeValues_)) {
  182|  2.05k|    if (codeValues.empty())
  ------------------
  |  Branch (182:9): [True: 0, False: 2.05k]
  ------------------
  183|  2.05k|      ThrowRDE("Empty code alphabet?");
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  184|  2.05k|    assert(
  ------------------
  |  Branch (184:5): [True: 2.05k, False: 1]
  ------------------
  185|  2.05k|        all_of(codeValues.begin(), codeValues.end(),
  186|  2.05k|               [](const CodeValueTy& v) { return v <= Traits::MaxCodeValue; }));
  187|  2.05k|  }
_ZN8rawspeed18AbstractPrefixCodeINS_15BaselineCodeTagEE10CodeSymbol16HaveCommonPrefixERKS3_S5_:
  163|  50.5k|                                 const CodeSymbol& partial) {
  164|  50.5k|      assert(partial.code_len <= symbol.code_len);
  ------------------
  |  Branch (164:7): [True: 50.5k, False: 0]
  ------------------
  165|       |
  166|  50.5k|      const auto s0 = extractHighBits(symbol.code, partial.code_len,
  167|  50.5k|                                      /*effectiveBitwidth=*/symbol.code_len);
  168|  50.5k|      const auto s1 = partial.code;
  169|       |
  170|  50.5k|      return s0 == s1;
  171|  50.5k|    }

_ZN8rawspeed25AbstractPrefixCodeDecoderINS_15BaselineCodeTagEE6extendEjj:
   70|  1.62M|  static int RAWSPEED_READNONE extend(uint32_t diff, uint32_t len) {
   71|  1.62M|    invariant(len > 0);
  ------------------
  |  |   27|  1.62M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (71:5): [True: 1.62M, False: 0]
  ------------------
   72|  1.62M|    auto ret = static_cast<int32_t>(diff);
   73|  1.62M|    if ((diff & (1 << (len - 1))) == 0)
  ------------------
  |  Branch (73:9): [True: 590k, False: 1.03M]
  ------------------
   74|   590k|      ret -= (1 << len) - 1;
   75|  1.62M|    return ret;
   76|  1.62M|  }
_ZNK8rawspeed25AbstractPrefixCodeDecoderINS_15BaselineCodeTagEE13processSymbolINS_15BitStreamerJPEGELb1EEEiRT_NS_18AbstractPrefixCodeIS1_E10CodeSymbolEh:
   45|  16.3k|                    typename Traits::CodeValueTy codeValue) const {
   46|  16.3k|    invariant(symbol.code_len >= 0 &&
  ------------------
  |  |   27|  16.3k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (46:5): [True: 16.3k, False: 0]
  |  Branch (46:5): [True: 16.3k, False: 0]
  |  Branch (46:5): [True: 16.3k, False: 0]
  ------------------
   47|  16.3k|              symbol.code_len <= Traits::MaxCodeLenghtBits);
   48|       |
   49|       |    // If we were only looking for symbol's code value, then just return it.
   50|       |    if constexpr (!FULL_DECODE)
   51|       |      return codeValue;
   52|       |
   53|       |    // Else, treat it as the length of following difference
   54|       |    // that we need to read and extend.
   55|  16.3k|    int diff_l = codeValue;
   56|  16.3k|    invariant(diff_l >= 0 && diff_l <= 16);
  ------------------
  |  |   27|  16.3k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (56:5): [True: 16.3k, False: 0]
  |  Branch (56:5): [True: 16.3k, False: 0]
  |  Branch (56:5): [True: 16.3k, False: 0]
  ------------------
   57|       |
   58|  16.3k|    if (diff_l == 16) {
  ------------------
  |  Branch (58:9): [True: 3.32k, False: 13.0k]
  ------------------
   59|  3.32k|      if (Base::handleDNGBug16())
  ------------------
  |  Branch (59:11): [True: 1.85k, False: 1.47k]
  ------------------
   60|  1.85k|        bs.skipBitsNoFill(16);
   61|  3.32k|      return -32768;
   62|  3.32k|    }
   63|       |
   64|  13.0k|    invariant(symbol.code_len + diff_l <= 32);
  ------------------
  |  |   27|  13.0k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (64:5): [True: 13.0k, False: 0]
  ------------------
   65|  13.0k|    return diff_l ? extend(bs.getBitsNoFill(diff_l), diff_l) : 0;
  ------------------
  |  Branch (65:12): [True: 11.5k, False: 1.46k]
  ------------------
   66|  13.0k|  }
_ZNK8rawspeed25AbstractPrefixCodeDecoderINS_15BaselineCodeTagEE13processSymbolINS_14BitStreamerMSBELb1EEEiRT_NS_18AbstractPrefixCodeIS1_E10CodeSymbolEh:
   45|  29.9k|                    typename Traits::CodeValueTy codeValue) const {
   46|  29.9k|    invariant(symbol.code_len >= 0 &&
  ------------------
  |  |   27|  29.9k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (46:5): [True: 29.9k, False: 0]
  |  Branch (46:5): [True: 29.9k, False: 0]
  |  Branch (46:5): [True: 29.9k, False: 0]
  ------------------
   47|  29.9k|              symbol.code_len <= Traits::MaxCodeLenghtBits);
   48|       |
   49|       |    // If we were only looking for symbol's code value, then just return it.
   50|       |    if constexpr (!FULL_DECODE)
   51|       |      return codeValue;
   52|       |
   53|       |    // Else, treat it as the length of following difference
   54|       |    // that we need to read and extend.
   55|  29.9k|    int diff_l = codeValue;
   56|  29.9k|    invariant(diff_l >= 0 && diff_l <= 16);
  ------------------
  |  |   27|  29.9k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (56:5): [True: 29.9k, False: 0]
  |  Branch (56:5): [True: 29.9k, False: 0]
  |  Branch (56:5): [True: 29.9k, False: 0]
  ------------------
   57|       |
   58|  29.9k|    if (diff_l == 16) {
  ------------------
  |  Branch (58:9): [True: 0, False: 29.9k]
  ------------------
   59|      0|      if (Base::handleDNGBug16())
  ------------------
  |  Branch (59:11): [True: 0, False: 0]
  ------------------
   60|      0|        bs.skipBitsNoFill(16);
   61|      0|      return -32768;
   62|      0|    }
   63|       |
   64|  29.9k|    invariant(symbol.code_len + diff_l <= 32);
  ------------------
  |  |   27|  29.9k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (64:5): [True: 29.9k, False: 0]
  ------------------
   65|  29.9k|    return diff_l ? extend(bs.getBitsNoFill(diff_l), diff_l) : 0;
  ------------------
  |  Branch (65:12): [True: 29.8k, False: 69]
  ------------------
   66|  29.9k|  }
_ZNK8rawspeed25AbstractPrefixCodeDecoderINS_15BaselineCodeTagEE13processSymbolINS_16BitStreamerMSB32ELb0EEEiRT_NS_18AbstractPrefixCodeIS1_E10CodeSymbolEh:
   45|    580|                    typename Traits::CodeValueTy codeValue) const {
   46|    580|    invariant(symbol.code_len >= 0 &&
  ------------------
  |  |   27|    580|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (46:5): [True: 580, False: 0]
  |  Branch (46:5): [True: 580, False: 0]
  |  Branch (46:5): [True: 580, False: 0]
  ------------------
   47|    580|              symbol.code_len <= Traits::MaxCodeLenghtBits);
   48|       |
   49|       |    // If we were only looking for symbol's code value, then just return it.
   50|       |    if constexpr (!FULL_DECODE)
   51|    580|      return codeValue;
   52|       |
   53|       |    // Else, treat it as the length of following difference
   54|       |    // that we need to read and extend.
   55|      0|    int diff_l = codeValue;
   56|    580|    invariant(diff_l >= 0 && diff_l <= 16);
  ------------------
  |  |   27|    580|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (56:5): [True: 0, False: 580]
  |  Branch (56:5): [True: 0, False: 0]
  |  Branch (56:5): [True: 0, False: 580]
  ------------------
   57|       |
   58|      0|    if (diff_l == 16) {
  ------------------
  |  Branch (58:9): [True: 0, False: 0]
  ------------------
   59|      0|      if (Base::handleDNGBug16())
  ------------------
  |  Branch (59:11): [True: 0, False: 0]
  ------------------
   60|      0|        bs.skipBitsNoFill(16);
   61|      0|      return -32768;
   62|      0|    }
   63|       |
   64|      0|    invariant(symbol.code_len + diff_l <= 32);
  ------------------
  |  |   27|      0|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (64:5): [True: 0, False: 0]
  ------------------
   65|      0|    return diff_l ? extend(bs.getBitsNoFill(diff_l), diff_l) : 0;
  ------------------
  |  Branch (65:12): [True: 0, False: 0]
  ------------------
   66|      0|  }

_ZN8rawspeed28AbstractPrefixCodeTranscoderINS_15BaselineCodeTagEEC2ENS_10PrefixCodeIS1_EE:
   48|  2.05k|      : code(std::move(code_)) {}
_ZN8rawspeed28AbstractPrefixCodeTranscoderINS_15BaselineCodeTagEE5setupEbb:
   71|  2.05k|  void setup(bool fullDecode_, bool fixDNGBug16_) {
   72|  2.05k|    invariant(!fullDecode_ || Traits::SupportsFullDecode);
  ------------------
  |  |   27|  2.05k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (72:5): [True: 207, False: 1.84k]
  |  Branch (72:5): [True: 1.84k, Folded]
  |  Branch (72:5): [True: 2.05k, False: 0]
  ------------------
   73|       |
   74|  2.05k|    this->fullDecode = fullDecode_;
   75|  2.05k|    this->fixDNGBug16 = fixDNGBug16_;
   76|       |
   77|  2.05k|    if (fullDecode) {
  ------------------
  |  Branch (77:9): [True: 1.84k, False: 207]
  ------------------
   78|       |      // If we are in a full-decoding mode, we will be interpreting code values
   79|       |      // as bit length of the following difference, which incurs hard limit
   80|       |      // of 16 (since we want to need to read at most 32 bits max for a symbol
   81|       |      // plus difference). Though we could enforce it per-code instead?
   82|  1.84k|      verifyCodeValuesAsDiffLengths();
   83|  1.84k|    }
   84|  2.05k|  }
_ZNK8rawspeed28AbstractPrefixCodeTranscoderINS_15BaselineCodeTagEE29verifyCodeValuesAsDiffLengthsEv:
   50|  1.93k|  void verifyCodeValuesAsDiffLengths() const {
   51|  9.80k|    for (const auto cValue : code.Base::codeValues) {
  ------------------
  |  Branch (51:28): [True: 9.80k, False: 1.90k]
  ------------------
   52|  9.80k|      if (cValue <= Traits::MaxDiffLength)
  ------------------
  |  Branch (52:11): [True: 9.76k, False: 36]
  ------------------
   53|  9.76k|        continue;
   54|  9.80k|      ThrowRDE("Corrupt Huffman code: difference length %u longer than %u",
  ------------------
  |  |   38|     36|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     36|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     36|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     36|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   55|  9.80k|               cValue, Traits::MaxDiffLength);
   56|  9.80k|    }
   57|  1.93k|    assert(maxCodePlusDiffLength() <= 32U);
  ------------------
  |  Branch (57:5): [True: 1.90k, False: 0]
  ------------------
   58|  1.90k|  }
_ZNK8rawspeed28AbstractPrefixCodeTranscoderINS_15BaselineCodeTagEE21maxCodePlusDiffLengthEv:
   66|  1.90k|  maxCodePlusDiffLength() const {
   67|  1.90k|    return maxCodeLength() + *(std::max_element(code.Base::codeValues.cbegin(),
   68|  1.90k|                                                code.Base::codeValues.cend()));
   69|  1.90k|  }
_ZNK8rawspeed28AbstractPrefixCodeTranscoderINS_15BaselineCodeTagEE13maxCodeLengthEv:
   61|  45.3k|  [[nodiscard]] size_t RAWSPEED_READONLY maxCodeLength() const {
   62|  45.3k|    return code.nCodesPerLength.size() - 1;
   63|  45.3k|  }
_ZNK8rawspeed28AbstractPrefixCodeTranscoderINS_15BaselineCodeTagEE12isFullDecodeEv:
   87|  25.8M|  [[nodiscard]] bool RAWSPEED_READONLY isFullDecode() const {
   88|  25.8M|    return fullDecode;
   89|  25.8M|  }
_ZNK8rawspeed28AbstractPrefixCodeTranscoderINS_15BaselineCodeTagEE14handleDNGBug16Ev:
   90|   150k|  [[nodiscard]] bool RAWSPEED_READONLY handleDNGBug16() const {
   91|   150k|    return fixDNGBug16;
   92|   150k|  }

_ZN8rawspeed11HuffmanCodeINS_15BaselineCodeTagEEC2Ev:
   48|  2.26k|  HuffmanCode() = default;
_ZN8rawspeed11HuffmanCodeINS_15BaselineCodeTagEE18setNCodesPerLengthENS_6BufferE:
   99|  2.24k|  uint32_t setNCodesPerLength(Buffer data) {
  100|  2.24k|    invariant(data.getSize() == Traits::MaxCodeLenghtBits);
  ------------------
  |  |   27|  2.24k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (100:5): [True: 2.24k, False: 0]
  ------------------
  101|       |
  102|  2.24k|    nCodesPerLength.resize((1 + Traits::MaxCodeLenghtBits), 0);
  103|  2.24k|    std::copy(data.begin(), data.end(), &nCodesPerLength[1]);
  104|  2.24k|    assert(nCodesPerLength[0] == 0);
  ------------------
  |  Branch (104:5): [True: 2.24k, False: 0]
  ------------------
  105|       |
  106|       |    // trim empty entries from the codes per length table on the right
  107|  21.6k|    while (!nCodesPerLength.empty() && nCodesPerLength.back() == 0)
  ------------------
  |  Branch (107:12): [True: 21.6k, False: 3]
  |  Branch (107:40): [True: 19.3k, False: 2.23k]
  ------------------
  108|  19.3k|      nCodesPerLength.pop_back();
  109|       |
  110|  2.24k|    if (nCodesPerLength.empty())
  ------------------
  |  Branch (110:9): [True: 3, False: 2.23k]
  ------------------
  111|  2.24k|      ThrowRDE("Codes-per-length table is empty");
  ------------------
  |  |   38|      3|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      3|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      3|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      3|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  112|       |
  113|  2.24k|    assert(nCodesPerLength.back() > 0);
  ------------------
  |  Branch (113:5): [True: 2.23k, False: 0]
  ------------------
  114|       |
  115|  2.23k|    const auto count = maxCodesCount();
  116|  2.23k|    invariant(count > 0);
  ------------------
  |  |   27|  2.23k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (116:5): [True: 2.23k, False: 0]
  ------------------
  117|       |
  118|  2.23k|    if (count > Traits::MaxNumCodeValues)
  ------------------
  |  Branch (118:9): [True: 22, False: 2.21k]
  ------------------
  119|  2.23k|      ThrowRDE("Too big code-values table");
  ------------------
  |  |   38|     22|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     22|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     22|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     22|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  120|       |
  121|       |    // We are at the Root node, len is 1, there are two possible child Nodes
  122|  2.21k|    unsigned maxCodes = 2;
  123|       |
  124|  18.3k|    for (auto codeLen = 1UL; codeLen < nCodesPerLength.size(); codeLen++) {
  ------------------
  |  Branch (124:30): [True: 16.1k, False: 2.19k]
  ------------------
  125|       |      // we have codeLen bits. make sure that that code count can actually fit
  126|       |      // E.g. for len 1 we could have two codes: 0b0 and 0b1
  127|       |      // (but in that case there can be no other codes (with higher lengths))
  128|  16.1k|      const auto maxCodesInCurrLen = (1U << codeLen);
  129|  16.1k|      const auto nCodes = nCodesPerLength[codeLen];
  130|  16.1k|      if (nCodes > maxCodesInCurrLen) {
  ------------------
  |  Branch (130:11): [True: 15, False: 16.1k]
  ------------------
  131|     15|        ThrowRDE("Corrupt Huffman. Can never have %u codes in %lu-bit len",
  ------------------
  |  |   38|     15|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     15|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     15|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     15|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  132|     15|                 nCodes, codeLen);
  133|     15|      }
  134|       |
  135|       |      // Also, check that we actually can have this much leafs for this length
  136|  16.1k|      if (nCodes > maxCodes) {
  ------------------
  |  Branch (136:11): [True: 8, False: 16.1k]
  ------------------
  137|      8|        ThrowRDE(
  ------------------
  |  |   38|      8|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      8|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      8|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      8|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  138|      8|            "Corrupt Huffman. Can only fit %u out of %u codes in %lu-bit len",
  139|      8|            maxCodes, nCodes, codeLen);
  140|      8|      }
  141|       |
  142|       |      // There are nCodes leafs on this level, and those can not be branches
  143|  16.1k|      maxCodes -= nCodes;
  144|       |      // On the next level, rest can be branches, and can have two child Nodes
  145|  16.1k|      maxCodes *= 2;
  146|  16.1k|    }
  147|       |
  148|  2.19k|    return count;
  149|  2.21k|  }
_ZNK8rawspeed11HuffmanCodeINS_15BaselineCodeTagEE13maxCodesCountEv:
   61|  16.9k|  [[nodiscard]] unsigned int RAWSPEED_READONLY maxCodesCount() const {
   62|  16.9k|    return std::accumulate(nCodesPerLength.begin(), nCodesPerLength.end(), 0U);
   63|  16.9k|  }
_ZN8rawspeed11HuffmanCodeINS_15BaselineCodeTagEE13setCodeValuesENS_10Array1DRefIKhEE:
  151|  2.17k|  void setCodeValues(Array1DRef<const typename Traits::CodeValueTy> data) {
  152|  2.17k|    invariant(data.size() <= Traits::MaxNumCodeValues);
  ------------------
  |  |   27|  2.17k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (152:5): [True: 2.17k, False: 0]
  ------------------
  153|  2.17k|    invariant(static_cast<unsigned>(data.size()) == maxCodesCount());
  ------------------
  |  |   27|  2.17k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (153:5): [True: 2.17k, False: 0]
  ------------------
  154|       |
  155|  2.17k|    this->codeValues.clear();
  156|  2.17k|    this->codeValues.reserve(maxCodesCount());
  157|  2.17k|    std::copy(data.begin(), data.end(), std::back_inserter(this->codeValues));
  158|  2.17k|    assert(this->codeValues.size() == maxCodesCount());
  ------------------
  |  Branch (158:5): [True: 2.17k, False: 0]
  ------------------
  159|       |
  160|  11.5k|    for (const auto& cValue : this->codeValues) {
  ------------------
  |  Branch (160:29): [True: 11.5k, False: 2.17k]
  ------------------
  161|  11.5k|      if (cValue <= Traits::MaxCodeValue)
  ------------------
  |  Branch (161:11): [True: 11.5k, False: 0]
  ------------------
  162|  11.5k|        continue;
  163|      0|      ThrowRDE("Corrupt Huffman code: code value %u is larger than maximum %u",
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  164|  11.5k|               cValue, Traits::MaxCodeValue);
  165|  11.5k|    }
  166|  2.17k|  }
_ZNK8rawspeed11HuffmanCodeINS_15BaselineCodeTagEEeqERKS2_:
   94|    746|  bool operator==(const HuffmanCode& other) const {
   95|    746|    return nCodesPerLength == other.nCodesPerLength &&
  ------------------
  |  Branch (95:12): [True: 546, False: 200]
  ------------------
   96|    546|           this->codeValues == other.codeValues;
  ------------------
  |  Branch (96:12): [True: 122, False: 424]
  ------------------
   97|    746|  }
_ZN8rawspeed11HuffmanCodeINS_15BaselineCodeTagEEcvNS_10PrefixCodeIS1_EEEv:
  168|  2.05k|  explicit operator PrefixCode<CodeTag>() {
  169|  2.05k|    std::vector<CodeSymbol> symbols = generateCodeSymbols();
  170|  2.05k|    return {std::move(symbols), std::move(Parent::codeValues)};
  171|  2.05k|  }
_ZNK8rawspeed11HuffmanCodeINS_15BaselineCodeTagEE19generateCodeSymbolsEv:
   66|  2.05k|  [[nodiscard]] std::vector<CodeSymbol> generateCodeSymbols() const {
   67|  2.05k|    std::vector<CodeSymbol> symbols;
   68|       |
   69|  2.05k|    assert(!nCodesPerLength.empty());
  ------------------
  |  Branch (69:5): [True: 2.05k, False: 0]
  ------------------
   70|  2.05k|    assert(maxCodesCount() > 0);
  ------------------
  |  Branch (70:5): [True: 2.05k, False: 0]
  ------------------
   71|       |
   72|  2.05k|    assert(this->codeValues.size() == maxCodesCount());
  ------------------
  |  Branch (72:5): [True: 2.05k, False: 0]
  ------------------
   73|       |
   74|       |    // reserve all the memory. avoids lots of small allocs
   75|  2.05k|    symbols.reserve(maxCodesCount());
   76|       |
   77|       |    // Figure C.1: make table of Huffman code length for each symbol
   78|       |    // Figure C.2: generate the codes themselves
   79|  2.05k|    uint32_t code = 0;
   80|  17.5k|    for (unsigned int l = 1; l <= maxCodeLength(); ++l) {
  ------------------
  |  Branch (80:30): [True: 15.5k, False: 2.05k]
  ------------------
   81|  26.7k|      for (unsigned int i = 0; i < nCodesPerLength[l]; ++i) {
  ------------------
  |  Branch (81:32): [True: 11.2k, False: 15.5k]
  ------------------
   82|  11.2k|        symbols.emplace_back(code, l);
   83|  11.2k|        code++;
   84|  11.2k|      }
   85|       |
   86|  15.5k|      code <<= 1;
   87|  15.5k|    }
   88|       |
   89|  2.05k|    assert(symbols.size() == maxCodesCount());
  ------------------
  |  Branch (89:5): [True: 2.05k, False: 1]
  ------------------
   90|       |
   91|  2.05k|    return symbols;
   92|  2.05k|  }
_ZNK8rawspeed11HuffmanCodeINS_15BaselineCodeTagEE13maxCodeLengthEv:
   51|  17.5k|  [[nodiscard]] size_t RAWSPEED_READONLY maxCodeLength() const {
   52|  17.5k|    return nCodesPerLength.size() - 1;
   53|  17.5k|  }

_ZN8rawspeed10PrefixCodeINS_15BaselineCodeTagEEC2ENSt3__16vectorINS_18AbstractPrefixCodeIS1_E10CodeSymbolENS3_9allocatorIS7_EEEENS4_IhNS8_IhEEEE:
   52|  2.05k|      : Base(std::move(codeValues_)), symbols(std::move(symbols_)) {
   53|  2.05k|    if (symbols.empty() || Base::codeValues.empty() ||
  ------------------
  |  Branch (53:9): [True: 0, False: 2.05k]
  |  Branch (53:28): [True: 0, False: 2.05k]
  ------------------
   54|  2.05k|        symbols.size() != Base::codeValues.size())
  ------------------
  |  Branch (54:9): [True: 0, False: 2.05k]
  ------------------
   55|  2.05k|      ThrowRDE("Malformed code");
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   56|       |
   57|  2.05k|    nCodesPerLength.resize(1 + Traits::MaxCodeLenghtBits);
   58|  11.2k|    for (const CodeSymbol& s : symbols) {
  ------------------
  |  Branch (58:30): [True: 11.2k, False: 2.05k]
  ------------------
   59|  11.2k|      assert(s.code_len > 0 && s.code_len <= Traits::MaxCodeLenghtBits);
  ------------------
  |  Branch (59:7): [True: 11.2k, False: 0]
  |  Branch (59:7): [True: 11.2k, False: 0]
  |  Branch (59:7): [True: 11.2k, False: 0]
  ------------------
   60|  11.2k|      ++nCodesPerLength[s.code_len];
   61|  11.2k|    }
   62|  19.4k|    while (nCodesPerLength.back() == 0)
  ------------------
  |  Branch (62:12): [True: 17.3k, False: 2.05k]
  ------------------
   63|  17.3k|      nCodesPerLength.pop_back();
   64|  2.05k|    assert(nCodesPerLength.size() > 1);
  ------------------
  |  Branch (64:5): [True: 2.05k, False: 18.4E]
  ------------------
   65|       |
   66|  2.05k|    verifyCodeSymbols();
   67|  2.05k|  }
_ZN8rawspeed10PrefixCodeINS_15BaselineCodeTagEE17verifyCodeSymbolsEv:
   70|  2.05k|  void verifyCodeSymbols() {
   71|       |    // We are at the Root node, len is 1, there are two possible child Nodes
   72|  2.05k|    unsigned maxCodes = 2;
   73|  17.5k|    for (auto codeLen = 1UL; codeLen < nCodesPerLength.size(); codeLen++) {
  ------------------
  |  Branch (73:30): [True: 15.5k, False: 2.05k]
  ------------------
   74|       |      // we have codeLen bits. make sure that that code count can actually fit
   75|       |      // E.g. for len 1 we could have two codes: 0b0 and 0b1
   76|       |      // (but in that case there can be no other codes (with higher lengths))
   77|  15.5k|      const unsigned nCodes = nCodesPerLength[codeLen];
   78|  15.5k|      if (nCodes > maxCodes)
  ------------------
  |  Branch (78:11): [True: 0, False: 15.5k]
  ------------------
   79|  15.5k|        ThrowRDE("Too many codes of of length %lu.", codeLen);
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   80|       |      // There are nCodes leafs on this level, and those can not be branches
   81|  15.5k|      maxCodes -= nCodes;
   82|       |      // On the next level, rest can be branches, and can have two child Nodes
   83|  15.5k|      maxCodes *= 2;
   84|  15.5k|    }
   85|       |
   86|       |    // The code symbols are ordered so that the code lengths are not decreasing.
   87|       |    // NOTE: codes of same lenght are not nessesairly sorted!
   88|  2.05k|    if (std::adjacent_find(
  ------------------
  |  Branch (88:9): [True: 0, False: 2.05k]
  ------------------
   89|  2.05k|            symbols.cbegin(), symbols.cend(),
   90|  2.05k|            [](const CodeSymbol& lhs, const CodeSymbol& rhs) -> bool {
   91|  2.05k|              return !std::less_equal<>()(lhs.code_len, rhs.code_len);
   92|  2.05k|            }) != symbols.cend())
   93|  2.05k|      ThrowRDE("Code symbols are not globally ordered");
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   94|       |
   95|       |    // No two symbols should have the same prefix (high bits)
   96|       |    // Only analyze the lower triangular matrix, excluding diagonal
   97|  13.3k|    for (auto sId = 0UL; sId < symbols.size(); sId++) {
  ------------------
  |  Branch (97:26): [True: 11.2k, False: 2.05k]
  ------------------
   98|  61.7k|      for (auto pId = 0UL; pId < sId; pId++)
  ------------------
  |  Branch (98:28): [True: 50.5k, False: 11.2k]
  ------------------
   99|  50.5k|        if (CodeSymbol::HaveCommonPrefix(symbols[sId], symbols[pId]))
  ------------------
  |  Branch (99:13): [True: 0, False: 50.5k]
  ------------------
  100|  11.2k|          ThrowRDE("Not prefix codes!");
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  101|  11.2k|    }
  102|  2.05k|  }
_ZZN8rawspeed10PrefixCodeINS_15BaselineCodeTagEE17verifyCodeSymbolsEvENKUlRKNS_18AbstractPrefixCodeIS1_E10CodeSymbolES7_E_clES7_S7_:
   90|  9.21k|            [](const CodeSymbol& lhs, const CodeSymbol& rhs) -> bool {
   91|  9.21k|              return !std::less_equal<>()(lhs.code_len, rhs.code_len);
   92|  9.21k|            }) != symbols.cend())

_ZN8rawspeed20PrefixCodeLUTDecoderINS_15BaselineCodeTagENS_23PrefixCodeLookupDecoderIS1_EEE5setupEbb:
   95|  2.05k|  void setup(bool fullDecode_, bool fixDNGBug16_) {
   96|  2.05k|    Base::setup(fullDecode_, fixDNGBug16_);
   97|       |
   98|       |    // Generate lookup table for fast decoding lookup.
   99|       |    // See definition of decodeLookup above
  100|  2.05k|    decodeLookup.resize(1 << LookupDepth);
  101|  10.1k|    for (size_t i = 0; i < Base::code.symbols.size(); i++) {
  ------------------
  |  Branch (101:24): [True: 8.67k, False: 1.42k]
  ------------------
  102|  8.67k|      uint8_t code_l = Base::code.symbols[i].code_len;
  103|  8.67k|      if (code_l > static_cast<int>(LookupDepth))
  ------------------
  |  Branch (103:11): [True: 625, False: 8.05k]
  ------------------
  104|    625|        break;
  105|       |
  106|  8.05k|      auto ll = implicit_cast<uint16_t>(Base::code.symbols[i].code
  107|  8.05k|                                        << (LookupDepth - code_l));
  108|  8.05k|      auto ul =
  109|  8.05k|          implicit_cast<uint16_t>(ll | ((1 << (LookupDepth - code_l)) - 1));
  110|  8.05k|      static_assert(Traits::MaxCodeValueLenghtBits <=
  111|  8.05k|                    bitwidth<LUTEntryTy>() - PayloadShift);
  112|  8.05k|      LUTUnsignedEntryTy diff_l = Base::code.codeValues[i];
  113|  2.52M|      for (uint16_t c = ll; c <= ul; c++) {
  ------------------
  |  Branch (113:29): [True: 2.51M, False: 8.05k]
  ------------------
  114|  2.51M|        if (!(c < decodeLookup.size()))
  ------------------
  |  Branch (114:13): [True: 0, False: 2.51M]
  ------------------
  115|  2.51M|          ThrowRDE("Corrupt Huffman");
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  116|       |
  117|  2.51M|        if (!FlagMask || !Base::isFullDecode() || code_l > LookupDepth ||
  ------------------
  |  Branch (117:13): [Folded, False: 2.51M]
  |  Branch (117:26): [True: 163k, False: 2.35M]
  |  Branch (117:51): [True: 71, False: 2.35M]
  ------------------
  118|  2.35M|            (code_l + diff_l > LookupDepth && diff_l != 16)) {
  ------------------
  |  Branch (118:14): [True: 521k, False: 1.83M]
  |  Branch (118:47): [True: 374k, False: 147k]
  ------------------
  119|       |          // lookup bit depth is too small to fit both the encoded length
  120|       |          // and the final difference value.
  121|       |          // -> store only the length and do a normal sign extension later
  122|   536k|          invariant(!Base::isFullDecode() || diff_l > 0);
  ------------------
  |  |   27|   536k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (122:11): [True: 162k, False: 374k]
  |  Branch (122:11): [True: 374k, False: 0]
  |  Branch (122:11): [True: 536k, False: 0]
  ------------------
  123|   536k|          decodeLookup[c] = diff_l << PayloadShift | code_l;
  124|       |
  125|   536k|          if (!Base::isFullDecode())
  ------------------
  |  Branch (125:15): [True: 162k, False: 374k]
  ------------------
  126|   162k|            decodeLookup[c] |= FlagMask;
  127|  1.97M|        } else {
  128|       |          // Lookup bit depth is sufficient to encode the final value.
  129|  1.97M|          decodeLookup[c] = FlagMask | code_l;
  130|  1.97M|          if (diff_l != 16 || Base::handleDNGBug16())
  ------------------
  |  Branch (130:15): [True: 1.83M, False: 147k]
  |  Branch (130:31): [True: 362, False: 146k]
  ------------------
  131|  1.83M|            decodeLookup[c] += diff_l;
  132|       |
  133|  1.97M|          if (diff_l) {
  ------------------
  |  Branch (133:15): [True: 1.06M, False: 913k]
  ------------------
  134|  1.06M|            LUTUnsignedEntryTy diff;
  135|  1.06M|            if (diff_l != 16) {
  ------------------
  |  Branch (135:17): [True: 919k, False: 147k]
  ------------------
  136|   919k|              diff = extractHighBits(c, code_l + diff_l,
  137|   919k|                                     /*effectiveBitwidth=*/LookupDepth);
  138|   919k|              diff &= ((1 << diff_l) - 1);
  139|   919k|            } else {
  140|   147k|              diff = LUTUnsignedEntryTy(-32768);
  141|   147k|            }
  142|  1.06M|            decodeLookup[c] |= static_cast<LUTEntryTy>(
  143|  1.06M|                static_cast<LUTUnsignedEntryTy>(Base::extend(diff, diff_l))
  144|  1.06M|                << PayloadShift);
  145|  1.06M|          }
  146|  1.97M|        }
  147|  2.51M|      }
  148|  8.05k|    }
  149|  2.05k|  }
_ZNK8rawspeed20PrefixCodeLUTDecoderINS_15BaselineCodeTagENS_23PrefixCodeLookupDecoderIS1_EEE16decodeDifferenceINS_15BitStreamerJPEGEEEiRT_:
  161|  10.7M|  __attribute__((always_inline)) int decodeDifference(BIT_STREAM& bs) const {
  162|  10.7M|    static_assert(
  163|  10.7M|        BitStreamerTraits<BIT_STREAM>::canUseWithPrefixCodeDecoder,
  164|  10.7M|        "This BitStreamer specialization is not marked as usable here");
  165|  10.7M|    invariant(Base::isFullDecode());
  ------------------
  |  |   27|  10.7M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (165:5): [True: 10.7M, False: 18.4E]
  ------------------
  166|  10.7M|    return decode<BIT_STREAM, true>(bs);
  167|  10.7M|  }
_ZNK8rawspeed20PrefixCodeLUTDecoderINS_15BaselineCodeTagENS_23PrefixCodeLookupDecoderIS1_EEE6decodeINS_15BitStreamerJPEGELb1EEEiRT_:
  174|  10.7M|  __attribute__((always_inline)) int decode(BIT_STREAM& bs) const {
  175|  10.7M|    static_assert(
  176|  10.7M|        BitStreamerTraits<BIT_STREAM>::canUseWithPrefixCodeDecoder,
  177|  10.7M|        "This BitStreamer specialization is not marked as usable here");
  178|  10.7M|    invariant(FULL_DECODE == Base::isFullDecode());
  ------------------
  |  |   27|  10.7M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (178:5): [True: 10.7M, False: 3.07k]
  ------------------
  179|  10.7M|    bs.fill(32);
  180|       |
  181|  10.7M|    typename Base::CodeSymbol partial;
  182|  10.7M|    partial.code_len = LookupDepth;
  183|  10.7M|    partial.code = implicit_cast<typename Traits::CodeTy>(
  184|  10.7M|        bs.peekBitsNoFill(partial.code_len));
  185|       |
  186|  10.7M|    assert(partial.code < decodeLookup.size());
  ------------------
  |  Branch (186:5): [True: 10.7M, False: 18.4E]
  ------------------
  187|  10.7M|    auto lutEntry = static_cast<unsigned>(decodeLookup[partial.code]);
  188|  10.7M|    int payload = static_cast<int>(lutEntry) >> PayloadShift;
  189|  10.7M|    int len = lutEntry & LenMask;
  190|       |
  191|       |    // How far did reading of those LookupDepth bits *actually* move us forward?
  192|  10.7M|    bs.skipBitsNoFill(len);
  193|       |
  194|       |    // If the flag bit is set, then we have already skipped all the len bits
  195|       |    // we needed to skip, and payload is the answer we were looking for.
  196|  10.7M|    if (lutEntry & FlagMask)
  ------------------
  |  Branch (196:9): [True: 10.7M, False: 15.2k]
  ------------------
  197|  10.7M|      return payload;
  198|       |
  199|  15.2k|    typename Traits::CodeValueTy codeValue;
  200|  15.2k|    if (lutEntry) {
  ------------------
  |  Branch (200:9): [True: 11.3k, False: 3.91k]
  ------------------
  201|       |      // If the flag is not set, but the entry is not empty,
  202|       |      // the payload is the code value for this symbol.
  203|  11.3k|      partial.code_len = implicit_cast<uint8_t>(len);
  204|  11.3k|      codeValue = implicit_cast<typename Traits::CodeValueTy>(payload);
  205|  11.3k|      invariant(!FULL_DECODE || codeValue /*aka diff_l*/ > 0);
  ------------------
  |  |   27|  11.3k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (205:7): [Folded, False: 11.3k]
  |  Branch (205:7): [True: 11.3k, False: 0]
  |  Branch (205:7): [True: 11.3k, False: 0]
  ------------------
  206|  11.3k|    } else {
  207|       |      // No match in the lookup table, because either the code is longer
  208|       |      // than LookupDepth or the input is corrupt. Need to read more bits...
  209|  3.91k|      invariant(len == 0);
  ------------------
  |  |   27|  3.91k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (209:7): [True: 5.24k, False: 18.4E]
  ------------------
  210|  5.24k|      bs.skipBitsNoFill(partial.code_len);
  211|  5.24k|      std::tie(partial, codeValue) =
  212|  5.24k|          Base::finishReadingPartialSymbol(bs, partial);
  213|  5.24k|    }
  214|       |
  215|  16.6k|    return Base::template processSymbol<BIT_STREAM, FULL_DECODE>(bs, partial,
  216|  16.6k|                                                                 codeValue);
  217|  15.2k|  }
_ZNK8rawspeed20PrefixCodeLUTDecoderINS_15BaselineCodeTagENS_23PrefixCodeLookupDecoderIS1_EEE16decodeDifferenceINS_14BitStreamerMSBEEEiRT_:
  161|   384k|  __attribute__((always_inline)) int decodeDifference(BIT_STREAM& bs) const {
  162|   384k|    static_assert(
  163|   384k|        BitStreamerTraits<BIT_STREAM>::canUseWithPrefixCodeDecoder,
  164|   384k|        "This BitStreamer specialization is not marked as usable here");
  165|   384k|    invariant(Base::isFullDecode());
  ------------------
  |  |   27|   384k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (165:5): [True: 384k, False: 0]
  ------------------
  166|   384k|    return decode<BIT_STREAM, true>(bs);
  167|   384k|  }
_ZNK8rawspeed20PrefixCodeLUTDecoderINS_15BaselineCodeTagENS_23PrefixCodeLookupDecoderIS1_EEE6decodeINS_14BitStreamerMSBELb1EEEiRT_:
  174|   384k|  __attribute__((always_inline)) int decode(BIT_STREAM& bs) const {
  175|   384k|    static_assert(
  176|   384k|        BitStreamerTraits<BIT_STREAM>::canUseWithPrefixCodeDecoder,
  177|   384k|        "This BitStreamer specialization is not marked as usable here");
  178|   384k|    invariant(FULL_DECODE == Base::isFullDecode());
  ------------------
  |  |   27|   384k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (178:5): [True: 384k, False: 0]
  ------------------
  179|   384k|    bs.fill(32);
  180|       |
  181|   384k|    typename Base::CodeSymbol partial;
  182|   384k|    partial.code_len = LookupDepth;
  183|   384k|    partial.code = implicit_cast<typename Traits::CodeTy>(
  184|   384k|        bs.peekBitsNoFill(partial.code_len));
  185|       |
  186|   384k|    assert(partial.code < decodeLookup.size());
  ------------------
  |  Branch (186:5): [True: 384k, False: 72]
  ------------------
  187|   384k|    auto lutEntry = static_cast<unsigned>(decodeLookup[partial.code]);
  188|   384k|    int payload = static_cast<int>(lutEntry) >> PayloadShift;
  189|   384k|    int len = lutEntry & LenMask;
  190|       |
  191|       |    // How far did reading of those LookupDepth bits *actually* move us forward?
  192|   384k|    bs.skipBitsNoFill(len);
  193|       |
  194|       |    // If the flag bit is set, then we have already skipped all the len bits
  195|       |    // we needed to skip, and payload is the answer we were looking for.
  196|   384k|    if (lutEntry & FlagMask)
  ------------------
  |  Branch (196:9): [True: 354k, False: 29.9k]
  ------------------
  197|   354k|      return payload;
  198|       |
  199|  29.9k|    typename Traits::CodeValueTy codeValue;
  200|  29.9k|    if (lutEntry) {
  ------------------
  |  Branch (200:9): [True: 29.8k, False: 108]
  ------------------
  201|       |      // If the flag is not set, but the entry is not empty,
  202|       |      // the payload is the code value for this symbol.
  203|  29.8k|      partial.code_len = implicit_cast<uint8_t>(len);
  204|  29.8k|      codeValue = implicit_cast<typename Traits::CodeValueTy>(payload);
  205|  29.8k|      invariant(!FULL_DECODE || codeValue /*aka diff_l*/ > 0);
  ------------------
  |  |   27|  29.8k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (205:7): [Folded, False: 29.8k]
  |  Branch (205:7): [True: 29.8k, False: 0]
  |  Branch (205:7): [True: 29.8k, False: 0]
  ------------------
  206|  29.8k|    } else {
  207|       |      // No match in the lookup table, because either the code is longer
  208|       |      // than LookupDepth or the input is corrupt. Need to read more bits...
  209|    108|      invariant(len == 0);
  ------------------
  |  |   27|    108|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (209:7): [True: 108, False: 0]
  ------------------
  210|    108|      bs.skipBitsNoFill(partial.code_len);
  211|    108|      std::tie(partial, codeValue) =
  212|    108|          Base::finishReadingPartialSymbol(bs, partial);
  213|    108|    }
  214|       |
  215|  29.9k|    return Base::template processSymbol<BIT_STREAM, FULL_DECODE>(bs, partial,
  216|  29.9k|                                                                 codeValue);
  217|  29.9k|  }
_ZNK8rawspeed20PrefixCodeLUTDecoderINS_15BaselineCodeTagENS_23PrefixCodeLookupDecoderIS1_EEE15decodeCodeValueINS_16BitStreamerMSB32EEEiRT_:
  152|  20.9k|  __attribute__((always_inline)) int decodeCodeValue(BIT_STREAM& bs) const {
  153|  20.9k|    static_assert(
  154|  20.9k|        BitStreamerTraits<BIT_STREAM>::canUseWithPrefixCodeDecoder,
  155|  20.9k|        "This BitStreamer specialization is not marked as usable here");
  156|  20.9k|    invariant(!Base::isFullDecode());
  ------------------
  |  |   27|  20.9k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (156:5): [True: 20.9k, False: 0]
  ------------------
  157|  20.9k|    return decode<BIT_STREAM, false>(bs);
  158|  20.9k|  }
_ZNK8rawspeed20PrefixCodeLUTDecoderINS_15BaselineCodeTagENS_23PrefixCodeLookupDecoderIS1_EEE6decodeINS_16BitStreamerMSB32ELb0EEEiRT_:
  174|  20.9k|  __attribute__((always_inline)) int decode(BIT_STREAM& bs) const {
  175|  20.9k|    static_assert(
  176|  20.9k|        BitStreamerTraits<BIT_STREAM>::canUseWithPrefixCodeDecoder,
  177|  20.9k|        "This BitStreamer specialization is not marked as usable here");
  178|  20.9k|    invariant(FULL_DECODE == Base::isFullDecode());
  ------------------
  |  |   27|  20.9k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (178:5): [True: 20.9k, False: 0]
  ------------------
  179|  20.9k|    bs.fill(32);
  180|       |
  181|  20.9k|    typename Base::CodeSymbol partial;
  182|  20.9k|    partial.code_len = LookupDepth;
  183|  20.9k|    partial.code = implicit_cast<typename Traits::CodeTy>(
  184|  20.9k|        bs.peekBitsNoFill(partial.code_len));
  185|       |
  186|  20.9k|    assert(partial.code < decodeLookup.size());
  ------------------
  |  Branch (186:5): [True: 20.9k, False: 0]
  ------------------
  187|  20.9k|    auto lutEntry = static_cast<unsigned>(decodeLookup[partial.code]);
  188|  20.9k|    int payload = static_cast<int>(lutEntry) >> PayloadShift;
  189|  20.9k|    int len = lutEntry & LenMask;
  190|       |
  191|       |    // How far did reading of those LookupDepth bits *actually* move us forward?
  192|  20.9k|    bs.skipBitsNoFill(len);
  193|       |
  194|       |    // If the flag bit is set, then we have already skipped all the len bits
  195|       |    // we needed to skip, and payload is the answer we were looking for.
  196|  20.9k|    if (lutEntry & FlagMask)
  ------------------
  |  Branch (196:9): [True: 20.3k, False: 666]
  ------------------
  197|  20.3k|      return payload;
  198|       |
  199|    666|    typename Traits::CodeValueTy codeValue;
  200|    666|    if (lutEntry) {
  ------------------
  |  Branch (200:9): [True: 0, False: 666]
  ------------------
  201|       |      // If the flag is not set, but the entry is not empty,
  202|       |      // the payload is the code value for this symbol.
  203|      0|      partial.code_len = implicit_cast<uint8_t>(len);
  204|      0|      codeValue = implicit_cast<typename Traits::CodeValueTy>(payload);
  205|      0|      invariant(!FULL_DECODE || codeValue /*aka diff_l*/ > 0);
  ------------------
  |  |   27|      0|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (205:7): [True: 0, Folded]
  |  Branch (205:7): [True: 0, False: 0]
  |  Branch (205:7): [True: 0, Folded]
  ------------------
  206|    666|    } else {
  207|       |      // No match in the lookup table, because either the code is longer
  208|       |      // than LookupDepth or the input is corrupt. Need to read more bits...
  209|    666|      invariant(len == 0);
  ------------------
  |  |   27|    666|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (209:7): [True: 666, False: 0]
  ------------------
  210|    666|      bs.skipBitsNoFill(partial.code_len);
  211|    666|      std::tie(partial, codeValue) =
  212|    666|          Base::finishReadingPartialSymbol(bs, partial);
  213|    666|    }
  214|       |
  215|    666|    return Base::template processSymbol<BIT_STREAM, FULL_DECODE>(bs, partial,
  216|    666|                                                                 codeValue);
  217|    666|  }

_ZN8rawspeed23PrefixCodeLookupDecoderINS_15BaselineCodeTagEEC2EONS_11HuffmanCodeIS1_EE:
   80|  2.05k|      : Base(std::move(hc).operator rawspeed::PrefixCode<CodeTag>()) {}
_ZN8rawspeed23PrefixCodeLookupDecoderINS_15BaselineCodeTagEE5setupEbb:
   97|  2.05k|  void setup(bool fullDecode_, bool fixDNGBug16_) {
   98|  2.05k|    AbstractPrefixCodeDecoder<CodeTag>::setup(fullDecode_, fixDNGBug16_);
   99|       |
  100|       |    // Figure F.15: generate decoding tables
  101|  2.05k|    codeOffsetOL.resize(Base::maxCodeLength() + 1UL, MaxCodeValue);
  102|  2.05k|    maxCodeOL.resize(Base::maxCodeLength() + 1UL, MaxCodeValue);
  103|  2.05k|    for (unsigned int numCodesSoFar = 0, codeLen = 1;
  104|  17.3k|         codeLen <= Base::maxCodeLength(); codeLen++) {
  ------------------
  |  Branch (104:10): [True: 15.3k, False: 2.05k]
  ------------------
  105|  15.3k|      if (!Base::code.nCodesPerLength[codeLen])
  ------------------
  |  Branch (105:11): [True: 9.20k, False: 6.10k]
  ------------------
  106|  9.20k|        continue;
  107|  6.10k|      codeOffsetOL[codeLen] = implicit_cast<typename Traits::CodeTy>(
  108|  6.10k|          Base::code.symbols[numCodesSoFar].code - numCodesSoFar);
  109|  6.10k|      assert(codeOffsetOL[codeLen] != MaxCodeValue);
  ------------------
  |  Branch (109:7): [True: 6.10k, False: 0]
  ------------------
  110|  6.10k|      numCodesSoFar += Base::code.nCodesPerLength[codeLen];
  111|  6.10k|      maxCodeOL[codeLen] = Base::code.symbols[numCodesSoFar - 1].code;
  112|  6.10k|    }
  113|  2.05k|  }
_ZNK8rawspeed23PrefixCodeLookupDecoderINS_15BaselineCodeTagEE26finishReadingPartialSymbolINS_15BitStreamerJPEGEEENSt3__14pairINS_18AbstractPrefixCodeIS1_E10CodeSymbolEiEERT_S9_:
  136|  5.24k|                             typename Base::CodeSymbol partial) const {
  137|  5.24k|    static_assert(
  138|  5.24k|        BitStreamerTraits<BIT_STREAM>::canUseWithPrefixCodeDecoder,
  139|  5.24k|        "This BitStreamer specialization is not marked as usable here");
  140|  14.0k|    while (partial.code_len < Base::maxCodeLength() &&
  ------------------
  |  Branch (140:12): [True: 12.7k, False: 1.29k]
  ------------------
  141|  12.7k|           (MaxCodeValue == maxCodeOL[partial.code_len] ||
  ------------------
  |  Branch (141:13): [True: 8.58k, False: 4.17k]
  ------------------
  142|  8.80k|            partial.code > maxCodeOL[partial.code_len])) {
  ------------------
  |  Branch (142:13): [True: 225, False: 3.95k]
  ------------------
  143|  8.80k|      uint32_t temp = bs.getBitsNoFill(1);
  144|  8.80k|      partial.code =
  145|  8.80k|          implicit_cast<typename Traits::CodeTy>((partial.code << 1) | temp);
  146|  8.80k|      partial.code_len++;
  147|  8.80k|    }
  148|       |
  149|       |    // NOTE: when we are called from PrefixCodeLUTDecoder, the partial.code_len
  150|       |    // *could* be larger than the largest code lenght for this huffman table,
  151|       |    // which is a symptom of a corrupt code.
  152|  5.24k|    if (partial.code_len > Base::maxCodeLength() ||
  ------------------
  |  Branch (152:9): [True: 145, False: 5.10k]
  ------------------
  153|  5.10k|        partial.code > maxCodeOL[partial.code_len])
  ------------------
  |  Branch (153:9): [True: 137, False: 4.96k]
  ------------------
  154|  5.24k|      ThrowRDE("bad Huffman code: %u (len: %u)", partial.code,
  ------------------
  |  |   38|    282|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|    282|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|    282|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|    282|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  155|  4.96k|               partial.code_len);
  156|       |
  157|  5.24k|    assert(MaxCodeValue != codeOffsetOL[partial.code_len]);
  ------------------
  |  Branch (157:5): [True: 4.96k, False: 0]
  ------------------
  158|  4.96k|    assert(partial.code >= codeOffsetOL[partial.code_len]);
  ------------------
  |  Branch (158:5): [True: 4.96k, False: 0]
  ------------------
  159|  4.96k|    unsigned codeIndex = partial.code - codeOffsetOL[partial.code_len];
  160|  4.96k|    assert(codeIndex < Base::code.codeValues.size());
  ------------------
  |  Branch (160:5): [True: 4.96k, False: 0]
  ------------------
  161|       |
  162|  4.96k|    typename Traits::CodeValueTy codeValue = Base::code.codeValues[codeIndex];
  163|  4.96k|    return {partial, codeValue};
  164|  4.96k|  }
_ZNK8rawspeed23PrefixCodeLookupDecoderINS_15BaselineCodeTagEE26finishReadingPartialSymbolINS_14BitStreamerMSBEEENSt3__14pairINS_18AbstractPrefixCodeIS1_E10CodeSymbolEiEERT_S9_:
  136|    108|                             typename Base::CodeSymbol partial) const {
  137|    108|    static_assert(
  138|    108|        BitStreamerTraits<BIT_STREAM>::canUseWithPrefixCodeDecoder,
  139|    108|        "This BitStreamer specialization is not marked as usable here");
  140|    214|    while (partial.code_len < Base::maxCodeLength() &&
  ------------------
  |  Branch (140:12): [True: 106, False: 108]
  ------------------
  141|    106|           (MaxCodeValue == maxCodeOL[partial.code_len] ||
  ------------------
  |  Branch (141:13): [True: 92, False: 14]
  ------------------
  142|    106|            partial.code > maxCodeOL[partial.code_len])) {
  ------------------
  |  Branch (142:13): [True: 14, False: 0]
  ------------------
  143|    106|      uint32_t temp = bs.getBitsNoFill(1);
  144|    106|      partial.code =
  145|    106|          implicit_cast<typename Traits::CodeTy>((partial.code << 1) | temp);
  146|    106|      partial.code_len++;
  147|    106|    }
  148|       |
  149|       |    // NOTE: when we are called from PrefixCodeLUTDecoder, the partial.code_len
  150|       |    // *could* be larger than the largest code lenght for this huffman table,
  151|       |    // which is a symptom of a corrupt code.
  152|    108|    if (partial.code_len > Base::maxCodeLength() ||
  ------------------
  |  Branch (152:9): [True: 2, False: 106]
  ------------------
  153|    106|        partial.code > maxCodeOL[partial.code_len])
  ------------------
  |  Branch (153:9): [True: 12, False: 94]
  ------------------
  154|    108|      ThrowRDE("bad Huffman code: %u (len: %u)", partial.code,
  ------------------
  |  |   38|     14|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     14|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     14|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     14|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  155|     94|               partial.code_len);
  156|       |
  157|    108|    assert(MaxCodeValue != codeOffsetOL[partial.code_len]);
  ------------------
  |  Branch (157:5): [True: 94, False: 0]
  ------------------
  158|     94|    assert(partial.code >= codeOffsetOL[partial.code_len]);
  ------------------
  |  Branch (158:5): [True: 94, False: 0]
  ------------------
  159|     94|    unsigned codeIndex = partial.code - codeOffsetOL[partial.code_len];
  160|     94|    assert(codeIndex < Base::code.codeValues.size());
  ------------------
  |  Branch (160:5): [True: 94, False: 0]
  ------------------
  161|       |
  162|     94|    typename Traits::CodeValueTy codeValue = Base::code.codeValues[codeIndex];
  163|     94|    return {partial, codeValue};
  164|     94|  }
_ZNK8rawspeed23PrefixCodeLookupDecoderINS_15BaselineCodeTagEE26finishReadingPartialSymbolINS_16BitStreamerMSB32EEENSt3__14pairINS_18AbstractPrefixCodeIS1_E10CodeSymbolEiEERT_S9_:
  136|    666|                             typename Base::CodeSymbol partial) const {
  137|    666|    static_assert(
  138|    666|        BitStreamerTraits<BIT_STREAM>::canUseWithPrefixCodeDecoder,
  139|    666|        "This BitStreamer specialization is not marked as usable here");
  140|  1.79k|    while (partial.code_len < Base::maxCodeLength() &&
  ------------------
  |  Branch (140:12): [True: 1.25k, False: 539]
  ------------------
  141|  1.25k|           (MaxCodeValue == maxCodeOL[partial.code_len] ||
  ------------------
  |  Branch (141:13): [True: 988, False: 264]
  ------------------
  142|  1.12k|            partial.code > maxCodeOL[partial.code_len])) {
  ------------------
  |  Branch (142:13): [True: 137, False: 127]
  ------------------
  143|  1.12k|      uint32_t temp = bs.getBitsNoFill(1);
  144|  1.12k|      partial.code =
  145|  1.12k|          implicit_cast<typename Traits::CodeTy>((partial.code << 1) | temp);
  146|  1.12k|      partial.code_len++;
  147|  1.12k|    }
  148|       |
  149|       |    // NOTE: when we are called from PrefixCodeLUTDecoder, the partial.code_len
  150|       |    // *could* be larger than the largest code lenght for this huffman table,
  151|       |    // which is a symptom of a corrupt code.
  152|    666|    if (partial.code_len > Base::maxCodeLength() ||
  ------------------
  |  Branch (152:9): [True: 4, False: 662]
  ------------------
  153|    662|        partial.code > maxCodeOL[partial.code_len])
  ------------------
  |  Branch (153:9): [True: 82, False: 580]
  ------------------
  154|    666|      ThrowRDE("bad Huffman code: %u (len: %u)", partial.code,
  ------------------
  |  |   38|     86|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     86|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     86|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     86|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  155|    580|               partial.code_len);
  156|       |
  157|    666|    assert(MaxCodeValue != codeOffsetOL[partial.code_len]);
  ------------------
  |  Branch (157:5): [True: 580, False: 0]
  ------------------
  158|    580|    assert(partial.code >= codeOffsetOL[partial.code_len]);
  ------------------
  |  Branch (158:5): [True: 580, False: 0]
  ------------------
  159|    580|    unsigned codeIndex = partial.code - codeOffsetOL[partial.code_len];
  160|    580|    assert(codeIndex < Base::code.codeValues.size());
  ------------------
  |  Branch (160:5): [True: 580, False: 0]
  ------------------
  161|       |
  162|    580|    typename Traits::CodeValueTy codeValue = Base::code.codeValues[codeIndex];
  163|    580|    return {partial, codeValue};
  164|    580|  }

_ZN8rawspeed22getTranslationalOffsetENS_10BayerPhaseES0_:
   67|  1.16k|inline iPoint2D getTranslationalOffset(BayerPhase src, BayerPhase tgt) {
   68|  1.16k|  auto getCanonicalPosition = [](BayerPhase p) -> iPoint2D {
   69|  1.16k|    auto i = static_cast<unsigned>(p);
   70|  1.16k|    return {(i & 0b01) != 0, (i & 0b10) != 0};
   71|  1.16k|  };
   72|       |
   73|  1.16k|  iPoint2D off = getCanonicalPosition(tgt) - getCanonicalPosition(src);
   74|  1.16k|  return {std::abs(off.x), std::abs(off.y)};
   75|  1.16k|}
_ZN8rawspeed14getAsCFAColorsENS_10BayerPhaseE:
   97|  1.16k|inline std::array<CFAColor, 4> getAsCFAColors(BayerPhase p) {
   98|  1.16k|  const BayerPhase basePhase = BayerPhase::RGGB;
   99|  1.16k|  using enum CFAColor;
  100|  1.16k|  const std::array<CFAColor, 4> basePat = {RED, GREEN, GREEN, BLUE};
  101|  1.16k|  return applyPhaseShift(basePat, basePhase, /*tgtPhase=*/p);
  102|  1.16k|}
_ZN8rawspeed15getAsBayerPhaseERKNS_16ColorFilterArrayE:
  131|    483|inline Optional<BayerPhase> getAsBayerPhase(const ColorFilterArray& CFA) {
  132|    483|  if (CFA.getSize() != iPoint2D(2, 2))
  ------------------
  |  Branch (132:7): [True: 23, False: 460]
  ------------------
  133|     23|    return {};
  134|       |
  135|    460|  std::array<CFAColor, 4> patData;
  136|    460|  const Array2DRef<CFAColor> pat(patData.data(), 2, 2);
  137|  1.38k|  for (int row = 0; row < pat.height(); ++row) {
  ------------------
  |  Branch (137:21): [True: 927, False: 460]
  ------------------
  138|  2.77k|    for (int col = 0; col < pat.width(); ++col) {
  ------------------
  |  Branch (138:23): [True: 1.84k, False: 927]
  ------------------
  139|  1.84k|      pat(row, col) = CFA.getColorAt(col, row);
  140|  1.84k|    }
  141|    927|  }
  142|       |
  143|    460|  for (auto i = static_cast<int>(BayerPhase::RGGB);
  144|  1.24k|       i <= static_cast<int>(BayerPhase::BGGR); ++i) {
  ------------------
  |  Branch (144:8): [True: 1.16k, False: 73]
  ------------------
  145|  1.16k|    if (auto p = static_cast<BayerPhase>(i); getAsCFAColors(p) == patData)
  ------------------
  |  Branch (145:46): [True: 387, False: 781]
  ------------------
  146|    387|      return p;
  147|  1.16k|  }
  148|       |
  149|     73|  return {};
  150|    460|}
_ZN8rawspeed15applyPhaseShiftINS_8CFAColorEEENSt3__15arrayIT_Lm4EEES5_NS_10BayerPhaseES6_:
   81|  1.16k|                                        BayerPhase tgtPhase) {
   82|  1.16k|  const iPoint2D coordOffset = getTranslationalOffset(srcPhase, tgtPhase);
   83|  1.16k|  assert(coordOffset >= iPoint2D(0, 0) && "Offset is non-negative.");
  ------------------
  |  Branch (83:3): [True: 1.15k, False: 2]
  |  Branch (83:3): [True: 1.15k, Folded]
  |  Branch (83:3): [True: 1.16k, False: 0]
  ------------------
   84|  1.16k|  const Array2DRef<const T> src(srcData.data(), 2, 2);
   85|       |
   86|  1.16k|  std::array<T, 4> tgtData;
   87|  1.16k|  const Array2DRef<T> tgt(tgtData.data(), 2, 2);
   88|  3.48k|  for (int row = 0; row < tgt.height(); ++row) {
  ------------------
  |  Branch (88:21): [True: 2.32k, False: 1.16k]
  ------------------
   89|  6.96k|    for (int col = 0; col < tgt.width(); ++col) {
  ------------------
  |  Branch (89:23): [True: 4.64k, False: 2.32k]
  ------------------
   90|  4.64k|      tgt(row, col) = src((coordOffset.y + row) % 2, (coordOffset.x + col) % 2);
   91|  4.64k|    }
   92|  2.32k|  }
   93|       |
   94|  1.16k|  return tgtData;
   95|  1.16k|}
_ZZN8rawspeed22getTranslationalOffsetENS_10BayerPhaseES0_ENKUlS0_E_clES0_:
   68|  2.33k|  auto getCanonicalPosition = [](BayerPhase p) -> iPoint2D {
   69|  2.33k|    auto i = static_cast<unsigned>(p);
   70|  2.33k|    return {(i & 0b01) != 0, (i & 0b10) != 0};
   71|  2.33k|  };

_ZN8rawspeed8writeLogENS_10DEBUG_PRIOEPKcz:
   31|   349k|void writeLog(DEBUG_PRIO priority, const char* format, ...) {
   32|       |  // When fuzzing, any output is really undesirable.
   33|   349k|}

_ZN8rawspeed21getMisalignmentOffsetImQsr3stdE13is_integral_vIT_EEEmS1_m:
  109|  8.05k|                                                           uint64_t multiple) {
  110|  8.05k|  if (multiple == 0)
  ------------------
  |  Branch (110:7): [True: 0, False: 8.05k]
  ------------------
  111|      0|    return 0;
  112|  8.05k|  return value % multiple;
  113|  8.05k|}
_ZN8rawspeed15roundToMultipleImEET_S1_mb:
  117|  8.05k|                                              bool roundDown) {
  118|  8.05k|  uint64_t offset = getMisalignmentOffset(value, multiple);
  119|  8.05k|  if (offset == 0)
  ------------------
  |  Branch (119:7): [True: 3.15k, False: 4.90k]
  ------------------
  120|  3.15k|    return value;
  121|       |  // Drop remainder.
  122|  4.90k|  T roundedDown = value - offset;
  123|  4.90k|  if (roundDown) // If we were rounding down, then that's it.
  ------------------
  |  Branch (123:7): [True: 32, False: 4.87k]
  ------------------
  124|     32|    return roundedDown;
  125|       |  // Else, just add one multiple.
  126|  4.87k|  return roundedDown + multiple;
  127|  4.90k|}
_ZN8rawspeed14copyPixelsImplENS_10Array1DRefISt4byteEENS0_IKS1_EE:
   56|  19.8k|                           Array1DRef<const std::byte> src) {
   57|  19.8k|  invariant(src.size() == dest.size());
  ------------------
  |  |   27|  19.8k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (57:3): [True: 19.8k, False: 18.4E]
  ------------------
   58|  19.8k|  std::copy(src.begin(), src.end(), dest.begin());
   59|  19.8k|}
_ZN8rawspeed14copyPixelsImplENS_10Array2DRefISt4byteEENS0_IKS1_EE:
   62|    706|                           Array2DRef<const std::byte> src) {
   63|    706|  invariant(src.width() > 0);
  ------------------
  |  |   27|    706|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (63:3): [True: 707, False: 18.4E]
  ------------------
   64|    707|  invariant(src.height() > 0);
  ------------------
  |  |   27|    707|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (64:3): [True: 706, False: 1]
  ------------------
   65|    706|  invariant(dest.width() > 0);
  ------------------
  |  |   27|    706|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (65:3): [True: 706, False: 0]
  ------------------
   66|    706|  invariant(dest.height() > 0);
  ------------------
  |  |   27|    706|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (66:3): [True: 706, False: 0]
  ------------------
   67|    706|  invariant(src.height() == dest.height());
  ------------------
  |  |   27|    706|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (67:3): [True: 706, False: 0]
  ------------------
   68|    706|  invariant(src.width() == dest.width());
  ------------------
  |  |   27|    706|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (68:3): [True: 706, False: 0]
  ------------------
   69|    706|  if (auto [destAsStrip, srcAsStrip] =
   70|    706|          std::make_tuple(dest.getAsArray1DRef(), src.getAsArray1DRef());
   71|    706|      destAsStrip && srcAsStrip) {
  ------------------
  |  Branch (71:7): [True: 196, False: 510]
  |  Branch (71:22): [True: 194, False: 2]
  ------------------
   72|    194|    copyPixelsImpl(*destAsStrip, *srcAsStrip);
   73|    194|    return;
   74|    194|  }
   75|  20.1k|  for (int row = 0; row != src.height(); ++row)
  ------------------
  |  Branch (75:21): [True: 19.6k, False: 512]
  ------------------
   76|  19.6k|    copyPixelsImpl(dest[row], src[row]);
   77|    512|}
_ZN8rawspeed10copyPixelsEPSt4byteiPKS0_iii:
   81|    706|                       int height) {
   82|    706|  invariant(destPtr);
  ------------------
  |  |   27|    706|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (82:3): [True: 706, False: 0]
  ------------------
   83|    706|  invariant(dstPitch > 0);
  ------------------
  |  |   27|    706|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (83:3): [True: 706, False: 0]
  ------------------
   84|    706|  invariant(srcPtr);
  ------------------
  |  |   27|    706|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (84:3): [True: 706, False: 0]
  ------------------
   85|    706|  invariant(srcPitch > 0);
  ------------------
  |  |   27|    706|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (85:3): [True: 706, False: 0]
  ------------------
   86|    706|  invariant(rowSize > 0);
  ------------------
  |  |   27|    706|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (86:3): [True: 706, False: 0]
  ------------------
   87|    706|  invariant(height > 0);
  ------------------
  |  |   27|    706|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (87:3): [True: 706, False: 0]
  ------------------
   88|    706|  invariant(rowSize <= srcPitch);
  ------------------
  |  |   27|    706|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (88:3): [True: 706, False: 0]
  ------------------
   89|    706|  invariant(rowSize <= dstPitch);
  ------------------
  |  |   27|    706|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (89:3): [True: 706, False: 0]
  ------------------
   90|    706|  auto dest = Array2DRef(destPtr, rowSize, height, dstPitch);
   91|    706|  auto src = Array2DRef(srcPtr, rowSize, height, srcPitch);
   92|    706|  copyPixelsImpl(dest, src);
   93|    706|}
_ZN8rawspeed9roundDownEmm:
  130|     48|                                               uint64_t multiple) {
  131|     48|  return roundToMultiple(value, multiple, /*roundDown=*/true);
  132|     48|}
_ZN8rawspeed7roundUpEmm:
  135|  8.01k|                                             uint64_t multiple) {
  136|  8.01k|  return roundToMultiple(value, multiple, /*roundDown=*/false);
  137|  8.01k|}
_ZN8rawspeed19roundUpDivisionSafeEmm:
  146|  24.8k|                                                         uint64_t div) {
  147|  18.4E|  return (value != 0) ? (1 + ((value - 1) / div)) : 0;
  ------------------
  |  Branch (147:10): [True: 24.8k, False: 18.4E]
  ------------------
  148|  24.8k|}
_ZN8rawspeed10trimSpacesENSt3__117basic_string_viewIcNS0_11char_traitsIcEEEE:
  163|   123k|inline std::string trimSpaces(std::string_view str) {
  164|       |  // Find the first character position after excluding leading blank spaces
  165|   123k|  size_t startpos = str.find_first_not_of(" \t");
  166|       |
  167|       |  // Find the first character position from reverse af
  168|   123k|  size_t endpos = str.find_last_not_of(" \t");
  169|       |
  170|       |  // if all spaces or empty return an empty string
  171|   123k|  if ((startpos == std::string::npos) || (endpos == std::string::npos))
  ------------------
  |  Branch (171:7): [True: 34.0k, False: 88.9k]
  |  Branch (171:42): [True: 0, False: 88.9k]
  ------------------
  172|  34.0k|    return "";
  173|       |
  174|  88.9k|  str = str.substr(startpos, endpos - startpos + 1);
  175|  88.9k|  return {str.begin(), str.end()};
  176|   123k|}
_ZN8rawspeed21getMisalignmentOffsetIPhQsr3stdE12is_pointer_vIT_EEEmS2_m:
   98|  15.8k|                                                           uint64_t multiple) {
   99|  15.8k|  if (multiple == 0)
  ------------------
  |  Branch (99:7): [True: 0, False: 15.8k]
  ------------------
  100|      0|    return 0;
  101|  15.8k|  static_assert(bitwidth<uintptr_t>() >= bitwidth<T>(),
  102|  15.8k|                "uintptr_t can not represent all pointer values?");
  103|  15.8k|  return reinterpret_cast<uintptr_t>(value) % multiple;
  104|  15.8k|}
_ZN8rawspeed9isAlignedIPhEEbT_m:
  151|  15.8k|constexpr RAWSPEED_READNONE bool isAligned(T value, size_t multiple) {
  152|  15.8k|  return (multiple == 0) || (getMisalignmentOffset(value, multiple) == 0);
  ------------------
  |  Branch (152:10): [True: 0, False: 15.8k]
  |  Branch (152:29): [True: 15.8k, False: 0]
  ------------------
  153|  15.8k|}
_ZN8rawspeed4isInINS_7TiffTagES1_EEbT_RKSt16initializer_listIT0_E:
  157|   178k|                            const std::initializer_list<T2>& list) {
  158|   178k|  return std::any_of(list.begin(), list.end(),
  159|   178k|                     [value](const T2& t) { return t == value; });
  160|   178k|}
_ZZN8rawspeed4isInINS_7TiffTagES1_EEbT_RKSt16initializer_listIT0_EENKUlRKS1_E_clES9_:
  159|   976k|                     [value](const T2& t) { return t == value; });
_ZN8rawspeed9isAlignedIiEEbT_m:
  151|  7.93k|constexpr RAWSPEED_READNONE bool isAligned(T value, size_t multiple) {
  152|  7.93k|  return (multiple == 0) || (getMisalignmentOffset(value, multiple) == 0);
  ------------------
  |  Branch (152:10): [True: 0, False: 7.93k]
  |  Branch (152:29): [True: 7.93k, False: 0]
  ------------------
  153|  7.93k|}
_ZN8rawspeed21getMisalignmentOffsetIiQsr3stdE13is_integral_vIT_EEEmS1_m:
  109|  7.93k|                                                           uint64_t multiple) {
  110|  7.93k|  if (multiple == 0)
  ------------------
  |  Branch (110:7): [True: 0, False: 7.93k]
  ------------------
  111|      0|    return 0;
  112|  7.93k|  return value % multiple;
  113|  7.93k|}
_ZN8rawspeed9isAlignedIPSt4byteEEbT_m:
  151|  5.66M|constexpr RAWSPEED_READNONE bool isAligned(T value, size_t multiple) {
  152|  5.66M|  return (multiple == 0) || (getMisalignmentOffset(value, multiple) == 0);
  ------------------
  |  Branch (152:10): [True: 0, False: 5.66M]
  |  Branch (152:29): [True: 5.66M, False: 0]
  ------------------
  153|  5.66M|}
_ZN8rawspeed21getMisalignmentOffsetIPSt4byteQsr3stdE12is_pointer_vIT_EEEmS3_m:
   98|  5.66M|                                                           uint64_t multiple) {
   99|  5.66M|  if (multiple == 0)
  ------------------
  |  Branch (99:7): [True: 0, False: 5.66M]
  ------------------
  100|      0|    return 0;
  101|  5.66M|  static_assert(bitwidth<uintptr_t>() >= bitwidth<T>(),
  102|  5.66M|                "uintptr_t can not represent all pointer values?");
  103|  5.66M|  return reinterpret_cast<uintptr_t>(value) % multiple;
  104|  5.66M|}

_ZN8rawspeed10DngOpcodesC2ERKNS_8RawImageENS_10ByteStreamE:
  672|  1.02k|DngOpcodes::DngOpcodes(const RawImage& ri, ByteStream bs) {
  673|       |  // DNG opcodes are always stored in big-endian byte order.
  674|  1.02k|  bs.setByteOrder(Endianness::big);
  675|       |
  676|  1.02k|  const auto opcode_count = bs.getU32();
  677|  1.02k|  auto origPos = bs.getPosition();
  678|       |
  679|       |  // validate opcode count. we either have to do this, or we can't preallocate
  680|  68.8k|  for (auto i = 0U; i < opcode_count; i++) {
  ------------------
  |  Branch (680:21): [True: 67.8k, False: 1.02k]
  ------------------
  681|  67.8k|    bs.skipBytes(4); // code
  682|  67.8k|    bs.skipBytes(4); // version
  683|  67.8k|    bs.skipBytes(4); // flags
  684|  67.8k|    const auto opcode_size = bs.getU32();
  685|  67.8k|    bs.skipBytes(opcode_size);
  686|  67.8k|  }
  687|       |
  688|  1.02k|  bs.setPosition(origPos);
  689|       |
  690|       |  // okay, we may indeed have that many opcodes in here. now let's reserve
  691|  1.02k|  opcodes.reserve(opcode_count);
  692|       |
  693|  1.02k|  iRectangle2D integrated_subimg = getImageCropAsRectangle(ri);
  694|       |
  695|  2.29k|  for (auto i = 0U; i < opcode_count; i++) {
  ------------------
  |  Branch (695:21): [True: 1.34k, False: 950]
  ------------------
  696|  1.34k|    auto code = bs.getU32();
  697|  1.34k|    bs.skipBytes(4); // ignore version
  698|       |#ifdef DEBUG
  699|       |    bs.skipBytes(4); // ignore flags
  700|       |#else
  701|  1.34k|    auto flags = bs.getU32();
  702|  1.34k|#endif
  703|  1.34k|    const auto opcode_size = bs.getU32();
  704|  1.34k|    ByteStream opcode_bs = bs.getStream(opcode_size);
  705|       |
  706|  1.34k|    const char* opName = nullptr;
  707|  1.34k|    constructor_t opConstructor = nullptr;
  708|  1.34k|    if (auto Op = Map(code))
  ------------------
  |  Branch (708:14): [True: 1.32k, False: 20]
  ------------------
  709|  1.32k|      std::tie(opName, opConstructor) = *Op;
  710|     20|    else
  711|  1.34k|      ThrowRDE("Unknown unhandled Opcode: %u", code);
  ------------------
  |  |   38|     20|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     20|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     20|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     20|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  712|       |
  713|  1.32k|    if (opConstructor != nullptr)
  ------------------
  |  Branch (713:9): [True: 1.27k, False: 50]
  ------------------
  714|  1.27k|      opcodes.emplace_back(opConstructor(ri, opcode_bs, integrated_subimg));
  715|     50|    else {
  716|     50|#ifndef DEBUG
  717|       |      // Throw Error if not marked as optional
  718|     50|      if (!(flags & 1))
  ------------------
  |  Branch (718:11): [True: 4, False: 46]
  ------------------
  719|      4|#endif
  720|     50|        ThrowRDE("Unsupported Opcode: %u (%s)", code, opName);
  ------------------
  |  |   38|      4|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      4|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      4|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      4|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  721|     50|    }
  722|       |
  723|  1.31k|    if (opcode_bs.getRemainSize() != 0)
  ------------------
  |  Branch (723:9): [True: 49, False: 1.27k]
  ------------------
  724|  1.31k|      ThrowRDE("Inconsistent length of opcode");
  ------------------
  |  |   38|     49|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     49|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     49|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     49|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  725|  1.31k|  }
  726|       |
  727|       |#ifdef DEBUG
  728|       |  assert(opcodes.size() == opcode_count);
  729|       |#endif
  730|  1.02k|}
DngOpcodes.cpp:_ZN8rawspeed12_GLOBAL__N_123getImageCropAsRectangleERKNS_8RawImageE:
   68|  2.61k|iRectangle2D getImageCropAsRectangle(const RawImage& ri) {
   69|  2.61k|  iRectangle2D rect;
   70|  2.61k|  switch (ri->getDataType()) {
  ------------------
  |  Branch (70:11): [True: 2.61k, False: 0]
  ------------------
   71|  2.39k|  case RawImageType::UINT16:
  ------------------
  |  Branch (71:3): [True: 2.39k, False: 217]
  ------------------
   72|  2.39k|    rect = getImageCropAsRectangle(ri->getU16DataAsCroppedArray2DRef());
   73|  2.39k|    break;
   74|    217|  case RawImageType::F32:
  ------------------
  |  Branch (74:3): [True: 217, False: 2.39k]
  ------------------
   75|    217|    rect = getImageCropAsRectangle(ri->getF32DataAsCroppedArray2DRef());
   76|    217|    break;
   77|  2.61k|  }
   78|  5.22k|  for (int* col : {&rect.pos.x, &rect.dim.x}) {
  ------------------
  |  Branch (78:17): [True: 5.22k, False: 2.61k]
  ------------------
   79|  5.22k|    assert(*col % ri->getCpp() == 0 && "Column is width * cpp");
  ------------------
  |  Branch (79:5): [True: 5.22k, False: 0]
  |  Branch (79:5): [True: 5.22k, Folded]
  |  Branch (79:5): [True: 5.22k, False: 0]
  ------------------
   80|  5.22k|    *col /= ri->getCpp();
   81|  5.22k|  }
   82|  2.61k|  return rect;
   83|  2.61k|}
DngOpcodes.cpp:_ZN8rawspeed12_GLOBAL__N_123getImageCropAsRectangleItEENS_12iRectangle2DENS_17CroppedArray2DRefIT_EE:
   63|  2.39k|iRectangle2D getImageCropAsRectangle(CroppedArray2DRef<T> img) {
   64|  2.39k|  return {{img.offsetCols, img.offsetRows},
   65|  2.39k|          {img.croppedWidth, img.croppedHeight}};
   66|  2.39k|}
DngOpcodes.cpp:_ZN8rawspeed12_GLOBAL__N_123getImageCropAsRectangleIfEENS_12iRectangle2DENS_17CroppedArray2DRefIT_EE:
   63|    217|iRectangle2D getImageCropAsRectangle(CroppedArray2DRef<T> img) {
   64|    217|  return {{img.offsetCols, img.offsetRows},
   65|    217|          {img.croppedWidth, img.croppedHeight}};
   66|    217|}
_ZN8rawspeed10DngOpcodesD2Ev:
  734|    387|DngOpcodes::~DngOpcodes() = default;
_ZNK8rawspeed10DngOpcodes12applyOpCodesERKNS_8RawImageE:
  736|    387|void DngOpcodes::applyOpCodes(const RawImage& ri) const {
  737|    567|  for (const auto& code : opcodes) {
  ------------------
  |  Branch (737:25): [True: 567, False: 387]
  ------------------
  738|    567|    code->setup(ri);
  739|    567|    code->apply(ri);
  740|    567|  }
  741|    387|}
_ZN8rawspeed10DngOpcodes3MapEj:
  753|  1.34k|DngOpcodes::Map(uint32_t code) {
  754|  1.34k|  switch (code) {
  755|     16|  case 1U:
  ------------------
  |  Branch (755:3): [True: 16, False: 1.32k]
  ------------------
  756|     16|    return make_pair("WarpRectilinear", nullptr);
  757|     10|  case 2U:
  ------------------
  |  Branch (757:3): [True: 10, False: 1.33k]
  ------------------
  758|     10|    return make_pair("WarpFisheye", nullptr);
  759|     12|  case 3U:
  ------------------
  |  Branch (759:3): [True: 12, False: 1.33k]
  ------------------
  760|     12|    return make_pair("FixVignetteRadial", nullptr);
  761|    123|  case 4U:
  ------------------
  |  Branch (761:3): [True: 123, False: 1.22k]
  ------------------
  762|    123|    return make_pair(
  763|    123|        "FixBadPixelsConstant",
  764|    123|        &DngOpcodes::constructor<DngOpcodes::FixBadPixelsConstant>);
  765|    413|  case 5U:
  ------------------
  |  Branch (765:3): [True: 413, False: 930]
  ------------------
  766|    413|    return make_pair("FixBadPixelsList",
  767|    413|                     &DngOpcodes::constructor<DngOpcodes::FixBadPixelsList>);
  768|     67|  case 6U:
  ------------------
  |  Branch (768:3): [True: 67, False: 1.27k]
  ------------------
  769|     67|    return make_pair("TrimBounds",
  770|     67|                     &DngOpcodes::constructor<DngOpcodes::TrimBounds>);
  771|    100|  case 7U:
  ------------------
  |  Branch (771:3): [True: 100, False: 1.24k]
  ------------------
  772|    100|    return make_pair("MapTable",
  773|    100|                     &DngOpcodes::constructor<DngOpcodes::TableMap>);
  774|     82|  case 8U:
  ------------------
  |  Branch (774:3): [True: 82, False: 1.26k]
  ------------------
  775|     82|    return make_pair("MapPolynomial",
  776|     82|                     &DngOpcodes::constructor<DngOpcodes::PolynomialMap>);
  777|     11|  case 9U:
  ------------------
  |  Branch (777:3): [True: 11, False: 1.33k]
  ------------------
  778|     11|    return make_pair("GainMap", nullptr);
  779|    130|  case 10U:
  ------------------
  |  Branch (779:3): [True: 130, False: 1.21k]
  ------------------
  780|    130|    return make_pair(
  781|    130|        "DeltaPerRow",
  782|    130|        &DngOpcodes::constructor<
  783|    130|            DngOpcodes::OffsetPerRowOrCol<DeltaRowOrColBase::SelectY>>);
  784|    143|  case 11U:
  ------------------
  |  Branch (784:3): [True: 143, False: 1.20k]
  ------------------
  785|    143|    return make_pair(
  786|    143|        "DeltaPerColumn",
  787|    143|        &DngOpcodes::constructor<
  788|    143|            DngOpcodes::OffsetPerRowOrCol<DeltaRowOrColBase::SelectX>>);
  789|    102|  case 12U:
  ------------------
  |  Branch (789:3): [True: 102, False: 1.24k]
  ------------------
  790|    102|    return make_pair(
  791|    102|        "ScalePerRow",
  792|    102|        &DngOpcodes::constructor<
  793|    102|            DngOpcodes::ScalePerRowOrCol<DeltaRowOrColBase::SelectY>>);
  794|    113|  case 13U:
  ------------------
  |  Branch (794:3): [True: 113, False: 1.23k]
  ------------------
  795|    113|    return make_pair(
  796|    113|        "ScalePerColumn",
  797|    113|        &DngOpcodes::constructor<
  798|    113|            DngOpcodes::ScalePerRowOrCol<DeltaRowOrColBase::SelectX>>);
  799|      1|  case 14U:
  ------------------
  |  Branch (799:3): [True: 1, False: 1.34k]
  ------------------
  800|      1|    return make_pair("WarpRectilinear2", nullptr);
  801|     20|  default:
  ------------------
  |  Branch (801:3): [True: 20, False: 1.32k]
  ------------------
  802|     20|    return std::nullopt;
  803|  1.34k|  }
  804|  1.34k|}
_ZN8rawspeed10DngOpcodes11constructorINS0_20FixBadPixelsConstantEEENSt3__110unique_ptrINS0_9DngOpcodeENS3_14default_deleteIS5_EEEERKNS_8RawImageERNS_10ByteStreamERNS_12iRectangle2DE:
  746|    123|                        iRectangle2D& integrated_subimg) {
  747|    123|  return std::make_unique<Opcode>(ri, bs, integrated_subimg);
  748|    123|}
_ZN8rawspeed10DngOpcodes20FixBadPixelsConstantC2ERKNS_8RawImageERNS_10ByteStreamERKNS_12iRectangle2DE:
  157|    123|      : DngOpcodes::DngOpcode(integrated_subimg_), value(bs.getU32()) {
  158|    123|    bs.getU32(); // Bayer Phase not used
  159|    123|  }
_ZN8rawspeed10DngOpcodes9DngOpcodeC2ERKNS_12iRectangle2DE:
  108|  2.39k|      : integrated_subimg(integrated_subimg_)
  109|       |#endif
  110|  2.39k|  {
  111|       |    assert(std::uncaught_exceptions() == 0 &&
  ------------------
  |  Branch (111:5): [True: 2.39k, False: 0]
  |  Branch (111:5): [True: 2.39k, Folded]
  |  Branch (111:5): [True: 2.39k, False: 0]
  ------------------
  112|  2.39k|           "Creating DngOpcode during call stack unwinding?");
  113|  2.39k|  }
_ZN8rawspeed10DngOpcodes9DngOpcodeD2Ev:
  121|  2.39k|  virtual ~DngOpcode() {
  122|       |    assert((std::uncaught_exceptions() > 0 || setup_was_called) &&
  ------------------
  |  Branch (122:5): [True: 806, False: 1.58k]
  |  Branch (122:5): [True: 1.58k, False: 0]
  |  Branch (122:5): [True: 2.39k, Folded]
  |  Branch (122:5): [True: 2.39k, False: 0]
  ------------------
  123|  2.39k|           "Derived classes did not call our setup()!");
  124|  2.39k|  }
_ZN8rawspeed10DngOpcodes11constructorINS0_16FixBadPixelsListEEENSt3__110unique_ptrINS0_9DngOpcodeENS3_14default_deleteIS5_EEEERKNS_8RawImageERNS_10ByteStreamERNS_12iRectangle2DE:
  746|    413|                        iRectangle2D& integrated_subimg) {
  747|    413|  return std::make_unique<Opcode>(ri, bs, integrated_subimg);
  748|    413|}
_ZN8rawspeed10DngOpcodes16FixBadPixelsListC2ERKNS_8RawImageERNS_10ByteStreamERKNS_12iRectangle2DE:
  271|    413|      : DngOpcodes::DngOpcode(integrated_subimg_) {
  272|       |    // Although it is not really obvious from the spec,
  273|       |    // the coordinates appear to be global/crop-independent,
  274|       |    // and apply to the source uncropped image.
  275|    413|    const iRectangle2D fullImage({0, 0}, ri->getUncroppedDim());
  276|       |
  277|    413|    bs.getU32(); // Skip phase - we don't care
  278|    413|    auto badPointCount = bs.getU32();
  279|    413|    auto badRectCount = bs.getU32();
  280|       |
  281|       |    // first, check that we indeed have much enough data
  282|    413|    const auto origPos = bs.getPosition();
  283|    413|    bs.skipBytes(badPointCount, 2 * 4);
  284|    413|    bs.skipBytes(badRectCount, 4 * 4);
  285|    413|    bs.setPosition(origPos);
  286|       |
  287|       |    // Read points
  288|    413|    badPixels.reserve(badPixels.size() + badPointCount);
  289|  1.55k|    for (auto i = 0U; i < badPointCount; ++i) {
  ------------------
  |  Branch (289:23): [True: 1.21k, False: 342]
  ------------------
  290|  1.21k|      auto y = bs.getU32();
  291|  1.21k|      auto x = bs.getU32();
  292|       |
  293|  1.21k|      if (const iPoint2D badPoint(x, y); !fullImage.isPointInside(badPoint))
  ------------------
  |  Branch (293:42): [True: 71, False: 1.14k]
  ------------------
  294|  1.21k|        ThrowRDE("Bad point not inside image.");
  ------------------
  |  |   38|     71|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     71|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     71|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     71|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  295|       |
  296|  1.14k|      badPixels.emplace_back(y << 16 | x);
  297|  1.14k|    }
  298|       |
  299|       |    // Read rects
  300|  1.40k|    for (auto i = 0U; i < badRectCount; ++i) {
  ------------------
  |  Branch (300:23): [True: 1.11k, False: 285]
  ------------------
  301|  1.11k|      iRectangle2D fullImage_ = fullImage;
  302|  1.11k|      const DummyROIOpcode dummy(ri, bs, fullImage_);
  303|       |
  304|  1.11k|      const iRectangle2D badRect = dummy.getRoi();
  305|  1.11k|      assert(badRect.isThisInside(fullImage));
  ------------------
  |  Branch (305:7): [True: 1.06k, False: 57]
  ------------------
  306|       |
  307|  1.06k|      auto area = badRect.getHeight() * badRect.getWidth();
  308|  1.06k|      badPixels.reserve(badPixels.size() + area);
  309|  14.4k|      for (auto y = 0; y < badRect.getHeight(); ++y) {
  ------------------
  |  Branch (309:24): [True: 13.4k, False: 1.06k]
  ------------------
  310|   998k|        for (auto x = 0; x < badRect.getWidth(); ++x) {
  ------------------
  |  Branch (310:26): [True: 984k, False: 13.4k]
  ------------------
  311|   984k|          badPixels.emplace_back((badRect.getTop() + y) << 16 |
  312|   984k|                                 (badRect.getLeft() + x));
  313|   984k|        }
  314|  13.4k|      }
  315|  1.06k|    }
  316|    342|  }
_ZN8rawspeed10DngOpcodes14DummyROIOpcodeC2ERKNS_8RawImageERNS_10ByteStreamERKNS_12iRectangle2DE:
  244|  1.11k|      : ROIOpcode(ri, bs, integrated_subimg_) {
  245|  1.11k|    DummyROIOpcode::setup(ri);
  246|  1.11k|  }
_ZN8rawspeed10DngOpcodes9ROIOpcodeC2ERKNS_8RawImageERNS_10ByteStreamERKNS_12iRectangle2DE:
  201|  1.85k|      : DngOpcodes::DngOpcode(integrated_subimg_) {
  202|  1.85k|    const iRectangle2D subImage = {{0, 0}, integrated_subimg_.dim};
  203|       |
  204|  1.85k|    uint32_t top = bs.getU32();
  205|  1.85k|    uint32_t left = bs.getU32();
  206|  1.85k|    uint32_t bottom = bs.getU32();
  207|  1.85k|    uint32_t right = bs.getU32();
  208|       |
  209|  1.85k|    const iPoint2D topLeft(left, top);
  210|  1.85k|    const iPoint2D bottomRight(right, bottom);
  211|       |
  212|  1.85k|    if (!(subImage.isPointInsideInclusive(topLeft) &&
  ------------------
  |  Branch (212:11): [True: 1.70k, False: 150]
  ------------------
  213|  1.70k|          subImage.isPointInsideInclusive(bottomRight) &&
  ------------------
  |  Branch (213:11): [True: 1.61k, False: 92]
  ------------------
  214|  1.61k|          bottomRight >= topLeft)) {
  ------------------
  |  Branch (214:11): [True: 1.61k, False: 1]
  ------------------
  215|    218|      ThrowRDE("Rectangle (%d, %d, %d, %d) not inside image (%d, %d, %d, %d).",
  ------------------
  |  |   38|    218|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|    218|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|    218|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|    218|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  216|    218|               topLeft.x, topLeft.y, bottomRight.x, bottomRight.y,
  217|    218|               subImage.getTopLeft().x, subImage.getTopLeft().y,
  218|    218|               subImage.getBottomRight().x, subImage.getBottomRight().y);
  219|    218|    }
  220|       |
  221|  1.63k|    roi.setTopLeft(topLeft);
  222|  1.63k|    roi.setBottomRightAbsolute(bottomRight);
  223|       |    assert(roi.isThisInside(subImage));
  ------------------
  |  Branch (223:5): [True: 1.61k, False: 25]
  ------------------
  224|  1.63k|  }
_ZNK8rawspeed10DngOpcodes9ROIOpcode6getRoiEv:
  226|  2.64k|  [[nodiscard]] const iRectangle2D& RAWSPEED_READONLY getRoi() const {
  227|  2.64k|    return roi;
  228|  2.64k|  }
_ZN8rawspeed10DngOpcodes11constructorINS0_10TrimBoundsEEENSt3__110unique_ptrINS0_9DngOpcodeENS3_14default_deleteIS5_EEEERKNS_8RawImageERNS_10ByteStreamERNS_12iRectangle2DE:
  746|     67|                        iRectangle2D& integrated_subimg) {
  747|     67|  return std::make_unique<Opcode>(ri, bs, integrated_subimg);
  748|     67|}
_ZN8rawspeed10DngOpcodes10TrimBoundsC2ERKNS_8RawImageERNS_10ByteStreamERNS_12iRectangle2DE:
  338|     67|      : ROIOpcode(ri, bs, integrated_subimg_) {
  339|     67|    integrated_subimg_.pos += getRoi().pos;
  340|     67|    integrated_subimg_.dim = getRoi().dim;
  341|     67|  }
_ZN8rawspeed10DngOpcodes11constructorINS0_8TableMapEEENSt3__110unique_ptrINS0_9DngOpcodeENS3_14default_deleteIS5_EEEERKNS_8RawImageERNS_10ByteStreamERNS_12iRectangle2DE:
  746|    100|                        iRectangle2D& integrated_subimg) {
  747|    100|  return std::make_unique<Opcode>(ri, bs, integrated_subimg);
  748|    100|}
_ZN8rawspeed10DngOpcodes8TableMapC2ERKNS_8RawImageERNS_10ByteStreamERKNS_12iRectangle2DE:
  453|    100|      : LookupOpcode(ri, bs, integrated_subimg_) {
  454|    100|    auto count = bs.getU32();
  455|       |
  456|    100|    if (count == 0 || count > 65536)
  ------------------
  |  Branch (456:9): [True: 35, False: 65]
  |  Branch (456:23): [True: 13, False: 52]
  ------------------
  457|    100|      ThrowRDE("Invalid size of lookup table");
  ------------------
  |  |   38|     14|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     14|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     14|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     14|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  458|       |
  459|   210k|    for (auto i = 0U; i < count; ++i)
  ------------------
  |  Branch (459:23): [True: 210k, False: 86]
  ------------------
  460|   210k|      lookup[i] = bs.getU16();
  461|       |
  462|     86|    if (count < lookup.size())
  ------------------
  |  Branch (462:9): [True: 46, False: 40]
  ------------------
  463|     46|      fill_n(&lookup[count], lookup.size() - count, lookup[count - 1]);
  464|     86|  }
_ZN8rawspeed10DngOpcodes11PixelOpcodeC2ERKNS_8RawImageERNS_10ByteStreamERKNS_12iRectangle2DE:
  364|    670|      : ROIOpcode(ri, bs, integrated_subimg_), firstPlane(bs.getU32()),
  365|    670|        planes(bs.getU32()) {
  366|       |
  367|    670|    if (planes == 0 || firstPlane > ri->getCpp() || planes > ri->getCpp() ||
  ------------------
  |  Branch (367:9): [True: 153, False: 517]
  |  Branch (367:24): [True: 34, False: 483]
  |  Branch (367:53): [True: 29, False: 454]
  ------------------
  368|    454|        firstPlane + planes > ri->getCpp()) {
  ------------------
  |  Branch (368:9): [True: 1, False: 453]
  ------------------
  369|     65|      ThrowRDE("Bad plane params (first %u, num %u), got planes = %u",
  ------------------
  |  |   38|     65|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     65|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     65|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     65|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  370|     65|               firstPlane, planes, ri->getCpp());
  371|     65|    }
  372|       |
  373|    605|    rowPitch = bs.getU32();
  374|    605|    colPitch = bs.getU32();
  375|       |
  376|    605|    const iRectangle2D& ROI = getRoi();
  377|       |
  378|    605|    if (rowPitch < 1 || rowPitch > static_cast<uint32_t>(ROI.getHeight()) ||
  ------------------
  |  Branch (378:9): [True: 154, False: 451]
  |  Branch (378:25): [True: 10, False: 441]
  ------------------
  379|    441|        colPitch < 1 || colPitch > static_cast<uint32_t>(ROI.getWidth()))
  ------------------
  |  Branch (379:9): [True: 3, False: 438]
  |  Branch (379:25): [True: 35, False: 403]
  ------------------
  380|    605|      ThrowRDE("Invalid pitch");
  ------------------
  |  |   38|     49|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     49|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     49|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     49|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  381|    605|  }
_ZN8rawspeed10DngOpcodes11constructorINS0_13PolynomialMapEEENSt3__110unique_ptrINS0_9DngOpcodeENS3_14default_deleteIS5_EEEERKNS_8RawImageERNS_10ByteStreamERNS_12iRectangle2DE:
  746|     82|                        iRectangle2D& integrated_subimg) {
  747|     82|  return std::make_unique<Opcode>(ri, bs, integrated_subimg);
  748|     82|}
_ZN8rawspeed10DngOpcodes13PolynomialMapC2ERKNS_8RawImageERNS_10ByteStreamERKNS_12iRectangle2DE:
  480|     82|      : LookupOpcode(ri, bs, integrated_subimg_) {
  481|     82|    vector<double> polynomial;
  482|       |
  483|     82|    const auto polynomial_size = bs.getU32() + 1UL;
  484|     82|    (void)bs.check(implicit_cast<Buffer::size_type>(8UL * polynomial_size));
  485|     82|    if (polynomial_size > 9)
  ------------------
  |  Branch (485:9): [True: 2, False: 80]
  ------------------
  486|     82|      ThrowRDE("A polynomial with more than 8 degrees not allowed");
  ------------------
  |  |   38|      2|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      2|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      2|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      2|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  487|       |
  488|     80|    polynomial.reserve(polynomial_size);
  489|     80|    std::generate_n(std::back_inserter(polynomial), polynomial_size,
  490|     80|                    [&bs]() { return bs.get<double>(); });
  491|       |
  492|       |    // Create lookup
  493|     80|    lookup.resize(65536);
  494|  2.75M|    for (auto i = 0UL; i < lookup.size(); ++i) {
  ------------------
  |  Branch (494:24): [True: 2.75M, False: 80]
  ------------------
  495|  2.75M|      double val = polynomial[0];
  496|  5.37M|      for (auto j = 1UL; j < polynomial.size(); ++j)
  ------------------
  |  Branch (496:26): [True: 2.62M, False: 2.75M]
  ------------------
  497|  2.62M|        val += polynomial[j] * pow(implicit_cast<double>(i) / 65536.0,
  498|  2.62M|                                   implicit_cast<double>(j));
  499|  2.75M|      lookup[i] = implicit_cast<uint16_t>(std::clamp<double>(
  500|  2.75M|          val * 65535.5, std::numeric_limits<uint16_t>::min(),
  501|  2.75M|          std::numeric_limits<uint16_t>::max()));
  502|  2.75M|    }
  503|     80|  }
_ZZN8rawspeed10DngOpcodes13PolynomialMapC1ERKNS_8RawImageERNS_10ByteStreamERKNS_12iRectangle2DEENKUlvE_clEv:
  490|     82|                    [&bs]() { return bs.get<double>(); });
_ZN8rawspeed10DngOpcodes11constructorINS0_17OffsetPerRowOrColINS0_17DeltaRowOrColBase7SelectYEEEEENSt3__110unique_ptrINS0_9DngOpcodeENS6_14default_deleteIS8_EEEERKNS_8RawImageERNS_10ByteStreamERNS_12iRectangle2DE:
  746|    130|                        iRectangle2D& integrated_subimg) {
  747|    130|  return std::make_unique<Opcode>(ri, bs, integrated_subimg);
  748|    130|}
_ZN8rawspeed10DngOpcodes17OffsetPerRowOrColINS0_17DeltaRowOrColBase7SelectYEEC2ERKNS_8RawImageERNS_10ByteStreamERKNS_12iRectangle2DE:
  612|    130|      : DeltaRowOrCol<S>(ri, bs, integrated_subimg_, 65535.0F),
  613|    130|        absLimit(double(std::numeric_limits<uint16_t>::max()) /
  614|    130|                 implicit_cast<double>(this->f2iScale)) {}
_ZN8rawspeed10DngOpcodes13DeltaRowOrColINS0_17DeltaRowOrColBase7SelectYEEC2ERKNS_8RawImageERNS_10ByteStreamERKNS_12iRectangle2DEf:
  565|    232|      : DeltaRowOrColBase(ri, bs, integrated_subimg_), f2iScale(f2iScale_) {
  566|    232|    const auto deltaF_count = bs.getU32();
  567|    232|    (void)bs.check(deltaF_count, 4);
  568|       |
  569|       |    // See PixelOpcode::applyOP(). We will access deltaF/deltaI up to (excl.)
  570|       |    // either ROI.getWidth() or ROI.getHeight() index. Thus, we need to have
  571|       |    // either ROI.getRight() or ROI.getBottom() elements in there.
  572|    232|    if (const auto expectedSize = roundUpDivisionSafe(
  573|    232|            S::select(getRoi().getWidth(), getRoi().getHeight()),
  574|    232|            S::select(getPitch().x, getPitch().y));
  575|    232|        expectedSize != deltaF_count) {
  ------------------
  |  Branch (575:9): [True: 4, False: 228]
  ------------------
  576|      4|      ThrowRDE("Got unexpected number of elements (%" PRIu64 "), expected %u.",
  ------------------
  |  |   38|      4|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      4|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      4|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      4|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  577|      4|               expectedSize, deltaF_count);
  578|      4|    }
  579|       |
  580|    228|    deltaF.reserve(deltaF_count);
  581|    228|    std::generate_n(std::back_inserter(deltaF), deltaF_count, [&bs]() {
  582|    228|      const auto F = bs.get<float>();
  583|    228|      switch (std::fpclassify(F)) {
  584|    228|      case FP_NORMAL:
  585|    228|      case FP_SUBNORMAL:
  586|    228|      case FP_ZERO:
  587|    228|        return F;
  588|    228|      default:
  589|    228|        ThrowRDE("Got bad float %f.", implicit_cast<double>(F));
  590|    228|      }
  591|    228|    });
  592|    228|  }
_ZN8rawspeed10DngOpcodes17DeltaRowOrColBaseC2ERKNS_8RawImageERNS_10ByteStreamERKNS_12iRectangle2DE:
  528|    488|      : PixelOpcode(ri, bs, integrated_subimg_) {}
_ZN8rawspeed10DngOpcodes17DeltaRowOrColBase7SelectY6selectEjj:
  522|  7.89k|    static uint32_t select(uint32_t /*x*/, uint32_t y) { return y; }
_ZNK8rawspeed10DngOpcodes11PixelOpcode8getPitchEv:
  383|    275|  [[nodiscard]] iPoint2D RAWSPEED_READONLY getPitch() const {
  384|    275|    return {static_cast<int>(colPitch), static_cast<int>(rowPitch)};
  385|    275|  }
_ZZN8rawspeed10DngOpcodes13DeltaRowOrColINS0_17DeltaRowOrColBase7SelectYEEC1ERKNS_8RawImageERNS_10ByteStreamERKNS_12iRectangle2DEfENKUlvE_clEv:
  581|    195|    std::generate_n(std::back_inserter(deltaF), deltaF_count, [&bs]() {
  582|    195|      const auto F = bs.get<float>();
  583|    195|      switch (std::fpclassify(F)) {
  584|    150|      case FP_NORMAL:
  ------------------
  |  Branch (584:7): [True: 150, False: 45]
  ------------------
  585|    150|      case FP_SUBNORMAL:
  ------------------
  |  Branch (585:7): [True: 0, False: 195]
  ------------------
  586|    195|      case FP_ZERO:
  ------------------
  |  Branch (586:7): [True: 45, False: 150]
  ------------------
  587|    195|        return F;
  588|      0|      default:
  ------------------
  |  Branch (588:7): [True: 0, False: 195]
  ------------------
  589|      0|        ThrowRDE("Got bad float %f.", implicit_cast<double>(F));
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  590|    195|      }
  591|    195|    });
_ZN8rawspeed10DngOpcodes13DeltaRowOrColINS0_17DeltaRowOrColBase7SelectYEE5setupERKNS_8RawImageE:
  539|    107|  void setup(const RawImage& ri) final {
  540|    107|    PixelOpcode::setup(ri);
  541|       |
  542|       |    // If we are working on a float image, no need to convert to int
  543|    107|    if (ri->getDataType() != RawImageType::UINT16)
  ------------------
  |  Branch (543:9): [True: 35, False: 72]
  ------------------
  544|     35|      return;
  545|       |
  546|     72|    deltaI.reserve(deltaF.size());
  547|    116|    for (const auto f : deltaF) {
  ------------------
  |  Branch (547:23): [True: 116, False: 66]
  ------------------
  548|    116|      if (!valueIsOk(f))
  ------------------
  |  Branch (548:11): [True: 6, False: 110]
  ------------------
  549|    116|        ThrowRDE("Got float %f which is unacceptable.",
  ------------------
  |  |   38|      6|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      6|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      6|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      6|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  550|    110|                 implicit_cast<double>(f));
  551|    110|      deltaI.emplace_back(static_cast<int>(f2iScale * f));
  552|    110|    }
  553|     72|  }
_ZN8rawspeed10DngOpcodes17OffsetPerRowOrColINS0_17DeltaRowOrColBase7SelectYEE5applyERKNS_8RawImageE:
  616|     47|  void apply(const RawImage& ri) override {
  617|     47|    if (ri->getDataType() == RawImageType::UINT16) {
  ------------------
  |  Branch (617:9): [True: 33, False: 14]
  ------------------
  618|     33|      this->template applyOP<uint16_t>(
  619|     33|          ri, [this](uint32_t x, uint32_t y, uint16_t v) {
  620|     33|            return clampBits(this->deltaI[S::select(x, y)] + v, 16);
  621|     33|          });
  622|     33|    } else {
  623|     14|      this->template applyOP<float>(ri,
  624|     14|                                    [this](uint32_t x, uint32_t y, float v) {
  625|     14|                                      return this->deltaF[S::select(x, y)] + v;
  626|     14|                                    });
  627|     14|    }
  628|     47|  }
_ZNK8rawspeed10DngOpcodes11PixelOpcode7applyOPItZNS0_17OffsetPerRowOrColINS0_17DeltaRowOrColBase7SelectYEE5applyERKNS_8RawImageEEUljjtE_EEvS9_T0_:
  391|     33|  void applyOP(const RawImage& ri, OP op) const {
  392|     33|    const CroppedArray2DRef<T> img = getDataAsCroppedArray2DRef<T>(ri);
  393|     33|    int cpp = ri->getCpp();
  394|     33|    const iRectangle2D& ROI = getRoi();
  395|     33|    const iPoint2D numAffected(
  396|     33|        implicit_cast<int>(roundUpDivisionSafe(getRoi().dim.x, colPitch)),
  397|     33|        implicit_cast<int>(roundUpDivisionSafe(getRoi().dim.y, rowPitch)));
  398|     85|    for (int y = 0; y < numAffected.y; ++y) {
  ------------------
  |  Branch (398:21): [True: 52, False: 33]
  ------------------
  399|    839|      for (int x = 0; x < numAffected.x; ++x) {
  ------------------
  |  Branch (399:23): [True: 787, False: 52]
  ------------------
  400|  2.18k|        for (auto p = 0U; p < planes; ++p) {
  ------------------
  |  Branch (400:27): [True: 1.39k, False: 787]
  ------------------
  401|  1.39k|          T& pixel =
  402|  1.39k|              img(ROI.getTop() + (rowPitch * y),
  403|  1.39k|                  firstPlane + ((ROI.getLeft() + colPitch * x) * cpp) + p);
  404|  1.39k|          pixel = op(x, y, pixel);
  405|  1.39k|        }
  406|    787|      }
  407|     52|    }
  408|     33|  }
DngOpcodes.cpp:_ZN8rawspeed12_GLOBAL__N_126getDataAsCroppedArray2DRefItEENS_17CroppedArray2DRefIT_EERKNS_8RawImageE:
   87|    179|CroppedArray2DRef<T> getDataAsCroppedArray2DRef(const RawImage& ri) {
   88|       |  if constexpr (std::is_same<T, uint16_t>())
   89|    179|    return ri->getU16DataAsCroppedArray2DRef();
   90|       |  if constexpr (std::is_same<T, float>())
   91|       |    return ri->getF32DataAsCroppedArray2DRef();
   92|    179|  __builtin_unreachable();
   93|    179|}
_ZZN8rawspeed10DngOpcodes17OffsetPerRowOrColINS0_17DeltaRowOrColBase7SelectYEE5applyERKNS_8RawImageEENKUljjtE_clEjjt:
  619|  1.39k|          ri, [this](uint32_t x, uint32_t y, uint16_t v) {
  620|  1.39k|            return clampBits(this->deltaI[S::select(x, y)] + v, 16);
  621|  1.39k|          });
_ZNK8rawspeed10DngOpcodes11PixelOpcode7applyOPIfZNS0_17OffsetPerRowOrColINS0_17DeltaRowOrColBase7SelectYEE5applyERKNS_8RawImageEEUljjfE_EEvS9_T0_:
  391|     14|  void applyOP(const RawImage& ri, OP op) const {
  392|     14|    const CroppedArray2DRef<T> img = getDataAsCroppedArray2DRef<T>(ri);
  393|     14|    int cpp = ri->getCpp();
  394|     14|    const iRectangle2D& ROI = getRoi();
  395|     14|    const iPoint2D numAffected(
  396|     14|        implicit_cast<int>(roundUpDivisionSafe(getRoi().dim.x, colPitch)),
  397|     14|        implicit_cast<int>(roundUpDivisionSafe(getRoi().dim.y, rowPitch)));
  398|     28|    for (int y = 0; y < numAffected.y; ++y) {
  ------------------
  |  Branch (398:21): [True: 14, False: 14]
  ------------------
  399|    483|      for (int x = 0; x < numAffected.x; ++x) {
  ------------------
  |  Branch (399:23): [True: 469, False: 14]
  ------------------
  400|  1.15k|        for (auto p = 0U; p < planes; ++p) {
  ------------------
  |  Branch (400:27): [True: 687, False: 469]
  ------------------
  401|    687|          T& pixel =
  402|    687|              img(ROI.getTop() + (rowPitch * y),
  403|    687|                  firstPlane + ((ROI.getLeft() + colPitch * x) * cpp) + p);
  404|    687|          pixel = op(x, y, pixel);
  405|    687|        }
  406|    469|      }
  407|     14|    }
  408|     14|  }
DngOpcodes.cpp:_ZN8rawspeed12_GLOBAL__N_126getDataAsCroppedArray2DRefIfEENS_17CroppedArray2DRefIT_EERKNS_8RawImageE:
   87|     68|CroppedArray2DRef<T> getDataAsCroppedArray2DRef(const RawImage& ri) {
   88|       |  if constexpr (std::is_same<T, uint16_t>())
   89|       |    return ri->getU16DataAsCroppedArray2DRef();
   90|       |  if constexpr (std::is_same<T, float>())
   91|     68|    return ri->getF32DataAsCroppedArray2DRef();
   92|      0|  __builtin_unreachable();
   93|     68|}
_ZZN8rawspeed10DngOpcodes17OffsetPerRowOrColINS0_17DeltaRowOrColBase7SelectYEE5applyERKNS_8RawImageEENKUljjfE_clEjjf:
  624|    687|                                    [this](uint32_t x, uint32_t y, float v) {
  625|    687|                                      return this->deltaF[S::select(x, y)] + v;
  626|    687|                                    });
_ZN8rawspeed10DngOpcodes17OffsetPerRowOrColINS0_17DeltaRowOrColBase7SelectYEE9valueIsOkEf:
  605|     53|  bool valueIsOk(float value) override {
  606|     53|    return implicit_cast<double>(std::abs(value)) <= absLimit;
  607|     53|  }
_ZN8rawspeed10DngOpcodes11constructorINS0_17OffsetPerRowOrColINS0_17DeltaRowOrColBase7SelectXEEEEENSt3__110unique_ptrINS0_9DngOpcodeENS6_14default_deleteIS8_EEEERKNS_8RawImageERNS_10ByteStreamERNS_12iRectangle2DE:
  746|    143|                        iRectangle2D& integrated_subimg) {
  747|    143|  return std::make_unique<Opcode>(ri, bs, integrated_subimg);
  748|    143|}
_ZN8rawspeed10DngOpcodes17OffsetPerRowOrColINS0_17DeltaRowOrColBase7SelectXEEC2ERKNS_8RawImageERNS_10ByteStreamERKNS_12iRectangle2DE:
  612|    143|      : DeltaRowOrCol<S>(ri, bs, integrated_subimg_, 65535.0F),
  613|    143|        absLimit(double(std::numeric_limits<uint16_t>::max()) /
  614|    143|                 implicit_cast<double>(this->f2iScale)) {}
_ZN8rawspeed10DngOpcodes13DeltaRowOrColINS0_17DeltaRowOrColBase7SelectXEEC2ERKNS_8RawImageERNS_10ByteStreamERKNS_12iRectangle2DEf:
  565|    256|      : DeltaRowOrColBase(ri, bs, integrated_subimg_), f2iScale(f2iScale_) {
  566|    256|    const auto deltaF_count = bs.getU32();
  567|    256|    (void)bs.check(deltaF_count, 4);
  568|       |
  569|       |    // See PixelOpcode::applyOP(). We will access deltaF/deltaI up to (excl.)
  570|       |    // either ROI.getWidth() or ROI.getHeight() index. Thus, we need to have
  571|       |    // either ROI.getRight() or ROI.getBottom() elements in there.
  572|    256|    if (const auto expectedSize = roundUpDivisionSafe(
  573|    256|            S::select(getRoi().getWidth(), getRoi().getHeight()),
  574|    256|            S::select(getPitch().x, getPitch().y));
  575|    256|        expectedSize != deltaF_count) {
  ------------------
  |  Branch (575:9): [True: 4, False: 252]
  ------------------
  576|      4|      ThrowRDE("Got unexpected number of elements (%" PRIu64 "), expected %u.",
  ------------------
  |  |   38|      4|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      4|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      4|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      4|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  577|      4|               expectedSize, deltaF_count);
  578|      4|    }
  579|       |
  580|    252|    deltaF.reserve(deltaF_count);
  581|    252|    std::generate_n(std::back_inserter(deltaF), deltaF_count, [&bs]() {
  582|    252|      const auto F = bs.get<float>();
  583|    252|      switch (std::fpclassify(F)) {
  584|    252|      case FP_NORMAL:
  585|    252|      case FP_SUBNORMAL:
  586|    252|      case FP_ZERO:
  587|    252|        return F;
  588|    252|      default:
  589|    252|        ThrowRDE("Got bad float %f.", implicit_cast<double>(F));
  590|    252|      }
  591|    252|    });
  592|    252|  }
_ZN8rawspeed10DngOpcodes17DeltaRowOrColBase7SelectX6selectEjj:
  518|  41.2k|    static uint32_t select(uint32_t x, uint32_t /*y*/) { return x; }
_ZZN8rawspeed10DngOpcodes13DeltaRowOrColINS0_17DeltaRowOrColBase7SelectXEEC1ERKNS_8RawImageERNS_10ByteStreamERKNS_12iRectangle2DEfENKUlvE_clEv:
  581|  49.0k|    std::generate_n(std::back_inserter(deltaF), deltaF_count, [&bs]() {
  582|  49.0k|      const auto F = bs.get<float>();
  583|  49.0k|      switch (std::fpclassify(F)) {
  584|  21.6k|      case FP_NORMAL:
  ------------------
  |  Branch (584:7): [True: 21.6k, False: 27.3k]
  ------------------
  585|  21.6k|      case FP_SUBNORMAL:
  ------------------
  |  Branch (585:7): [True: 0, False: 49.0k]
  ------------------
  586|  49.0k|      case FP_ZERO:
  ------------------
  |  Branch (586:7): [True: 27.3k, False: 21.6k]
  ------------------
  587|  49.0k|        return F;
  588|      0|      default:
  ------------------
  |  Branch (588:7): [True: 0, False: 49.0k]
  ------------------
  589|      0|        ThrowRDE("Got bad float %f.", implicit_cast<double>(F));
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  590|  49.0k|      }
  591|  49.0k|    });
_ZN8rawspeed10DngOpcodes13DeltaRowOrColINS0_17DeltaRowOrColBase7SelectXEE5setupERKNS_8RawImageE:
  539|    116|  void setup(const RawImage& ri) final {
  540|    116|    PixelOpcode::setup(ri);
  541|       |
  542|       |    // If we are working on a float image, no need to convert to int
  543|    116|    if (ri->getDataType() != RawImageType::UINT16)
  ------------------
  |  Branch (543:9): [True: 33, False: 83]
  ------------------
  544|     33|      return;
  545|       |
  546|     83|    deltaI.reserve(deltaF.size());
  547|  1.17k|    for (const auto f : deltaF) {
  ------------------
  |  Branch (547:23): [True: 1.17k, False: 70]
  ------------------
  548|  1.17k|      if (!valueIsOk(f))
  ------------------
  |  Branch (548:11): [True: 13, False: 1.15k]
  ------------------
  549|  1.17k|        ThrowRDE("Got float %f which is unacceptable.",
  ------------------
  |  |   38|     13|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     13|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     13|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     13|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  550|  1.15k|                 implicit_cast<double>(f));
  551|  1.15k|      deltaI.emplace_back(static_cast<int>(f2iScale * f));
  552|  1.15k|    }
  553|     83|  }
_ZN8rawspeed10DngOpcodes17OffsetPerRowOrColINS0_17DeltaRowOrColBase7SelectXEE5applyERKNS_8RawImageE:
  616|     56|  void apply(const RawImage& ri) override {
  617|     56|    if (ri->getDataType() == RawImageType::UINT16) {
  ------------------
  |  Branch (617:9): [True: 37, False: 19]
  ------------------
  618|     37|      this->template applyOP<uint16_t>(
  619|     37|          ri, [this](uint32_t x, uint32_t y, uint16_t v) {
  620|     37|            return clampBits(this->deltaI[S::select(x, y)] + v, 16);
  621|     37|          });
  622|     37|    } else {
  623|     19|      this->template applyOP<float>(ri,
  624|     19|                                    [this](uint32_t x, uint32_t y, float v) {
  625|     19|                                      return this->deltaF[S::select(x, y)] + v;
  626|     19|                                    });
  627|     19|    }
  628|     56|  }
_ZNK8rawspeed10DngOpcodes11PixelOpcode7applyOPItZNS0_17OffsetPerRowOrColINS0_17DeltaRowOrColBase7SelectXEE5applyERKNS_8RawImageEEUljjtE_EEvS9_T0_:
  391|     37|  void applyOP(const RawImage& ri, OP op) const {
  392|     37|    const CroppedArray2DRef<T> img = getDataAsCroppedArray2DRef<T>(ri);
  393|     37|    int cpp = ri->getCpp();
  394|     37|    const iRectangle2D& ROI = getRoi();
  395|     37|    const iPoint2D numAffected(
  396|     37|        implicit_cast<int>(roundUpDivisionSafe(getRoi().dim.x, colPitch)),
  397|     37|        implicit_cast<int>(roundUpDivisionSafe(getRoi().dim.y, rowPitch)));
  398|  1.41k|    for (int y = 0; y < numAffected.y; ++y) {
  ------------------
  |  Branch (398:21): [True: 1.38k, False: 37]
  ------------------
  399|  3.08k|      for (int x = 0; x < numAffected.x; ++x) {
  ------------------
  |  Branch (399:23): [True: 1.70k, False: 1.38k]
  ------------------
  400|  3.52k|        for (auto p = 0U; p < planes; ++p) {
  ------------------
  |  Branch (400:27): [True: 1.81k, False: 1.70k]
  ------------------
  401|  1.81k|          T& pixel =
  402|  1.81k|              img(ROI.getTop() + (rowPitch * y),
  403|  1.81k|                  firstPlane + ((ROI.getLeft() + colPitch * x) * cpp) + p);
  404|  1.81k|          pixel = op(x, y, pixel);
  405|  1.81k|        }
  406|  1.70k|      }
  407|  1.38k|    }
  408|     37|  }
_ZZN8rawspeed10DngOpcodes17OffsetPerRowOrColINS0_17DeltaRowOrColBase7SelectXEE5applyERKNS_8RawImageEENKUljjtE_clEjjt:
  619|  1.81k|          ri, [this](uint32_t x, uint32_t y, uint16_t v) {
  620|  1.81k|            return clampBits(this->deltaI[S::select(x, y)] + v, 16);
  621|  1.81k|          });
_ZNK8rawspeed10DngOpcodes11PixelOpcode7applyOPIfZNS0_17OffsetPerRowOrColINS0_17DeltaRowOrColBase7SelectXEE5applyERKNS_8RawImageEEUljjfE_EEvS9_T0_:
  391|     19|  void applyOP(const RawImage& ri, OP op) const {
  392|     19|    const CroppedArray2DRef<T> img = getDataAsCroppedArray2DRef<T>(ri);
  393|     19|    int cpp = ri->getCpp();
  394|     19|    const iRectangle2D& ROI = getRoi();
  395|     19|    const iPoint2D numAffected(
  396|     19|        implicit_cast<int>(roundUpDivisionSafe(getRoi().dim.x, colPitch)),
  397|     19|        implicit_cast<int>(roundUpDivisionSafe(getRoi().dim.y, rowPitch)));
  398|    484|    for (int y = 0; y < numAffected.y; ++y) {
  ------------------
  |  Branch (398:21): [True: 465, False: 19]
  ------------------
  399|  13.1k|      for (int x = 0; x < numAffected.x; ++x) {
  ------------------
  |  Branch (399:23): [True: 12.6k, False: 465]
  ------------------
  400|  49.8k|        for (auto p = 0U; p < planes; ++p) {
  ------------------
  |  Branch (400:27): [True: 37.1k, False: 12.6k]
  ------------------
  401|  37.1k|          T& pixel =
  402|  37.1k|              img(ROI.getTop() + (rowPitch * y),
  403|  37.1k|                  firstPlane + ((ROI.getLeft() + colPitch * x) * cpp) + p);
  404|  37.1k|          pixel = op(x, y, pixel);
  405|  37.1k|        }
  406|  12.6k|      }
  407|    465|    }
  408|     19|  }
_ZZN8rawspeed10DngOpcodes17OffsetPerRowOrColINS0_17DeltaRowOrColBase7SelectXEE5applyERKNS_8RawImageEENKUljjfE_clEjjf:
  624|  37.1k|                                    [this](uint32_t x, uint32_t y, float v) {
  625|  37.1k|                                      return this->deltaF[S::select(x, y)] + v;
  626|  37.1k|                                    });
_ZN8rawspeed10DngOpcodes17OffsetPerRowOrColINS0_17DeltaRowOrColBase7SelectXEE9valueIsOkEf:
  605|    740|  bool valueIsOk(float value) override {
  606|    740|    return implicit_cast<double>(std::abs(value)) <= absLimit;
  607|    740|  }
_ZN8rawspeed10DngOpcodes11constructorINS0_16ScalePerRowOrColINS0_17DeltaRowOrColBase7SelectYEEEEENSt3__110unique_ptrINS0_9DngOpcodeENS6_14default_deleteIS8_EEEERKNS_8RawImageERNS_10ByteStreamERNS_12iRectangle2DE:
  746|    102|                        iRectangle2D& integrated_subimg) {
  747|    102|  return std::make_unique<Opcode>(ri, bs, integrated_subimg);
  748|    102|}
_ZN8rawspeed10DngOpcodes16ScalePerRowOrColINS0_17DeltaRowOrColBase7SelectYEEC2ERKNS_8RawImageERNS_10ByteStreamERKNS_12iRectangle2DE:
  650|    102|      : DeltaRowOrCol<S>(ri, bs, integrated_subimg_, 1024.0F),
  651|    102|        maxLimit((double(std::numeric_limits<int>::max() - rounding) /
  652|    102|                  double(std::numeric_limits<uint16_t>::max())) /
  653|    102|                 implicit_cast<double>(this->f2iScale)) {}
_ZN8rawspeed10DngOpcodes16ScalePerRowOrColINS0_17DeltaRowOrColBase7SelectYEE5applyERKNS_8RawImageE:
  655|     54|  void apply(const RawImage& ri) override {
  656|     54|    if (ri->getDataType() == RawImageType::UINT16) {
  ------------------
  |  Branch (656:9): [True: 33, False: 21]
  ------------------
  657|     33|      this->template applyOP<uint16_t>(ri, [this](uint32_t x, uint32_t y,
  658|     33|                                                  uint16_t v) {
  659|     33|        return clampBits((this->deltaI[S::select(x, y)] * v + 512) >> 10, 16);
  660|     33|      });
  661|     33|    } else {
  662|     21|      this->template applyOP<float>(ri,
  663|     21|                                    [this](uint32_t x, uint32_t y, float v) {
  664|     21|                                      return this->deltaF[S::select(x, y)] * v;
  665|     21|                                    });
  666|     21|    }
  667|     54|  }
_ZNK8rawspeed10DngOpcodes11PixelOpcode7applyOPItZNS0_16ScalePerRowOrColINS0_17DeltaRowOrColBase7SelectYEE5applyERKNS_8RawImageEEUljjtE_EEvS9_T0_:
  391|     33|  void applyOP(const RawImage& ri, OP op) const {
  392|     33|    const CroppedArray2DRef<T> img = getDataAsCroppedArray2DRef<T>(ri);
  393|     33|    int cpp = ri->getCpp();
  394|     33|    const iRectangle2D& ROI = getRoi();
  395|     33|    const iPoint2D numAffected(
  396|     33|        implicit_cast<int>(roundUpDivisionSafe(getRoi().dim.x, colPitch)),
  397|     33|        implicit_cast<int>(roundUpDivisionSafe(getRoi().dim.y, rowPitch)));
  398|     88|    for (int y = 0; y < numAffected.y; ++y) {
  ------------------
  |  Branch (398:21): [True: 55, False: 33]
  ------------------
  399|  4.46k|      for (int x = 0; x < numAffected.x; ++x) {
  ------------------
  |  Branch (399:23): [True: 4.40k, False: 55]
  ------------------
  400|  9.19k|        for (auto p = 0U; p < planes; ++p) {
  ------------------
  |  Branch (400:27): [True: 4.79k, False: 4.40k]
  ------------------
  401|  4.79k|          T& pixel =
  402|  4.79k|              img(ROI.getTop() + (rowPitch * y),
  403|  4.79k|                  firstPlane + ((ROI.getLeft() + colPitch * x) * cpp) + p);
  404|  4.79k|          pixel = op(x, y, pixel);
  405|  4.79k|        }
  406|  4.40k|      }
  407|     55|    }
  408|     33|  }
_ZZN8rawspeed10DngOpcodes16ScalePerRowOrColINS0_17DeltaRowOrColBase7SelectYEE5applyERKNS_8RawImageEENKUljjtE_clEjjt:
  658|  4.79k|                                                  uint16_t v) {
  659|  4.79k|        return clampBits((this->deltaI[S::select(x, y)] * v + 512) >> 10, 16);
  660|  4.79k|      });
_ZNK8rawspeed10DngOpcodes11PixelOpcode7applyOPIfZNS0_16ScalePerRowOrColINS0_17DeltaRowOrColBase7SelectYEE5applyERKNS_8RawImageEEUljjfE_EEvS9_T0_:
  391|     21|  void applyOP(const RawImage& ri, OP op) const {
  392|     21|    const CroppedArray2DRef<T> img = getDataAsCroppedArray2DRef<T>(ri);
  393|     21|    int cpp = ri->getCpp();
  394|     21|    const iRectangle2D& ROI = getRoi();
  395|     21|    const iPoint2D numAffected(
  396|     21|        implicit_cast<int>(roundUpDivisionSafe(getRoi().dim.x, colPitch)),
  397|     21|        implicit_cast<int>(roundUpDivisionSafe(getRoi().dim.y, rowPitch)));
  398|     42|    for (int y = 0; y < numAffected.y; ++y) {
  ------------------
  |  Branch (398:21): [True: 21, False: 21]
  ------------------
  399|    525|      for (int x = 0; x < numAffected.x; ++x) {
  ------------------
  |  Branch (399:23): [True: 504, False: 21]
  ------------------
  400|  1.25k|        for (auto p = 0U; p < planes; ++p) {
  ------------------
  |  Branch (400:27): [True: 753, False: 504]
  ------------------
  401|    753|          T& pixel =
  402|    753|              img(ROI.getTop() + (rowPitch * y),
  403|    753|                  firstPlane + ((ROI.getLeft() + colPitch * x) * cpp) + p);
  404|    753|          pixel = op(x, y, pixel);
  405|    753|        }
  406|    504|      }
  407|     21|    }
  408|     21|  }
_ZZN8rawspeed10DngOpcodes16ScalePerRowOrColINS0_17DeltaRowOrColBase7SelectYEE5applyERKNS_8RawImageEENKUljjfE_clEjjf:
  663|    753|                                    [this](uint32_t x, uint32_t y, float v) {
  664|    753|                                      return this->deltaF[S::select(x, y)] * v;
  665|    753|                                    });
_ZN8rawspeed10DngOpcodes16ScalePerRowOrColINS0_17DeltaRowOrColBase7SelectYEE9valueIsOkEf:
  643|     63|  bool valueIsOk(float value) override {
  644|     63|    return value >= minLimit && implicit_cast<double>(value) <= maxLimit;
  ------------------
  |  Branch (644:12): [True: 59, False: 4]
  |  Branch (644:33): [True: 58, False: 1]
  ------------------
  645|     63|  }
_ZN8rawspeed10DngOpcodes11constructorINS0_16ScalePerRowOrColINS0_17DeltaRowOrColBase7SelectXEEEEENSt3__110unique_ptrINS0_9DngOpcodeENS6_14default_deleteIS8_EEEERKNS_8RawImageERNS_10ByteStreamERNS_12iRectangle2DE:
  746|    113|                        iRectangle2D& integrated_subimg) {
  747|    113|  return std::make_unique<Opcode>(ri, bs, integrated_subimg);
  748|    113|}
_ZN8rawspeed10DngOpcodes16ScalePerRowOrColINS0_17DeltaRowOrColBase7SelectXEEC2ERKNS_8RawImageERNS_10ByteStreamERKNS_12iRectangle2DE:
  650|    113|      : DeltaRowOrCol<S>(ri, bs, integrated_subimg_, 1024.0F),
  651|    113|        maxLimit((double(std::numeric_limits<int>::max() - rounding) /
  652|    113|                  double(std::numeric_limits<uint16_t>::max())) /
  653|    113|                 implicit_cast<double>(this->f2iScale)) {}
_ZN8rawspeed10DngOpcodes16ScalePerRowOrColINS0_17DeltaRowOrColBase7SelectXEE5applyERKNS_8RawImageE:
  655|     47|  void apply(const RawImage& ri) override {
  656|     47|    if (ri->getDataType() == RawImageType::UINT16) {
  ------------------
  |  Branch (656:9): [True: 33, False: 14]
  ------------------
  657|     33|      this->template applyOP<uint16_t>(ri, [this](uint32_t x, uint32_t y,
  658|     33|                                                  uint16_t v) {
  659|     33|        return clampBits((this->deltaI[S::select(x, y)] * v + 512) >> 10, 16);
  660|     33|      });
  661|     33|    } else {
  662|     14|      this->template applyOP<float>(ri,
  663|     14|                                    [this](uint32_t x, uint32_t y, float v) {
  664|     14|                                      return this->deltaF[S::select(x, y)] * v;
  665|     14|                                    });
  666|     14|    }
  667|     47|  }
_ZNK8rawspeed10DngOpcodes11PixelOpcode7applyOPItZNS0_16ScalePerRowOrColINS0_17DeltaRowOrColBase7SelectXEE5applyERKNS_8RawImageEEUljjtE_EEvS9_T0_:
  391|     33|  void applyOP(const RawImage& ri, OP op) const {
  392|     33|    const CroppedArray2DRef<T> img = getDataAsCroppedArray2DRef<T>(ri);
  393|     33|    int cpp = ri->getCpp();
  394|     33|    const iRectangle2D& ROI = getRoi();
  395|     33|    const iPoint2D numAffected(
  396|     33|        implicit_cast<int>(roundUpDivisionSafe(getRoi().dim.x, colPitch)),
  397|     33|        implicit_cast<int>(roundUpDivisionSafe(getRoi().dim.y, rowPitch)));
  398|    707|    for (int y = 0; y < numAffected.y; ++y) {
  ------------------
  |  Branch (398:21): [True: 674, False: 33]
  ------------------
  399|  1.61k|      for (int x = 0; x < numAffected.x; ++x) {
  ------------------
  |  Branch (399:23): [True: 936, False: 674]
  ------------------
  400|  2.09k|        for (auto p = 0U; p < planes; ++p) {
  ------------------
  |  Branch (400:27): [True: 1.16k, False: 936]
  ------------------
  401|  1.16k|          T& pixel =
  402|  1.16k|              img(ROI.getTop() + (rowPitch * y),
  403|  1.16k|                  firstPlane + ((ROI.getLeft() + colPitch * x) * cpp) + p);
  404|  1.16k|          pixel = op(x, y, pixel);
  405|  1.16k|        }
  406|    936|      }
  407|    674|    }
  408|     33|  }
_ZZN8rawspeed10DngOpcodes16ScalePerRowOrColINS0_17DeltaRowOrColBase7SelectXEE5applyERKNS_8RawImageEENKUljjtE_clEjjt:
  658|  1.16k|                                                  uint16_t v) {
  659|  1.16k|        return clampBits((this->deltaI[S::select(x, y)] * v + 512) >> 10, 16);
  660|  1.16k|      });
_ZNK8rawspeed10DngOpcodes11PixelOpcode7applyOPIfZNS0_16ScalePerRowOrColINS0_17DeltaRowOrColBase7SelectXEE5applyERKNS_8RawImageEEUljjfE_EEvS9_T0_:
  391|     14|  void applyOP(const RawImage& ri, OP op) const {
  392|     14|    const CroppedArray2DRef<T> img = getDataAsCroppedArray2DRef<T>(ri);
  393|     14|    int cpp = ri->getCpp();
  394|     14|    const iRectangle2D& ROI = getRoi();
  395|     14|    const iPoint2D numAffected(
  396|     14|        implicit_cast<int>(roundUpDivisionSafe(getRoi().dim.x, colPitch)),
  397|     14|        implicit_cast<int>(roundUpDivisionSafe(getRoi().dim.y, rowPitch)));
  398|    453|    for (int y = 0; y < numAffected.y; ++y) {
  ------------------
  |  Branch (398:21): [True: 439, False: 14]
  ------------------
  399|    886|      for (int x = 0; x < numAffected.x; ++x) {
  ------------------
  |  Branch (399:23): [True: 447, False: 439]
  ------------------
  400|  1.23k|        for (auto p = 0U; p < planes; ++p) {
  ------------------
  |  Branch (400:27): [True: 786, False: 447]
  ------------------
  401|    786|          T& pixel =
  402|    786|              img(ROI.getTop() + (rowPitch * y),
  403|    786|                  firstPlane + ((ROI.getLeft() + colPitch * x) * cpp) + p);
  404|    786|          pixel = op(x, y, pixel);
  405|    786|        }
  406|    447|      }
  407|    439|    }
  408|     14|  }
_ZZN8rawspeed10DngOpcodes16ScalePerRowOrColINS0_17DeltaRowOrColBase7SelectXEE5applyERKNS_8RawImageEENKUljjfE_clEjjf:
  663|    786|                                    [this](uint32_t x, uint32_t y, float v) {
  664|    786|                                      return this->deltaF[S::select(x, y)] * v;
  665|    786|                                    });
_ZN8rawspeed10DngOpcodes16ScalePerRowOrColINS0_17DeltaRowOrColBase7SelectXEE9valueIsOkEf:
  643|    430|  bool valueIsOk(float value) override {
  644|    430|    return value >= minLimit && implicit_cast<double>(value) <= maxLimit;
  ------------------
  |  Branch (644:12): [True: 426, False: 4]
  |  Branch (644:33): [True: 423, False: 3]
  ------------------
  645|    430|  }
_ZN8rawspeed10DngOpcodes9DngOpcode5setupERKNS_8RawImageE:
  128|  1.62k|  virtual void setup(const RawImage& ri) {
  129|  1.62k|#ifndef NDEBUG
  130|  1.62k|    setup_was_called = true;
  131|  1.62k|#endif
  132|  1.62k|    assert(integrated_subimg == getImageCropAsRectangle(ri) &&
  ------------------
  |  Branch (132:5): [True: 1.62k, False: 0]
  |  Branch (132:5): [True: 1.62k, Folded]
  |  Branch (132:5): [True: 1.62k, False: 0]
  ------------------
  133|  1.62k|           "Current image sub-crop does not match the expected one!");
  134|       |
  135|       |    // NOP by default. child class shall final this if needed.
  136|  1.62k|  }
_ZN8rawspeed10DngOpcodes20FixBadPixelsConstant5setupERKNS_8RawImageE:
  161|     83|  void setup(const RawImage& ri) override {
  162|     83|    DngOpcodes::DngOpcode::setup(ri);
  163|       |
  164|       |    // These limitations are present within the DNG SDK as well.
  165|     83|    if (ri->getDataType() != RawImageType::UINT16)
  ------------------
  |  Branch (165:9): [True: 1, False: 82]
  ------------------
  166|     83|      ThrowRDE("Only 16 bit images supported");
  ------------------
  |  |   38|      1|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      1|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      1|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      1|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  167|       |
  168|     82|    if (ri->getCpp() > 1)
  ------------------
  |  Branch (168:9): [True: 1, False: 81]
  ------------------
  169|     82|      ThrowRDE("Only 1 component images supported");
  ------------------
  |  |   38|      1|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      1|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      1|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      1|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  170|     82|  }
_ZN8rawspeed10DngOpcodes20FixBadPixelsConstant5applyERKNS_8RawImageE:
  172|     81|  void apply(const RawImage& ri) override {
  173|     81|    MutexLocker guard(&ri->mBadPixelMutex);
  174|     81|    const CroppedArray2DRef<uint16_t> img(ri->getU16DataAsCroppedArray2DRef());
  175|     81|    iPoint2D crop = ri->getCropOffset();
  176|     81|    uint32_t offset = crop.x | (crop.y << 16);
  177|  19.1k|    for (auto row = 0; row < img.croppedHeight; ++row) {
  ------------------
  |  Branch (177:24): [True: 19.1k, False: 81]
  ------------------
  178|   212k|      for (auto col = 0; col < img.croppedWidth; ++col) {
  ------------------
  |  Branch (178:26): [True: 193k, False: 19.1k]
  ------------------
  179|   193k|        if (img(row, col) == value)
  ------------------
  |  Branch (179:13): [True: 114k, False: 79.1k]
  ------------------
  180|   114k|          ri->mBadPixelPositions.push_back(offset + (row << 16 | col));
  181|   193k|      }
  182|  19.1k|    }
  183|     81|  }
_ZN8rawspeed10DngOpcodes16FixBadPixelsList5applyERKNS_8RawImageE:
  318|    193|  void apply(const RawImage& ri) override {
  319|    193|    MutexLocker guard(&ri->mBadPixelMutex);
  320|    193|    ri->mBadPixelPositions.insert(ri->mBadPixelPositions.begin(),
  321|    193|                                  badPixels.begin(), badPixels.end());
  322|    193|  }
_ZN8rawspeed10DngOpcodes10TrimBounds5applyERKNS_8RawImageE:
  343|     24|  void apply(const RawImage& ri) override { ri->subFrame(getRoi()); }
_ZN8rawspeed10DngOpcodes12LookupOpcode5setupERKNS_8RawImageE:
  426|     44|  void setup(const RawImage& ri) final {
  427|     44|    PixelOpcode::setup(ri);
  428|       |
  429|     44|    if (ri->getDataType() != RawImageType::UINT16)
  ------------------
  |  Branch (429:9): [True: 1, False: 43]
  ------------------
  430|     44|      ThrowRDE("Only 16 bit images supported");
  ------------------
  |  |   38|      1|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      1|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      1|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      1|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  431|     44|  }
_ZN8rawspeed10DngOpcodes12LookupOpcode5applyERKNS_8RawImageE:
  433|     43|  void apply(const RawImage& ri) final {
  434|     43|    applyOP<uint16_t>(ri, [this]([[maybe_unused]] uint32_t x,
  435|     43|                                 [[maybe_unused]] uint32_t y,
  436|     43|                                 uint16_t v) { return lookup[v]; });
  437|     43|  }
_ZNK8rawspeed10DngOpcodes11PixelOpcode7applyOPItZNS0_12LookupOpcode5applyERKNS_8RawImageEEUljjtE_EEvS6_T0_:
  391|     43|  void applyOP(const RawImage& ri, OP op) const {
  392|     43|    const CroppedArray2DRef<T> img = getDataAsCroppedArray2DRef<T>(ri);
  393|     43|    int cpp = ri->getCpp();
  394|     43|    const iRectangle2D& ROI = getRoi();
  395|     43|    const iPoint2D numAffected(
  396|     43|        implicit_cast<int>(roundUpDivisionSafe(getRoi().dim.x, colPitch)),
  397|     43|        implicit_cast<int>(roundUpDivisionSafe(getRoi().dim.y, rowPitch)));
  398|    468|    for (int y = 0; y < numAffected.y; ++y) {
  ------------------
  |  Branch (398:21): [True: 425, False: 43]
  ------------------
  399|  1.88k|      for (int x = 0; x < numAffected.x; ++x) {
  ------------------
  |  Branch (399:23): [True: 1.46k, False: 425]
  ------------------
  400|  3.38k|        for (auto p = 0U; p < planes; ++p) {
  ------------------
  |  Branch (400:27): [True: 1.91k, False: 1.46k]
  ------------------
  401|  1.91k|          T& pixel =
  402|  1.91k|              img(ROI.getTop() + (rowPitch * y),
  403|  1.91k|                  firstPlane + ((ROI.getLeft() + colPitch * x) * cpp) + p);
  404|  1.91k|          pixel = op(x, y, pixel);
  405|  1.91k|        }
  406|  1.46k|      }
  407|    425|    }
  408|     43|  }
_ZZN8rawspeed10DngOpcodes12LookupOpcode5applyERKNS_8RawImageEENKUljjtE_clEjjt:
  436|  1.91k|                                 uint16_t v) { return lookup[v]; });

_ZN8rawspeed8ErrorLog8setErrorERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
   29|  19.2k|void ErrorLog::setError(const std::string& err) {
   30|  19.2k|  MutexLocker guard(&mutex);
   31|  19.2k|  errors.push_back(err);
   32|  19.2k|}
_ZN8rawspeed8ErrorLog15isTooManyErrorsEjPNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
   34|  3.93k|bool ErrorLog::isTooManyErrors(unsigned many, std::string* firstErr) {
   35|  3.93k|  MutexLocker guard(&mutex);
   36|       |
   37|  3.93k|  if (errors.size() < many)
  ------------------
  |  Branch (37:7): [True: 2.87k, False: 1.05k]
  ------------------
   38|  2.87k|    return false;
   39|       |
   40|  1.05k|  if (!firstErr)
  ------------------
  |  Branch (40:7): [True: 0, False: 1.05k]
  ------------------
   41|      0|    return true;
   42|       |
   43|  1.05k|  *firstErr = errors[0];
   44|  1.05k|  return true;
   45|  1.05k|}

_ZN8rawspeed25extendBinaryFloatingPointINS_13ieee_754_20088Binary16ENS1_8Binary32EEEjj:
  108|   114k|inline uint32_t extendBinaryFloatingPoint(uint32_t narrow) {
  109|   114k|  uint32_t sign = (narrow >> NarrowType::SignBitPos) & 1;
  110|   114k|  uint32_t narrow_exponent = (narrow >> NarrowType::ExponentPos) &
  111|   114k|                             ((1 << NarrowType::ExponentWidth) - 1);
  112|   114k|  uint32_t narrow_fraction = narrow & ((1 << NarrowType::FractionWidth) - 1);
  113|       |
  114|       |  // Normalized or zero
  115|   114k|  uint32_t wide_exponent =
  116|   114k|      static_cast<int32_t>(narrow_exponent) - NarrowType::Bias + WideType::Bias;
  117|   114k|  uint32_t wide_fraction =
  118|   114k|      narrow_fraction << (WideType::FractionWidth - NarrowType::FractionWidth);
  119|       |
  120|   114k|  if (narrow_exponent == ((1 << NarrowType::ExponentWidth) - 1)) {
  ------------------
  |  Branch (120:7): [True: 4.10k, False: 110k]
  ------------------
  121|       |    // Infinity or NaN
  122|  4.10k|    wide_exponent = ((1 << WideType::ExponentWidth) - 1);
  123|       |    // Narrow fraction is kept/widened!
  124|   110k|  } else if (narrow_exponent == 0) {
  ------------------
  |  Branch (124:14): [True: 64.7k, False: 46.0k]
  ------------------
  125|  64.7k|    if (narrow_fraction == 0) {
  ------------------
  |  Branch (125:9): [True: 46.7k, False: 17.9k]
  ------------------
  126|       |      // +-Zero
  127|  46.7k|      wide_exponent = 0;
  128|  46.7k|      wide_fraction = 0;
  129|  46.7k|    } else {
  130|       |      // Subnormal numbers
  131|       |      // We can represent it as a normalized value in wider type,
  132|       |      // we have to shift fraction until we get 1.new_fraction
  133|       |      // and decrement exponent for each shift.
  134|       |      // FIXME; what is the implicit precondition here?
  135|  17.9k|      wide_exponent = 1 - NarrowType::Bias + WideType::Bias;
  136|   100k|      while (!(wide_fraction & (1 << WideType::FractionWidth))) {
  ------------------
  |  Branch (136:14): [True: 82.1k, False: 17.9k]
  ------------------
  137|  82.1k|        wide_exponent -= 1;
  138|  82.1k|        wide_fraction <<= 1;
  139|  82.1k|      }
  140|  17.9k|      wide_fraction &= ((1 << WideType::FractionWidth) - 1);
  141|  17.9k|    }
  142|  64.7k|  }
  143|   114k|  return (sign << WideType::SignBitPos) |
  144|   114k|         (wide_exponent << WideType::ExponentPos) | wide_fraction;
  145|   114k|}
_ZN8rawspeed25extendBinaryFloatingPointINS_13ieee_754_20088Binary24ENS1_8Binary32EEEjj:
  108|  87.0k|inline uint32_t extendBinaryFloatingPoint(uint32_t narrow) {
  109|  87.0k|  uint32_t sign = (narrow >> NarrowType::SignBitPos) & 1;
  110|  87.0k|  uint32_t narrow_exponent = (narrow >> NarrowType::ExponentPos) &
  111|  87.0k|                             ((1 << NarrowType::ExponentWidth) - 1);
  112|  87.0k|  uint32_t narrow_fraction = narrow & ((1 << NarrowType::FractionWidth) - 1);
  113|       |
  114|       |  // Normalized or zero
  115|  87.0k|  uint32_t wide_exponent =
  116|  87.0k|      static_cast<int32_t>(narrow_exponent) - NarrowType::Bias + WideType::Bias;
  117|  87.0k|  uint32_t wide_fraction =
  118|  87.0k|      narrow_fraction << (WideType::FractionWidth - NarrowType::FractionWidth);
  119|       |
  120|  87.0k|  if (narrow_exponent == ((1 << NarrowType::ExponentWidth) - 1)) {
  ------------------
  |  Branch (120:7): [True: 5.33k, False: 81.6k]
  ------------------
  121|       |    // Infinity or NaN
  122|  5.33k|    wide_exponent = ((1 << WideType::ExponentWidth) - 1);
  123|       |    // Narrow fraction is kept/widened!
  124|  81.6k|  } else if (narrow_exponent == 0) {
  ------------------
  |  Branch (124:14): [True: 33.5k, False: 48.0k]
  ------------------
  125|  33.5k|    if (narrow_fraction == 0) {
  ------------------
  |  Branch (125:9): [True: 23.7k, False: 9.85k]
  ------------------
  126|       |      // +-Zero
  127|  23.7k|      wide_exponent = 0;
  128|  23.7k|      wide_fraction = 0;
  129|  23.7k|    } else {
  130|       |      // Subnormal numbers
  131|       |      // We can represent it as a normalized value in wider type,
  132|       |      // we have to shift fraction until we get 1.new_fraction
  133|       |      // and decrement exponent for each shift.
  134|       |      // FIXME; what is the implicit precondition here?
  135|  9.85k|      wide_exponent = 1 - NarrowType::Bias + WideType::Bias;
  136|  79.8k|      while (!(wide_fraction & (1 << WideType::FractionWidth))) {
  ------------------
  |  Branch (136:14): [True: 69.9k, False: 9.85k]
  ------------------
  137|  69.9k|        wide_exponent -= 1;
  138|  69.9k|        wide_fraction <<= 1;
  139|  69.9k|      }
  140|  9.85k|      wide_fraction &= ((1 << WideType::FractionWidth) - 1);
  141|  9.85k|    }
  142|  33.5k|  }
  143|  87.0k|  return (sign << WideType::SignBitPos) |
  144|  87.0k|         (wide_exponent << WideType::ExponentPos) | wide_fraction;
  145|  87.0k|}

rawspeed_get_number_of_processor_cores:
   31|  4.36k|rawspeed_get_number_of_processor_cores() {
   32|  4.36k|  return omp_get_max_threads();
   33|  4.36k|}

_ZN8rawspeed12RawImageData10createDataEv:
   68|  7.99k|void RawImageData::createData() {
   69|  7.99k|  static constexpr const auto alignment = 16;
   70|       |
   71|  7.99k|  if (dim.x > 65535 || dim.y > 65535)
  ------------------
  |  Branch (71:7): [True: 0, False: 7.99k]
  |  Branch (71:24): [True: 0, False: 7.99k]
  ------------------
   72|  7.99k|    ThrowRDE("Dimensions too large for allocation.");
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   73|  7.99k|  if (dim.x <= 0 || dim.y <= 0)
  ------------------
  |  Branch (73:7): [True: 32, False: 7.95k]
  |  Branch (73:21): [True: 22, False: 7.93k]
  ------------------
   74|  7.99k|    ThrowRDE("Dimension of one sides is less than 1 - cannot allocate image.");
  ------------------
  |  |   38|     54|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     54|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     54|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     54|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   75|  7.93k|  if (cpp <= 0 || bpp <= 0)
  ------------------
  |  Branch (75:7): [True: 0, False: 7.93k]
  |  Branch (75:19): [True: 0, False: 7.93k]
  ------------------
   76|  7.93k|    ThrowRDE("Unspecified component count - cannot allocate image.");
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   77|  7.93k|  if (isAllocated())
  ------------------
  |  Branch (77:7): [True: 0, False: 7.93k]
  ------------------
   78|  7.93k|    ThrowRDE("Duplicate data allocation in createData.");
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   79|       |
   80|       |  // want each line to start at 16-byte aligned address
   81|  7.93k|  pitch =
   82|  7.93k|      implicit_cast<int>(roundUp(static_cast<size_t>(dim.x) * bpp, alignment));
   83|  7.93k|  assert(isAligned(pitch, alignment));
  ------------------
  |  Branch (83:3): [True: 7.93k, False: 0]
  ------------------
   84|       |
   85|       |#if defined(DEBUG) || __has_feature(address_sanitizer) ||                      \
   86|       |    defined(__SANITIZE_ADDRESS__)
   87|       |  // want to ensure that we have some padding
   88|       |  pitch += alignment * alignment;
   89|       |  assert(isAligned(pitch, alignment));
   90|       |#endif
   91|       |
   92|  7.93k|  padding = pitch - dim.x * bpp;
   93|       |
   94|       |#if defined(DEBUG) || __has_feature(address_sanitizer) ||                      \
   95|       |    defined(__SANITIZE_ADDRESS__)
   96|       |  assert(padding > 0);
   97|       |#endif
   98|       |
   99|  7.93k|  data.resize(static_cast<size_t>(pitch) * dim.y);
  100|       |
  101|  7.93k|  uncropped_dim = dim;
  102|       |
  103|  7.93k|#ifndef NDEBUG
  104|  7.93k|  const Array2DRef<std::byte> img = getByteDataAsUncroppedArray2DRef();
  105|       |
  106|  5.67M|  for (int j = 0; j < dim.y; j++) {
  ------------------
  |  Branch (106:19): [True: 5.66M, False: 7.93k]
  ------------------
  107|       |    // each line is indeed 16-byte aligned
  108|  5.66M|    assert(isAligned(&img(j, 0), alignment));
  ------------------
  |  Branch (108:5): [True: 5.66M, False: 0]
  ------------------
  109|  5.66M|  }
  110|  7.93k|#endif
  111|       |
  112|  7.93k|  poisonPadding();
  113|  7.93k|}
_ZN8rawspeed12RawImageData13poisonPaddingEv:
  127|  7.93k|void RawImageData::poisonPadding() {
  128|       |  // if we are building without ASAN, then there is no need/way to poison.
  129|       |  // however, i think it is better to have such an empty function rather
  130|       |  // than making this whole function not exist in ASAN-less builds
  131|  7.93k|}
_ZN8rawspeed12RawImageData6setCppEj:
  153|  3.78k|void RawImageData::setCpp(uint32_t val) {
  154|  3.78k|  if (isAllocated())
  ------------------
  |  Branch (154:7): [True: 0, False: 3.78k]
  ------------------
  155|  3.78k|    ThrowRDE("Attempted to set Components per pixel after data allocation");
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  156|  3.78k|  if (val > 4) {
  ------------------
  |  Branch (156:7): [True: 0, False: 3.78k]
  ------------------
  157|      0|    ThrowRDE(
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  158|      0|        "Only up to 4 components per pixel is support - attempted to set: %u",
  159|      0|        val);
  160|      0|  }
  161|       |
  162|  3.78k|  bpp /= cpp;
  163|  3.78k|  cpp = val;
  164|  3.78k|  bpp *= val;
  165|  3.78k|}
_ZNK8rawspeed12RawImageData15getUncroppedDimEv:
  167|    646|iPoint2D RAWSPEED_READONLY rawspeed::RawImageData::getUncroppedDim() const {
  168|    646|  return uncropped_dim;
  169|    646|}
_ZNK8rawspeed12RawImageData13getCropOffsetEv:
  171|    314|iPoint2D RAWSPEED_READONLY RawImageData::getCropOffset() const {
  172|    314|  return mOffset;
  173|    314|}
_ZN8rawspeed12RawImageData8subFrameENS_12iRectangle2DE:
  175|    213|void RawImageData::subFrame(iRectangle2D crop) {
  176|    213|  if (!crop.hasPositiveArea())
  ------------------
  |  Branch (176:7): [True: 74, False: 139]
  ------------------
  177|    213|    ThrowRDE("No positive crop area");
  ------------------
  |  |   38|     74|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     74|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     74|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     74|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  178|       |
  179|    139|  if (!crop.dim.isThisInside(dim - crop.pos)) {
  ------------------
  |  Branch (179:7): [True: 0, False: 139]
  ------------------
  180|      0|    writeLog(DEBUG_PRIO::WARNING, "WARNING: RawImageData::subFrame - Attempted "
  181|      0|                                  "to create new subframe larger than original "
  182|      0|                                  "size. Crop skipped.");
  183|      0|    return;
  184|      0|  }
  185|    139|  if (crop.pos.x < 0 || crop.pos.y < 0 || crop.dim.x < 0 || crop.dim.y < 0) {
  ------------------
  |  Branch (185:7): [True: 0, False: 139]
  |  Branch (185:25): [True: 0, False: 139]
  |  Branch (185:43): [True: 0, False: 139]
  |  Branch (185:61): [True: 0, False: 139]
  ------------------
  186|      0|    writeLog(DEBUG_PRIO::WARNING, "WARNING: RawImageData::subFrame - Negative "
  187|      0|                                  "crop offset. Crop skipped.");
  188|      0|    return;
  189|      0|  }
  190|       |
  191|       |  // if CFA, and not X-Trans, adjust.
  192|    139|  if (isCFA && cfa.getDcrawFilter() != 1 && cfa.getDcrawFilter() != 9) {
  ------------------
  |  Branch (192:7): [True: 19, False: 120]
  |  Branch (192:16): [True: 18, False: 1]
  |  Branch (192:45): [True: 18, False: 0]
  ------------------
  193|     18|    cfa.shiftRight(crop.pos.x);
  194|     18|    cfa.shiftDown(crop.pos.y);
  195|     18|  }
  196|       |
  197|    139|  mOffset += crop.pos;
  198|    139|  dim = crop.dim;
  199|    139|}
_ZN8rawspeed12RawImageData11startWorkerENS_14RawImageWorker18RawImageWorkerTaskEb:
  272|     66|                               bool cropped) {
  273|     66|  const int height = [&]() {
  274|     66|    int h = cropped ? dim.y : uncropped_dim.y;
  275|     66|    if (static_cast<uint32_t>(task) &
  276|     66|        static_cast<uint32_t>(RawImageWorker::RawImageWorkerTask::FULL_IMAGE)) {
  277|     66|      h = uncropped_dim.y;
  278|     66|    }
  279|     66|    return h;
  280|     66|  }();
  281|       |
  282|     66|  const int threads = rawspeed_get_number_of_processor_cores();
  283|     66|  const int y_per_thread = (height + threads - 1) / threads;
  284|       |
  285|     66|#ifdef HAVE_OPENMP
  286|     66|#pragma omp parallel for default(none)                                         \
  287|     66|    firstprivate(threads, y_per_thread, height, task) num_threads(threads)     \
  288|     66|    schedule(static)
  289|     66|#endif
  290|     66|  for (int i = 0; i < threads; i++) {
  291|     66|    int y_offset = std::min(i * y_per_thread, height);
  292|     66|    int y_end = std::min((i + 1) * y_per_thread, height);
  293|       |
  294|     66|    RawImageWorker worker(this, task, y_offset, y_end);
  295|     66|  }
  296|     66|}
RawImage.cpp:_ZN8rawspeed12RawImageData11startWorkerENS_14RawImageWorker18RawImageWorkerTaskEb.omp_outlined_debug__:
  290|  4.17k|  for (int i = 0; i < threads; i++) {
  ------------------
  |  Branch (290:19): [True: 2.08k, False: 2.08k]
  ------------------
  291|  2.08k|    int y_offset = std::min(i * y_per_thread, height);
  292|  2.08k|    int y_end = std::min((i + 1) * y_per_thread, height);
  293|       |
  294|  2.08k|    RawImageWorker worker(this, task, y_offset, y_end);
  295|  2.08k|  }
RawImage.cpp:_ZZN8rawspeed12RawImageData11startWorkerENS_14RawImageWorker18RawImageWorkerTaskEbENK3$_0clEv:
  273|     66|  const int height = [&]() {
  274|     66|    int h = cropped ? dim.y : uncropped_dim.y;
  ------------------
  |  Branch (274:13): [True: 66, False: 0]
  ------------------
  275|     66|    if (static_cast<uint32_t>(task) &
  ------------------
  |  Branch (275:9): [True: 66, False: 0]
  ------------------
  276|     66|        static_cast<uint32_t>(RawImageWorker::RawImageWorkerTask::FULL_IMAGE)) {
  277|     66|      h = uncropped_dim.y;
  278|     66|    }
  279|     66|    return h;
  280|     66|  }();
_ZN8rawspeed14RawImageWorkerC2EPNS_12RawImageDataENS0_18RawImageWorkerTaskEii:
  342|  2.08k|    : data(_img), task(_task), start_y(_start_y), end_y(_end_y) {
  343|  2.08k|  performTask();
  344|  2.08k|}
_ZN8rawspeed14RawImageWorker11performTaskEv:
  346|  2.08k|void RawImageWorker::performTask() noexcept {
  347|  2.08k|  try {
  348|  2.08k|    switch (task) {
  349|      0|      using enum RawImageWorkerTask;
  350|      0|    case SCALE_VALUES:
  ------------------
  |  Branch (350:5): [True: 0, False: 2.08k]
  ------------------
  351|      0|      data->scaleValues(start_y, end_y);
  352|      0|      break;
  353|      0|    case FIX_BAD_PIXELS:
  ------------------
  |  Branch (353:5): [True: 0, False: 2.08k]
  ------------------
  354|      0|      data->fixBadPixelsThread(start_y, end_y);
  355|      0|      break;
  356|  2.09k|    case APPLY_LOOKUP:
  ------------------
  |  Branch (356:5): [True: 2.09k, False: 18.4E]
  ------------------
  357|  2.09k|      data->doLookup(start_y, end_y);
  358|  2.09k|      break;
  359|      0|    default:
  ------------------
  |  Branch (359:5): [True: 0, False: 2.08k]
  ------------------
  360|      0|      assert(false);
  ------------------
  |  Branch (360:7): [Folded, False: 0]
  ------------------
  361|  2.08k|    }
  362|  2.08k|  } catch (const RawDecoderException& e) {
  363|    256|    data->setError(e.what());
  364|    256|  } catch (const TiffParserException& e) {
  365|      0|    data->setError(e.what());
  366|      0|  } catch (const IOException& e) {
  367|      0|    data->setError(e.what());
  368|      0|  } catch (...) {
  369|       |    // We should not get any other exception type here.
  370|      0|    __builtin_unreachable();
  371|      0|  }
  372|  2.08k|}
_ZN8rawspeed12RawImageData16sixteenBitLookupEv:
  374|     66|void RawImageData::sixteenBitLookup() {
  375|     66|  if (table == nullptr) {
  ------------------
  |  Branch (375:7): [True: 0, False: 66]
  ------------------
  376|      0|    return;
  377|      0|  }
  378|     66|  startWorker(RawImageWorker::RawImageWorkerTask::APPLY_LOOKUP, true);
  379|     66|}
_ZN8rawspeed12RawImageData8setTableENSt3__110unique_ptrINS_11TableLookUpENS1_14default_deleteIS3_EEEE:
  381|  1.31k|void RawImageData::setTable(std::unique_ptr<TableLookUp> t) {
  382|  1.31k|  table = std::move(t);
  383|  1.31k|}
_ZN8rawspeed12RawImageData8setTableERKNSt3__16vectorItNS1_9allocatorItEEEEb:
  385|    659|void RawImageData::setTable(const std::vector<uint16_t>& table_, bool dither) {
  386|    659|  assert(!table_.empty());
  ------------------
  |  Branch (386:3): [True: 659, False: 0]
  ------------------
  387|       |
  388|    659|  auto t = std::make_unique<TableLookUp>(1, dither);
  389|    659|  t->setTable(0, table_);
  390|    659|  this->setTable(std::move(t));
  391|    659|}

_ZNK8rawspeed12RawImageData6getCppEv:
  118|  63.8k|  [[nodiscard]] uint32_t RAWSPEED_READONLY getCpp() const { return cpp; }
_ZNK8rawspeed12RawImageData6getBppEv:
  119|  7.29k|  [[nodiscard]] uint32_t RAWSPEED_READONLY getBpp() const { return bpp; }
_ZNK8rawspeed12RawImageData11getDataTypeEv:
  125|  19.4k|  [[nodiscard]] rawspeed::RawImageType getDataType() const { return dataType; }
_ZNK8rawspeed12RawImageData11isAllocatedEv:
  152|  11.7k|  [[nodiscard]] bool isAllocated() const { return !data.empty(); }
_ZNK8rawspeed8RawImageptEv:
  253|  5.61M|  RawImageData* RAWSPEED_READONLY operator->() const { return &*p_; }
_ZNK8rawspeed8RawImagedeEv:
  254|  18.1k|  RawImageData& RAWSPEED_READONLY operator*() const { return *p_; }
_ZN8rawspeed8RawImageC2ENSt3__110shared_ptrINS_12RawImageDataEEE:
  257|  15.4k|  explicit RawImage(std::shared_ptr<RawImageData> p) : p_(std::move(p)) {}
_ZN8rawspeed8RawImage3getEv:
  259|    177|  RawImageData* get() { return &*p_; }
_ZN8rawspeed18RawImageCurveGuardC2EPKNS_8RawImageERKNSt3__16vectorItNS4_9allocatorItEEEEb:
  379|    659|      : mRaw(raw), curve(curve_), uncorrectedRawValues(uncorrectedRawValues_) {
  380|    659|    if (uncorrectedRawValues)
  ------------------
  |  Branch (380:9): [True: 0, False: 659]
  ------------------
  381|      0|      return;
  382|       |
  383|    659|    (*mRaw)->setTable(curve, true);
  384|    659|  }
_ZN8rawspeed18RawImageCurveGuardD2Ev:
  386|    658|  ~RawImageCurveGuard() {
  387|       |    // Set the table, if it should be needed later.
  388|    658|    if (uncorrectedRawValues)
  ------------------
  |  Branch (388:9): [True: 0, False: 658]
  ------------------
  389|      0|      (*mRaw)->setTable(curve, false);
  390|    658|    else
  391|    658|      (*mRaw)->setTable(nullptr);
  392|    658|  }
_ZN8rawspeed8RawImage6createENS_12RawImageTypeE:
  265|  15.4k|inline RawImage RawImage::create(RawImageType type) {
  266|  15.4k|  switch (type) {
  ------------------
  |  Branch (266:11): [True: 15.4k, False: 0]
  ------------------
  267|  15.1k|  case RawImageType::UINT16:
  ------------------
  |  Branch (267:3): [True: 15.1k, False: 308]
  ------------------
  268|  15.1k|    return RawImage(std::make_shared<RawImageDataU16>());
  269|    308|  case RawImageType::F32:
  ------------------
  |  Branch (269:3): [True: 308, False: 15.1k]
  ------------------
  270|    308|    return RawImage(std::make_shared<RawImageDataFloat>());
  271|  15.4k|  }
  272|      0|  writeLog(DEBUG_PRIO::ERROR, "RawImage::create: Unknown Image type!");
  273|      0|  __builtin_unreachable();
  274|  15.4k|}
_ZN8rawspeed12RawImageData31getU16DataAsUncroppedArray2DRefEv:
  290|  2.76M|RawImageData::getU16DataAsUncroppedArray2DRef() noexcept {
  291|  2.76M|  assert(dataType == RawImageType::UINT16 &&
  ------------------
  |  Branch (291:3): [True: 2.76M, False: 18.4E]
  |  Branch (291:3): [True: 2.76M, Folded]
  |  Branch (291:3): [True: 2.76M, False: 18.4E]
  ------------------
  292|  2.76M|         "Attempting to access floating-point buffer as uint16_t.");
  293|  2.76M|  assert(!data.empty() && "Data not yet allocated.");
  ------------------
  |  Branch (293:3): [True: 2.76M, False: 18.4E]
  |  Branch (293:3): [True: 2.76M, Folded]
  |  Branch (293:3): [True: 2.76M, False: 18.4E]
  ------------------
  294|  2.76M|#pragma GCC diagnostic push
  295|  2.76M|#pragma GCC diagnostic ignored "-Wpragmas"
  296|  2.76M|#pragma GCC diagnostic ignored "-Wunknown-warning-option"
  297|  2.76M|#pragma GCC diagnostic ignored "-Wunsafe-buffer-usage"
  298|  2.76M|  return {reinterpret_cast<uint16_t*>(data.data()), cpp * uncropped_dim.x,
  299|  2.76M|          uncropped_dim.y, static_cast<int>(pitch / sizeof(uint16_t))};
  300|  2.76M|#pragma GCC diagnostic pop
  301|  2.76M|}
_ZN8rawspeed12RawImageData29getU16DataAsCroppedArray2DRefEv:
  304|  2.65k|RawImageData::getU16DataAsCroppedArray2DRef() noexcept {
  305|  2.65k|  return {getU16DataAsUncroppedArray2DRef(), cpp * mOffset.x, mOffset.y,
  306|  2.65k|          cpp * dim.x, dim.y};
  307|  2.65k|}
_ZN8rawspeed12RawImageData31getF32DataAsUncroppedArray2DRefEv:
  310|  1.17k|RawImageData::getF32DataAsUncroppedArray2DRef() noexcept {
  311|  1.17k|  assert(dataType == RawImageType::F32 &&
  ------------------
  |  Branch (311:3): [True: 1.17k, False: 0]
  |  Branch (311:3): [True: 1.17k, Folded]
  |  Branch (311:3): [True: 1.17k, False: 0]
  ------------------
  312|  1.17k|         "Attempting to access integer buffer as float.");
  313|  1.17k|  assert(!data.empty() && "Data not yet allocated.");
  ------------------
  |  Branch (313:3): [True: 1.17k, False: 0]
  |  Branch (313:3): [True: 1.17k, Folded]
  |  Branch (313:3): [True: 1.17k, False: 0]
  ------------------
  314|  1.17k|#pragma GCC diagnostic push
  315|  1.17k|#pragma GCC diagnostic ignored "-Wpragmas"
  316|  1.17k|#pragma GCC diagnostic ignored "-Wunknown-warning-option"
  317|  1.17k|#pragma GCC diagnostic ignored "-Wunsafe-buffer-usage"
  318|  1.17k|  return {reinterpret_cast<float*>(data.data()), cpp * uncropped_dim.x,
  319|  1.17k|          uncropped_dim.y, static_cast<int>(pitch / sizeof(float))};
  320|  1.17k|#pragma GCC diagnostic pop
  321|  1.17k|}
_ZN8rawspeed12RawImageData29getF32DataAsCroppedArray2DRefEv:
  324|    285|RawImageData::getF32DataAsCroppedArray2DRef() noexcept {
  325|    285|  return {getF32DataAsUncroppedArray2DRef(), cpp * mOffset.x, mOffset.y,
  326|    285|          cpp * dim.x, dim.y};
  327|    285|}
_ZN8rawspeed12RawImageData32getByteDataAsUncroppedArray2DRefEv:
  330|  11.0k|RawImageData::getByteDataAsUncroppedArray2DRef() noexcept {
  331|  11.0k|  switch (dataType) {
  ------------------
  |  Branch (331:11): [True: 11.0k, False: 0]
  ------------------
  332|  10.4k|  case RawImageType::UINT16:
  ------------------
  |  Branch (332:3): [True: 10.4k, False: 545]
  ------------------
  333|  10.4k|    return getU16DataAsUncroppedArray2DRef();
  334|    545|  case RawImageType::F32:
  ------------------
  |  Branch (334:3): [True: 545, False: 10.4k]
  ------------------
  335|    545|    return getF32DataAsUncroppedArray2DRef();
  336|  11.0k|  }
  337|      0|  __builtin_unreachable();
  338|  11.0k|}
_ZN8rawspeed15RawImageDataU1613setWithLookUpEtPSt4bytePj:
  346|  1.86M|                                           uint32_t* random) {
  347|  1.86M|  auto* dest = reinterpret_cast<uint16_t*>(dst);
  348|  1.86M|  if (table == nullptr) {
  ------------------
  |  Branch (348:7): [True: 0, False: 1.86M]
  ------------------
  349|      0|    *dest = value;
  350|      0|    return;
  351|      0|  }
  352|  1.86M|  if (table->dither) {
  ------------------
  |  Branch (352:7): [True: 1.86M, False: 5.21k]
  ------------------
  353|  1.86M|    uint32_t base = table->tables[(2 * value) + 0];
  354|  1.86M|    uint32_t delta = table->tables[(2 * value) + 1];
  355|  1.86M|    uint32_t r = *random;
  356|       |
  357|  1.86M|    uint32_t pix = base + ((delta * (r & 2047) + 1024) >> 12);
  358|  1.86M|    *random = 15700 * (r & 65535) + (r >> 16);
  359|  1.86M|    *dest = implicit_cast<uint16_t>(pix);
  360|  1.86M|    return;
  361|  1.86M|  }
  362|  5.21k|  *dest = table->tables[value];
  363|  5.21k|}
_ZN8rawspeed12RawImageDataD2Ev:
  117|  15.4k|  virtual ~RawImageData() = default;
_ZN8rawspeed12RawImageDataC2Ev:
  191|  15.4k|  RawImageData() = default;

_ZN8rawspeed17RawImageDataFloatC2Ev:
   43|    308|RawImageDataFloat::RawImageDataFloat() {
   44|    308|  bpp = sizeof(float);
   45|    308|  dataType = RawImageType::F32;
   46|    308|}
_ZN8rawspeed17RawImageDataFloat8doLookupEii:
  262|    254|void RawImageDataFloat::doLookup(int start_y, int end_y) {
  263|    254|  ThrowRDE("Float point lookup tables not implemented");
  ------------------
  |  |   38|    254|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|    254|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|    254|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|    254|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  264|    254|}

_ZN8rawspeed15RawImageDataU16C2Ev:
   52|  15.1k|RawImageDataU16::RawImageDataU16() {
   53|  15.1k|  dataType = RawImageType::UINT16;
   54|  15.1k|  bpp = sizeof(uint16_t);
   55|  15.1k|}
_ZN8rawspeed15RawImageDataU168doLookupEii:
  488|  1.84k|void RawImageDataU16::doLookup(int start_y, int end_y) {
  489|  1.84k|  const Array2DRef<uint16_t> img = getU16DataAsUncroppedArray2DRef();
  490|       |
  491|  1.84k|  if (table->ntables == 1) {
  ------------------
  |  Branch (491:7): [True: 1.82k, False: 14]
  ------------------
  492|  1.83k|    if (table->dither) {
  ------------------
  |  Branch (492:9): [True: 1.83k, False: 18.4E]
  ------------------
  493|  1.83k|      int gw = uncropped_dim.x * cpp;
  494|  1.83k|      const auto t = table->getTable(0);
  495|  7.97k|      for (int y = start_y; y < end_y; y++) {
  ------------------
  |  Branch (495:29): [True: 6.14k, False: 1.83k]
  ------------------
  496|  6.14k|        uint32_t v = (uncropped_dim.x + y * 13) ^ 0x45694584;
  497|   363k|        for (int x = 0; x < gw; x++) {
  ------------------
  |  Branch (497:25): [True: 357k, False: 6.14k]
  ------------------
  498|   357k|          uint16_t p = img(y, x);
  499|   357k|          uint32_t base = t((2 * p) + 0);
  500|   357k|          uint32_t delta = t((2 * p) + 1);
  501|   357k|          v = 15700 * (v & 65535) + (v >> 16);
  502|   357k|          uint32_t pix = base + ((delta * (v & 2047) + 1024) >> 12);
  503|   357k|          img(y, x) = clampBits(pix, 16);
  504|   357k|        }
  505|  6.14k|      }
  506|  1.83k|      return;
  507|  1.83k|    }
  508|       |
  509|  18.4E|    int gw = uncropped_dim.x * cpp;
  510|  18.4E|    const auto t = table->getTable(0);
  511|  18.4E|    for (int y = start_y; y < end_y; y++) {
  ------------------
  |  Branch (511:27): [True: 0, False: 18.4E]
  ------------------
  512|      0|      for (int x = 0; x < gw; x++) {
  ------------------
  |  Branch (512:23): [True: 0, False: 0]
  ------------------
  513|      0|        img(y, x) = t(img(y, x));
  514|      0|      }
  515|      0|    }
  516|  18.4E|    return;
  517|  1.82k|  }
  518|     14|  ThrowRDE("Table lookup with multiple components not implemented");
  ------------------
  |  |   38|     14|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     14|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     14|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     14|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  519|  1.84k|}

_ZN8rawspeed17RawspeedException3logEPKc:
   58|   172k|  log(const char* msg) {
   59|   172k|    writeLog(DEBUG_PRIO::EXTRA, "EXCEPTION: %s", msg);
   60|   172k|  }
_ZN8rawspeed17RawspeedExceptionC2EPKc:
   67|   172k|      : std::runtime_error(msg) {
   68|   172k|    log(msg);
   69|   172k|  }
_ZN8rawspeed14ThrowExceptionINS_11IOExceptionEEEvPKcz:
   36|   121k|    ThrowException(const char* fmt, ...) {
   37|   121k|  static constexpr size_t bufSize = 8192;
   38|   121k|#if defined(HAVE_CXX_THREAD_LOCAL)
   39|   121k|  static thread_local std::array<char, bufSize> buf;
   40|       |#elif defined(HAVE_GCC_THREAD_LOCAL)
   41|       |  static __thread char buf[bufSize];
   42|       |#else
   43|       |#pragma message                                                                \
   44|       |    "Don't have thread-local-storage! Exception text may be garbled if used multithreaded"
   45|       |  static char buf[bufSize];
   46|       |#endif
   47|       |
   48|   121k|  va_list val;
   49|   121k|  va_start(val, fmt);
   50|   121k|  vsnprintf(buf.data(), sizeof(buf), fmt, val);
   51|       |  va_end(val);
   52|   121k|  writeLog(DEBUG_PRIO::EXTRA, "EXCEPTION: %s", buf.data());
   53|   121k|  throw T(buf.data());
   54|   121k|}
_ZN8rawspeed14ThrowExceptionINS_19TiffParserExceptionEEEvPKcz:
   36|  25.1k|    ThrowException(const char* fmt, ...) {
   37|  25.1k|  static constexpr size_t bufSize = 8192;
   38|  25.1k|#if defined(HAVE_CXX_THREAD_LOCAL)
   39|  25.1k|  static thread_local std::array<char, bufSize> buf;
   40|       |#elif defined(HAVE_GCC_THREAD_LOCAL)
   41|       |  static __thread char buf[bufSize];
   42|       |#else
   43|       |#pragma message                                                                \
   44|       |    "Don't have thread-local-storage! Exception text may be garbled if used multithreaded"
   45|       |  static char buf[bufSize];
   46|       |#endif
   47|       |
   48|  25.1k|  va_list val;
   49|  25.1k|  va_start(val, fmt);
   50|  25.1k|  vsnprintf(buf.data(), sizeof(buf), fmt, val);
   51|       |  va_end(val);
   52|  25.1k|  writeLog(DEBUG_PRIO::EXTRA, "EXCEPTION: %s", buf.data());
   53|  25.1k|  throw T(buf.data());
   54|  25.1k|}
_ZN8rawspeed14ThrowExceptionINS_19RawDecoderExceptionEEEvPKcz:
   36|  25.7k|    ThrowException(const char* fmt, ...) {
   37|  25.7k|  static constexpr size_t bufSize = 8192;
   38|  25.7k|#if defined(HAVE_CXX_THREAD_LOCAL)
   39|  25.7k|  static thread_local std::array<char, bufSize> buf;
   40|       |#elif defined(HAVE_GCC_THREAD_LOCAL)
   41|       |  static __thread char buf[bufSize];
   42|       |#else
   43|       |#pragma message                                                                \
   44|       |    "Don't have thread-local-storage! Exception text may be garbled if used multithreaded"
   45|       |  static char buf[bufSize];
   46|       |#endif
   47|       |
   48|  25.7k|  va_list val;
   49|  25.7k|  va_start(val, fmt);
   50|  25.7k|  vsnprintf(buf.data(), sizeof(buf), fmt, val);
   51|       |  va_end(val);
   52|  25.7k|  writeLog(DEBUG_PRIO::EXTRA, "EXCEPTION: %s", buf.data());
   53|  25.7k|  throw T(buf.data());
   54|  25.7k|}

_ZN8rawspeed9SimpleLUTIjLi12EEC2Ev:
   38|    572|  SimpleLUT() = default;
OlympusDecompressor.cpp:_ZN8rawspeed9SimpleLUTIaLi12EEC2INS_12_GLOBAL__N_123OlympusDecompressorImpl5numLZMUlmjE_EQaantsr3stdE9is_same_vINS0_IT_XT0_EEEu11__remove_cvIu20__remove_reference_tITL0__EEEsr3stdE16is_convertible_vISA_NSt3__18functionIFS7_NDtL_ZNS_9SimpleLUT5tableEEE9size_typeESH_EEEEEES7_:
   51|    133|  explicit SimpleLUT(F f) {
   52|    133|    const auto fullTableSize = 1U << TableBitWidth;
   53|    133|    table.reserve(fullTableSize);
   54|    133|    std::generate_n(std::back_inserter(table), fullTableSize,
   55|    133|                    [&f, table_ = &table]() {
   56|       |                      // which row [0..fullTableSize) are we filling?
   57|    133|                      const auto i = table_->size();
   58|    133|                      return f(i, fullTableSize);
   59|    133|                    });
   60|       |    assert(table.size() == fullTableSize);
  ------------------
  |  Branch (60:5): [True: 133, False: 0]
  ------------------
   61|    133|  }
OlympusDecompressor.cpp:_ZZN8rawspeed9SimpleLUTIaLi12EEC1INS_12_GLOBAL__N_123OlympusDecompressorImpl5numLZMUlmjE_EQaantsr3stdE9is_same_vINS0_IT_XT0_EEEu11__remove_cvIu20__remove_reference_tITL0__EEEsr3stdE16is_convertible_vISA_NSt3__18functionIFS7_NDtL_ZNS_9SimpleLUT5tableEEE9size_typeESH_EEEEEES7_ENKUlvE_clEv:
   55|   544k|                    [&f, table_ = &table]() {
   56|       |                      // which row [0..fullTableSize) are we filling?
   57|   544k|                      const auto i = table_->size();
   58|   544k|                      return f(i, fullTableSize);
   59|   544k|                    });
_ZNK8rawspeed9SimpleLUTIaLi12EEixEi:
   63|  1.45M|  value_type operator[](int x) const {
   64|  1.45M|    unsigned clampedX = clampBits(x, TableBitWidth);
   65|  1.45M|    return table[clampedX];
   66|  1.45M|  }

_ZN8rawspeed6SplineItEC2ERKNSt3__16vectorINS_8iPoint2DENS2_9allocatorIS4_EEEE:
  113|     88|  explicit Spline(const std::vector<iPoint2D>& control_points) {
  114|     88|    assert(control_points.size() >= 2 &&
  ------------------
  |  Branch (114:5): [True: 88, False: 0]
  |  Branch (114:5): [True: 88, Folded]
  |  Branch (114:5): [True: 88, False: 0]
  ------------------
  115|     88|           "Need at least two points to interpolate between");
  116|       |
  117|       |    // Expect the X coords of the curve to start/end at the extreme values
  118|     88|    assert(control_points.front().x == 0);
  ------------------
  |  Branch (118:5): [True: 88, False: 0]
  ------------------
  119|     88|    assert(control_points.back().x == 65535);
  ------------------
  |  Branch (119:5): [True: 88, False: 0]
  ------------------
  120|       |
  121|     88|    assert(std::adjacent_find(
  ------------------
  |  Branch (121:5): [True: 88, False: 0]
  |  Branch (121:5): [True: 88, Folded]
  |  Branch (121:5): [True: 88, False: 0]
  ------------------
  122|     88|               control_points.cbegin(), control_points.cend(),
  123|     88|               [](const iPoint2D& lhs, const iPoint2D& rhs) -> bool {
  124|     88|                 return std::greater_equal<>()(lhs.x, rhs.x);
  125|     88|               }) == control_points.cend() &&
  126|     88|           "The X coordinates must all be strictly increasing");
  127|       |
  128|     88|#ifndef NDEBUG
  129|     88|    if constexpr (!std::is_floating_point_v<value_type>) {
  130|       |      // The Y coords must be limited to the range of value_type
  131|     88|      std::for_each(control_points.cbegin(), control_points.cend(),
  132|     88|                    [](const iPoint2D& p) {
  133|     88|                      assert(p.y >= std::numeric_limits<value_type>::min());
  134|     88|                      assert(p.y <= std::numeric_limits<value_type>::max());
  135|     88|                    });
  136|     88|    }
  137|     88|#endif
  138|       |
  139|     88|    num_coords = implicit_cast<int>(control_points.size());
  140|     88|    num_segments = num_coords - 1;
  141|       |
  142|     88|    xCp.resize(num_coords);
  143|     88|    segments.resize(num_coords);
  144|    880|    for (int i = 0; i < num_coords; i++) {
  ------------------
  |  Branch (144:21): [True: 792, False: 88]
  ------------------
  145|    792|      xCp[i] = control_points[i].x;
  146|    792|      segments[i].a = control_points[i].y;
  147|    792|    }
  148|       |
  149|     88|    prepare();
  150|     88|  }
_ZZN8rawspeed6SplineItEC1ERKNSt3__16vectorINS_8iPoint2DENS2_9allocatorIS4_EEEEENKUlRKS4_E_clESB_:
  132|    792|                    [](const iPoint2D& p) {
  133|    792|                      assert(p.y >= std::numeric_limits<value_type>::min());
  ------------------
  |  Branch (133:23): [True: 792, False: 0]
  ------------------
  134|    792|                      assert(p.y <= std::numeric_limits<value_type>::max());
  ------------------
  |  Branch (134:23): [True: 792, False: 0]
  ------------------
  135|    792|                    });
_ZN8rawspeed6SplineItE7prepareEv:
   67|     88|  void prepare() {
   68|       |    // Extra values used during computation
   69|     88|    std::vector<double> h(num_segments);
   70|     88|    std::vector<double> alpha(num_segments);
   71|     88|    std::vector<double> mu(num_coords);
   72|     88|    std::vector<double> z(num_coords);
   73|       |
   74|    792|    for (int i = 0; i < num_segments; i++)
  ------------------
  |  Branch (74:21): [True: 704, False: 88]
  ------------------
   75|    704|      h[i] = xCp[i + 1] - xCp[i];
   76|       |
   77|    704|    for (int i = 1; i < num_segments; i++) {
  ------------------
  |  Branch (77:21): [True: 616, False: 88]
  ------------------
   78|    616|      Segment& sp = segments[i - 1];
   79|    616|      Segment& s = segments[i];
   80|    616|      Segment& sn = segments[i + 1];
   81|       |
   82|    616|      alpha[i] = (3. / h[i]) * (sn.a - s.a) - (3. / h[i - 1]) * (s.a - sp.a);
   83|    616|    }
   84|       |
   85|     88|    mu[0] = z[0] = 0;
   86|       |
   87|    704|    for (int i = 1; i < num_segments; i++) {
  ------------------
  |  Branch (87:21): [True: 616, False: 88]
  ------------------
   88|    616|      const double l = (2 * (xCp[i + 1] - xCp[i - 1])) - (h[i - 1] * mu[i - 1]);
   89|    616|      mu[i] = h[i] / l;
   90|    616|      z[i] = (alpha[i] - h[i - 1] * z[i - 1]) / l;
   91|    616|    }
   92|       |
   93|     88|    z.back() = segments.back().c = 0;
   94|       |
   95|    792|    for (int i = num_segments - 1; i >= 0; i--) {
  ------------------
  |  Branch (95:36): [True: 704, False: 88]
  ------------------
   96|    704|      Segment& s = segments[i];
   97|    704|      Segment& sn = segments[i + 1];
   98|       |
   99|    704|      s.c = z[i] - mu[i] * sn.c;
  100|    704|      s.b = (sn.a - s.a) / h[i] - h[i] * (sn.c + 2 * s.c) / 3.;
  101|    704|      s.d = (sn.c - s.c) / (3. * h[i]);
  102|    704|    }
  103|       |
  104|       |    // The last segment is nonsensical, and was only used to temporarily store
  105|       |    // the a and c to simplify calculations, so drop that 'segment' now
  106|     88|    segments.pop_back();
  107|       |
  108|       |    assert(static_cast<typename decltype(segments)::size_type>(num_segments) ==
  ------------------
  |  Branch (108:5): [True: 88, False: 0]
  ------------------
  109|     88|           segments.size());
  110|     88|  }
_ZNK8rawspeed6SplineItE14calculateCurveEv:
  154|     88|  [[nodiscard]] std::vector<value_type> calculateCurve() const {
  155|     88|    std::vector<value_type> curve(65536);
  156|       |
  157|    792|    for (int i = 0; i < num_segments; i++) {
  ------------------
  |  Branch (157:21): [True: 704, False: 88]
  ------------------
  158|    704|      const Segment& s = segments[i];
  159|       |
  160|  5.76M|      for (int x = xCp[i]; x <= xCp[i + 1]; x++) {
  ------------------
  |  Branch (160:28): [True: 5.76M, False: 704]
  ------------------
  161|  5.76M|        double diff = x - xCp[i];
  162|  5.76M|        double diff_2 = diff * diff;
  163|  5.76M|        double diff_3 = diff * diff * diff;
  164|       |
  165|  5.76M|        double interpolated =
  166|  5.76M|            s.a + (s.b * diff) + (s.c * diff_2) + (s.d * diff_3);
  167|       |
  168|  5.76M|        if constexpr (!std::is_floating_point_v<value_type>) {
  169|  5.76M|          interpolated = std::max(
  170|  5.76M|              interpolated, double(std::numeric_limits<value_type>::min()));
  171|  5.76M|          interpolated = std::min(
  172|  5.76M|              interpolated, double(std::numeric_limits<value_type>::max()));
  173|  5.76M|        }
  174|       |
  175|  5.76M|        curve[x] = implicit_cast<T>(interpolated);
  176|  5.76M|      }
  177|    704|    }
  178|       |
  179|     88|    return curve;
  180|     88|  }

_ZN8rawspeed11TableLookUpC2Eib:
   43|    659|    : ntables(_ntables), dither(_dither) {
   44|    659|  if (ntables < 1) {
  ------------------
  |  Branch (44:7): [True: 0, False: 659]
  ------------------
   45|      0|    ThrowRDE("Cannot construct 0 tables");
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   46|      0|  }
   47|    659|  tables.resize(ntables * TABLE_SIZE, uint16_t(0));
   48|    659|}
_ZN8rawspeed11TableLookUp8setTableEiRKNSt3__16vectorItNS1_9allocatorItEEEE:
   50|    659|void TableLookUp::setTable(int ntable, const std::vector<uint16_t>& table) {
   51|    659|  assert(!table.empty());
  ------------------
  |  Branch (51:3): [True: 659, False: 0]
  ------------------
   52|       |
   53|    659|  const auto nfilled = implicit_cast<int>(table.size());
   54|    659|  if (nfilled > TABLE_MAX_ELTS)
  ------------------
  |  Branch (54:7): [True: 1, False: 658]
  ------------------
   55|    659|    ThrowRDE("Table lookup with %i entries is unsupported", nfilled);
  ------------------
  |  |   38|      1|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      1|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      1|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      1|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   56|       |
   57|    658|  if (ntable > ntables) {
  ------------------
  |  Branch (57:7): [True: 0, False: 658]
  ------------------
   58|      0|    ThrowRDE("Table lookup with number greater than number of tables.");
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   59|      0|  }
   60|       |
   61|    658|  auto t = Array2DRef(tables.data(), TABLE_SIZE, ntables)[ntable];
   62|    658|  if (!dither) {
  ------------------
  |  Branch (62:7): [True: 0, False: 658]
  ------------------
   63|      0|    for (int i = 0; i < TABLE_MAX_ELTS; i++) {
  ------------------
  |  Branch (63:21): [True: 0, False: 0]
  ------------------
   64|      0|      t(i) = (i < nfilled) ? table[i] : table[nfilled - 1];
  ------------------
  |  Branch (64:14): [True: 0, False: 0]
  ------------------
   65|      0|    }
   66|      0|    return;
   67|      0|  }
   68|  4.79M|  for (int i = 0; i < nfilled; i++) {
  ------------------
  |  Branch (68:19): [True: 4.79M, False: 658]
  ------------------
   69|  4.79M|    int center = table[i];
   70|  4.79M|    int lower = i > 0 ? table[i - 1] : center;
  ------------------
  |  Branch (70:17): [True: 4.79M, False: 658]
  ------------------
   71|  4.79M|    int upper = i < (nfilled - 1) ? table[i + 1] : center;
  ------------------
  |  Branch (71:17): [True: 4.79M, False: 658]
  ------------------
   72|       |    // Non-monotonic LUT handling: don't interpolate across the cross-over.
   73|  4.79M|    lower = std::min(lower, center);
   74|  4.79M|    upper = std::max(upper, center);
   75|  4.79M|    int delta = upper - lower;
   76|  4.79M|    invariant(delta >= 0);
  ------------------
  |  |   27|  4.79M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (76:5): [True: 4.79M, False: 0]
  ------------------
   77|  4.79M|    t(i * 2) = clampBits(center - ((upper - lower + 2) / 4), 16);
   78|  4.79M|    t((i * 2) + 1) = implicit_cast<uint16_t>(delta);
   79|  4.79M|  }
   80|       |
   81|  38.3M|  for (int i = nfilled; i < TABLE_MAX_ELTS; i++) {
  ------------------
  |  Branch (81:25): [True: 38.3M, False: 658]
  ------------------
   82|  38.3M|    t(i * 2) = table[nfilled - 1];
   83|  38.3M|    t((i * 2) + 1) = 0;
   84|  38.3M|  }
   85|    658|}
_ZN8rawspeed11TableLookUp8getTableEi:
   87|  1.83k|Array1DRef<uint16_t> TableLookUp::getTable(int n) {
   88|  1.83k|  if (n > ntables) {
  ------------------
  |  Branch (88:7): [True: 0, False: 1.83k]
  ------------------
   89|      0|    ThrowRDE("Table lookup with number greater than number of tables.");
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   90|      0|  }
   91|  1.83k|  return Array2DRef(tables.data(), TABLE_SIZE, ntables)[n];
   92|  1.83k|}

_ZNK8rawspeed19AbstractTiffDecoder22getIFDWithLargestImageENS_7TiffTagE:
   37|  1.27k|AbstractTiffDecoder::getIFDWithLargestImage(TiffTag filter) const {
   38|  1.27k|  std::vector<const TiffIFD*> ifds = mRootIFD->getIFDsWithTag(filter);
   39|       |
   40|  1.27k|  if (ifds.empty())
  ------------------
  |  Branch (40:7): [True: 10, False: 1.26k]
  ------------------
   41|  1.27k|    ThrowRDE("No suitable IFD with tag 0x%04x found.",
  ------------------
  |  |   38|     10|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     10|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     10|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     10|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   42|  1.26k|             static_cast<unsigned>(filter));
   43|       |
   44|  1.26k|  const auto* res = ifds[0];
   45|  1.26k|  uint32_t width = res->getEntry(TiffTag::IMAGEWIDTH)->getU32();
   46|  1.53k|  for (const auto* ifd : ifds) {
  ------------------
  |  Branch (46:24): [True: 1.53k, False: 1.26k]
  ------------------
   47|  1.53k|    const TiffEntry* widthE = ifd->getEntry(TiffTag::IMAGEWIDTH);
   48|       |    // guard against random maker note entries with the same tag
   49|  1.53k|    if (widthE->count == 1 && widthE->getU32() > width) {
  ------------------
  |  Branch (49:9): [True: 881, False: 655]
  |  Branch (49:31): [True: 241, False: 640]
  ------------------
   50|    241|      res = ifd;
   51|    241|      width = widthE->getU32();
   52|    241|    }
   53|  1.53k|  }
   54|       |
   55|  1.26k|  return res;
   56|  1.27k|}

_ZN8rawspeed19AbstractTiffDecoderC2EONSt3__110unique_ptrINS_11TiffRootIFDENS1_14default_deleteIS3_EEEENS_6BufferE:
   44|  11.6k|      : RawDecoder(file), mRootIFD(std::move(root)) {}
_ZN8rawspeed19AbstractTiffDecoder10getRootIFDEv:
   46|    226|  TiffIFD* getRootIFD() final { return mRootIFD.get(); }
_ZN8rawspeed19AbstractTiffDecoder20checkCameraSupportedEPKNS_14CameraMetaDataERKNS_6TiffIDERKNSt3__112basic_stringIcNS7_11char_traitsIcEENS7_9allocatorIcEEEE:
   49|     39|                            const std::string& mode) {
   50|     39|    return RawDecoder::checkCameraSupported(meta, id.make, id.model, mode);
   51|     39|  }
_ZN8rawspeed19AbstractTiffDecoder11setMetaDataEPKNS_14CameraMetaDataERKNS_6TiffIDERKNSt3__112basic_stringIcNS7_11char_traitsIcEENS7_9allocatorIcEEEEi:
   56|    421|                   const std::string& mode, int iso_speed) {
   57|    421|    setMetaData(meta, id.make, id.model, mode, iso_speed);
   58|    421|  }
_ZN8rawspeed19AbstractTiffDecoder11setMetaDataEPKNS_14CameraMetaDataERKNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEEi:
   61|    147|                   int iso_speed) {
   62|    147|    setMetaData(meta, mRootIFD->getID(), mode, iso_speed);
   63|    147|  }

_ZN8rawspeed10ArwDecoder20isAppropriateDecoderEPKNS_11TiffRootIFDENS_6BufferE:
   61|  4.15k|                                      [[maybe_unused]] Buffer file) {
   62|  4.15k|  const auto id = rootIFD->getID();
   63|  4.15k|  const std::string& make = id.make;
   64|       |
   65|       |  // FIXME: magic
   66|       |
   67|  4.15k|  return make == "SONY";
   68|  4.15k|}
_ZN8rawspeed10ArwDecoder21decodeTransitionalArwEv:
  120|    815|RawImage ArwDecoder::decodeTransitionalArw() {
  121|    815|  if (const TiffEntry* model = mRootIFD->getEntryRecursive(TiffTag::MODEL);
  122|    815|      model && model->getString() == "DSLR-A100") {
  ------------------
  |  Branch (122:7): [True: 815, False: 0]
  |  Branch (122:7): [True: 794, False: 21]
  |  Branch (122:16): [True: 794, False: 21]
  ------------------
  123|       |    // We've caught the elusive A100 in the wild, a transitional format
  124|       |    // between the simple sanity of the MRW custom format and the wordly
  125|       |    // wonderfullness of the Tiff-based ARW format, let's shoot from the hip
  126|    794|    const TiffIFD* raw = mRootIFD->getIFDWithTag(TiffTag::SUBIFDS);
  127|    794|    uint32_t off = raw->getEntry(TiffTag::SUBIFDS)->getU32();
  128|    794|    uint32_t width = 3881;
  129|    794|    uint32_t height = 2608;
  130|       |
  131|    794|    mRaw->dim = iPoint2D(width, height);
  132|       |
  133|    794|    ByteStream input(DataBuffer(mFile.getSubView(off), Endianness::little));
  134|    794|    SonyArw1Decompressor a(mRaw);
  135|    794|    mRaw->createData();
  136|    794|    a.decompress(input);
  137|       |
  138|    794|    return mRaw;
  139|    794|  }
  140|       |
  141|     21|  if (hints.contains("srf_format"))
  ------------------
  |  Branch (141:7): [True: 0, False: 21]
  ------------------
  142|      0|    return decodeSRF();
  143|       |
  144|     21|  ThrowRDE("No image data found");
  ------------------
  |  |   38|     21|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     21|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     21|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     21|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  145|     21|}
_ZN8rawspeed10ArwDecoder11decodeCurveEPKNS_7TiffIFDE:
  147|    213|std::vector<uint16_t> ArwDecoder::decodeCurve(const TiffIFD* raw) {
  148|    213|  std::vector<uint16_t> curve(0x4001);
  149|    213|  const TiffEntry* c = raw->getEntry(TiffTag::SONYCURVE);
  150|    213|  std::array<uint32_t, 6> sony_curve = {{0, 0, 0, 0, 0, 4095}};
  151|       |
  152|  1.03k|  for (uint32_t i = 0; i < 4; i++)
  ------------------
  |  Branch (152:24): [True: 817, False: 213]
  ------------------
  153|    817|    sony_curve[i + 1] = (c->getU16(i) >> 2) & 0xfff;
  154|       |
  155|  3.34M|  for (uint32_t i = 0; i < 0x4001; i++)
  ------------------
  |  Branch (155:24): [True: 3.34M, False: 213]
  ------------------
  156|  3.34M|    curve[i] = implicit_cast<uint16_t>(i);
  157|       |
  158|  1.23k|  for (uint32_t i = 0; i < 5; i++)
  ------------------
  |  Branch (158:24): [True: 1.02k, False: 213]
  ------------------
  159|  1.03M|    for (uint32_t j = sony_curve[i] + 1; j <= sony_curve[i + 1]; j++)
  ------------------
  |  Branch (159:42): [True: 1.03M, False: 1.02k]
  ------------------
  160|  1.03M|      curve[j] = implicit_cast<uint16_t>(curve[j - 1] + (1 << i));
  161|       |
  162|    213|  return curve;
  163|    213|}
_ZN8rawspeed10ArwDecoder17decodeRawInternalEv:
  165|  1.32k|RawImage ArwDecoder::decodeRawInternal() {
  166|  1.32k|  vector<const TiffIFD*> data = mRootIFD->getIFDsWithTag(TiffTag::STRIPOFFSETS);
  167|       |
  168|  1.32k|  if (data.empty())
  ------------------
  |  Branch (168:7): [True: 815, False: 513]
  ------------------
  169|    815|    return decodeTransitionalArw();
  170|       |
  171|    513|  const TiffIFD* raw = data[0];
  172|    513|  int compression = raw->getEntry(TiffTag::COMPRESSION)->getU32();
  173|    513|  if (1 == compression) {
  ------------------
  |  Branch (173:7): [True: 152, False: 361]
  ------------------
  174|    152|    DecodeUncompressed(raw);
  175|    152|    return mRaw;
  176|    152|  }
  177|       |
  178|    361|  if (7 == compression) {
  ------------------
  |  Branch (178:7): [True: 45, False: 316]
  ------------------
  179|     45|    DecodeLJpeg(raw);
  180|       |    // cropping of lossless compressed L files already done in Ljpeg decoder
  181|     45|    applyCrop = false;
  182|     45|    return mRaw;
  183|     45|  }
  184|       |
  185|    316|  if (32767 != compression)
  ------------------
  |  Branch (185:7): [True: 39, False: 277]
  ------------------
  186|    316|    ThrowRDE("Unsupported compression %i", compression);
  ------------------
  |  |   38|     39|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     39|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     39|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     39|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  187|       |
  188|    277|  const TiffEntry* offsets = raw->getEntry(TiffTag::STRIPOFFSETS);
  189|    277|  const TiffEntry* counts = raw->getEntry(TiffTag::STRIPBYTECOUNTS);
  190|       |
  191|    277|  if (offsets->count != 1) {
  ------------------
  |  Branch (191:7): [True: 1, False: 276]
  ------------------
  192|      1|    ThrowRDE("Multiple Strips found: %u", offsets->count);
  ------------------
  |  |   38|      1|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      1|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      1|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      1|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  193|      1|  }
  194|    276|  if (counts->count != offsets->count) {
  ------------------
  |  Branch (194:7): [True: 2, False: 274]
  ------------------
  195|      2|    ThrowRDE(
  ------------------
  |  |   38|      2|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      2|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      2|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      2|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  196|      2|        "Byte count number does not match strip size: count:%u, strips:%u ",
  197|      2|        counts->count, offsets->count);
  198|      2|  }
  199|    274|  uint32_t width = raw->getEntry(TiffTag::IMAGEWIDTH)->getU32();
  200|    274|  uint32_t height = raw->getEntry(TiffTag::IMAGELENGTH)->getU32();
  201|    274|  uint32_t bitPerPixel = raw->getEntry(TiffTag::BITSPERSAMPLE)->getU32();
  202|       |
  203|    274|  switch (bitPerPixel) {
  204|    218|  case 8:
  ------------------
  |  Branch (204:3): [True: 218, False: 56]
  ------------------
  205|    265|  case 12:
  ------------------
  |  Branch (205:3): [True: 47, False: 227]
  ------------------
  206|    270|  case 14:
  ------------------
  |  Branch (206:3): [True: 5, False: 269]
  ------------------
  207|    270|    break;
  208|      1|  default:
  ------------------
  |  Branch (208:3): [True: 1, False: 273]
  ------------------
  209|      1|    ThrowRDE("Unexpected bits per pixel: %u", bitPerPixel);
  ------------------
  |  |   38|      1|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      1|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      1|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      1|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  210|    274|  }
  211|       |
  212|       |  // Sony E-550 marks compressed 8bpp ARW with 12 bit per pixel
  213|       |  // this makes the compression detect it as a ARW v1.
  214|       |  // This camera has however another MAKER entry, so we MAY be able
  215|       |  // to detect it this way in the future.
  216|    270|  data = mRootIFD->getIFDsWithTag(TiffTag::MAKE);
  217|    270|  if (data.size() > 1) {
  ------------------
  |  Branch (217:7): [True: 13, False: 257]
  ------------------
  218|     36|    for (auto& i : data) {
  ------------------
  |  Branch (218:18): [True: 36, False: 13]
  ------------------
  219|     36|      std::string make = i->getEntry(TiffTag::MAKE)->getString();
  220|       |      /* Check for maker "SONY" without spaces */
  221|     36|      if (make == "SONY")
  ------------------
  |  Branch (221:11): [True: 19, False: 17]
  ------------------
  222|     19|        bitPerPixel = 8;
  223|     36|    }
  224|     13|  }
  225|       |
  226|    270|  if (width == 0 || height == 0 || height % 2 != 0 || width > 9600 ||
  ------------------
  |  Branch (226:7): [True: 3, False: 267]
  |  Branch (226:21): [True: 1, False: 266]
  |  Branch (226:36): [True: 2, False: 264]
  |  Branch (226:55): [True: 25, False: 239]
  ------------------
  227|    239|      height > 6376)
  ------------------
  |  Branch (227:7): [True: 25, False: 214]
  ------------------
  228|    270|    ThrowRDE("Unexpected image dimensions found: (%u; %u)", width, height);
  ------------------
  |  |   38|     55|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     55|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     55|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     55|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  229|       |
  230|    215|  bool arw1 = uint64_t(counts->getU32()) * 8 != width * height * bitPerPixel;
  231|    215|  if (arw1)
  ------------------
  |  Branch (231:7): [True: 108, False: 107]
  ------------------
  232|    108|    height += 8;
  233|       |
  234|    215|  mRaw->dim = iPoint2D(width, height);
  235|       |
  236|    215|  std::vector<uint16_t> curve = decodeCurve(raw);
  237|       |
  238|    215|  RawImageCurveGuard curveHandler(&mRaw, curve, uncorrectedRawValues);
  239|       |
  240|    215|  uint32_t c2 = counts->getU32();
  241|    215|  uint32_t off = offsets->getU32();
  242|       |
  243|    215|  if (!mFile.isValid(off))
  ------------------
  |  Branch (243:7): [True: 30, False: 185]
  ------------------
  244|    215|    ThrowRDE("Data offset after EOF, file probably truncated");
  ------------------
  |  |   38|     30|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     30|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     30|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     30|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  245|       |
  246|    185|  if (!mFile.isValid(off, c2))
  ------------------
  |  Branch (246:7): [True: 84, False: 101]
  ------------------
  247|     84|    c2 = mFile.getSize() - off;
  248|       |
  249|    185|  ByteStream input(DataBuffer(mFile.getSubView(off, c2), Endianness::little));
  250|       |
  251|    185|  if (arw1) {
  ------------------
  |  Branch (251:7): [True: 81, False: 104]
  ------------------
  252|     81|    SonyArw1Decompressor a(mRaw);
  253|     81|    mRaw->createData();
  254|     81|    a.decompress(input);
  255|     81|    mShiftDownScaleForExif = 2;
  256|    104|  } else {
  257|    104|    DecodeARW2(input, width, height, bitPerPixel);
  258|    104|  }
  259|       |
  260|    185|  if (bitPerPixel == 12)
  ------------------
  |  Branch (260:7): [True: 2, False: 183]
  ------------------
  261|      2|    mShiftDownScaleForExif = 2;
  262|       |
  263|    185|  return mRaw;
  264|    215|}
_ZNK8rawspeed10ArwDecoder18DecodeUncompressedEPKNS_7TiffIFDE:
  266|    152|void ArwDecoder::DecodeUncompressed(const TiffIFD* raw) const {
  267|    152|  uint32_t width = raw->getEntry(TiffTag::IMAGEWIDTH)->getU32();
  268|    152|  uint32_t height = raw->getEntry(TiffTag::IMAGELENGTH)->getU32();
  269|    152|  uint32_t off = raw->getEntry(TiffTag::STRIPOFFSETS)->getU32();
  270|    152|  uint32_t c2 = raw->getEntry(TiffTag::STRIPBYTECOUNTS)->getU32();
  271|       |
  272|    152|  mRaw->dim = iPoint2D(width, height);
  273|       |
  274|    152|  if (width == 0 || height == 0 || width > 9600 || height > 6376)
  ------------------
  |  Branch (274:7): [True: 2, False: 150]
  |  Branch (274:21): [True: 1, False: 149]
  |  Branch (274:36): [True: 28, False: 121]
  |  Branch (274:52): [True: 17, False: 104]
  ------------------
  275|    152|    ThrowRDE("Unexpected image dimensions found: (%u; %u)", width, height);
  ------------------
  |  |   38|     47|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     47|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     47|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     47|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  276|       |
  277|    105|  if (c2 == 0)
  ------------------
  |  Branch (277:7): [True: 1, False: 104]
  ------------------
  278|    105|    ThrowRDE("Strip is empty, nothing to decode!");
  ------------------
  |  |   38|      1|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      1|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      1|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      1|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  279|       |
  280|    104|  const Buffer buf(mFile.getSubView(off, c2));
  281|       |
  282|    104|  if (hints.contains("sr2_format")) {
  ------------------
  |  Branch (282:7): [True: 0, False: 104]
  ------------------
  283|      0|    UncompressedDecompressor u(ByteStream(DataBuffer(buf, Endianness::little)),
  284|      0|                               mRaw,
  285|      0|                               iRectangle2D({0, 0}, iPoint2D(width, height)),
  286|      0|                               2 * width, 16, BitOrder::MSB);
  287|      0|    mRaw->createData();
  288|      0|    u.readUncompressedRaw();
  289|    104|  } else {
  290|    104|    UncompressedDecompressor u(ByteStream(DataBuffer(buf, Endianness::little)),
  291|    104|                               mRaw,
  292|    104|                               iRectangle2D({0, 0}, iPoint2D(width, height)),
  293|    104|                               2 * width, 16, BitOrder::LSB);
  294|    104|    mRaw->createData();
  295|    104|    u.readUncompressedRaw();
  296|    104|  }
  297|    104|}
_ZN8rawspeed10ArwDecoder11DecodeLJpegEPKNS_7TiffIFDE:
  299|     45|void ArwDecoder::DecodeLJpeg(const TiffIFD* raw) {
  300|     45|  uint32_t width = raw->getEntry(TiffTag::IMAGEWIDTH)->getU32();
  301|     45|  uint32_t height = raw->getEntry(TiffTag::IMAGELENGTH)->getU32();
  302|     45|  uint32_t bitPerPixel = raw->getEntry(TiffTag::BITSPERSAMPLE)->getU32();
  303|     45|  uint32_t photometric =
  304|     45|      raw->getEntry(TiffTag::PHOTOMETRICINTERPRETATION)->getU32();
  305|       |
  306|     45|  if (photometric != 32803)
  ------------------
  |  Branch (306:7): [True: 5, False: 40]
  ------------------
  307|     45|    ThrowRDE("Unsupported photometric interpretation: %u", photometric);
  ------------------
  |  |   38|      5|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      5|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      5|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      5|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  308|       |
  309|     40|  switch (bitPerPixel) {
  310|     16|  case 8:
  ------------------
  |  Branch (310:3): [True: 16, False: 24]
  ------------------
  311|     31|  case 12:
  ------------------
  |  Branch (311:3): [True: 15, False: 25]
  ------------------
  312|     38|  case 14:
  ------------------
  |  Branch (312:3): [True: 7, False: 33]
  ------------------
  313|     38|    break;
  314|      1|  default:
  ------------------
  |  Branch (314:3): [True: 1, False: 39]
  ------------------
  315|      1|    ThrowRDE("Unexpected bits per pixel: %u", bitPerPixel);
  ------------------
  |  |   38|      1|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      1|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      1|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      1|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  316|     40|  }
  317|       |
  318|     38|  if (width == 0 || height == 0 || width % 2 != 0 || height % 2 != 0 ||
  ------------------
  |  Branch (318:7): [True: 1, False: 37]
  |  Branch (318:21): [True: 1, False: 36]
  |  Branch (318:36): [True: 1, False: 35]
  |  Branch (318:54): [True: 1, False: 34]
  ------------------
  319|     34|      width > 9728 || height > 6656)
  ------------------
  |  Branch (319:7): [True: 10, False: 24]
  |  Branch (319:23): [True: 16, False: 8]
  ------------------
  320|     38|    ThrowRDE("Unexpected image dimensions found: (%u; %u)", width, height);
  ------------------
  |  |   38|     30|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     30|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     30|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     30|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  321|       |
  322|      8|  mRaw->dim = iPoint2D(width, height);
  323|       |
  324|      8|  auto tilew = uint64_t(raw->getEntry(TiffTag::TILEWIDTH)->getU32());
  325|      8|  uint32_t tileh = raw->getEntry(TiffTag::TILELENGTH)->getU32();
  326|       |
  327|      8|  if (tilew <= 0 || tileh <= 0 || tileh % 2 != 0)
  ------------------
  |  Branch (327:7): [True: 3, False: 5]
  |  Branch (327:21): [True: 1, False: 4]
  |  Branch (327:35): [True: 2, False: 2]
  ------------------
  328|      8|    ThrowRDE("Invalid tile size: (%" PRIu64 ", %u)", tilew, tileh);
  ------------------
  |  |   38|      4|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      4|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      4|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      4|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  329|       |
  330|      8|  assert(tilew > 0);
  ------------------
  |  Branch (330:3): [True: 2, False: 2]
  ------------------
  331|      2|  const auto tilesX =
  332|      2|      implicit_cast<uint32_t>(roundUpDivisionSafe(mRaw->dim.x, tilew));
  333|      2|  if (!tilesX)
  ------------------
  |  Branch (333:7): [True: 0, False: 2]
  ------------------
  334|      2|    ThrowRDE("Zero tiles horizontally");
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  335|       |
  336|      2|  assert(tileh > 0);
  ------------------
  |  Branch (336:3): [True: 2, False: 0]
  ------------------
  337|      2|  const auto tilesY =
  338|      2|      implicit_cast<uint32_t>(roundUpDivisionSafe(mRaw->dim.y, tileh));
  339|      2|  if (!tilesY)
  ------------------
  |  Branch (339:7): [True: 0, False: 2]
  ------------------
  340|      2|    ThrowRDE("Zero tiles vertically");
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  341|       |
  342|       |  // Math thoughs: if we know that the total size is 100, while tile size is 11,
  343|       |  // we end up with 9 full tiles, and 1 partial tile (10 total).
  344|       |  //
  345|       |  // BUT! If we know that the total size is 100, and we have same 10 tiles,
  346|       |  // we'd naively guess that each tile's size is 10, and not 11...
  347|       |
  348|      2|  const TiffEntry* offsets = raw->getEntry(TiffTag::TILEOFFSETS);
  349|      2|  const TiffEntry* counts = raw->getEntry(TiffTag::TILEBYTECOUNTS);
  350|      2|  if (offsets->count != counts->count) {
  ------------------
  |  Branch (350:7): [True: 0, False: 2]
  ------------------
  351|      0|    ThrowRDE("Tile count mismatch: offsets:%u count:%u", offsets->count,
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  352|      0|             counts->count);
  353|      0|  }
  354|       |
  355|       |  // tilesX * tilesY may overflow, but division is fine, so let's do that.
  356|      2|  if ((offsets->count / tilesX != tilesY || (offsets->count % tilesX != 0)) ||
  ------------------
  |  Branch (356:8): [True: 2, False: 0]
  |  Branch (356:45): [True: 0, False: 0]
  ------------------
  357|      0|      (offsets->count / tilesY != tilesX || (offsets->count % tilesY != 0))) {
  ------------------
  |  Branch (357:8): [True: 0, False: 0]
  |  Branch (357:45): [True: 0, False: 0]
  ------------------
  358|      0|    ThrowRDE("Tile X/Y count mismatch: total:%u X:%u, Y:%u", offsets->count,
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  359|      0|             tilesX, tilesY);
  360|      0|  }
  361|       |
  362|      2|  NORangesSet<Buffer> tilesLegality;
  363|      2|  for (int tile = 0U; tile < implicit_cast<int>(offsets->count); tile++) {
  ------------------
  |  Branch (363:23): [True: 0, False: 2]
  ------------------
  364|      0|    const uint32_t offset = offsets->getU32(tile);
  365|      0|    const uint32_t length = counts->getU32(tile);
  366|      0|    if (!tilesLegality.insert(mFile.getSubView(offset, length)))
  ------------------
  |  Branch (366:9): [True: 0, False: 0]
  ------------------
  367|      0|      ThrowRDE("Two tiles overlap. Raw corrupt!");
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  368|      0|  }
  369|       |
  370|      2|  mRaw->createData();
  371|      2|#ifdef HAVE_OPENMP
  372|      2|#pragma omp parallel for schedule(static) default(none)                        \
  373|      2|    shared(offsets, counts) firstprivate(tilesX, tilew, tileh)
  374|      2|#endif
  375|      2|  for (int tile = 0U; tile < static_cast<int>(offsets->count); tile++) {
  376|      2|    try {
  377|      2|      const uint32_t tileX = tile % tilesX;
  378|      2|      const uint32_t tileY = tile / tilesX;
  379|      2|      const uint32_t offset = offsets->getU32(tile);
  380|      2|      const uint32_t length = counts->getU32(tile);
  381|       |
  382|      2|      LJpegDecoder decoder(
  383|      2|          ByteStream(
  384|      2|              DataBuffer(mFile.getSubView(offset, length), Endianness::little)),
  385|      2|          mRaw);
  386|      2|      auto offsetX = implicit_cast<uint32_t>(tileX * tilew);
  387|      2|      auto offsetY = tileY * tileh;
  388|      2|      auto tileWidth = implicit_cast<uint32_t>(tilew);
  389|      2|      auto tileHeight = tileh;
  390|      2|      auto maxDim = iPoint2D{implicit_cast<int>(tileWidth),
  391|      2|                             implicit_cast<int>(tileHeight)};
  392|      2|      decoder.decode(offsetX, offsetY, tileWidth, tileHeight, maxDim,
  393|      2|                     /*fixDng16Bug=*/false);
  394|      2|    } catch (const RawDecoderException& err) {
  395|      2|      mRaw->setError(err.what());
  396|      2|    } catch (const IOException& err) {
  397|      2|      mRaw->setError(err.what());
  398|      2|    } catch (...) {
  399|       |      // We should not get any other exception type here.
  400|      2|      __builtin_unreachable();
  401|      2|    }
  402|      2|  }
  403|       |
  404|      2|  std::string firstErr;
  405|      2|  if (mRaw->isTooManyErrors(1, &firstErr)) {
  ------------------
  |  Branch (405:7): [True: 0, False: 2]
  ------------------
  406|      0|    ThrowRDE("Too many errors encountered. Giving up. First Error:\n%s",
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  407|      0|             firstErr.c_str());
  408|      0|  }
  409|       |
  410|      2|  const TiffEntry* size_entry = raw->getEntry(TiffTag::SONYRAWIMAGESIZE);
  411|      2|  iRectangle2D crop(0, 0, size_entry->getU32(0), size_entry->getU32(1));
  412|      2|  mRaw->subFrame(crop);
  413|      2|}
_ZN8rawspeed10ArwDecoder10DecodeARW2ENS_10ByteStreamEjjj:
  416|     93|                            uint32_t bpp) {
  417|       |
  418|     93|  if (bpp == 8) {
  ------------------
  |  Branch (418:7): [True: 92, False: 1]
  ------------------
  419|     92|    SonyArw2Decompressor a2(mRaw, input);
  420|     92|    mRaw->createData();
  421|     92|    a2.decompress();
  422|     92|    return;
  423|     92|  } // End bpp = 8
  424|       |
  425|      1|  if (bpp == 12) {
  ------------------
  |  Branch (425:7): [True: 1, False: 0]
  ------------------
  426|      1|    input.setByteOrder(Endianness::little);
  427|      1|    UncompressedDecompressor u(input, mRaw,
  428|      1|                               iRectangle2D({0, 0}, iPoint2D(w, h)),
  429|      1|                               bpp * w / 8, bpp, BitOrder::LSB);
  430|      1|    mRaw->createData();
  431|      1|    u.readUncompressedRaw();
  432|       |
  433|       |    // Shift scales, since black and white are the same as compressed precision
  434|      1|    mShiftDownScale = 2;
  435|      1|    return;
  436|      1|  }
  437|      0|  ThrowRDE("Unsupported bit depth");
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  438|      1|}
_ZNK8rawspeed10ArwDecoder11ParseA100WBEv:
  440|     24|void ArwDecoder::ParseA100WB() const {
  441|     24|  if (!mRootIFD->hasEntryRecursive(TiffTag::DNGPRIVATEDATA))
  ------------------
  |  Branch (441:7): [True: 1, False: 23]
  ------------------
  442|      1|    return;
  443|       |
  444|       |  // only contains the offset, not the length!
  445|     23|  const TiffEntry* priv = mRootIFD->getEntryRecursive(TiffTag::DNGPRIVATEDATA);
  446|     23|  ByteStream bs = priv->getData();
  447|     23|  bs.setByteOrder(Endianness::little);
  448|     23|  const uint32_t off = bs.getU32();
  449|       |
  450|     23|  bs = ByteStream(DataBuffer(mFile.getSubView(off), Endianness::little));
  451|       |
  452|       |  // MRW style, see MrwDecoder
  453|       |
  454|     23|  bs.setByteOrder(Endianness::big);
  455|     23|  uint32_t tag = bs.getU32();
  456|     23|  if (0x4D5249 != tag) // MRI
  ------------------
  |  Branch (456:7): [True: 7, False: 16]
  ------------------
  457|     23|    ThrowRDE("Can not parse DNGPRIVATEDATA, invalid tag (0x%x).", tag);
  ------------------
  |  |   38|      7|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      7|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      7|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      7|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  458|       |
  459|     16|  bs.setByteOrder(Endianness::little);
  460|     16|  uint32_t len = bs.getU32();
  461|       |
  462|     16|  bs = bs.getSubStream(bs.getPosition(), len);
  463|       |
  464|    106|  while (bs.getRemainSize() > 0) {
  ------------------
  |  Branch (464:10): [True: 104, False: 2]
  ------------------
  465|    104|    bs.setByteOrder(Endianness::big);
  466|    104|    tag = bs.getU32();
  467|    104|    bs.setByteOrder(Endianness::little);
  468|    104|    len = bs.getU32();
  469|    104|    (void)bs.check(len);
  470|    104|    if (!len)
  ------------------
  |  Branch (470:9): [True: 2, False: 102]
  ------------------
  471|    104|      ThrowRDE("Found entry of zero length, corrupt.");
  ------------------
  |  |   38|      2|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      2|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      2|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      2|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  472|       |
  473|    102|    if (0x574247 != tag) { // WBG
  ------------------
  |  Branch (473:9): [True: 90, False: 12]
  ------------------
  474|       |      // not the tag we are interested in, skip
  475|     90|      bs.skipBytes(len);
  476|     90|      continue;
  477|     90|    }
  478|       |
  479|     12|    bs.skipBytes(4);
  480|       |
  481|     12|    bs.setByteOrder(Endianness::little);
  482|     12|    std::array<uint16_t, 4> tmp;
  483|     12|    for (auto& coeff : tmp)
  ------------------
  |  Branch (483:22): [True: 4, False: 12]
  ------------------
  484|      4|      coeff = bs.getU16();
  485|       |
  486|     12|    std::array<float, 4> wbCoeffs = {};
  487|     12|    wbCoeffs[0] = static_cast<float>(tmp[0]);
  488|     12|    wbCoeffs[1] = static_cast<float>(tmp[1]);
  489|     12|    wbCoeffs[2] = static_cast<float>(tmp[3]);
  490|     12|    mRaw->metadata.wbCoeffs = wbCoeffs;
  491|       |
  492|       |    // only need this one block, no need to process any further
  493|     12|    break;
  494|    102|  }
  495|     16|}
_ZN8rawspeed10ArwDecoder22decodeMetaDataInternalEPKNS_14CameraMetaDataE:
  497|     95|void ArwDecoder::decodeMetaDataInternal(const CameraMetaData* meta) {
  498|       |  // Default
  499|     95|  int iso = 0;
  500|       |
  501|     95|  mRaw->cfa.setCFA(iPoint2D(2, 2), CFAColor::RED, CFAColor::GREEN,
  502|     95|                   CFAColor::GREEN, CFAColor::BLUE);
  503|       |
  504|     95|  if (mRootIFD->hasEntryRecursive(TiffTag::ISOSPEEDRATINGS))
  ------------------
  |  Branch (504:7): [True: 1, False: 94]
  ------------------
  505|      1|    iso = mRootIFD->getEntryRecursive(TiffTag::ISOSPEEDRATINGS)->getU32();
  506|       |
  507|     95|  auto id = mRootIFD->getID();
  508|       |
  509|     95|  setMetaData(meta, id, "", iso);
  510|     95|  if (mRaw->whitePoint)
  ------------------
  |  Branch (510:7): [True: 0, False: 95]
  ------------------
  511|      0|    mRaw->whitePoint = *mRaw->whitePoint >> mShiftDownScale;
  512|     95|  mRaw->blackLevel >>= mShiftDownScale;
  513|       |
  514|       |  // Set the whitebalance
  515|     95|  try {
  516|     95|    if (id.model == "DSLR-A100") { // Handle the MRW style WB of the A100
  ------------------
  |  Branch (516:9): [True: 24, False: 71]
  ------------------
  517|     24|      ParseA100WB();
  518|     71|    } else { // Everything else but the A100
  519|     71|      GetWB();
  520|     71|    }
  521|     95|  } catch (const RawspeedException& e) {
  522|     86|    mRaw->setError(e.what());
  523|       |    // We caught an exception reading WB, just ignore it
  524|     86|  }
  525|     95|}
_ZN8rawspeed10ArwDecoder11SonyDecryptENS_10Array1DRefIKhEENS1_IhEEij:
  528|     19|                             Array1DRef<uint8_t> obuf, int len, uint32_t key) {
  529|     19|  invariant(ibuf.size() == obuf.size());
  ------------------
  |  |   27|     19|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (529:3): [True: 19, False: 0]
  ------------------
  530|     19|  invariant(ibuf.size() == 4 * len);
  ------------------
  |  |   27|     19|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (530:3): [True: 19, False: 0]
  ------------------
  531|     19|  invariant(obuf.size() == 4 * len);
  ------------------
  |  |   27|     19|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (531:3): [True: 19, False: 0]
  ------------------
  532|       |
  533|     19|  if (0 == len)
  ------------------
  |  Branch (533:7): [True: 0, False: 19]
  ------------------
  534|      0|    return;
  535|       |
  536|     19|  std::array<uint32_t, 128> pad;
  537|       |
  538|       |  // Initialize the decryption pad from the key
  539|     95|  for (int p = 0; p < 4; p++)
  ------------------
  |  Branch (539:19): [True: 76, False: 19]
  ------------------
  540|     76|    pad[p] = key = uint32_t((key * 48828125UL) + 1UL);
  541|     19|  pad[3] = pad[3] << 1 | (pad[0] ^ pad[2]) >> 31;
  542|  2.35k|  for (int p = 4; p < 127; p++)
  ------------------
  |  Branch (542:19): [True: 2.33k, False: 19]
  ------------------
  543|  2.33k|    pad[p] = (pad[p - 4] ^ pad[p - 2]) << 1 | (pad[p - 3] ^ pad[p - 1]) >> 31;
  544|  2.43k|  for (int p = 0; p < 127; p++)
  ------------------
  |  Branch (544:19): [True: 2.41k, False: 19]
  ------------------
  545|  2.41k|    pad[p] = getU32BE(&pad[p]);
  546|       |
  547|     19|  int p = 127;
  548|       |  // Decrypt the buffer in place using the pad
  549|   185k|  for (int i = 0; i != len; ++i) {
  ------------------
  |  Branch (549:19): [True: 185k, False: 19]
  ------------------
  550|   185k|    pad[p & 127] = pad[(p + 1) & 127] ^ pad[(p + 1 + 64) & 127];
  551|       |
  552|   185k|    uint32_t pv = pad[p & 127];
  553|       |
  554|   185k|    uint32_t bv;
  555|   185k|    memcpy(&bv, ibuf.getBlock(4, i).begin(), sizeof(uint32_t));
  556|       |
  557|   185k|    bv ^= pv;
  558|       |
  559|   185k|    memcpy(obuf.getBlock(4, i).begin(), &bv, sizeof(uint32_t));
  560|       |
  561|   185k|    p++;
  562|   185k|  }
  563|     19|}
_ZNK8rawspeed10ArwDecoder5GetWBEv:
  565|     70|void ArwDecoder::GetWB() const {
  566|       |  // Set the whitebalance for all the modern ARW formats (everything after A100)
  567|     70|  if (mRootIFD->hasEntryRecursive(TiffTag::DNGPRIVATEDATA)) {
  ------------------
  |  Branch (567:7): [True: 65, False: 5]
  ------------------
  568|     65|    NORangesSet<Buffer> ifds_undecoded;
  569|       |
  570|     65|    const TiffEntry* priv =
  571|     65|        mRootIFD->getEntryRecursive(TiffTag::DNGPRIVATEDATA);
  572|     65|    TiffRootIFD makerNoteIFD(nullptr, &ifds_undecoded, priv->getRootIfdData(),
  573|     65|                             priv->getU32());
  574|       |
  575|     65|    const TiffEntry* sony_offset =
  576|     65|        makerNoteIFD.getEntryRecursive(TiffTag::SONYOFFSET);
  577|     65|    const TiffEntry* sony_length =
  578|     65|        makerNoteIFD.getEntryRecursive(TiffTag::SONYLENGTH);
  579|     65|    const TiffEntry* sony_key =
  580|     65|        makerNoteIFD.getEntryRecursive(TiffTag::SONYKEY);
  581|     65|    if (!sony_offset || !sony_length || !sony_key || sony_key->count != 4)
  ------------------
  |  Branch (581:9): [True: 11, False: 54]
  |  Branch (581:25): [True: 4, False: 50]
  |  Branch (581:41): [True: 1, False: 49]
  |  Branch (581:54): [True: 0, False: 49]
  ------------------
  582|     65|      ThrowRDE("couldn't find the correct metadata for WB decoding");
  ------------------
  |  |   38|     10|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     10|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     10|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     10|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  583|       |
  584|     65|    assert(sony_offset != nullptr);
  ------------------
  |  Branch (584:5): [True: 49, False: 6]
  ------------------
  585|     49|    uint32_t off = sony_offset->getU32();
  586|       |
  587|     49|    assert(sony_length != nullptr);
  ------------------
  |  Branch (587:5): [True: 48, False: 1]
  ------------------
  588|       |    // The Decryption is done in blocks of 4 bytes.
  589|     48|    auto len = implicit_cast<uint32_t>(roundDown(sony_length->getU32(), 4));
  590|     48|    if (!len)
  ------------------
  |  Branch (590:9): [True: 1, False: 47]
  ------------------
  591|     48|      ThrowRDE("No buffer to decrypt?");
  ------------------
  |  |   38|      1|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      1|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      1|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      1|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  592|       |
  593|     48|    assert(sony_key != nullptr);
  ------------------
  |  Branch (593:5): [True: 47, False: 0]
  ------------------
  594|     47|    uint32_t key = getU32LE(sony_key->getData().getData(4));
  595|       |
  596|       |    // "Decrypt" IFD
  597|     47|    const auto& ifd_crypt = priv->getRootIfdData();
  598|     47|    const auto EncryptedBuffer =
  599|     47|        ifd_crypt.getSubView(off, len).getAsArray1DRef();
  600|       |    // We do have to prepend 'off' padding, because TIFF uses absolute offsets.
  601|     47|    const auto DecryptedBufferSize = off + EncryptedBuffer.size();
  602|     47|    std::vector<uint8_t> DecryptedBuffer(DecryptedBufferSize);
  603|       |
  604|     47|    SonyDecrypt(EncryptedBuffer,
  605|     47|                {&DecryptedBuffer[off], implicit_cast<int>(len)}, len / 4, key);
  606|       |
  607|     47|    NORangesSet<Buffer> ifds_decoded;
  608|     47|    Buffer decIFD(DecryptedBuffer.data(), DecryptedBufferSize);
  609|     47|    const Buffer Padding(decIFD.getSubView(0, off));
  610|       |    // The Decrypted Root Ifd can not point to preceding padding buffer.
  611|     47|    ifds_decoded.insert(Padding);
  612|       |
  613|     47|    DataBuffer dbIDD(decIFD, priv->getRootIfdData().getByteOrder());
  614|     47|    TiffRootIFD encryptedIFD(nullptr, &ifds_decoded, dbIDD, off);
  615|       |
  616|     47|    if (encryptedIFD.hasEntry(TiffTag::SONYGRBGLEVELS)) {
  ------------------
  |  Branch (616:9): [True: 0, False: 47]
  ------------------
  617|      0|      const TiffEntry* wb = encryptedIFD.getEntry(TiffTag::SONYGRBGLEVELS);
  618|      0|      if (wb->count != 4)
  ------------------
  |  Branch (618:11): [True: 0, False: 0]
  ------------------
  619|      0|        ThrowRDE("WB has %u entries instead of 4", wb->count);
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  620|      0|      std::array<float, 4> wbCoeffs = {};
  621|      0|      wbCoeffs[0] = wb->getFloat(1);
  622|      0|      wbCoeffs[1] = wb->getFloat(0);
  623|      0|      wbCoeffs[2] = wb->getFloat(2);
  624|      0|      mRaw->metadata.wbCoeffs = wbCoeffs;
  625|     47|    } else if (encryptedIFD.hasEntry(TiffTag::SONYRGGBLEVELS)) {
  ------------------
  |  Branch (625:16): [True: 0, False: 47]
  ------------------
  626|      0|      const TiffEntry* wb = encryptedIFD.getEntry(TiffTag::SONYRGGBLEVELS);
  627|      0|      if (wb->count != 4)
  ------------------
  |  Branch (627:11): [True: 0, False: 0]
  ------------------
  628|      0|        ThrowRDE("WB has %u entries instead of 4", wb->count);
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  629|      0|      std::array<float, 4> wbCoeffs = {};
  630|      0|      wbCoeffs[0] = wb->getFloat(0);
  631|      0|      wbCoeffs[1] = wb->getFloat(1);
  632|      0|      wbCoeffs[2] = wb->getFloat(3);
  633|      0|      mRaw->metadata.wbCoeffs = wbCoeffs;
  634|      0|    }
  635|       |
  636|     47|    if (encryptedIFD.hasEntry(TiffTag::SONYBLACKLEVEL)) {
  ------------------
  |  Branch (636:9): [True: 0, False: 47]
  ------------------
  637|      0|      const TiffEntry* bl = encryptedIFD.getEntry(TiffTag::SONYBLACKLEVEL);
  638|      0|      if (bl->count != 4)
  ------------------
  |  Branch (638:11): [True: 0, False: 0]
  ------------------
  639|      0|        ThrowRDE("Black Level has %u entries instead of 4", bl->count);
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  640|      0|      mRaw->blackLevelSeparate =
  641|      0|          Array2DRef(mRaw->blackLevelSeparateStorage.data(), 2, 2);
  642|      0|      auto blackLevelSeparate1D = *mRaw->blackLevelSeparate->getAsArray1DRef();
  643|      0|      for (int i = 0; i < 4; ++i)
  ------------------
  |  Branch (643:23): [True: 0, False: 0]
  ------------------
  644|      0|        blackLevelSeparate1D(i) = bl->getU16(i) >> mShiftDownScaleForExif;
  645|      0|    }
  646|       |
  647|     47|    if (encryptedIFD.hasEntry(TiffTag::SONYWHITELEVEL)) {
  ------------------
  |  Branch (647:9): [True: 0, False: 47]
  ------------------
  648|      0|      const TiffEntry* wl = encryptedIFD.getEntry(TiffTag::SONYWHITELEVEL);
  649|      0|      if (wl->count != 1 && wl->count != 3)
  ------------------
  |  Branch (649:11): [True: 0, False: 0]
  |  Branch (649:29): [True: 0, False: 0]
  ------------------
  650|      0|        ThrowRDE("White Level has %u entries instead of 1 or 3", wl->count);
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  651|      0|      mRaw->whitePoint = wl->getU16(0) >> mShiftDownScaleForExif;
  652|      0|    }
  653|     47|  }
  654|     70|}

_ZN8rawspeed10ArwDecoderC2EONSt3__110unique_ptrINS_11TiffRootIFDENS1_14default_deleteIS3_EEEENS_6BufferE:
   43|  1.32k|      : AbstractTiffDecoder(std::move(root), file) {}

_ZN8rawspeed10Cr2Decoder20isAppropriateDecoderEPKNS_11TiffRootIFDENS_6BufferE:
   58|  6.42k|                                      [[maybe_unused]] Buffer file) {
   59|  6.42k|  const auto id = rootIFD->getID();
   60|  6.42k|  const std::string& make = id.make;
   61|  6.42k|  const std::string& model = id.model;
   62|       |
   63|       |  // FIXME: magic
   64|       |
   65|  6.42k|  return make == "Canon" ||
  ------------------
  |  Branch (65:10): [True: 1.07k, False: 5.34k]
  ------------------
   66|  5.34k|         (make == "Kodak" && (model == "DCS520C" || model == "DCS560C"));
  ------------------
  |  Branch (66:11): [True: 279, False: 5.06k]
  |  Branch (66:31): [True: 1, False: 278]
  |  Branch (66:53): [True: 0, False: 278]
  ------------------
   67|  6.42k|}
_ZN8rawspeed10Cr2Decoder15decodeOldFormatEv:
   69|    959|RawImage Cr2Decoder::decodeOldFormat() {
   70|    959|  uint32_t offset = 0;
   71|    959|  if (mRootIFD->getEntryRecursive(TiffTag::CANON_RAW_DATA_OFFSET)) {
  ------------------
  |  Branch (71:7): [True: 936, False: 23]
  ------------------
   72|    936|    offset =
   73|    936|        mRootIFD->getEntryRecursive(TiffTag::CANON_RAW_DATA_OFFSET)->getU32();
   74|    936|  } else {
   75|       |    // D2000 is oh so special...
   76|     23|    const auto* ifd = mRootIFD->getIFDWithTag(TiffTag::CFAPATTERN);
   77|     23|    if (!ifd->hasEntry(TiffTag::STRIPOFFSETS))
  ------------------
  |  Branch (77:9): [True: 6, False: 17]
  ------------------
   78|     23|      ThrowRDE("Couldn't find offset");
  ------------------
  |  |   38|      6|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      6|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      6|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      6|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   79|       |
   80|     17|    offset = ifd->getEntry(TiffTag::STRIPOFFSETS)->getU32();
   81|     17|  }
   82|       |
   83|    953|  ByteStream b(DataBuffer(mFile.getSubView(offset), Endianness::big));
   84|    953|  b.skipBytes(41);
   85|    953|  int height = b.getU16();
   86|    953|  int width = b.getU16();
   87|       |
   88|       |  // some old models (1D/1DS/D2000C) encode two lines as one
   89|       |  // see: FIX_CANON_HALF_HEIGHT_DOUBLE_WIDTH
   90|    953|  if (width > 2 * height) {
  ------------------
  |  Branch (90:7): [True: 751, False: 202]
  ------------------
   91|    751|    height *= 2;
   92|    751|    width /= 2;
   93|    751|  }
   94|    953|  width *= 2; // components
   95|       |
   96|    953|  mRaw->dim = {width, height};
   97|       |
   98|    953|  const ByteStream bs(DataBuffer(mFile.getSubView(offset), Endianness::little));
   99|       |
  100|    953|  Cr2LJpegDecoder l(bs, mRaw);
  101|    953|  mRaw->createData();
  102|       |
  103|    953|  Cr2SliceWidths slicing(/*numSlices=*/1, /*sliceWidth=don't care*/ 0,
  104|    953|                         /*lastSliceWidth=*/implicit_cast<uint16_t>(width));
  105|    953|  l.decode(slicing);
  106|    953|  ljpegSamplePrecision = l.getSamplePrecision();
  107|       |
  108|       |  // deal with D2000 GrayResponseCurve
  109|    953|  if (const TiffEntry* curve =
  110|    953|          mRootIFD->getEntryRecursive(static_cast<TiffTag>(0x123));
  111|    953|      curve && curve->type == TiffDataType::SHORT && curve->count == 4096) {
  ------------------
  |  Branch (111:7): [True: 2, False: 951]
  |  Branch (111:16): [True: 1, False: 1]
  |  Branch (111:54): [True: 0, False: 1]
  ------------------
  112|      0|    auto table = curve->getU16Array(curve->count);
  113|      0|    RawImageCurveGuard curveHandler(&mRaw, table, uncorrectedRawValues);
  114|       |
  115|       |    // Apply table
  116|      0|    if (!uncorrectedRawValues)
  ------------------
  |  Branch (116:9): [True: 0, False: 0]
  ------------------
  117|      0|      mRaw->sixteenBitLookup();
  118|      0|  }
  119|       |
  120|    953|  return mRaw;
  121|    959|}
_ZN8rawspeed10Cr2Decoder15decodeNewFormatEv:
  125|    114|RawImage Cr2Decoder::decodeNewFormat() {
  126|    114|  const TiffEntry* sensorInfoE =
  127|    114|      mRootIFD->getEntryRecursive(TiffTag::CANON_SENSOR_INFO);
  128|    114|  if (!sensorInfoE)
  ------------------
  |  Branch (128:7): [True: 2, False: 112]
  ------------------
  129|    114|    ThrowTPE("failed to get SensorInfo from MakerNote");
  ------------------
  |  |   39|      2|  ThrowExceptionHelper(rawspeed::TiffParserException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      2|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      2|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      2|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  130|       |
  131|    114|  assert(sensorInfoE != nullptr);
  ------------------
  |  Branch (131:3): [True: 112, False: 0]
  ------------------
  132|       |
  133|    112|  if (isSubSampled() != (getSubSampling() != iPoint2D{1, 1}))
  ------------------
  |  Branch (133:7): [True: 2, False: 110]
  ------------------
  134|    112|    ThrowTPE("Subsampling sanity check failed");
  ------------------
  |  |   39|      2|  ThrowExceptionHelper(rawspeed::TiffParserException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      2|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      2|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      2|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  135|       |
  136|    110|  mRaw->dim = {sensorInfoE->getU16(1), sensorInfoE->getU16(2)};
  137|    110|  mRaw->setCpp(1);
  138|    110|  mRaw->isCFA = !isSubSampled();
  139|       |
  140|    110|  if (isSubSampled()) {
  ------------------
  |  Branch (140:7): [True: 3, False: 107]
  ------------------
  141|      3|    iPoint2D& subSampling = mRaw->metadata.subsampling;
  142|      3|    subSampling = getSubSampling();
  143|      3|    if (subSampling.x <= 1 && subSampling.y <= 1)
  ------------------
  |  Branch (143:9): [True: 0, False: 3]
  |  Branch (143:31): [True: 0, False: 0]
  ------------------
  144|      3|      ThrowRDE("RAW is expected to be subsampled, but it's not");
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  145|       |
  146|      3|    if (mRaw->dim.x % subSampling.x != 0)
  ------------------
  |  Branch (146:9): [True: 1, False: 2]
  ------------------
  147|      3|      ThrowRDE("Raw width is not a multiple of horizontal subsampling factor");
  ------------------
  |  |   38|      1|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      1|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      1|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      1|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  148|      2|    mRaw->dim.x /= subSampling.x;
  149|       |
  150|      2|    if (mRaw->dim.y % subSampling.y != 0)
  ------------------
  |  Branch (150:9): [True: 1, False: 1]
  ------------------
  151|      2|      ThrowRDE("Raw height is not a multiple of vertical subsampling factor");
  ------------------
  |  |   38|      1|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      1|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      1|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      1|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  152|      1|    mRaw->dim.y /= subSampling.y;
  153|       |
  154|      1|    mRaw->dim.x *= 2 + subSampling.x * subSampling.y;
  155|      1|  }
  156|       |
  157|    108|  const TiffIFD* raw = mRootIFD->getSubIFDs()[3].get();
  158|       |
  159|    108|  Cr2SliceWidths slicing;
  160|       |  // there are four cases:
  161|       |  // * there is a tag with three components,
  162|       |  //   $ last two components are non-zero: all fine then.
  163|       |  //   $ first two components are zero, last component is non-zero
  164|       |  //     we let Cr2LJpegDecoder guess it (it'll throw if fails)
  165|       |  //   $ else the image is considered corrupt.
  166|       |  // * there is a tag with not three components, the image is considered
  167|       |  // corrupt. $ there is no tag, we let Cr2LJpegDecoder guess it (it'll throw if
  168|       |  // fails)
  169|    108|  if (const TiffEntry* cr2SliceEntry =
  170|    108|          raw->getEntryRecursive(TiffTag::CANONCR2SLICE);
  171|    108|      cr2SliceEntry) {
  ------------------
  |  Branch (171:7): [True: 67, False: 41]
  ------------------
  172|     67|    if (cr2SliceEntry->count != 3) {
  ------------------
  |  Branch (172:9): [True: 1, False: 66]
  ------------------
  173|      1|      ThrowRDE("Found RawImageSegmentation tag with %u elements, should be 3.",
  ------------------
  |  |   38|      1|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      1|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      1|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      1|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  174|      1|               cr2SliceEntry->count);
  175|      1|    }
  176|       |
  177|     66|    if (cr2SliceEntry->getU16(1) != 0 && cr2SliceEntry->getU16(2) != 0) {
  ------------------
  |  Branch (177:9): [True: 61, False: 5]
  |  Branch (177:42): [True: 59, False: 2]
  ------------------
  178|       |      // first component can be either zero or non-zero, don't care
  179|     59|      slicing = Cr2SliceWidths(/*numSlices=*/1 + cr2SliceEntry->getU16(0),
  180|     59|                               /*sliceWidth=*/cr2SliceEntry->getU16(1),
  181|     59|                               /*lastSliceWidth=*/cr2SliceEntry->getU16(2));
  182|     59|    } else if (cr2SliceEntry->getU16(0) == 0 && cr2SliceEntry->getU16(1) == 0 &&
  ------------------
  |  Branch (182:16): [True: 6, False: 1]
  |  Branch (182:49): [True: 5, False: 1]
  ------------------
  183|      5|               cr2SliceEntry->getU16(2) != 0) {
  ------------------
  |  Branch (183:16): [True: 4, False: 1]
  ------------------
  184|       |      // PowerShot G16, PowerShot S120, let Cr2LJpegDecoder guess.
  185|      4|    } else {
  186|      3|      ThrowRDE("Strange RawImageSegmentation tag: (%d, %d, %d), image corrupt.",
  ------------------
  |  |   38|      3|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      3|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      3|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      3|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  187|      3|               cr2SliceEntry->getU16(0), cr2SliceEntry->getU16(1),
  188|      3|               cr2SliceEntry->getU16(2));
  189|      3|    }
  190|     66|  } // EOS 20D, EOS-1D Mark II, let Cr2LJpegDecoder guess.
  191|       |
  192|    104|  const uint32_t offset = raw->getEntry(TiffTag::STRIPOFFSETS)->getU32();
  193|    104|  const uint32_t count = raw->getEntry(TiffTag::STRIPBYTECOUNTS)->getU32();
  194|       |
  195|    104|  const ByteStream bs(
  196|    104|      DataBuffer(mFile.getSubView(offset, count), Endianness::little));
  197|       |
  198|    104|  Cr2LJpegDecoder d(bs, mRaw);
  199|    104|  mRaw->createData();
  200|    104|  d.decode(slicing);
  201|    104|  ljpegSamplePrecision = d.getSamplePrecision();
  202|       |
  203|    104|  assert(getSubSampling() == mRaw->metadata.subsampling);
  ------------------
  |  Branch (203:3): [True: 1, False: 103]
  ------------------
  204|       |
  205|      1|  if (mRaw->metadata.subsampling.x > 1 || mRaw->metadata.subsampling.y > 1)
  ------------------
  |  Branch (205:7): [True: 0, False: 1]
  |  Branch (205:43): [True: 0, False: 1]
  ------------------
  206|      0|    sRawInterpolate();
  207|       |
  208|      1|  return mRaw;
  209|    104|}
_ZN8rawspeed10Cr2Decoder17decodeRawInternalEv:
  211|  1.07k|RawImage Cr2Decoder::decodeRawInternal() {
  212|  1.07k|  if (mRootIFD->getSubIFDs().size() < 4)
  ------------------
  |  Branch (212:7): [True: 959, False: 114]
  ------------------
  213|    959|    return decodeOldFormat();
  214|    114|  else // NOLINT(readability-else-after-return): ok, here it make sense
  215|    114|    return decodeNewFormat();
  216|  1.07k|}
_ZNK8rawspeed10Cr2Decoder20decodeCanonColorDataEv:
  383|     40|bool Cr2Decoder::decodeCanonColorData() const {
  384|     40|  const TiffEntry* wb = mRootIFD->getEntryRecursive(TiffTag::CANONCOLORDATA);
  385|     40|  if (!wb)
  ------------------
  |  Branch (385:7): [True: 18, False: 22]
  ------------------
  386|     18|    return false;
  387|       |
  388|     22|  auto dsc = deduceColorDataFormat(wb);
  389|     22|  if (!dsc)
  ------------------
  |  Branch (389:7): [True: 6, False: 16]
  ------------------
  390|      6|    return false;
  391|       |
  392|     16|  auto [f, ver] = *dsc;
  393|       |
  394|     16|  int offset = getWhiteBalanceOffsetInColorData(f);
  395|       |
  396|     16|  offset /= 2;
  397|       |
  398|     16|  std::array<float, 4> wbCoeffs = {};
  399|     16|  wbCoeffs[0] = static_cast<float>(wb->getU16(offset + 0));
  400|     16|  wbCoeffs[1] = static_cast<float>(wb->getU16(offset + 1));
  401|     16|  wbCoeffs[2] = static_cast<float>(wb->getU16(offset + 3));
  402|     16|  mRaw->metadata.wbCoeffs = wbCoeffs;
  403|       |
  404|     16|  auto levelOffsets = getBlackAndWhiteLevelOffsetsInColorData(f, ver);
  405|     16|  if (!levelOffsets)
  ------------------
  |  Branch (405:7): [True: 3, False: 13]
  ------------------
  406|      3|    return false;
  407|       |
  408|     13|  mRaw->whitePoint = wb->getU16(levelOffsets->second);
  409|       |
  410|     13|  mRaw->blackLevelSeparate =
  411|     13|      Array2DRef(mRaw->blackLevelSeparateStorage.data(), 2, 2);
  412|     13|  auto blackLevelSeparate1D = *mRaw->blackLevelSeparate->getAsArray1DRef();
  413|     13|  for (int c = 0; c != 4; ++c)
  ------------------
  |  Branch (413:19): [True: 0, False: 13]
  ------------------
  414|      0|    blackLevelSeparate1D(c) = wb->getU16(c + levelOffsets->first);
  415|       |
  416|       |  // In Canon MakerNotes, the levels are always unscaled, and are 14-bit,
  417|       |  // and so if the LJpeg precision was lower, we need to adjust.
  418|     13|  constexpr int makernotesPrecision = 14;
  419|     13|  if (makernotesPrecision > ljpegSamplePrecision) {
  ------------------
  |  Branch (419:7): [True: 0, False: 13]
  ------------------
  420|      0|    int bitDepthDiff = makernotesPrecision - ljpegSamplePrecision;
  421|      0|    assert(bitDepthDiff >= 1 && bitDepthDiff <= 12);
  ------------------
  |  Branch (421:5): [True: 0, False: 0]
  |  Branch (421:5): [True: 0, False: 0]
  |  Branch (421:5): [True: 0, False: 0]
  ------------------
  422|      0|    if (shouldRescaleBlackLevels(f, ver)) {
  ------------------
  |  Branch (422:9): [True: 0, False: 0]
  ------------------
  423|      0|      for (int c = 0; c != 4; ++c)
  ------------------
  |  Branch (423:23): [True: 0, False: 0]
  ------------------
  424|      0|        blackLevelSeparate1D(c) >>= bitDepthDiff;
  425|      0|    }
  426|      0|    mRaw->whitePoint = *mRaw->whitePoint >> bitDepthDiff;
  427|      0|  }
  428|       |
  429|     13|  return true;
  430|     13|}
Cr2Decoder.cpp:_ZN8rawspeed12_GLOBAL__N_121deduceColorDataFormatEPKNS_9TiffEntryE:
  243|     22|deduceColorDataFormat(const TiffEntry* ccd) {
  244|       |  // The original ColorData, detect by it's fixed size.
  245|     22|  if (ccd->count == 582)
  ------------------
  |  Branch (245:7): [True: 0, False: 22]
  ------------------
  246|      0|    return {{ColorDataFormat::ColorData1, {}}};
  247|       |  // Second incarnation of ColorData, still size-only detection.
  248|     22|  if (ccd->count == 653)
  ------------------
  |  Branch (248:7): [True: 0, False: 22]
  ------------------
  249|      0|    return {{ColorDataFormat::ColorData2, {}}};
  250|       |  // From now onwards, Canon has finally added a `version` field, use it.
  251|     22|  switch (int colorDataVersion = static_cast<int16_t>(ccd->getU16(0));
  252|     22|          colorDataVersion) {
  253|      1|  case 1:
  ------------------
  |  Branch (253:3): [True: 1, False: 21]
  ------------------
  254|      1|    return {{ColorDataFormat::ColorData3, colorDataVersion}};
  255|      1|  case 2:
  ------------------
  |  Branch (255:3): [True: 1, False: 21]
  ------------------
  256|      2|  case 3:
  ------------------
  |  Branch (256:3): [True: 1, False: 21]
  ------------------
  257|      3|  case 4:
  ------------------
  |  Branch (257:3): [True: 1, False: 21]
  ------------------
  258|      4|  case 5:
  ------------------
  |  Branch (258:3): [True: 1, False: 21]
  ------------------
  259|      5|  case 6:
  ------------------
  |  Branch (259:3): [True: 1, False: 21]
  ------------------
  260|      6|  case 7:
  ------------------
  |  Branch (260:3): [True: 1, False: 21]
  ------------------
  261|      7|  case 9:
  ------------------
  |  Branch (261:3): [True: 1, False: 21]
  ------------------
  262|      7|    return {{ColorDataFormat::ColorData4, colorDataVersion}};
  263|      1|  case -4:
  ------------------
  |  Branch (263:3): [True: 1, False: 21]
  ------------------
  264|      2|  case -3:
  ------------------
  |  Branch (264:3): [True: 1, False: 21]
  ------------------
  265|      2|    return {{ColorDataFormat::ColorData5, colorDataVersion}};
  266|      1|  case 10: {
  ------------------
  |  Branch (266:3): [True: 1, False: 21]
  ------------------
  267|      1|    ColorDataFormat f = [count = ccd->count]() {
  268|      1|      switch (count) {
  269|      1|      case 1273:
  270|      1|      case 1275:
  271|      1|        return ColorDataFormat::ColorData6;
  272|      1|      default:
  273|      1|        return ColorDataFormat::ColorData7;
  274|      1|      }
  275|      1|    }();
  276|      1|    return {{f, colorDataVersion}};
  277|      1|  }
  278|      1|  case 11:
  ------------------
  |  Branch (278:3): [True: 1, False: 21]
  ------------------
  279|      1|    return {{ColorDataFormat::ColorData7, colorDataVersion}};
  280|      1|  case 12:
  ------------------
  |  Branch (280:3): [True: 1, False: 21]
  ------------------
  281|      2|  case 13:
  ------------------
  |  Branch (281:3): [True: 1, False: 21]
  ------------------
  282|      3|  case 14:
  ------------------
  |  Branch (282:3): [True: 1, False: 21]
  ------------------
  283|      4|  case 15:
  ------------------
  |  Branch (283:3): [True: 1, False: 21]
  ------------------
  284|      4|    return {{ColorDataFormat::ColorData8, colorDataVersion}};
  285|      6|  default:
  ------------------
  |  Branch (285:3): [True: 6, False: 16]
  ------------------
  286|      6|    break;
  287|     22|  }
  288|      6|  return std::nullopt;
  289|     22|}
Cr2Decoder.cpp:_ZZN8rawspeed12_GLOBAL__N_121deduceColorDataFormatEPKNS_9TiffEntryEENK3$_0clEv:
  267|      1|    ColorDataFormat f = [count = ccd->count]() {
  268|      1|      switch (count) {
  269|      0|      case 1273:
  ------------------
  |  Branch (269:7): [True: 0, False: 1]
  ------------------
  270|      0|      case 1275:
  ------------------
  |  Branch (270:7): [True: 0, False: 1]
  ------------------
  271|      0|        return ColorDataFormat::ColorData6;
  272|      1|      default:
  ------------------
  |  Branch (272:7): [True: 1, False: 0]
  ------------------
  273|      1|        return ColorDataFormat::ColorData7;
  274|      1|      }
  275|      1|    }();
Cr2Decoder.cpp:_ZN8rawspeed12_GLOBAL__N_132getWhiteBalanceOffsetInColorDataENS0_15ColorDataFormatE:
  291|     16|[[nodiscard]] int getWhiteBalanceOffsetInColorData(ColorDataFormat f) {
  292|     16|  switch (f) {
  ------------------
  |  Branch (292:11): [True: 16, False: 0]
  ------------------
  293|      0|    using enum ColorDataFormat;
  294|      0|  case ColorData1:
  ------------------
  |  Branch (294:3): [True: 0, False: 16]
  ------------------
  295|      0|    return 50;
  296|      0|  case ColorData2:
  ------------------
  |  Branch (296:3): [True: 0, False: 16]
  ------------------
  297|      0|    return 68;
  298|      1|  case ColorData3:
  ------------------
  |  Branch (298:3): [True: 1, False: 15]
  ------------------
  299|      8|  case ColorData4:
  ------------------
  |  Branch (299:3): [True: 7, False: 9]
  ------------------
  300|      8|  case ColorData6:
  ------------------
  |  Branch (300:3): [True: 0, False: 16]
  ------------------
  301|     10|  case ColorData7:
  ------------------
  |  Branch (301:3): [True: 2, False: 14]
  ------------------
  302|     14|  case ColorData8:
  ------------------
  |  Branch (302:3): [True: 4, False: 12]
  ------------------
  303|     14|    return 126;
  304|      2|  case ColorData5:
  ------------------
  |  Branch (304:3): [True: 2, False: 14]
  ------------------
  305|      2|    return 142;
  306|     16|  }
  307|      0|  __builtin_unreachable();
  308|     16|}
Cr2Decoder.cpp:_ZN8rawspeed12_GLOBAL__N_139getBlackAndWhiteLevelOffsetsInColorDataENS0_15ColorDataFormatENS_8OptionalIiEE:
  312|      4|                                        Optional<int> colorDataVersion) {
  313|      4|  switch (f) {
  ------------------
  |  Branch (313:11): [True: 4, False: 0]
  ------------------
  314|      0|    using enum ColorDataFormat;
  315|      0|  case ColorData1:
  ------------------
  |  Branch (315:3): [True: 0, False: 4]
  ------------------
  316|      0|  case ColorData2:
  ------------------
  |  Branch (316:3): [True: 0, False: 4]
  ------------------
  317|      1|  case ColorData3:
  ------------------
  |  Branch (317:3): [True: 1, False: 3]
  ------------------
  318|       |    // These seemingly did not contain `SpecularWhiteLevel` yet.
  319|      1|    return std::nullopt;
  320|      3|  case ColorData4:
  ------------------
  |  Branch (320:3): [True: 3, False: 1]
  ------------------
  321|      3|    switch (*colorDataVersion) {
  322|      1|    case 2:
  ------------------
  |  Branch (322:5): [True: 1, False: 2]
  ------------------
  323|      2|    case 3:
  ------------------
  |  Branch (323:5): [True: 1, False: 2]
  ------------------
  324|      2|      return std::nullopt; // Still no `SpecularWhiteLevel`.
  325|      1|    case 4:
  ------------------
  |  Branch (325:5): [True: 1, False: 2]
  ------------------
  326|      1|    case 5:
  ------------------
  |  Branch (326:5): [True: 0, False: 3]
  ------------------
  327|      1|      return {{692, 697}};
  328|      0|    case 6:
  ------------------
  |  Branch (328:5): [True: 0, False: 3]
  ------------------
  329|      0|    case 7:
  ------------------
  |  Branch (329:5): [True: 0, False: 3]
  ------------------
  330|      0|      return {{715, 720}};
  331|      0|    case 9:
  ------------------
  |  Branch (331:5): [True: 0, False: 3]
  ------------------
  332|      0|      return {{719, 724}};
  333|      0|    default:
  ------------------
  |  Branch (333:5): [True: 0, False: 3]
  ------------------
  334|      0|      __builtin_unreachable();
  335|      3|    }
  336|      0|  case ColorData5:
  ------------------
  |  Branch (336:3): [True: 0, False: 4]
  ------------------
  337|      0|    switch (*colorDataVersion) {
  338|      0|    case -4:
  ------------------
  |  Branch (338:5): [True: 0, False: 0]
  ------------------
  339|      0|      return {{333, 1386}};
  340|      0|    case -3:
  ------------------
  |  Branch (340:5): [True: 0, False: 0]
  ------------------
  341|      0|      return {{264, 662}};
  342|      0|    default:
  ------------------
  |  Branch (342:5): [True: 0, False: 0]
  ------------------
  343|      0|      __builtin_unreachable();
  344|      0|    }
  345|      0|  case ColorData6:
  ------------------
  |  Branch (345:3): [True: 0, False: 4]
  ------------------
  346|      0|    switch (*colorDataVersion) {
  347|      0|    case 10:
  ------------------
  |  Branch (347:5): [True: 0, False: 0]
  ------------------
  348|      0|      return {{479, 484}};
  349|      0|    default:
  ------------------
  |  Branch (349:5): [True: 0, False: 0]
  ------------------
  350|      0|      __builtin_unreachable();
  351|      0|    }
  352|      0|  case ColorData7:
  ------------------
  |  Branch (352:3): [True: 0, False: 4]
  ------------------
  353|      0|    switch (*colorDataVersion) {
  354|      0|    case 10:
  ------------------
  |  Branch (354:5): [True: 0, False: 0]
  ------------------
  355|      0|      return {{504, 509}};
  356|      0|    case 11:
  ------------------
  |  Branch (356:5): [True: 0, False: 0]
  ------------------
  357|      0|      return {{728, 733}};
  358|      0|    default:
  ------------------
  |  Branch (358:5): [True: 0, False: 0]
  ------------------
  359|      0|      __builtin_unreachable();
  360|      0|    }
  361|      0|  case ColorData8:
  ------------------
  |  Branch (361:3): [True: 0, False: 4]
  ------------------
  362|      0|    switch (*colorDataVersion) {
  363|      0|    case 12:
  ------------------
  |  Branch (363:5): [True: 0, False: 0]
  ------------------
  364|      0|    case 13:
  ------------------
  |  Branch (364:5): [True: 0, False: 0]
  ------------------
  365|      0|    case 15:
  ------------------
  |  Branch (365:5): [True: 0, False: 0]
  ------------------
  366|      0|      return {{778, 783}};
  367|      0|    case 14:
  ------------------
  |  Branch (367:5): [True: 0, False: 0]
  ------------------
  368|      0|      return {{556, 561}};
  369|      0|    default:
  ------------------
  |  Branch (369:5): [True: 0, False: 0]
  ------------------
  370|      0|      __builtin_unreachable();
  371|      0|    }
  372|      4|  }
  373|      0|  __builtin_unreachable();
  374|      4|}
_ZNK8rawspeed10Cr2Decoder17parseWhiteBalanceEv:
  432|     40|void Cr2Decoder::parseWhiteBalance() const {
  433|       |  // Default white point is LJpeg sample precision.
  434|     40|  mRaw->whitePoint = (1U << ljpegSamplePrecision) - 1;
  435|       |
  436|     40|  if (decodeCanonColorData())
  ------------------
  |  Branch (436:7): [True: 0, False: 40]
  ------------------
  437|      0|    return;
  438|       |
  439|     40|  if (mRootIFD->hasEntryRecursive(TiffTag::CANONSHOTINFO) &&
  ------------------
  |  Branch (439:7): [True: 7, False: 33]
  ------------------
  440|      7|      mRootIFD->hasEntryRecursive(TiffTag::CANONPOWERSHOTG9WB)) {
  ------------------
  |  Branch (440:7): [True: 3, False: 4]
  ------------------
  441|      3|    const TiffEntry* shot_info =
  442|      3|        mRootIFD->getEntryRecursive(TiffTag::CANONSHOTINFO);
  443|      3|    const TiffEntry* g9_wb =
  444|      3|        mRootIFD->getEntryRecursive(TiffTag::CANONPOWERSHOTG9WB);
  445|       |
  446|      3|    uint16_t wb_index = shot_info->getU16(7);
  447|      3|    int wb_offset = (wb_index < 18)
  ------------------
  |  Branch (447:21): [True: 1, False: 2]
  ------------------
  448|      3|                        ? std::string_view("012347800000005896")[wb_index] - '0'
  449|      3|                        : 0;
  450|      3|    wb_offset = wb_offset * 8 + 2;
  451|       |
  452|      3|    std::array<float, 4> wbCoeffs = {};
  453|      3|    wbCoeffs[0] = static_cast<float>(g9_wb->getU32(wb_offset + 1));
  454|      3|    wbCoeffs[1] = (static_cast<float>(g9_wb->getU32(wb_offset + 0)) +
  455|      3|                   static_cast<float>(g9_wb->getU32(wb_offset + 3))) /
  456|      3|                  2.0F;
  457|      3|    wbCoeffs[2] = static_cast<float>(g9_wb->getU32(wb_offset + 2));
  458|      3|    mRaw->metadata.wbCoeffs = wbCoeffs;
  459|     37|  } else if (mRootIFD->hasEntryRecursive(static_cast<TiffTag>(0xa4))) {
  ------------------
  |  Branch (459:14): [True: 9, False: 28]
  ------------------
  460|       |    // WB for the old 1D and 1DS
  461|      9|    const TiffEntry* wb =
  462|      9|        mRootIFD->getEntryRecursive(static_cast<TiffTag>(0xa4));
  463|      9|    if (wb->count >= 3) {
  ------------------
  |  Branch (463:9): [True: 7, False: 2]
  ------------------
  464|      7|      std::array<float, 4> wbCoeffs = {};
  465|      7|      wbCoeffs[0] = wb->getFloat(0);
  466|      7|      wbCoeffs[1] = wb->getFloat(1);
  467|      7|      wbCoeffs[2] = wb->getFloat(2);
  468|      7|      mRaw->metadata.wbCoeffs = wbCoeffs;
  469|      7|    }
  470|      9|  }
  471|     40|}
_ZN8rawspeed10Cr2Decoder22decodeMetaDataInternalEPKNS_14CameraMetaDataE:
  473|     41|void Cr2Decoder::decodeMetaDataInternal(const CameraMetaData* meta) {
  474|     41|  int iso = 0;
  475|     41|  mRaw->cfa.setCFA(iPoint2D(2, 2), CFAColor::RED, CFAColor::GREEN,
  476|     41|                   CFAColor::GREEN, CFAColor::BLUE);
  477|       |
  478|     41|  std::string mode;
  479|       |
  480|     41|  if (mRaw->metadata.subsampling.y == 2 && mRaw->metadata.subsampling.x == 2)
  ------------------
  |  Branch (480:7): [True: 0, False: 41]
  |  Branch (480:44): [True: 0, False: 0]
  ------------------
  481|      0|    mode = "sRaw1";
  482|       |
  483|     41|  if (mRaw->metadata.subsampling.y == 1 && mRaw->metadata.subsampling.x == 2)
  ------------------
  |  Branch (483:7): [True: 41, False: 0]
  |  Branch (483:44): [True: 0, False: 41]
  ------------------
  484|      0|    mode = "sRaw2";
  485|       |
  486|     41|  if (mRootIFD->hasEntryRecursive(TiffTag::ISOSPEEDRATINGS))
  ------------------
  |  Branch (486:7): [True: 9, False: 32]
  ------------------
  487|      9|    iso = mRootIFD->getEntryRecursive(TiffTag::ISOSPEEDRATINGS)->getU32();
  488|     41|  if (65535 == iso) {
  ------------------
  |  Branch (488:7): [True: 0, False: 41]
  ------------------
  489|       |    // ISOSPEEDRATINGS is a SHORT EXIF value. For larger values, we have to look
  490|       |    // at RECOMMENDEDEXPOSUREINDEX (maybe Canon specific).
  491|      0|    if (mRootIFD->hasEntryRecursive(TiffTag::RECOMMENDEDEXPOSUREINDEX))
  ------------------
  |  Branch (491:9): [True: 0, False: 0]
  ------------------
  492|      0|      iso = mRootIFD->getEntryRecursive(TiffTag::RECOMMENDEDEXPOSUREINDEX)
  493|      0|                ->getU32();
  494|      0|  }
  495|       |
  496|       |  // Fetch the white balance
  497|     41|  try {
  498|     41|    parseWhiteBalance();
  499|     41|  } catch (const RawspeedException& e) {
  500|     23|    mRaw->setError(e.what());
  501|       |    // We caught an exception reading WB, just ignore it
  502|     23|  }
  503|     41|  setMetaData(meta, mode, iso);
  504|     40|  assert(mShiftUpScaleForExif == 0 || mShiftUpScaleForExif == 2);
  ------------------
  |  Branch (504:3): [True: 40, False: 0]
  |  Branch (504:3): [True: 0, False: 0]
  |  Branch (504:3): [True: 40, False: 0]
  ------------------
  505|     40|  if (mShiftUpScaleForExif) {
  ------------------
  |  Branch (505:7): [True: 0, False: 40]
  ------------------
  506|      0|    mRaw->blackLevel = 0;
  507|      0|    mRaw->blackLevelSeparate = std::nullopt;
  508|      0|  }
  509|     40|  if (mShiftUpScaleForExif != 0 && isPowerOfTwo(1 + *mRaw->whitePoint))
  ------------------
  |  Branch (509:7): [True: 0, False: 40]
  |  Branch (509:36): [True: 0, False: 0]
  ------------------
  510|      0|    mRaw->whitePoint = ((1 + *mRaw->whitePoint) << mShiftUpScaleForExif) - 1;
  511|     40|  else
  512|     40|    mRaw->whitePoint = *mRaw->whitePoint << mShiftUpScaleForExif;
  513|     40|}
_ZNK8rawspeed10Cr2Decoder12isSubSampledEv:
  515|    318|bool Cr2Decoder::isSubSampled() const {
  516|    318|  if (mRootIFD->getSubIFDs().size() != 4)
  ------------------
  |  Branch (516:7): [True: 236, False: 82]
  ------------------
  517|    236|    return false;
  518|     82|  const TiffEntry* typeE =
  519|     82|      mRootIFD->getSubIFDs()[3]->getEntryRecursive(TiffTag::CANON_SRAWTYPE);
  520|     82|  return typeE && typeE->getU32() == 4;
  ------------------
  |  Branch (520:10): [True: 75, False: 7]
  |  Branch (520:19): [True: 10, False: 65]
  ------------------
  521|    318|}
_ZNK8rawspeed10Cr2Decoder14getSubSamplingEv:
  523|    116|iPoint2D Cr2Decoder::getSubSampling() const {
  524|    116|  const TiffEntry* CCS =
  525|    116|      mRootIFD->getEntryRecursive(TiffTag::CANON_CAMERA_SETTINGS);
  526|    116|  if (!CCS)
  ------------------
  |  Branch (526:7): [True: 1, False: 115]
  ------------------
  527|    116|    ThrowRDE("CanonCameraSettings entry not found.");
  ------------------
  |  |   38|      1|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      1|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      1|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      1|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  528|       |
  529|    115|  if (CCS->type != TiffDataType::SHORT)
  ------------------
  |  Branch (529:7): [True: 2, False: 113]
  ------------------
  530|    115|    ThrowRDE("Unexpected CanonCameraSettings entry type encountered ");
  ------------------
  |  |   38|      2|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      2|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      2|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      2|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  531|       |
  532|    113|  if (CCS->count < 47)
  ------------------
  |  Branch (532:7): [True: 99, False: 14]
  ------------------
  533|     99|    return {1, 1};
  534|       |
  535|     14|  switch (uint16_t qual = CCS->getU16(46)) {
  536|      3|  case 0:
  ------------------
  |  Branch (536:3): [True: 3, False: 11]
  ------------------
  537|      3|    return {1, 1};
  538|      2|  case 1:
  ------------------
  |  Branch (538:3): [True: 2, False: 12]
  ------------------
  539|      2|    return {2, 2};
  540|      5|  case 2:
  ------------------
  |  Branch (540:3): [True: 5, False: 9]
  ------------------
  541|      5|    return {2, 1};
  542|      4|  default:
  ------------------
  |  Branch (542:3): [True: 4, False: 10]
  ------------------
  543|      4|    ThrowRDE("Unexpected SRAWQuality value found: %u", qual);
  ------------------
  |  |   38|      4|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      4|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      4|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      4|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  544|     14|  }
  545|     14|}

_ZN8rawspeed10Cr2DecoderC2EONSt3__110unique_ptrINS_11TiffRootIFDENS1_14default_deleteIS3_EEEENS_6BufferE:
   39|  1.07k|      : AbstractTiffDecoder(std::move(root), file) {}

_ZN8rawspeed10DcrDecoder20isAppropriateDecoderEPKNS_11TiffRootIFDENS_6BufferE:
   44|  1.20k|                                      [[maybe_unused]] Buffer file) {
   45|  1.20k|  const auto id = rootIFD->getID();
   46|  1.20k|  const std::string& make = id.make;
   47|       |
   48|       |  // FIXME: magic
   49|       |
   50|  1.20k|  return make == "Kodak";
   51|  1.20k|}
_ZN8rawspeed10DcrDecoder20checkImageDimensionsEv:
   53|    250|void DcrDecoder::checkImageDimensions() {
   54|    250|  if (width > 4516 || height > 3012)
  ------------------
  |  Branch (54:7): [True: 22, False: 228]
  |  Branch (54:23): [True: 17, False: 211]
  ------------------
   55|    250|    ThrowRDE("Unexpected image dimensions found: (%u; %u)", width, height);
  ------------------
  |  |   38|     39|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     39|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     39|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     39|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   56|    250|}
_ZN8rawspeed10DcrDecoder17decodeRawInternalEv:
   58|    278|RawImage DcrDecoder::decodeRawInternal() {
   59|    278|  SimpleTiffDecoder::prepareForRawDecoding();
   60|       |
   61|    278|  ByteStream input(DataBuffer(mFile.getSubView(off), Endianness::little));
   62|       |
   63|    278|  if (int compression = raw->getEntry(TiffTag::COMPRESSION)->getU32();
   64|    278|      65000 != compression)
  ------------------
  |  Branch (64:7): [True: 7, False: 271]
  ------------------
   65|    278|    ThrowRDE("Unsupported compression %d", compression);
  ------------------
  |  |   38|      7|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      7|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      7|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      7|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   66|       |
   67|    271|  const TiffEntry* ifdoffset = mRootIFD->getEntryRecursive(TiffTag::KODAK_IFD);
   68|    271|  if (!ifdoffset)
  ------------------
  |  Branch (68:7): [True: 1, False: 270]
  ------------------
   69|    271|    ThrowRDE("Couldn't find the Kodak IFD offset");
  ------------------
  |  |   38|      1|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      1|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      1|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      1|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   70|       |
   71|    270|  NORangesSet<Buffer> ifds;
   72|       |
   73|    270|  assert(ifdoffset != nullptr);
  ------------------
  |  Branch (73:3): [True: 202, False: 68]
  ------------------
   74|    202|  TiffRootIFD kodakifd(nullptr, &ifds, ifdoffset->getRootIfdData(),
   75|    202|                       ifdoffset->getU32());
   76|       |
   77|    202|  const TiffEntry* linearization =
   78|    202|      kodakifd.getEntryRecursive(TiffTag::KODAK_LINEARIZATION);
   79|    202|  if (!linearization ||
  ------------------
  |  Branch (79:7): [True: 126, False: 76]
  ------------------
   80|     76|      (linearization->count != 1024 && linearization->count != 4096) ||
  ------------------
  |  Branch (80:8): [True: 2, False: 74]
  |  Branch (80:40): [True: 1, False: 1]
  ------------------
   81|     75|      linearization->type != TiffDataType::SHORT)
  ------------------
  |  Branch (81:7): [True: 1, False: 74]
  ------------------
   82|    202|    ThrowRDE("Couldn't find the linearization table");
  ------------------
  |  |   38|    118|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|    118|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|    118|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|    118|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   83|       |
   84|    202|  assert(linearization != nullptr);
  ------------------
  |  Branch (84:3): [True: 74, False: 10]
  ------------------
   85|     74|  auto linTable = linearization->getU16Array(linearization->count);
   86|       |
   87|     74|  RawImageCurveGuard curveHandler(&mRaw, linTable, uncorrectedRawValues);
   88|       |
   89|       |  // FIXME: dcraw does all sorts of crazy things besides this to fetch
   90|       |  //        WB from what appear to be presets and calculate it in weird ways
   91|       |  //        The only file I have only uses this method, if anybody careas look
   92|       |  //        in dcraw.c parse_kodak_ifd() for all that weirdness
   93|     74|  if (const TiffEntry* blob =
   94|     74|          kodakifd.getEntryRecursive(static_cast<TiffTag>(0x03fd));
   95|     74|      blob && blob->count == 72) {
  ------------------
  |  Branch (95:7): [True: 26, False: 48]
  |  Branch (95:15): [True: 23, False: 3]
  ------------------
   96|     23|    std::array<float, 4> wbCoeffs = {};
   97|     84|    for (auto i = 0U; i < 3; i++) {
  ------------------
  |  Branch (97:23): [True: 64, False: 20]
  ------------------
   98|     64|      const auto mul = blob->getU16(20 + i);
   99|     64|      if (0 == mul)
  ------------------
  |  Branch (99:11): [True: 3, False: 61]
  ------------------
  100|     64|        ThrowRDE("WB coefficient is zero!");
  ------------------
  |  |   38|      3|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      3|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      3|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      3|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  101|     61|      wbCoeffs[i] = 2048.0F / mul;
  102|     61|    }
  103|     20|    mRaw->metadata.wbCoeffs = wbCoeffs;
  104|     20|  }
  105|       |
  106|     71|  const int bps = [CurveSize = linearization->count]() {
  107|     71|    switch (CurveSize) {
  108|     71|    case 1024:
  109|     71|      return 10;
  110|     71|    case 4096:
  111|     71|      return 12;
  112|     71|    default:
  113|     71|      __builtin_unreachable();
  114|     71|    }
  115|     71|  }();
  116|       |
  117|     71|  KodakDecompressor k(mRaw, input, bps, uncorrectedRawValues);
  118|     71|  mRaw->createData();
  119|     71|  k.decompress();
  120|       |
  121|     71|  return mRaw;
  122|     74|}
DcrDecoder.cpp:_ZZN8rawspeed10DcrDecoder17decodeRawInternalEvENK3$_0clEv:
  106|     70|  const int bps = [CurveSize = linearization->count]() {
  107|     70|    switch (CurveSize) {
  108|     69|    case 1024:
  ------------------
  |  Branch (108:5): [True: 69, False: 1]
  ------------------
  109|     69|      return 10;
  110|      1|    case 4096:
  ------------------
  |  Branch (110:5): [True: 1, False: 69]
  ------------------
  111|      1|      return 12;
  112|      0|    default:
  ------------------
  |  Branch (112:5): [True: 0, False: 70]
  ------------------
  113|      0|      __builtin_unreachable();
  114|     70|    }
  115|     70|  }();
_ZN8rawspeed10DcrDecoder22decodeMetaDataInternalEPKNS_14CameraMetaDataE:
  124|      3|void DcrDecoder::decodeMetaDataInternal(const CameraMetaData* meta) {
  125|      3|  setMetaData(meta, "", 0);
  126|      3|}

_ZN8rawspeed10DcrDecoderC2EONSt3__110unique_ptrINS_11TiffRootIFDENS1_14default_deleteIS3_EEEENS_6BufferE:
   41|    278|      : SimpleTiffDecoder(std::move(root), file) {}

_ZN8rawspeed10DcsDecoder20isAppropriateDecoderEPKNS_11TiffRootIFDENS_6BufferE:
   44|    929|                                      [[maybe_unused]] Buffer file) {
   45|    929|  const auto id = rootIFD->getID();
   46|    929|  const std::string& make = id.make;
   47|       |
   48|       |  // FIXME: magic
   49|       |
   50|    929|  return make == "KODAK";
   51|    929|}
_ZN8rawspeed10DcsDecoder20checkImageDimensionsEv:
   53|     75|void DcsDecoder::checkImageDimensions() {
   54|     75|  if (width > 3072 || height > 2048)
  ------------------
  |  Branch (54:7): [True: 30, False: 45]
  |  Branch (54:23): [True: 19, False: 26]
  ------------------
   55|     75|    ThrowRDE("Unexpected image dimensions found: (%u; %u)", width, height);
  ------------------
  |  |   38|     49|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     49|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     49|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     49|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   56|     75|}
_ZN8rawspeed10DcsDecoder17decodeRawInternalEv:
   58|    100|RawImage DcsDecoder::decodeRawInternal() {
   59|    100|  SimpleTiffDecoder::prepareForRawDecoding();
   60|       |
   61|    100|  const TiffEntry* linearization =
   62|    100|      mRootIFD->getEntryRecursive(TiffTag::GRAYRESPONSECURVE);
   63|    100|  if (!linearization || linearization->count != 256 ||
  ------------------
  |  Branch (63:7): [True: 78, False: 22]
  |  Branch (63:25): [True: 3, False: 19]
  ------------------
   64|     19|      linearization->type != TiffDataType::SHORT)
  ------------------
  |  Branch (64:7): [True: 1, False: 18]
  ------------------
   65|    100|    ThrowRDE("Couldn't find the linearization table");
  ------------------
  |  |   38|      8|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      8|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      8|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      8|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   66|       |
   67|    100|  assert(linearization != nullptr);
  ------------------
  |  Branch (67:3): [True: 18, False: 74]
  ------------------
   68|     18|  auto table = linearization->getU16Array(256);
   69|       |
   70|     18|  RawImageCurveGuard curveHandler(&mRaw, table, uncorrectedRawValues);
   71|       |
   72|     18|  UncompressedDecompressor u(
   73|     18|      ByteStream(DataBuffer(mFile.getSubView(off, c2), Endianness::little)),
   74|     18|      mRaw, iRectangle2D({0, 0}, iPoint2D(width, height)), 8 * width / 8, 8,
   75|     18|      BitOrder::LSB);
   76|     18|  mRaw->createData();
   77|       |
   78|     18|  if (uncorrectedRawValues)
  ------------------
  |  Branch (78:7): [True: 0, False: 18]
  ------------------
   79|      0|    u.decode8BitRaw<true>();
   80|     18|  else
   81|     18|    u.decode8BitRaw<false>();
   82|       |
   83|     18|  return mRaw;
   84|     92|}
_ZN8rawspeed10DcsDecoder22decodeMetaDataInternalEPKNS_14CameraMetaDataE:
   86|     17|void DcsDecoder::decodeMetaDataInternal(const CameraMetaData* meta) {
   87|     17|  setMetaData(meta, "", 0);
   88|     17|}

_ZN8rawspeed10DcsDecoderC2EONSt3__110unique_ptrINS_11TiffRootIFDENS1_14default_deleteIS3_EEEENS_6BufferE:
   43|    100|      : SimpleTiffDecoder(std::move(root), file) {}

_ZN8rawspeed10DngDecoder20isAppropriateDecoderEPKNS_11TiffRootIFDENS_6BufferE:
   62|  12.8k|    const TiffRootIFD* rootIFD, [[maybe_unused]] Buffer file) {
   63|  12.8k|  return rootIFD->hasEntryRecursive(TiffTag::DNGVERSION);
   64|  12.8k|}
_ZN8rawspeed10DngDecoderC2EONSt3__110unique_ptrINS_11TiffRootIFDENS1_14default_deleteIS3_EEEENS_6BufferE:
   67|  3.94k|    : AbstractTiffDecoder(std::move(rootIFD), file) {
   68|  3.94k|  if (!mRootIFD->hasEntryRecursive(TiffTag::DNGVERSION))
  ------------------
  |  Branch (68:7): [True: 0, False: 3.94k]
  ------------------
   69|  3.94k|    ThrowRDE("DNG, but version tag is missing. Will not guess.");
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   70|       |
   71|  3.94k|  const auto v =
   72|  3.94k|      mRootIFD->getEntryRecursive(TiffTag::DNGVERSION)->getData().getBuffer(4);
   73|       |
   74|  3.94k|  if (v[0] != 1) {
  ------------------
  |  Branch (74:7): [True: 9, False: 3.93k]
  ------------------
   75|      9|    ThrowRDE("Not a supported DNG image format: v%i.%i.%i.%i",
  ------------------
  |  |   38|      9|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      9|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      9|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      9|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   76|      9|             static_cast<int>(v[0]), static_cast<int>(v[1]),
   77|      9|             static_cast<int>(v[2]), static_cast<int>(v[3]));
   78|      9|  }
   79|       |  //  if (v[1] > 4)
   80|       |  //    ThrowRDE("Not a supported DNG image format: v%u.%u.%u.%u", (int)v[0],
   81|       |  //    (int)v[1], (int)v[2], (int)v[3]);
   82|       |
   83|       |  // Prior to v1.1.xxx  fix LJPEG encoding bug
   84|  3.93k|  mFixLjpeg = (v[0] <= 1) && (v[1] < 1);
  ------------------
  |  Branch (84:15): [True: 3.93k, False: 1]
  |  Branch (84:30): [True: 358, False: 3.57k]
  ------------------
   85|  3.93k|}
_ZN8rawspeed10DngDecoder20dropUnsuportedChunksEPNSt3__16vectorIPKNS_7TiffIFDENS1_9allocatorIS5_EEEE:
   87|  3.91k|void DngDecoder::dropUnsuportedChunks(std::vector<const TiffIFD*>* data) {
   88|  8.73k|  for (auto i = data->begin(); i != data->end();) {
  ------------------
  |  Branch (88:32): [True: 4.82k, False: 3.90k]
  ------------------
   89|  4.82k|    const auto& ifd = *i;
   90|       |
   91|  4.82k|    int comp = ifd->getEntry(TiffTag::COMPRESSION)->getU16();
   92|  4.82k|    bool isSubsampled = false;
   93|  4.82k|    bool isAlpha = false;
   94|       |
   95|  4.82k|    if (ifd->hasEntry(TiffTag::NEWSUBFILETYPE) &&
  ------------------
  |  Branch (95:9): [True: 430, False: 4.39k]
  ------------------
   96|    430|        ifd->getEntry(TiffTag::NEWSUBFILETYPE)->isInt()) {
  ------------------
  |  Branch (96:9): [True: 407, False: 23]
  ------------------
   97|    407|      const uint32_t NewSubFileType =
   98|    407|          (*i)->getEntry(TiffTag::NEWSUBFILETYPE)->getU32();
   99|       |
  100|       |      // bit 0 is on if image is subsampled.
  101|       |      // the value itself can be either 1, or 0x10001.
  102|       |      // or 5 for "Transparency information for subsampled raw images"
  103|    407|      isSubsampled = NewSubFileType & (1 << 0);
  104|       |
  105|       |      // bit 2 is on if image contains transparency information.
  106|       |      // the value itself can be either 4 or 5
  107|    407|      isAlpha = NewSubFileType & (1 << 2);
  108|    407|    }
  109|       |
  110|       |    // normal raw?
  111|  4.82k|    bool supported = !isSubsampled && !isAlpha;
  ------------------
  |  Branch (111:22): [True: 4.53k, False: 285]
  |  Branch (111:39): [True: 4.53k, False: 1]
  ------------------
  112|       |
  113|  4.82k|    switch (comp) {
  114|  3.16k|    case 1: // uncompressed
  ------------------
  |  Branch (114:5): [True: 3.16k, False: 1.66k]
  ------------------
  115|  3.82k|    case 7: // lossless JPEG
  ------------------
  |  Branch (115:5): [True: 663, False: 4.15k]
  ------------------
  116|       |#ifdef HAVE_ZLIB
  117|       |    case 8: // deflate
  118|       |#endif
  119|  4.09k|    case 9: // VC-5 as used by GoPro
  ------------------
  |  Branch (119:5): [True: 271, False: 4.55k]
  ------------------
  120|       |#ifdef HAVE_JPEG
  121|       |    case 0x884c: // lossy JPEG
  122|       |#endif
  123|       |                 // no change, if supported, then is still supported.
  124|  4.09k|      break;
  125|       |
  126|      0|#ifndef HAVE_ZLIB
  127|     14|    case 8: // deflate
  ------------------
  |  Branch (127:5): [True: 14, False: 4.80k]
  ------------------
  128|     14|#pragma message                                                                \
  129|     14|    "ZLIB is not present! Deflate compression will not be supported!"
  130|     14|      writeLog(DEBUG_PRIO::WARNING, "DNG Decoder: found Deflate-encoded chunk, "
  131|     14|                                    "but the deflate support was disabled at "
  132|     14|                                    "build!");
  133|     14|      [[clang::fallthrough]];
  134|     14|#endif
  135|     14|#ifndef HAVE_JPEG
  136|     79|    case 0x884c: // lossy JPEG
  ------------------
  |  Branch (136:5): [True: 65, False: 4.75k]
  ------------------
  137|     79|#pragma message                                                                \
  138|     79|    "JPEG is not present! Lossy JPEG compression will not be supported!"
  139|     79|      writeLog(DEBUG_PRIO::WARNING, "DNG Decoder: found lossy JPEG-encoded "
  140|     79|                                    "chunk, but the jpeg support was "
  141|     79|                                    "disabled at build!");
  142|     79|      [[clang::fallthrough]];
  143|     79|#endif
  144|    720|    default:
  ------------------
  |  Branch (144:5): [True: 641, False: 4.18k]
  ------------------
  145|    720|      supported = false;
  146|    720|      break;
  147|  4.82k|    }
  148|       |
  149|  4.81k|    if (supported)
  ------------------
  |  Branch (149:9): [True: 3.94k, False: 870]
  ------------------
  150|  3.94k|      ++i;
  151|    870|    else
  152|    870|      i = data->erase(i);
  153|  4.81k|  }
  154|  3.91k|}
_ZNK8rawspeed10DngDecoder15parseACTIVEAREAEPKNS_7TiffIFDE:
  156|  2.76k|Optional<iRectangle2D> DngDecoder::parseACTIVEAREA(const TiffIFD* raw) const {
  157|  2.76k|  if (!raw->hasEntry(TiffTag::ACTIVEAREA))
  ------------------
  |  Branch (157:7): [True: 2.55k, False: 212]
  ------------------
  158|  2.55k|    return {};
  159|       |
  160|    212|  const TiffEntry* active_area = raw->getEntry(TiffTag::ACTIVEAREA);
  161|    212|  if (active_area->count != 4)
  ------------------
  |  Branch (161:7): [True: 2, False: 210]
  ------------------
  162|    212|    ThrowRDE("active area has %u values instead of 4", active_area->count);
  ------------------
  |  |   38|      2|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      2|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      2|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      2|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  163|       |
  164|    210|  const iRectangle2D fullImage(0, 0, mRaw->dim.x, mRaw->dim.y);
  165|       |
  166|    210|  const auto corners = active_area->getU32Array(4);
  167|    210|  const iPoint2D topLeft(static_cast<int>(corners[1]),
  168|    210|                         static_cast<int>(corners[0]));
  169|    210|  const iPoint2D bottomRight(static_cast<int>(corners[3]),
  170|    210|                             static_cast<int>(corners[2]));
  171|       |
  172|    210|  if (!(fullImage.isPointInsideInclusive(topLeft) &&
  ------------------
  |  Branch (172:9): [True: 107, False: 103]
  ------------------
  173|    107|        fullImage.isPointInsideInclusive(bottomRight) &&
  ------------------
  |  Branch (173:9): [True: 18, False: 89]
  ------------------
  174|    193|        bottomRight >= topLeft)) {
  ------------------
  |  Branch (174:9): [True: 16, False: 2]
  ------------------
  175|    193|    ThrowRDE("Rectangle (%i, %i, %i, %i) not inside image (%i, %i, %i, %i).",
  ------------------
  |  |   38|    193|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|    193|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|    193|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|    193|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  176|    193|             topLeft.x, topLeft.y, bottomRight.x, bottomRight.y,
  177|    193|             fullImage.getTopLeft().x, fullImage.getTopLeft().y,
  178|    193|             fullImage.getBottomRight().x, fullImage.getBottomRight().y);
  179|    193|  }
  180|       |
  181|     17|  iRectangle2D crop;
  182|     17|  crop.setTopLeft(topLeft);
  183|     17|  crop.setBottomRightAbsolute(bottomRight);
  184|     17|  assert(fullImage.isThisInside(fullImage));
  ------------------
  |  Branch (184:3): [True: 16, False: 1]
  ------------------
  185|       |
  186|     16|  return crop;
  187|     17|}
_ZNK8rawspeed10DngDecoder8parseCFAEPKNS_7TiffIFDE:
  213|    344|void DngDecoder::parseCFA(const TiffIFD* raw) const {
  214|       |
  215|       |  // Check if layout is OK, if present
  216|    344|  if (raw->hasEntry(TiffTag::CFALAYOUT) &&
  ------------------
  |  Branch (216:7): [True: 2, False: 342]
  ------------------
  217|      2|      raw->getEntry(TiffTag::CFALAYOUT)->getU16() != 1)
  ------------------
  |  Branch (217:7): [True: 1, False: 1]
  ------------------
  218|    344|    ThrowRDE("Unsupported CFA Layout.");
  ------------------
  |  |   38|      1|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      1|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      1|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      1|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  219|       |
  220|    343|  const TiffEntry* cfadim = raw->getEntry(TiffTag::CFAREPEATPATTERNDIM);
  221|    343|  if (cfadim->count != 2)
  ------------------
  |  Branch (221:7): [True: 1, False: 342]
  ------------------
  222|    343|    ThrowRDE("Couldn't read CFA pattern dimension");
  ------------------
  |  |   38|      1|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      1|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      1|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      1|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  223|       |
  224|       |  // Does NOT contain dimensions as some documents state
  225|    342|  const TiffEntry* cPat = raw->getEntry(TiffTag::CFAPATTERN);
  226|    342|  if (!cPat->count)
  ------------------
  |  Branch (226:7): [True: 1, False: 341]
  ------------------
  227|    342|    ThrowRDE("CFA pattern is empty!");
  ------------------
  |  |   38|      1|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      1|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      1|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      1|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  228|       |
  229|    341|  iPoint2D cfaSize(cfadim->getU32(1), cfadim->getU32(0));
  230|    341|  if (!cfaSize.hasPositiveArea() || cfaSize.area() != cPat->count) {
  ------------------
  |  Branch (230:7): [True: 26, False: 315]
  |  Branch (230:37): [True: 73, False: 242]
  ------------------
  231|     92|    ThrowRDE("CFA pattern dimension and pattern count does not "
  ------------------
  |  |   38|     92|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     92|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     92|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     92|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  232|     92|             "match: %u.",
  233|     92|             cPat->count);
  234|     92|  }
  235|       |
  236|    249|  mRaw->cfa.setSize(cfaSize);
  237|       |
  238|    844|  for (int y = 0; y < cfaSize.y; y++) {
  ------------------
  |  Branch (238:19): [True: 609, False: 235]
  ------------------
  239|  1.79k|    for (int x = 0; x < cfaSize.x; x++) {
  ------------------
  |  Branch (239:21): [True: 1.19k, False: 595]
  ------------------
  240|  1.19k|      uint32_t c1 = cPat->getByte(x + (y * cfaSize.x));
  241|       |
  242|  1.19k|      auto c2 = getDNGCFAPatternAsCFAColor(c1);
  243|  1.19k|      if (!c2)
  ------------------
  |  Branch (243:11): [True: 14, False: 1.18k]
  ------------------
  244|  1.19k|        ThrowRDE("Unsupported CFA Color: %u", c1);
  ------------------
  |  |   38|     14|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     14|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     14|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     14|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  245|       |
  246|  1.18k|      mRaw->cfa.setColorAt(iPoint2D(x, y), *c2);
  247|  1.18k|    }
  248|    609|  }
  249|       |
  250|       |  // the cfa is specified relative to the ActiveArea. we want it relative (0,0)
  251|       |  // Since in handleMetadata(), in subFrame() we unconditionally shift CFA by
  252|       |  // activearea+DefaultCropOrigin; here we need to undo the 'ACTIVEAREA' part.
  253|    235|  const Optional<iRectangle2D> aa = parseACTIVEAREA(raw);
  254|    235|  if (!aa)
  ------------------
  |  Branch (254:7): [True: 216, False: 19]
  ------------------
  255|    216|    return;
  256|       |
  257|       |  // To reverse the ActiveArea modifictions done earlier, we need to
  258|       |  // use the negated ActiveArea x/y values.
  259|     19|  mRaw->cfa.shiftRight(-int(aa->pos.x));
  260|     19|  mRaw->cfa.shiftDown(-int(aa->pos.y));
  261|     19|}
DngDecoder.cpp:_ZN8rawspeed12_GLOBAL__N_126getDNGCFAPatternAsCFAColorEj:
  190|  1.19k|Optional<CFAColor> getDNGCFAPatternAsCFAColor(uint32_t c) {
  191|  1.19k|  switch (c) {
  192|      0|    using enum CFAColor;
  193|    464|  case 0:
  ------------------
  |  Branch (193:3): [True: 464, False: 730]
  ------------------
  194|    464|    return RED;
  195|    395|  case 1:
  ------------------
  |  Branch (195:3): [True: 395, False: 799]
  ------------------
  196|    395|    return GREEN;
  197|    217|  case 2:
  ------------------
  |  Branch (197:3): [True: 217, False: 977]
  ------------------
  198|    217|    return BLUE;
  199|     26|  case 3:
  ------------------
  |  Branch (199:3): [True: 26, False: 1.16k]
  ------------------
  200|     26|    return CYAN;
  201|     24|  case 4:
  ------------------
  |  Branch (201:3): [True: 24, False: 1.17k]
  ------------------
  202|     24|    return MAGENTA;
  203|     20|  case 5:
  ------------------
  |  Branch (203:3): [True: 20, False: 1.17k]
  ------------------
  204|     20|    return YELLOW;
  205|     34|  case 6:
  ------------------
  |  Branch (205:3): [True: 34, False: 1.16k]
  ------------------
  206|     34|    return WHITE;
  207|     14|  default:
  ------------------
  |  Branch (207:3): [True: 14, False: 1.18k]
  ------------------
  208|     14|    return std::nullopt;
  209|  1.19k|  }
  210|  1.19k|}
_ZNK8rawspeed10DngDecoder16parseColorMatrixEv:
  263|  1.68k|void DngDecoder::parseColorMatrix() const {
  264|       |  // Look for D65 calibrated color matrix
  265|       |
  266|  1.68k|  auto impl = [this](TiffTag I, TiffTag M) -> TiffEntry* {
  267|  1.68k|    if (!mRootIFD->hasEntryRecursive(I))
  268|  1.68k|      return nullptr;
  269|  1.68k|    if (const TiffEntry* illuminant = mRootIFD->getEntryRecursive(I);
  270|  1.68k|        illuminant->getU16() != 21 || // D65
  271|  1.68k|        !mRootIFD->hasEntryRecursive(M))
  272|  1.68k|      return nullptr;
  273|  1.68k|    return mRootIFD->getEntryRecursive(M);
  274|  1.68k|  };
  275|       |
  276|  1.68k|  const TiffEntry* mat;
  277|  1.68k|  mat = impl(TiffTag::CALIBRATIONILLUMINANT1, TiffTag::COLORMATRIX1);
  278|  1.68k|  if (!mat)
  ------------------
  |  Branch (278:7): [True: 1.64k, False: 32]
  ------------------
  279|  1.64k|    mat = impl(TiffTag::CALIBRATIONILLUMINANT2, TiffTag::COLORMATRIX2);
  280|  1.68k|  if (!mat)
  ------------------
  |  Branch (280:7): [True: 1.63k, False: 43]
  ------------------
  281|  1.63k|    return;
  282|       |
  283|       |  // Color matrix size *MUST* be a multiple of 3 (number of channels in XYZ).
  284|     43|  if (mat->count % 3 != 0)
  ------------------
  |  Branch (284:7): [True: 2, False: 41]
  ------------------
  285|      2|    return;
  286|       |
  287|     41|  const auto srat_vals = mat->getSRationalArray(mat->count);
  288|     41|  bool Success = true;
  289|     41|  mRaw->metadata.colorMatrix.reserve(mat->count);
  290|  1.75k|  for (const auto& val : srat_vals) {
  ------------------
  |  Branch (290:24): [True: 1.75k, False: 36]
  ------------------
  291|  1.75k|    Success &= val.den != 0;
  292|  1.75k|    if (!Success)
  ------------------
  |  Branch (292:9): [True: 5, False: 1.75k]
  ------------------
  293|      5|      break;
  294|  1.75k|    mRaw->metadata.colorMatrix.emplace_back(val);
  295|  1.75k|  }
  296|     41|  if (!Success)
  ------------------
  |  Branch (296:7): [True: 5, False: 36]
  ------------------
  297|      5|    mRaw->metadata.colorMatrix.clear();
  298|     41|}
DngDecoder.cpp:_ZZNK8rawspeed10DngDecoder16parseColorMatrixEvENK3$_0clENS_7TiffTagES2_:
  266|  3.33k|  auto impl = [this](TiffTag I, TiffTag M) -> TiffEntry* {
  267|  3.33k|    if (!mRootIFD->hasEntryRecursive(I))
  ------------------
  |  Branch (267:9): [True: 3.26k, False: 67]
  ------------------
  268|  3.26k|      return nullptr;
  269|     67|    if (const TiffEntry* illuminant = mRootIFD->getEntryRecursive(I);
  270|     67|        illuminant->getU16() != 21 || // D65
  ------------------
  |  Branch (270:9): [True: 37, False: 30]
  ------------------
  271|     30|        !mRootIFD->hasEntryRecursive(M))
  ------------------
  |  Branch (271:9): [True: 2, False: 28]
  ------------------
  272|     24|      return nullptr;
  273|     43|    return mRootIFD->getEntryRecursive(M);
  274|     67|  };
_ZNK8rawspeed10DngDecoder20getTilingDescriptionEPKNS_7TiffIFDE:
  301|  3.47k|DngDecoder::getTilingDescription(const TiffIFD* raw) const {
  302|  3.47k|  if (raw->hasEntry(TiffTag::TILEOFFSETS)) {
  ------------------
  |  Branch (302:7): [True: 322, False: 3.15k]
  ------------------
  303|    322|    const uint32_t tilew = raw->getEntry(TiffTag::TILEWIDTH)->getU32();
  304|    322|    const uint32_t tileh = raw->getEntry(TiffTag::TILELENGTH)->getU32();
  305|       |
  306|    322|    if (tilew <= 0 || tileh <= 0)
  ------------------
  |  Branch (306:9): [True: 2, False: 320]
  |  Branch (306:23): [True: 2, False: 318]
  ------------------
  307|    322|      ThrowRDE("Invalid tile size: (%u, %u)", tilew, tileh);
  ------------------
  |  |   38|      3|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      3|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      3|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      3|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  308|       |
  309|    322|    assert(tilew > 0);
  ------------------
  |  Branch (309:5): [True: 318, False: 1]
  ------------------
  310|    318|    const auto tilesX =
  311|    318|        implicit_cast<uint32_t>(roundUpDivisionSafe(mRaw->dim.x, tilew));
  312|    318|    if (!tilesX)
  ------------------
  |  Branch (312:9): [True: 0, False: 318]
  ------------------
  313|    318|      ThrowRDE("Zero tiles horizontally");
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  314|       |
  315|    318|    assert(tileh > 0);
  ------------------
  |  Branch (315:5): [True: 318, False: 0]
  ------------------
  316|    318|    const auto tilesY =
  317|    318|        implicit_cast<uint32_t>(roundUpDivisionSafe(mRaw->dim.y, tileh));
  318|    318|    if (!tilesY)
  ------------------
  |  Branch (318:9): [True: 0, False: 318]
  ------------------
  319|    318|      ThrowRDE("Zero tiles vertically");
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  320|       |
  321|    318|    const TiffEntry* offsets = raw->getEntry(TiffTag::TILEOFFSETS);
  322|    318|    if (const TiffEntry* counts = raw->getEntry(TiffTag::TILEBYTECOUNTS);
  323|    318|        offsets->count != counts->count) {
  ------------------
  |  Branch (323:9): [True: 3, False: 315]
  ------------------
  324|      3|      ThrowRDE("Tile count mismatch: offsets:%u count:%u", offsets->count,
  ------------------
  |  |   38|      3|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      3|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      3|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      3|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  325|      3|               counts->count);
  326|      3|    }
  327|       |
  328|       |    // tilesX * tilesY may overflow, but division is fine, so let's do that.
  329|    315|    if ((offsets->count / tilesX != tilesY || (offsets->count % tilesX != 0)) ||
  ------------------
  |  Branch (329:10): [True: 11, False: 304]
  |  Branch (329:47): [True: 1, False: 303]
  ------------------
  330|    303|        (offsets->count / tilesY != tilesX || (offsets->count % tilesY != 0))) {
  ------------------
  |  Branch (330:10): [True: 0, False: 303]
  |  Branch (330:47): [True: 0, False: 303]
  ------------------
  331|     12|      ThrowRDE("Tile X/Y count mismatch: total:%u X:%u, Y:%u", offsets->count,
  ------------------
  |  |   38|     12|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     12|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     12|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     12|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  332|     12|               tilesX, tilesY);
  333|     12|    }
  334|       |
  335|    303|    return {mRaw->dim, tilew, tileh};
  336|    315|  }
  337|       |
  338|       |  // Strips
  339|  3.15k|  const TiffEntry* offsets = raw->getEntry(TiffTag::STRIPOFFSETS);
  340|  3.15k|  const TiffEntry* counts = raw->getEntry(TiffTag::STRIPBYTECOUNTS);
  341|       |
  342|  3.15k|  if (counts->count != offsets->count) {
  ------------------
  |  Branch (342:7): [True: 15, False: 3.14k]
  ------------------
  343|     15|    ThrowRDE("Byte count number does not match strip size: "
  ------------------
  |  |   38|     15|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     15|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     15|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     15|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  344|     15|             "count:%u, stips:%u ",
  345|     15|             counts->count, offsets->count);
  346|     15|  }
  347|       |
  348|  3.14k|  uint32_t yPerSlice = raw->hasEntry(TiffTag::ROWSPERSTRIP)
  ------------------
  |  Branch (348:24): [True: 242, False: 2.89k]
  ------------------
  349|  3.14k|                           ? raw->getEntry(TiffTag::ROWSPERSTRIP)->getU32()
  350|  3.14k|                           : mRaw->dim.y;
  351|       |
  352|  3.14k|  if (yPerSlice == 0 ||
  ------------------
  |  Branch (352:7): [True: 21, False: 3.12k]
  ------------------
  353|  3.12k|      roundUpDivisionSafe(mRaw->dim.y, yPerSlice) != counts->count) {
  ------------------
  |  Branch (353:7): [True: 7, False: 3.11k]
  ------------------
  354|      8|    ThrowRDE("Invalid y per slice %u or strip count %u (height = %i)",
  ------------------
  |  |   38|      8|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      8|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      8|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      8|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  355|      8|             yPerSlice, counts->count, mRaw->dim.y);
  356|      8|  }
  357|       |
  358|  3.13k|  return {mRaw->dim, static_cast<uint32_t>(mRaw->dim.x), yPerSlice};
  359|  3.14k|}
_ZNK8rawspeed10DngDecoder10decodeDataEPKNS_7TiffIFDEj:
  361|  3.47k|void DngDecoder::decodeData(const TiffIFD* raw, uint32_t sample_format) const {
  362|  3.47k|  if (compression == 8 && sample_format != 3) {
  ------------------
  |  Branch (362:7): [True: 0, False: 3.47k]
  |  Branch (362:27): [True: 0, False: 0]
  ------------------
  363|      0|    ThrowRDE("Only float format is supported for "
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  364|      0|             "deflate-compressed data.");
  365|  3.47k|  } else if ((compression == 7 || compression == 0x884c) &&
  ------------------
  |  Branch (365:15): [True: 531, False: 2.94k]
  |  Branch (365:35): [True: 0, False: 2.94k]
  ------------------
  366|    531|             sample_format != 1) {
  ------------------
  |  Branch (366:14): [True: 1, False: 530]
  ------------------
  367|      1|    ThrowRDE("Only 16 bit unsigned data supported for "
  ------------------
  |  |   38|      1|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      1|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      1|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      1|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  368|      1|             "JPEG-compressed data.");
  369|      1|  }
  370|       |
  371|  3.47k|  uint32_t predictor = ~0U;
  372|  3.47k|  if (raw->hasEntry(TiffTag::PREDICTOR))
  ------------------
  |  Branch (372:7): [True: 1, False: 3.47k]
  ------------------
  373|      1|    predictor = raw->getEntry(TiffTag::PREDICTOR)->getU32();
  374|       |
  375|  3.47k|  if (mRaw->getDataType() == RawImageType::UINT16) {
  ------------------
  |  Branch (375:7): [True: 3.17k, False: 304]
  ------------------
  376|       |    // Default white level is (2 ** BitsPerSample) - 1
  377|  3.17k|    mRaw->whitePoint = implicit_cast<int>((1UL << *bps) - 1UL);
  378|  3.17k|  } else if (mRaw->getDataType() == RawImageType::F32) {
  ------------------
  |  Branch (378:14): [True: 304, False: 0]
  ------------------
  379|       |    // 1. We divide by white level to normalize the image,
  380|       |    //    s.t. the 1.0 becomes the white level.
  381|       |    // 2. In DNG spec, white level is always an integer,
  382|       |    //    there can not be a non-integral white level.
  383|       |    // 3. Additionally, no white level for FP DNG's means that
  384|       |    //    it is pre-normalized (default is 1.0).
  385|       |    //
  386|       |    // Therefore, we can surmise that:
  387|       |    // a) FP DNG's never have white level of <1.0
  388|       |    // b) FP DNG's always have integral white level
  389|       |    // c) if FP DNG has a white level of `w`, it is always correct
  390|       |    //    to divide by `float(w)` to normalize the image
  391|       |    // ... therefore, we can, as an optimization,
  392|       |    // store FP DNG white level as an integer.
  393|    304|    mRaw->whitePoint = 1;
  394|    304|  }
  395|       |
  396|       |  // Some decompressors (such as VC5) may depend on the white point
  397|  3.47k|  if (raw->hasEntry(TiffTag::WHITELEVEL)) {
  ------------------
  |  Branch (397:7): [True: 148, False: 3.33k]
  ------------------
  398|    148|    const TiffEntry* whitelevel = raw->getEntry(TiffTag::WHITELEVEL);
  399|    148|    if (whitelevel->isInt())
  ------------------
  |  Branch (399:9): [True: 143, False: 5]
  ------------------
  400|    143|      mRaw->whitePoint = whitelevel->getU32();
  401|    148|  }
  402|       |
  403|  3.47k|  AbstractDngDecompressor slices(mRaw, getTilingDescription(raw), compression,
  404|  3.47k|                                 mFixLjpeg, *bps, predictor);
  405|       |
  406|  3.47k|  slices.slices.reserve(slices.dsc.numTiles);
  407|       |
  408|  3.47k|  const TiffEntry* offsets = nullptr;
  409|  3.47k|  const TiffEntry* counts = nullptr;
  410|  3.47k|  if (raw->hasEntry(TiffTag::TILEOFFSETS)) {
  ------------------
  |  Branch (410:7): [True: 303, False: 3.17k]
  ------------------
  411|    303|    offsets = raw->getEntry(TiffTag::TILEOFFSETS);
  412|    303|    counts = raw->getEntry(TiffTag::TILEBYTECOUNTS);
  413|  3.17k|  } else { // Strips
  414|  3.17k|    offsets = raw->getEntry(TiffTag::STRIPOFFSETS);
  415|  3.17k|    counts = raw->getEntry(TiffTag::STRIPBYTECOUNTS);
  416|  3.17k|  }
  417|  3.47k|  assert(slices.dsc.numTiles == offsets->count);
  ------------------
  |  Branch (417:3): [True: 3.41k, False: 62]
  ------------------
  418|  3.47k|  assert(slices.dsc.numTiles == counts->count);
  ------------------
  |  Branch (418:3): [True: 3.41k, False: 0]
  ------------------
  419|       |
  420|  3.41k|  NORangesSet<Buffer> tilesLegality;
  421|  7.99k|  for (auto n = 0U; n < slices.dsc.numTiles; n++) {
  ------------------
  |  Branch (421:21): [True: 4.57k, False: 3.41k]
  ------------------
  422|  4.57k|    const auto offset = offsets->getU32(n);
  423|  4.57k|    const auto count = counts->getU32(n);
  424|       |
  425|  4.57k|    if (count < 1)
  ------------------
  |  Branch (425:9): [True: 1, False: 4.57k]
  ------------------
  426|  4.57k|      ThrowRDE("Tile %u is empty", n);
  ------------------
  |  |   38|      1|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      1|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      1|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      1|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  427|       |
  428|  4.57k|    ByteStream bs(DataBuffer(mFile.getSubView(offset, count),
  429|  4.57k|                             mRootIFD->rootBuffer.getByteOrder()));
  430|       |
  431|  4.57k|    if (!tilesLegality.insert(bs))
  ------------------
  |  Branch (431:9): [True: 2, False: 4.57k]
  ------------------
  432|  4.57k|      ThrowTPE("Two tiles overlap. Raw corrupt!");
  ------------------
  |  |   39|      2|  ThrowExceptionHelper(rawspeed::TiffParserException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      2|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      2|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      2|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  433|       |
  434|  4.57k|    slices.slices.emplace_back(slices.dsc, n, bs);
  435|  4.57k|  }
  436|       |
  437|  3.41k|  assert(slices.slices.size() == slices.dsc.numTiles);
  ------------------
  |  Branch (437:3): [True: 3.36k, False: 47]
  ------------------
  438|  3.36k|  if (slices.slices.empty())
  ------------------
  |  Branch (438:7): [True: 0, False: 3.36k]
  ------------------
  439|  3.36k|    ThrowRDE("No valid slices found.");
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  440|       |
  441|       |  // FIXME: should we sort the tiles, to linearize the input reading?
  442|       |
  443|  3.36k|  mRaw->createData();
  444|       |
  445|  3.36k|  slices.decompress();
  446|  3.36k|}
_ZN8rawspeed10DngDecoder17decodeRawInternalEv:
  448|  3.93k|RawImage DngDecoder::decodeRawInternal() {
  449|  3.93k|  vector<const TiffIFD*> data = mRootIFD->getIFDsWithTag(TiffTag::COMPRESSION);
  450|       |
  451|  3.93k|  if (data.empty())
  ------------------
  |  Branch (451:7): [True: 19, False: 3.91k]
  ------------------
  452|  3.93k|    ThrowRDE("No image data found");
  ------------------
  |  |   38|     19|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     19|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     19|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     19|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  453|       |
  454|  3.91k|  dropUnsuportedChunks(&data);
  455|       |
  456|  3.91k|  if (data.empty())
  ------------------
  |  Branch (456:7): [True: 93, False: 3.82k]
  ------------------
  457|  3.91k|    ThrowRDE("No RAW chunks found");
  ------------------
  |  |   38|     93|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     93|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     93|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     93|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  458|       |
  459|  3.82k|  if (data.size() > 1) {
  ------------------
  |  Branch (459:7): [True: 29, False: 3.79k]
  ------------------
  460|     29|    writeLog(DEBUG_PRIO::EXTRA,
  461|     29|             "Multiple RAW chunks found - using first only!");
  462|     29|  }
  463|       |
  464|  3.82k|  const TiffIFD* raw = data[0];
  465|       |
  466|  3.82k|  bps = raw->getEntry(TiffTag::BITSPERSAMPLE)->getU32();
  467|  3.82k|  if (*bps < 1 || *bps > 32)
  ------------------
  |  Branch (467:7): [True: 60, False: 3.76k]
  |  Branch (467:19): [True: 21, False: 3.74k]
  ------------------
  468|  3.82k|    ThrowRDE("Unsupported bit per sample count: %i.", *bps);
  ------------------
  |  |   38|     42|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     42|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     42|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     42|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  469|       |
  470|  3.78k|  uint32_t sample_format = 1;
  471|  3.78k|  if (raw->hasEntry(TiffTag::SAMPLEFORMAT))
  ------------------
  |  Branch (471:7): [True: 309, False: 3.47k]
  ------------------
  472|    309|    sample_format = raw->getEntry(TiffTag::SAMPLEFORMAT)->getU32();
  473|       |
  474|  3.78k|  compression = raw->getEntry(TiffTag::COMPRESSION)->getU16();
  475|       |
  476|  3.78k|  switch (sample_format) {
  477|  3.43k|  case 1:
  ------------------
  |  Branch (477:3): [True: 3.43k, False: 348]
  ------------------
  478|  3.43k|    mRaw = RawImage::create(RawImageType::UINT16);
  479|  3.43k|    break;
  480|    308|  case 3:
  ------------------
  |  Branch (480:3): [True: 308, False: 3.47k]
  ------------------
  481|    308|    mRaw = RawImage::create(RawImageType::F32);
  482|    308|    break;
  483|      1|  default:
  ------------------
  |  Branch (483:3): [True: 1, False: 3.78k]
  ------------------
  484|      1|    ThrowRDE("Only 16 bit unsigned or float point data supported. Sample "
  ------------------
  |  |   38|      1|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      1|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      1|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      1|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  485|  3.78k|             "format %u is not supported.",
  486|  3.78k|             sample_format);
  487|  3.78k|  }
  488|       |
  489|  3.74k|  mRaw->isCFA =
  490|  3.74k|      (raw->getEntry(TiffTag::PHOTOMETRICINTERPRETATION)->getU16() == 32803);
  491|       |
  492|  3.74k|  if (mRaw->isCFA)
  ------------------
  |  Branch (492:7): [True: 351, False: 3.39k]
  ------------------
  493|    351|    writeLog(DEBUG_PRIO::EXTRA, "This is a CFA image");
  494|  3.39k|  else {
  495|  3.39k|    writeLog(DEBUG_PRIO::EXTRA, "This is NOT a CFA image");
  496|  3.39k|  }
  497|       |
  498|  3.74k|  if (sample_format == 1 && *bps > 16)
  ------------------
  |  Branch (498:7): [True: 3.42k, False: 319]
  |  Branch (498:29): [True: 6, False: 3.41k]
  ------------------
  499|  3.74k|    ThrowRDE("Integer precision larger than 16 bits currently not supported.");
  ------------------
  |  |   38|      6|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      6|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      6|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      6|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  500|       |
  501|  3.73k|  if (sample_format == 3 && *bps != 16 && *bps != 24 && *bps != 32)
  ------------------
  |  Branch (501:7): [True: 308, False: 3.42k]
  |  Branch (501:29): [True: 150, False: 158]
  |  Branch (501:43): [True: 26, False: 124]
  |  Branch (501:57): [True: 2, False: 24]
  ------------------
  502|  3.73k|    ThrowRDE("Floating point must be 16/24/32 bits per sample.");
  ------------------
  |  |   38|      2|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      2|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      2|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      2|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  503|       |
  504|  3.73k|  mRaw->dim.x = raw->getEntry(TiffTag::IMAGEWIDTH)->getU32();
  505|  3.73k|  mRaw->dim.y = raw->getEntry(TiffTag::IMAGELENGTH)->getU32();
  506|       |
  507|  3.73k|  if (!mRaw->dim.hasPositiveArea())
  ------------------
  |  Branch (507:7): [True: 40, False: 3.69k]
  ------------------
  508|  3.73k|    ThrowRDE("Image has zero size");
  ------------------
  |  |   38|     40|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     40|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     40|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     40|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  509|       |
  510|  3.69k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  511|       |  // Yeah, sure, here it would be just dumb to leave this for production :)
  512|  3.69k|  if (mRaw->dim.x > 9536 || mRaw->dim.y > 7680) {
  ------------------
  |  Branch (512:7): [True: 35, False: 3.65k]
  |  Branch (512:29): [True: 12, False: 3.64k]
  ------------------
  513|     29|    ThrowRDE("Unexpected image dimensions found: (%i; %i)", mRaw->dim.x,
  ------------------
  |  |   38|     29|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     29|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     29|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     29|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  514|     29|             mRaw->dim.y);
  515|     29|  }
  516|  3.66k|#endif
  517|       |
  518|  3.66k|  if (mRaw->isCFA)
  ------------------
  |  Branch (518:7): [True: 344, False: 3.32k]
  ------------------
  519|    344|    parseCFA(raw);
  520|       |
  521|  3.66k|  uint32_t cpp = raw->getEntry(TiffTag::SAMPLESPERPIXEL)->getU32();
  522|       |
  523|  3.66k|  if (cpp < 1 || cpp > 4)
  ------------------
  |  Branch (523:7): [True: 153, False: 3.51k]
  |  Branch (523:18): [True: 32, False: 3.47k]
  ------------------
  524|  3.66k|    ThrowRDE("Unsupported samples per pixel count: %u.", cpp);
  ------------------
  |  |   38|     33|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     33|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     33|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     33|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  525|       |
  526|  3.63k|  mRaw->setCpp(cpp);
  527|       |
  528|       |  // Now load the image
  529|  3.63k|  decodeData(raw, sample_format);
  530|       |
  531|  3.63k|  handleMetadata(raw);
  532|       |
  533|  3.63k|  return mRaw;
  534|  3.66k|}
_ZN8rawspeed10DngDecoder14handleMetadataEPKNS_7TiffIFDE:
  536|  2.54k|void DngDecoder::handleMetadata(const TiffIFD* raw) {
  537|       |  // Crop
  538|  2.54k|  if (const Optional<iRectangle2D> aa = parseACTIVEAREA(raw))
  ------------------
  |  Branch (538:36): [True: 8, False: 2.53k]
  ------------------
  539|      8|    mRaw->subFrame(*aa);
  540|       |
  541|  2.54k|  if (raw->hasEntry(TiffTag::DEFAULTCROPORIGIN) &&
  ------------------
  |  Branch (541:7): [True: 292, False: 2.25k]
  ------------------
  542|    292|      raw->hasEntry(TiffTag::DEFAULTCROPSIZE)) {
  ------------------
  |  Branch (542:7): [True: 270, False: 22]
  ------------------
  543|    270|    iRectangle2D cropped(0, 0, mRaw->dim.x, mRaw->dim.y);
  544|    270|    const TiffEntry* origin_entry = raw->getEntry(TiffTag::DEFAULTCROPORIGIN);
  545|    270|    const TiffEntry* size_entry = raw->getEntry(TiffTag::DEFAULTCROPSIZE);
  546|       |
  547|    270|    const auto tl_r = origin_entry->getRationalArray(2);
  548|    270|    std::array<unsigned, 2> tl;
  549|    270|    std::transform(tl_r.begin(), tl_r.end(), tl.begin(),
  550|    270|                   [](const NotARational<unsigned>& r) {
  551|    270|                     if (r.den == 0 || r.num % r.den != 0)
  552|    270|                       ThrowRDE("Error decoding default crop origin");
  553|    270|                     return r.num / r.den;
  554|    270|                   });
  555|       |
  556|    270|    if (iPoint2D cropOrigin(tl[0], tl[1]);
  557|    270|        cropped.isPointInsideInclusive(cropOrigin))
  ------------------
  |  Branch (557:9): [True: 15, False: 255]
  ------------------
  558|     15|      cropped = iRectangle2D(cropOrigin, {0, 0});
  559|       |
  560|    270|    cropped.dim = mRaw->dim - cropped.pos;
  561|       |
  562|    270|    const auto sz_r = size_entry->getRationalArray(2);
  563|    270|    std::array<unsigned, 2> sz;
  564|    270|    std::transform(sz_r.begin(), sz_r.end(), sz.begin(),
  565|    270|                   [](const NotARational<unsigned>& r) {
  566|    270|                     if (r.den == 0 || r.num % r.den != 0)
  567|    270|                       ThrowRDE("Error decoding default crop size");
  568|    270|                     return r.num / r.den;
  569|    270|                   });
  570|       |
  571|    270|    if (iPoint2D size(sz[0], sz[1]);
  572|    270|        size.isThisInside(mRaw->dim) &&
  ------------------
  |  Branch (572:9): [True: 74, False: 196]
  |  Branch (572:9): [True: 72, False: 198]
  ------------------
  573|     74|        (size + cropped.pos).isThisInside(mRaw->dim))
  ------------------
  |  Branch (573:9): [True: 72, False: 2]
  ------------------
  574|     72|      cropped.dim = size;
  575|       |
  576|    270|    mRaw->subFrame(cropped);
  577|    270|  }
  578|       |
  579|       |  // Adapt DNG DefaultScale to aspect-ratio
  580|  2.54k|  if (raw->hasEntry(TiffTag::DEFAULTSCALE)) {
  ------------------
  |  Branch (580:7): [True: 56, False: 2.48k]
  ------------------
  581|     56|    const TiffEntry* default_scale = raw->getEntry(TiffTag::DEFAULTSCALE);
  582|     56|    const auto scales = default_scale->getRationalArray(2);
  583|    110|    for (const auto& scale : scales) {
  ------------------
  |  Branch (583:28): [True: 110, False: 49]
  ------------------
  584|    110|      if (scale.num == 0 || scale.den == 0)
  ------------------
  |  Branch (584:11): [True: 2, False: 108]
  |  Branch (584:29): [True: 5, False: 103]
  ------------------
  585|    110|        ThrowRDE("Error decoding default pixel scale");
  ------------------
  |  |   38|      7|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      7|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      7|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      7|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  586|    110|    }
  587|     49|    mRaw->metadata.pixelAspectRatio =
  588|     49|        static_cast<double>(scales[0]) / static_cast<double>(scales[1]);
  589|     49|  }
  590|       |
  591|       |  // Apply stage 1 opcodes
  592|  2.53k|  if (applyStage1DngOpcodes && raw->hasEntry(TiffTag::OPCODELIST1)) {
  ------------------
  |  Branch (592:7): [True: 2.18k, False: 354]
  |  Branch (592:32): [True: 1.02k, False: 1.15k]
  ------------------
  593|  1.02k|    try {
  594|  1.02k|      const TiffEntry* opcodes = raw->getEntry(TiffTag::OPCODELIST1);
  595|       |      // The entry might exist, but it might be empty, which means no opcodes
  596|  1.02k|      if (opcodes->count > 0) {
  ------------------
  |  Branch (596:11): [True: 1.02k, False: 1]
  ------------------
  597|  1.02k|        DngOpcodes codes(mRaw, opcodes->getData());
  598|  1.02k|        codes.applyOpCodes(mRaw);
  599|  1.02k|      }
  600|  1.02k|    } catch (const RawDecoderException& e) {
  601|       |      // We push back errors from the opcode parser, since the image may still
  602|       |      // be usable
  603|    527|      mRaw->setError(e.what());
  604|    527|    }
  605|  1.02k|  }
  606|       |
  607|       |  // Linearization
  608|  2.53k|  if (raw->hasEntry(TiffTag::LINEARIZATIONTABLE) &&
  ------------------
  |  Branch (608:7): [True: 76, False: 2.32k]
  ------------------
  609|     76|      raw->getEntry(TiffTag::LINEARIZATIONTABLE)->count > 0) {
  ------------------
  |  Branch (609:7): [True: 75, False: 1]
  ------------------
  610|     75|    const TiffEntry* lintable = raw->getEntry(TiffTag::LINEARIZATIONTABLE);
  611|     75|    auto table = lintable->getU16Array(lintable->count);
  612|     75|    RawImageCurveGuard curveHandler(&mRaw, table, uncorrectedRawValues);
  613|     75|    if (!uncorrectedRawValues)
  ------------------
  |  Branch (613:9): [True: 66, False: 9]
  ------------------
  614|     66|      mRaw->sixteenBitLookup();
  615|     75|  }
  616|       |
  617|       |  // Set black
  618|  2.39k|  setBlack(raw);
  619|       |
  620|       |  // Apply opcodes to lossy DNG
  621|  2.39k|  if (compression == 0x884c && !uncorrectedRawValues &&
  ------------------
  |  Branch (621:7): [True: 0, False: 2.39k]
  |  Branch (621:32): [True: 0, False: 0]
  ------------------
  622|      0|      raw->hasEntry(TiffTag::OPCODELIST2)) {
  ------------------
  |  Branch (622:7): [True: 0, False: 0]
  ------------------
  623|       |    // We must apply black/white scaling
  624|      0|    mRaw->scaleBlackWhite();
  625|       |
  626|       |    // Apply stage 2 codes
  627|      0|    try {
  628|      0|      DngOpcodes codes(mRaw, raw->getEntry(TiffTag::OPCODELIST2)->getData());
  629|      0|      codes.applyOpCodes(mRaw);
  630|      0|    } catch (const RawDecoderException& e) {
  631|       |      // We push back errors from the opcode parser, since the image may still
  632|       |      // be usable
  633|      0|      mRaw->setError(e.what());
  634|      0|    }
  635|      0|    mRaw->blackAreas.clear();
  636|      0|    mRaw->blackLevel = 0;
  637|      0|    mRaw->blackLevelSeparate =
  638|      0|        Array2DRef(mRaw->blackLevelSeparateStorage.data(), 2, 2);
  639|      0|    auto blackLevelSeparate1D = *mRaw->blackLevelSeparate->getAsArray1DRef();
  640|      0|    std::fill(blackLevelSeparate1D.begin(), blackLevelSeparate1D.end(), 0);
  641|       |    // FIXME: why do we provide both the `blackLevel` and `blackLevelSeparate`?
  642|      0|    mRaw->whitePoint = 65535;
  643|      0|  }
  644|  2.39k|}
DngDecoder.cpp:_ZZN8rawspeed10DngDecoder14handleMetadataEPKNS_7TiffIFDEENK3$_0clERKNS_12NotARationalIjEE:
  550|    523|                   [](const NotARational<unsigned>& r) {
  551|    523|                     if (r.den == 0 || r.num % r.den != 0)
  ------------------
  |  Branch (551:26): [True: 2, False: 521]
  |  Branch (551:40): [True: 49, False: 472]
  ------------------
  552|    523|                       ThrowRDE("Error decoding default crop origin");
  ------------------
  |  |   38|     51|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     51|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     51|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     51|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  553|    472|                     return r.num / r.den;
  554|    523|                   });
DngDecoder.cpp:_ZZN8rawspeed10DngDecoder14handleMetadataEPKNS_7TiffIFDEENK3$_1clERKNS_12NotARationalIjEE:
  565|    389|                   [](const NotARational<unsigned>& r) {
  566|    389|                     if (r.den == 0 || r.num % r.den != 0)
  ------------------
  |  Branch (566:26): [True: 2, False: 387]
  |  Branch (566:40): [True: 21, False: 366]
  ------------------
  567|    389|                       ThrowRDE("Error decoding default crop size");
  ------------------
  |  |   38|     23|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     23|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     23|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     23|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  568|    366|                     return r.num / r.den;
  569|    389|                   });
_ZNK8rawspeed10DngDecoder17parseWhiteBalanceEv:
  646|  1.66k|void DngDecoder::parseWhiteBalance() const {
  647|       |  // Fetch the white balance
  648|  1.66k|  if (mRootIFD->hasEntryRecursive(TiffTag::ASSHOTNEUTRAL)) {
  ------------------
  |  Branch (648:7): [True: 55, False: 1.60k]
  ------------------
  649|     55|    const TiffEntry* as_shot_neutral =
  650|     55|        mRootIFD->getEntryRecursive(TiffTag::ASSHOTNEUTRAL);
  651|     55|    if (as_shot_neutral->count == 3) {
  ------------------
  |  Branch (651:9): [True: 43, False: 12]
  ------------------
  652|     43|      std::array<float, 4> wbCoeffs = {};
  653|    172|      for (uint32_t i = 0; i < 3; i++) {
  ------------------
  |  Branch (653:28): [True: 129, False: 43]
  ------------------
  654|    129|        float c = as_shot_neutral->getFloat(i);
  655|    129|        wbCoeffs[i] = (c > 0.0F) ? (1.0F / c) : 0.0F;
  ------------------
  |  Branch (655:23): [True: 71, False: 58]
  ------------------
  656|    129|      }
  657|     43|      mRaw->metadata.wbCoeffs = wbCoeffs;
  658|     43|    }
  659|     55|    return;
  660|     55|  }
  661|       |
  662|  1.60k|  if (!mRaw->metadata.colorMatrix.empty() &&
  ------------------
  |  Branch (662:7): [True: 19, False: 1.59k]
  ------------------
  663|     19|      mRootIFD->hasEntryRecursive(TiffTag::ASSHOTWHITEXY)) {
  ------------------
  |  Branch (663:7): [True: 10, False: 9]
  ------------------
  664|     10|    const TiffEntry* as_shot_white_xy =
  665|     10|        mRootIFD->getEntryRecursive(TiffTag::ASSHOTWHITEXY);
  666|     10|    assert(mRaw->metadata.colorMatrix.size() % 3 == 0);
  ------------------
  |  Branch (666:5): [True: 10, False: 0]
  ------------------
  667|     10|    const auto numColorPlanes = mRaw->metadata.colorMatrix.size() / 3;
  668|     10|    if (numColorPlanes == 3 && as_shot_white_xy->count == 2) {
  ------------------
  |  Branch (668:9): [True: 5, False: 5]
  |  Branch (668:32): [True: 4, False: 1]
  ------------------
  669|       |      // See http://www.brucelindbloom.com/index.html?Eqn_xyY_to_XYZ.html
  670|      4|      const float x = as_shot_white_xy->getFloat(0);
  671|      4|      const float y = as_shot_white_xy->getFloat(1);
  672|      4|      if (y > 0.0F) {
  ------------------
  |  Branch (672:11): [True: 3, False: 1]
  ------------------
  673|      3|        constexpr float Y = 1.0F;
  674|      3|        const std::array<float, 3> as_shot_white = {
  675|      3|            {x * Y / y, Y, (1 - x - y) * Y / y}};
  676|       |
  677|       |        // Convert from XYZ to camera reference values first
  678|      3|        std::array<float, 4> wbCoeffs = {};
  679|       |
  680|     12|        for (uint32_t i = 0; i < 3; i++) {
  ------------------
  |  Branch (680:30): [True: 9, False: 3]
  ------------------
  681|      9|          float c = (float(mRaw->metadata.colorMatrix[(i * 3) + 0]) *
  682|      9|                     as_shot_white[0]) +
  683|      9|                    (float(mRaw->metadata.colorMatrix[(i * 3) + 1]) *
  684|      9|                     as_shot_white[1]) +
  685|      9|                    (float(mRaw->metadata.colorMatrix[(i * 3) + 2]) *
  686|      9|                     as_shot_white[2]);
  687|      9|          wbCoeffs[i] = (c > 0.0F) ? (1.0F / c) : 0.0F;
  ------------------
  |  Branch (687:25): [True: 4, False: 5]
  ------------------
  688|      9|        }
  689|      3|        mRaw->metadata.wbCoeffs = wbCoeffs;
  690|      3|      }
  691|      4|    }
  692|     10|  }
  693|  1.60k|}
_ZN8rawspeed10DngDecoder22decodeMetaDataInternalEPKNS_14CameraMetaDataE:
  695|  1.70k|void DngDecoder::decodeMetaDataInternal(const CameraMetaData* meta) {
  696|  1.70k|  if (mRootIFD->hasEntryRecursive(TiffTag::ISOSPEEDRATINGS))
  ------------------
  |  Branch (696:7): [True: 10, False: 1.69k]
  ------------------
  697|     10|    mRaw->metadata.isoSpeed =
  698|     10|        mRootIFD->getEntryRecursive(TiffTag::ISOSPEEDRATINGS)->getU32();
  699|       |
  700|  1.70k|  TiffID id;
  701|       |
  702|  1.70k|  try {
  703|  1.70k|    id = mRootIFD->getID();
  704|  1.70k|  } catch (const RawspeedException& e) {
  705|  1.60k|    mRaw->setError(e.what());
  706|       |    // not all dngs have MAKE/MODEL entries,
  707|       |    // will be dealt with by using UNIQUECAMERAMODEL below
  708|  1.60k|  }
  709|       |
  710|       |  // Set the make and model
  711|  1.70k|  mRaw->metadata.make = id.make;
  712|  1.69k|  mRaw->metadata.model = id.model;
  713|       |
  714|  1.69k|  const Camera* cam = meta->getCamera(id.make, id.model, "dng");
  715|  1.69k|  if (!cam) // Also look for non-DNG cameras in case it's a converted file
  ------------------
  |  Branch (715:7): [True: 1.69k, False: 0]
  ------------------
  716|  1.69k|    cam = meta->getCamera(id.make, id.model, "");
  717|  1.69k|  if (!cam) // Worst case scenario, look for any such camera.
  ------------------
  |  Branch (717:7): [True: 1.69k, False: 0]
  ------------------
  718|  1.69k|    cam = meta->getCamera(id.make, id.model);
  719|  1.69k|  if (cam) {
  ------------------
  |  Branch (719:7): [True: 0, False: 1.69k]
  ------------------
  720|      0|    mRaw->metadata.canonical_make = cam->canonical_make;
  721|      0|    mRaw->metadata.canonical_model = cam->canonical_model;
  722|      0|    mRaw->metadata.canonical_alias = cam->canonical_alias;
  723|      0|    mRaw->metadata.canonical_id = cam->canonical_id;
  724|  1.69k|  } else {
  725|  1.69k|    mRaw->metadata.canonical_make = id.make;
  726|  1.69k|    mRaw->metadata.canonical_model = mRaw->metadata.canonical_alias = id.model;
  727|  1.69k|    if (mRootIFD->hasEntryRecursive(TiffTag::UNIQUECAMERAMODEL)) {
  ------------------
  |  Branch (727:9): [True: 16, False: 1.67k]
  ------------------
  728|     16|      mRaw->metadata.canonical_id =
  729|     16|          mRootIFD->getEntryRecursive(TiffTag::UNIQUECAMERAMODEL)->getString();
  730|  1.67k|    } else {
  731|  1.67k|      mRaw->metadata.canonical_id = id.make + " " + id.model;
  732|  1.67k|    }
  733|  1.69k|  }
  734|       |
  735|  1.69k|  parseColorMatrix();
  736|       |
  737|  1.69k|  parseWhiteBalance();
  738|  1.69k|}
_ZNK8rawspeed10DngDecoder17decodeMaskedAreasEPKNS_7TiffIFDE:
  762|    238|bool DngDecoder::decodeMaskedAreas(const TiffIFD* raw) const {
  763|    238|  const TiffEntry* masked = raw->getEntry(TiffTag::MASKEDAREAS);
  764|       |
  765|    238|  if (masked->type != TiffDataType::SHORT && masked->type != TiffDataType::LONG)
  ------------------
  |  Branch (765:7): [True: 168, False: 70]
  |  Branch (765:46): [True: 3, False: 165]
  ------------------
  766|      3|    return false;
  767|       |
  768|    235|  uint32_t nrects = masked->count / 4;
  769|    235|  if (0 == nrects)
  ------------------
  |  Branch (769:7): [True: 2, False: 233]
  ------------------
  770|      2|    return false;
  771|       |
  772|       |  /* Since we may both have short or int, copy it to int array. */
  773|    233|  auto rects = masked->getU32Array(nrects * 4);
  774|       |
  775|    233|  const iRectangle2D fullImage(0, 0, mRaw->getUncroppedDim().x,
  776|    233|                               mRaw->getUncroppedDim().y);
  777|    233|  const iPoint2D top = mRaw->getCropOffset();
  778|       |
  779|    813|  for (uint32_t i = 0; i < nrects; i++) {
  ------------------
  |  Branch (779:24): [True: 802, False: 11]
  ------------------
  780|    802|    iPoint2D topleft(rects[(i * 4UL) + 1UL], rects[i * 4UL]);
  781|    802|    iPoint2D bottomright(rects[(i * 4UL) + 3UL], rects[(i * 4UL) + 2UL]);
  782|       |
  783|    802|    if (!(fullImage.isPointInsideInclusive(topleft) &&
  ------------------
  |  Branch (783:11): [True: 688, False: 114]
  ------------------
  784|    688|          fullImage.isPointInsideInclusive(bottomright) &&
  ------------------
  |  Branch (784:11): [True: 589, False: 99]
  ------------------
  785|    589|          (topleft < bottomright)))
  ------------------
  |  Branch (785:11): [True: 580, False: 9]
  ------------------
  786|    802|      ThrowRDE("Bad masked area.");
  ------------------
  |  |   38|    222|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|    222|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|    222|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|    222|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  787|       |
  788|       |    // Is this a horizontal box, only add it if it covers the active width of
  789|       |    // the image
  790|    580|    if (topleft.x <= top.x && bottomright.x >= (mRaw->dim.x + top.x)) {
  ------------------
  |  Branch (790:9): [True: 493, False: 87]
  |  Branch (790:31): [True: 178, False: 315]
  ------------------
  791|    178|      mRaw->blackAreas.emplace_back(topleft.y, bottomright.y - topleft.y,
  792|    178|                                    false);
  793|    178|    }
  794|       |    // Is it a vertical box, only add it if it covers the active height of the
  795|       |    // image
  796|    402|    else if (topleft.y <= top.y && bottomright.y >= (mRaw->dim.y + top.y)) {
  ------------------
  |  Branch (796:14): [True: 301, False: 101]
  |  Branch (796:36): [True: 135, False: 166]
  ------------------
  797|    135|      mRaw->blackAreas.emplace_back(topleft.x, bottomright.x - topleft.x, true);
  798|    135|    }
  799|    580|  }
  800|     11|  return !mRaw->blackAreas.empty();
  801|    233|}
_ZNK8rawspeed10DngDecoder17decodeBlackLevelsEPKNS_7TiffIFDE:
  803|    318|bool DngDecoder::decodeBlackLevels(const TiffIFD* raw) const {
  804|    318|  iPoint2D blackdim(1, 1);
  805|    318|  if (raw->hasEntry(TiffTag::BLACKLEVELREPEATDIM)) {
  ------------------
  |  Branch (805:7): [True: 149, False: 169]
  ------------------
  806|    149|    const TiffEntry* bleveldim = raw->getEntry(TiffTag::BLACKLEVELREPEATDIM);
  807|    149|    if (bleveldim->count == 2)
  ------------------
  |  Branch (807:9): [True: 125, False: 24]
  ------------------
  808|    125|      blackdim = iPoint2D(bleveldim->getU32(0), bleveldim->getU32(1));
  809|     24|    else if (bleveldim->count == 1) {
  ------------------
  |  Branch (809:14): [True: 23, False: 1]
  ------------------
  810|       |      // Non-spec-compliant quirk. Assuming NxN repeat dimensions.
  811|     23|      blackdim = iPoint2D(bleveldim->getU32(0), bleveldim->getU32(0));
  812|       |      // Let's only allow somewhat unambiguous case of 1x1 repeat dimensions.
  813|     23|      if (blackdim != iPoint2D(1, 1))
  ------------------
  |  Branch (813:11): [True: 21, False: 2]
  ------------------
  814|     21|        return false;
  815|     23|    } else {
  816|      1|      return false;
  817|      1|    }
  818|    149|  }
  819|       |
  820|    296|  if (!blackdim.hasPositiveArea())
  ------------------
  |  Branch (820:7): [True: 41, False: 255]
  ------------------
  821|     41|    return false;
  822|       |
  823|    255|  if (!raw->hasEntry(TiffTag::BLACKLEVEL))
  ------------------
  |  Branch (823:7): [True: 0, False: 255]
  ------------------
  824|      0|    return true;
  825|       |
  826|    255|  if (mRaw->getCpp() != 1)
  ------------------
  |  Branch (826:7): [True: 2, False: 253]
  ------------------
  827|      2|    return false;
  828|       |
  829|    253|  const TiffEntry* black_entry = raw->getEntry(TiffTag::BLACKLEVEL);
  830|    253|  if (black_entry->count < blackdim.area())
  ------------------
  |  Branch (830:7): [True: 70, False: 183]
  ------------------
  831|    253|    ThrowRDE("BLACKLEVEL entry is too small");
  ------------------
  |  |   38|     70|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     70|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     70|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     70|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  832|       |
  833|    183|  using BlackType = decltype(mRaw->blackLevelSeparateStorage)::value_type;
  834|       |
  835|    183|  if (blackdim.x < 2 || blackdim.y < 2) {
  ------------------
  |  Branch (835:7): [True: 169, False: 14]
  |  Branch (835:25): [True: 1, False: 13]
  ------------------
  836|       |    // We so not have enough to fill all individually, read a single and copy it
  837|    170|    float value = black_entry->getFloat();
  838|       |
  839|    170|    if (static_cast<double>(value) < std::numeric_limits<BlackType>::min() ||
  ------------------
  |  Branch (839:9): [True: 8, False: 162]
  ------------------
  840|    162|        static_cast<double>(value) > std::numeric_limits<BlackType>::max())
  ------------------
  |  Branch (840:9): [True: 1, False: 161]
  ------------------
  841|    170|      ThrowRDE("Error decoding black level");
  ------------------
  |  |   38|      3|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      3|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      3|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      3|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  842|       |
  843|    167|    mRaw->blackLevelSeparate =
  844|    167|        Array2DRef(mRaw->blackLevelSeparateStorage.data(), 2, 2);
  845|    167|    auto blackLevelSeparate1D = *mRaw->blackLevelSeparate->getAsArray1DRef();
  846|    489|    for (int y = 0; y < 2; y++) {
  ------------------
  |  Branch (846:21): [True: 322, False: 167]
  ------------------
  847|    966|      for (int x = 0; x < 2; x++)
  ------------------
  |  Branch (847:23): [True: 644, False: 322]
  ------------------
  848|    644|        blackLevelSeparate1D((y * 2) + x) = implicit_cast<int>(value);
  849|    322|    }
  850|    167|  } else {
  851|     13|    mRaw->blackLevelSeparate =
  852|     13|        Array2DRef(mRaw->blackLevelSeparateStorage.data(), 2, 2);
  853|     13|    auto blackLevelSeparate1D = *mRaw->blackLevelSeparate->getAsArray1DRef();
  854|     25|    for (int y = 0; y < 2; y++) {
  ------------------
  |  Branch (854:21): [True: 21, False: 4]
  ------------------
  855|     50|      for (int x = 0; x < 2; x++) {
  ------------------
  |  Branch (855:23): [True: 38, False: 12]
  ------------------
  856|     38|        float value = black_entry->getFloat((y * blackdim.x) + x);
  857|       |
  858|     38|        if (static_cast<double>(value) <
  ------------------
  |  Branch (858:13): [True: 5, False: 33]
  ------------------
  859|     38|                std::numeric_limits<BlackType>::min() ||
  860|     33|            static_cast<double>(value) > std::numeric_limits<BlackType>::max())
  ------------------
  |  Branch (860:13): [True: 4, False: 29]
  ------------------
  861|     38|          ThrowRDE("Error decoding black level");
  ------------------
  |  |   38|      9|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      9|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      9|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      9|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  862|       |
  863|     29|        blackLevelSeparate1D((y * 2) + x) = implicit_cast<int>(value);
  864|     29|      }
  865|     21|    }
  866|     13|  }
  867|       |
  868|       |  // DNG Spec says we must add black in deltav and deltah
  869|    171|  if (raw->hasEntry(TiffTag::BLACKLEVELDELTAV)) {
  ------------------
  |  Branch (869:7): [True: 29, False: 142]
  ------------------
  870|     29|    const TiffEntry* blackleveldeltav =
  871|     29|        raw->getEntry(TiffTag::BLACKLEVELDELTAV);
  872|     29|    if (static_cast<int>(blackleveldeltav->count) < mRaw->dim.y)
  ------------------
  |  Branch (872:9): [True: 1, False: 28]
  ------------------
  873|     29|      ThrowRDE("BLACKLEVELDELTAV array is too small");
  ------------------
  |  |   38|      1|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      1|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      1|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      1|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  874|     28|    std::array<float, 2> black_sum = {{}};
  875|  1.34k|    for (int i = 0; i < mRaw->dim.y; i++)
  ------------------
  |  Branch (875:21): [True: 1.31k, False: 28]
  ------------------
  876|  1.31k|      black_sum[i & 1] += blackleveldeltav->getFloat(i);
  877|       |
  878|     28|    auto blackLevelSeparate1D = *mRaw->blackLevelSeparate->getAsArray1DRef();
  879|    110|    for (int i = 0; i < 4; i++) {
  ------------------
  |  Branch (879:21): [True: 91, False: 19]
  ------------------
  880|     91|      const float value =
  881|     91|          black_sum[i >> 1] / static_cast<float>(mRaw->dim.y) * 2.0F;
  882|     91|      if (static_cast<double>(value) < std::numeric_limits<BlackType>::min() ||
  ------------------
  |  Branch (882:11): [True: 4, False: 87]
  ------------------
  883|     87|          static_cast<double>(value) > std::numeric_limits<BlackType>::max())
  ------------------
  |  Branch (883:11): [True: 2, False: 85]
  ------------------
  884|     91|        ThrowRDE("Error decoding black level");
  ------------------
  |  |   38|      6|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      6|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      6|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      6|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  885|       |
  886|     85|      if (__builtin_sadd_overflow(blackLevelSeparate1D(i),
  ------------------
  |  Branch (886:11): [True: 3, False: 82]
  ------------------
  887|     85|                                  implicit_cast<int>(value),
  888|     85|                                  &blackLevelSeparate1D(i)))
  889|     85|        ThrowRDE("Integer overflow when calculating black level");
  ------------------
  |  |   38|      3|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      3|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      3|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      3|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  890|     85|    }
  891|     28|  }
  892|       |
  893|    161|  if (raw->hasEntry(TiffTag::BLACKLEVELDELTAH)) {
  ------------------
  |  Branch (893:7): [True: 95, False: 66]
  ------------------
  894|     95|    const TiffEntry* blackleveldeltah =
  895|     95|        raw->getEntry(TiffTag::BLACKLEVELDELTAH);
  896|     95|    if (static_cast<int>(blackleveldeltah->count) < mRaw->dim.x)
  ------------------
  |  Branch (896:9): [True: 2, False: 93]
  ------------------
  897|     95|      ThrowRDE("BLACKLEVELDELTAH array is too small");
  ------------------
  |  |   38|      2|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      2|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      2|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      2|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  898|     93|    std::array<float, 2> black_sum = {{}};
  899|  3.64k|    for (int i = 0; i < mRaw->dim.x; i++)
  ------------------
  |  Branch (899:21): [True: 3.54k, False: 93]
  ------------------
  900|  3.54k|      black_sum[i & 1] += blackleveldeltah->getFloat(i);
  901|       |
  902|     93|    auto blackLevelSeparate1D = *mRaw->blackLevelSeparate->getAsArray1DRef();
  903|    422|    for (int i = 0; i < 4; i++) {
  ------------------
  |  Branch (903:21): [True: 341, False: 81]
  ------------------
  904|    341|      const float value =
  905|    341|          black_sum[i & 1] / static_cast<float>(mRaw->dim.x) * 2.0F;
  906|    341|      if (static_cast<double>(value) < std::numeric_limits<BlackType>::min() ||
  ------------------
  |  Branch (906:11): [True: 3, False: 338]
  ------------------
  907|    338|          static_cast<double>(value) > std::numeric_limits<BlackType>::max())
  ------------------
  |  Branch (907:11): [True: 4, False: 334]
  ------------------
  908|    341|        ThrowRDE("Error decoding black level");
  ------------------
  |  |   38|      7|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      7|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      7|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      7|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  909|       |
  910|    334|      if (__builtin_sadd_overflow(blackLevelSeparate1D(i),
  ------------------
  |  Branch (910:11): [True: 5, False: 329]
  ------------------
  911|    334|                                  implicit_cast<int>(value),
  912|    334|                                  &blackLevelSeparate1D(i)))
  913|    334|        ThrowRDE("Integer overflow when calculating black level");
  ------------------
  |  |   38|      5|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      5|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      5|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      5|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  914|    334|    }
  915|     93|  }
  916|    147|  return true;
  917|    161|}
_ZNK8rawspeed10DngDecoder8setBlackEPKNS_7TiffIFDE:
  919|  2.03k|void DngDecoder::setBlack(const TiffIFD* raw) const {
  920|       |
  921|  2.03k|  if (raw->hasEntry(TiffTag::MASKEDAREAS) && decodeMaskedAreas(raw))
  ------------------
  |  Branch (921:7): [True: 238, False: 1.79k]
  |  Branch (921:46): [True: 7, False: 231]
  ------------------
  922|      7|    return;
  923|       |
  924|       |  // Black defaults to 0
  925|       |  // FIXME: is this the right thing to do?
  926|  2.02k|  mRaw->blackLevelSeparate =
  927|  2.02k|      Array2DRef(mRaw->blackLevelSeparateStorage.data(), 2, 2);
  928|  2.02k|  auto blackLevelSeparate1D = *mRaw->blackLevelSeparate->getAsArray1DRef();
  929|  2.02k|  std::fill(blackLevelSeparate1D.begin(), blackLevelSeparate1D.end(), 0);
  930|       |
  931|  2.02k|  if (raw->hasEntry(TiffTag::BLACKLEVEL))
  ------------------
  |  Branch (931:7): [True: 318, False: 1.71k]
  ------------------
  932|    318|    decodeBlackLevels(raw);
  933|  2.02k|}

_ZN8rawspeed10ErfDecoder20isAppropriateDecoderEPKNS_11TiffRootIFDENS_6BufferE:
   44|    742|                                      [[maybe_unused]] Buffer file) {
   45|    742|  const auto id = rootIFD->getID();
   46|    742|  const std::string& make = id.make;
   47|       |
   48|       |  // FIXME: magic
   49|       |
   50|    742|  return make == "SEIKO EPSON CORP.";
   51|    742|}
_ZN8rawspeed10ErfDecoder20checkImageDimensionsEv:
   53|     50|void ErfDecoder::checkImageDimensions() {
   54|     50|  if (width > 3040 || height > 2024)
  ------------------
  |  Branch (54:7): [True: 19, False: 31]
  |  Branch (54:23): [True: 6, False: 25]
  ------------------
   55|     50|    ThrowRDE("Unexpected image dimensions found: (%u; %u)", width, height);
  ------------------
  |  |   38|     25|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     25|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     25|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     25|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   56|     50|}
_ZN8rawspeed10ErfDecoder17decodeRawInternalEv:
   58|     53|RawImage ErfDecoder::decodeRawInternal() {
   59|     53|  SimpleTiffDecoder::prepareForRawDecoding();
   60|       |
   61|     53|  UncompressedDecompressor u(
   62|     53|      ByteStream(DataBuffer(mFile.getSubView(off, c2), Endianness::little)),
   63|     53|      mRaw, iRectangle2D({0, 0}, iPoint2D(width, height)),
   64|     53|      (12 * width / 8) + ((width + 2) / 10), 12, BitOrder::MSB);
   65|     53|  mRaw->createData();
   66|       |
   67|     53|  u.decode12BitRawWithControl<Endianness::big>();
   68|       |
   69|     53|  return mRaw;
   70|     53|}
_ZN8rawspeed10ErfDecoder22decodeMetaDataInternalEPKNS_14CameraMetaDataE:
   72|     22|void ErfDecoder::decodeMetaDataInternal(const CameraMetaData* meta) {
   73|     22|  setMetaData(meta, "", 0);
   74|       |
   75|     22|  if (mRootIFD->hasEntryRecursive(TiffTag::EPSONWB)) {
  ------------------
  |  Branch (75:7): [True: 3, False: 19]
  ------------------
   76|      3|    const TiffEntry* wb = mRootIFD->getEntryRecursive(TiffTag::EPSONWB);
   77|      3|    if (wb->count == 256) {
  ------------------
  |  Branch (77:9): [True: 0, False: 3]
  ------------------
   78|       |      // Magic values taken directly from dcraw
   79|      0|      std::array<float, 4> wbCoeffs = {};
   80|      0|      wbCoeffs[0] = static_cast<float>(wb->getU16(24)) * 508.0F * 1.078F /
   81|      0|                    static_cast<float>(0x10000);
   82|      0|      wbCoeffs[1] = 1.0F;
   83|      0|      wbCoeffs[2] = static_cast<float>(wb->getU16(25)) * 382.0F * 1.173F /
   84|      0|                    static_cast<float>(0x10000);
   85|      0|      mRaw->metadata.wbCoeffs = wbCoeffs;
   86|      0|    }
   87|      3|  }
   88|     22|}

_ZN8rawspeed10ErfDecoderC2EONSt3__110unique_ptrINS_11TiffRootIFDENS1_14default_deleteIS3_EEEENS_6BufferE:
   41|     53|      : SimpleTiffDecoder(std::move(root), file) {}

_ZN8rawspeed10IiqDecoder20isAppropriateDecoderENS_6BufferE:
   59|  8.23k|bool IiqDecoder::isAppropriateDecoder(Buffer file) {
   60|  8.23k|  const DataBuffer db(file, Endianness::little);
   61|       |
   62|       |  // The IIQ magic. Is present for all IIQ raws.
   63|  8.23k|  return db.get<uint32_t>(8) == 0x49494949;
   64|  8.23k|}
_ZN8rawspeed10IiqDecoder20isAppropriateDecoderEPKNS_11TiffRootIFDENS_6BufferE:
   66|  8.26k|bool IiqDecoder::isAppropriateDecoder(const TiffRootIFD* rootIFD, Buffer file) {
   67|  8.26k|  const auto id = rootIFD->getID();
   68|  8.26k|  const std::string& make = id.make;
   69|       |
   70|  8.26k|  return IiqDecoder::isAppropriateDecoder(file) &&
  ------------------
  |  Branch (70:10): [True: 1.20k, False: 7.05k]
  ------------------
   71|  1.20k|         (make == "Phase One A/S" || make == "Phase One" || make == "Leaf");
  ------------------
  |  Branch (71:11): [True: 53, False: 1.15k]
  |  Branch (71:38): [True: 946, False: 210]
  |  Branch (71:61): [True: 159, False: 51]
  ------------------
   72|  8.26k|}
_ZN8rawspeed10IiqDecoder13computeSripesENS_6BufferENSt3__16vectorINS0_9IiqOffsetENS2_9allocatorIS4_EEEEj:
   77|    870|                          uint32_t height) {
   78|    870|  assert(height > 0);
  ------------------
  |  Branch (78:3): [True: 870, False: 0]
  ------------------
   79|    870|  assert(offsets.size() == (1 + height));
  ------------------
  |  Branch (79:3): [True: 870, False: 0]
  ------------------
   80|       |
   81|    870|  ByteStream bs(DataBuffer(raw_data, Endianness::little));
   82|       |
   83|       |  // so... here's the thing. offsets are not guaranteed to be in
   84|       |  // monotonically increasing order. so for each element of 'offsets',
   85|       |  // we need to find element which specifies next larger offset.
   86|       |  // and only then by subtracting those two offsets we get the slice size.
   87|       |
   88|    870|  std::sort(offsets.begin(), offsets.end(),
   89|    870|            [](const IiqOffset& a, const IiqOffset& b) {
   90|    870|              if (a.offset == b.offset && &a != &b)
   91|    870|                ThrowRDE("Two identical offsets found. Corrupt raw.");
   92|    870|              return a.offset < b.offset;
   93|    870|            });
   94|       |
   95|    870|  std::vector<PhaseOneStrip> slices;
   96|    870|  slices.reserve(height);
   97|       |
   98|    870|  auto offset_iterator = std::begin(offsets);
   99|    870|  bs.skipBytes(offset_iterator->offset);
  100|       |
  101|    870|  auto next_offset_iterator = std::next(offset_iterator);
  102|  4.77k|  while (next_offset_iterator < std::end(offsets)) {
  ------------------
  |  Branch (102:10): [True: 3.90k, False: 870]
  ------------------
  103|  3.90k|    assert(next_offset_iterator->offset > offset_iterator->offset);
  ------------------
  |  Branch (103:5): [True: 3.90k, False: 0]
  ------------------
  104|  3.90k|    const auto size = next_offset_iterator->offset - offset_iterator->offset;
  105|  3.90k|    assert(size > 0);
  ------------------
  |  Branch (105:5): [True: 3.90k, False: 0]
  ------------------
  106|       |
  107|  3.90k|    slices.emplace_back(offset_iterator->n, bs.getStream(size));
  108|       |
  109|  3.90k|    std::advance(offset_iterator, 1);
  110|  3.90k|    std::advance(next_offset_iterator, 1);
  111|  3.90k|  }
  112|       |
  113|    870|  assert(slices.size() == height);
  ------------------
  |  Branch (113:3): [True: 488, False: 382]
  ------------------
  114|       |
  115|    488|  return slices;
  116|    870|}
IiqDecoder.cpp:_ZZN8rawspeed10IiqDecoder13computeSripesENS_6BufferENSt3__16vectorINS0_9IiqOffsetENS2_9allocatorIS4_EEEEjENK3$_0clERKS4_SA_:
   89|  1.06M|            [](const IiqOffset& a, const IiqOffset& b) {
   90|  1.06M|              if (a.offset == b.offset && &a != &b)
  ------------------
  |  Branch (90:19): [True: 151, False: 1.06M]
  |  Branch (90:43): [True: 151, False: 0]
  ------------------
   91|  1.06M|                ThrowRDE("Two identical offsets found. Corrupt raw.");
  ------------------
  |  |   38|    151|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|    151|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|    151|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|    151|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   92|  1.06M|              return a.offset < b.offset;
   93|  1.06M|            });
_ZN8rawspeed10IiqDecoder17decodeRawInternalEv:
  154|  1.15k|RawImage IiqDecoder::decodeRawInternal() {
  155|  1.15k|  const Buffer buf(mFile.getSubView(8));
  156|  1.15k|  const DataBuffer db(buf, Endianness::little);
  157|  1.15k|  ByteStream bs(db);
  158|       |
  159|  1.15k|  bs.skipBytes(4); // Phase One magic
  160|  1.15k|  bs.skipBytes(4); // padding?
  161|       |
  162|  1.15k|  const auto origPos = bs.getPosition();
  163|       |
  164|  1.15k|  const uint32_t entries_offset = bs.getU32();
  165|       |
  166|  1.15k|  bs.setPosition(entries_offset);
  167|       |
  168|  1.15k|  const uint32_t entries_count = bs.getU32();
  169|  1.15k|  bs.skipBytes(4); // ???
  170|       |
  171|       |  // this is how much is to be read for all the entries
  172|  1.15k|  ByteStream es(bs.getStream(entries_count, 16));
  173|       |
  174|  1.15k|  bs.setPosition(origPos);
  175|       |
  176|  1.15k|  uint32_t width = 0;
  177|  1.15k|  uint32_t height = 0;
  178|  1.15k|  uint32_t split_row = 0;
  179|  1.15k|  uint32_t split_col = 0;
  180|       |
  181|  1.15k|  Optional<IIQFormat> format;
  182|  1.15k|  Optional<Buffer> raw_data;
  183|  1.15k|  ByteStream block_offsets;
  184|  1.15k|  ByteStream wb;
  185|  1.15k|  ByteStream correction_meta_data;
  186|       |
  187|   142k|  for (uint32_t entry = 0; entry < entries_count; entry++) {
  ------------------
  |  Branch (187:28): [True: 140k, False: 1.09k]
  ------------------
  188|   140k|    const uint32_t tag = es.getU32();
  189|   140k|    es.skipBytes(4); // type
  190|   140k|    const uint32_t len = es.getU32();
  191|   140k|    const uint32_t data = es.getU32();
  192|       |
  193|   140k|    switch (tag) {
  194|     21|    case 0x107:
  ------------------
  |  Branch (194:5): [True: 21, False: 140k]
  ------------------
  195|     21|      wb = bs.getSubStream(data, len);
  196|     21|      break;
  197|  1.58k|    case 0x108:
  ------------------
  |  Branch (197:5): [True: 1.58k, False: 139k]
  ------------------
  198|  1.58k|      width = data;
  199|  1.58k|      break;
  200|  1.50k|    case 0x109:
  ------------------
  |  Branch (200:5): [True: 1.50k, False: 139k]
  ------------------
  201|  1.50k|      height = data;
  202|  1.50k|      break;
  203|    960|    case 0x10e: // RawFormat
  ------------------
  |  Branch (203:5): [True: 960, False: 140k]
  ------------------
  204|    960|      if (format)
  ------------------
  |  Branch (204:11): [True: 2, False: 958]
  ------------------
  205|    960|        ThrowRDE("Duplicate RawFormat tag.");
  ------------------
  |  |   38|      2|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      2|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      2|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      2|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  206|    958|      format = getAsIIQFormat(data);
  207|    958|      if (!format || *format != IIQFormat::IIQ_L)
  ------------------
  |  Branch (207:11): [True: 27, False: 931]
  |  Branch (207:22): [True: 0, False: 931]
  ------------------
  208|    958|        ThrowRDE("Unsupported RawFormat: %u", data);
  ------------------
  |  |   38|     27|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     27|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     27|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     27|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  209|    931|      break;
  210|  1.10k|    case 0x10f:
  ------------------
  |  Branch (210:5): [True: 1.10k, False: 139k]
  ------------------
  211|  1.10k|      raw_data = bs.getSubView(data, len);
  212|  1.10k|      break;
  213|    647|    case 0x110:
  ------------------
  |  Branch (213:5): [True: 647, False: 140k]
  ------------------
  214|    647|      correction_meta_data = bs.getSubStream(data);
  215|    647|      break;
  216|  1.32k|    case 0x21c:
  ------------------
  |  Branch (216:5): [True: 1.32k, False: 139k]
  ------------------
  217|       |      // they are not guaranteed to be sequential!
  218|  1.32k|      block_offsets = bs.getSubStream(data, len);
  219|  1.32k|      break;
  220|    143|    case 0x21d:
  ------------------
  |  Branch (220:5): [True: 143, False: 140k]
  ------------------
  221|       |      // 16-bit black level adapted to 14-bit raw data (IIQFormat::IIQ_L)
  222|    143|      black_level = data >> 2;
  223|    143|      break;
  224|    189|    case 0x222:
  ------------------
  |  Branch (224:5): [True: 189, False: 140k]
  ------------------
  225|    189|      split_col = data;
  226|    189|      break;
  227|    121|    case 0x224:
  ------------------
  |  Branch (227:5): [True: 121, False: 140k]
  ------------------
  228|    121|      split_row = data;
  229|    121|      break;
  230|   133k|    default:
  ------------------
  |  Branch (230:5): [True: 133k, False: 7.59k]
  ------------------
  231|       |      // FIXME: is there a "block_sizes" entry?
  232|   133k|      break;
  233|   140k|    }
  234|   140k|  }
  235|       |
  236|       |  // FIXME: could be wrong. max "active pixels" in "Sensor+" mode - "101 MP"
  237|  1.09k|  if (width == 0 || height == 0 || width > 11976 || height > 8854)
  ------------------
  |  Branch (237:7): [True: 85, False: 1.01k]
  |  Branch (237:21): [True: 44, False: 968]
  |  Branch (237:36): [True: 8, False: 960]
  |  Branch (237:53): [True: 44, False: 916]
  ------------------
  238|  1.09k|    ThrowRDE("Unexpected image dimensions found: (%u; %u)", width, height);
  ------------------
  |  |   38|    152|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|    152|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|    152|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|    152|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  239|       |
  240|    945|  if (!format)
  ------------------
  |  Branch (240:7): [True: 9, False: 936]
  ------------------
  241|    945|    ThrowRDE("Unspecified RawFormat");
  ------------------
  |  |   38|      9|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      9|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      9|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      9|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  242|       |
  243|    936|  if (!raw_data)
  ------------------
  |  Branch (243:7): [True: 2, False: 934]
  ------------------
  244|    936|    ThrowRDE("No raw data found");
  ------------------
  |  |   38|      2|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      2|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      2|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      2|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  245|       |
  246|    934|  if (split_col > width || split_row > height)
  ------------------
  |  Branch (246:7): [True: 58, False: 876]
  |  Branch (246:28): [True: 3, False: 873]
  ------------------
  247|    934|    ThrowRDE("Invalid sensor quadrant split values (%u, %u)", split_row,
  ------------------
  |  |   38|     32|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     32|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     32|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     32|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  248|    902|             split_col);
  249|       |
  250|    902|  block_offsets = block_offsets.getStream(height, sizeof(uint32_t));
  251|       |
  252|    902|  std::vector<IiqOffset> offsets;
  253|    902|  offsets.reserve(1 + height);
  254|       |
  255|   105k|  for (uint32_t row = 0; row < height; row++)
  ------------------
  |  Branch (255:26): [True: 104k, False: 902]
  ------------------
  256|   104k|    offsets.emplace_back(row, block_offsets.getU32());
  257|       |
  258|       |  // to simplify slice size calculation, we insert a dummy offset,
  259|       |  // which will be used much like end()
  260|    902|  offsets.emplace_back(height, raw_data->getSize());
  261|       |
  262|    902|  std::vector<PhaseOneStrip> strips(
  263|    902|      computeSripes(*raw_data, std::move(offsets), height));
  264|       |
  265|    902|  mRaw->dim = iPoint2D(width, height);
  266|       |
  267|    902|  PhaseOneDecompressor p(mRaw, std::move(strips));
  268|    902|  mRaw->createData();
  269|    902|  p.decompress();
  270|       |
  271|    902|  if (correction_meta_data.getSize() != 0 && iiq)
  ------------------
  |  Branch (271:7): [True: 326, False: 576]
  |  Branch (271:46): [True: 326, False: 0]
  ------------------
  272|    326|    CorrectPhaseOneC(correction_meta_data, split_row, split_col);
  273|       |
  274|    902|  std::array<float, 4> wbCoeffs = {};
  275|  1.02k|  for (int i = 0; i < 3; i++)
  ------------------
  |  Branch (275:19): [True: 127, False: 902]
  ------------------
  276|    127|    wbCoeffs[i] = wb.getFloat();
  277|    902|  mRaw->metadata.wbCoeffs = wbCoeffs;
  278|       |
  279|    902|  return mRaw;
  280|    934|}
IiqDecoder.cpp:_ZN8rawspeed12_GLOBAL__N_114getAsIIQFormatEj:
  130|    958|Optional<IIQFormat> getAsIIQFormat(uint32_t v) {
  131|    958|  switch (v) {
  132|      0|    using enum IIQFormat;
  133|      0|  case 1:
  ------------------
  |  Branch (133:3): [True: 0, False: 958]
  ------------------
  134|      0|    return RAW_1;
  135|      0|  case 2:
  ------------------
  |  Branch (135:3): [True: 0, False: 958]
  ------------------
  136|      0|    return RAW_2;
  137|    931|  case 3:
  ------------------
  |  Branch (137:3): [True: 931, False: 27]
  ------------------
  138|    931|    return IIQ_L;
  139|      0|  case 5:
  ------------------
  |  Branch (139:3): [True: 0, False: 958]
  ------------------
  140|      0|    return IIQ_S;
  141|      0|  case 6:
  ------------------
  |  Branch (141:3): [True: 0, False: 958]
  ------------------
  142|      0|    return IIQ_Sv2;
  143|      0|  case 8:
  ------------------
  |  Branch (143:3): [True: 0, False: 958]
  ------------------
  144|      0|    return IIQ_L16;
  145|     27|  default:
  ------------------
  |  Branch (145:3): [True: 27, False: 931]
  ------------------
  146|     27|    return std::nullopt;
  147|    958|  }
  148|    958|}
_ZNK8rawspeed10IiqDecoder16CorrectPhaseOneCENS_10ByteStreamEjj:
  283|    326|                                  uint32_t split_col) const {
  284|    326|  meta_data.skipBytes(8);
  285|    326|  const uint32_t bytes_to_entries = meta_data.getU32();
  286|    326|  meta_data.setPosition(bytes_to_entries);
  287|    326|  const uint32_t entries_count = meta_data.getU32();
  288|    326|  meta_data.skipBytes(4);
  289|       |
  290|       |  // this is how much is to be read for all the entries
  291|    326|  ByteStream entries(meta_data.getStream(entries_count, 12));
  292|    326|  meta_data.setPosition(0);
  293|       |
  294|    326|  bool QuadrantMultipliersSeen = false;
  295|    326|  bool SensorDefectsSeen = false;
  296|       |
  297|  24.6k|  for (uint32_t entry = 0; entry < entries_count; entry++) {
  ------------------
  |  Branch (297:28): [True: 24.5k, False: 103]
  ------------------
  298|  24.5k|    const uint32_t tag = entries.getU32();
  299|  24.5k|    const uint32_t len = entries.getU32();
  300|  24.5k|    const uint32_t offset = entries.getU32();
  301|       |
  302|  24.5k|    switch (tag) {
  303|     61|    case 0x400: // Sensor Defects
  ------------------
  |  Branch (303:5): [True: 61, False: 24.4k]
  ------------------
  304|     61|      if (SensorDefectsSeen)
  ------------------
  |  Branch (304:11): [True: 2, False: 59]
  ------------------
  305|     61|        ThrowRDE("Second sensor defects entry seen. Unexpected.");
  ------------------
  |  |   38|      2|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      2|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      2|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      2|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  306|     59|      correctSensorDefects(meta_data.getSubStream(offset, len));
  307|     59|      SensorDefectsSeen = true;
  308|     59|      break;
  309|    216|    case 0x40b: // Chroma calibration
  ------------------
  |  Branch (309:5): [True: 216, False: 24.3k]
  ------------------
  310|    216|      PhaseOneFlatField(meta_data.getSubStream(offset, len), IiqCorr::CHROMA);
  311|    216|      break;
  312|    311|    case 0x410: // Luma calibration
  ------------------
  |  Branch (312:5): [True: 311, False: 24.2k]
  ------------------
  313|    311|      PhaseOneFlatField(meta_data.getSubStream(offset, len), IiqCorr::LUMA);
  314|    311|      break;
  315|    151|    case 0x431:
  ------------------
  |  Branch (315:5): [True: 151, False: 24.3k]
  ------------------
  316|    151|      if (QuadrantMultipliersSeen)
  ------------------
  |  Branch (316:11): [True: 5, False: 146]
  ------------------
  317|    151|        ThrowRDE("Second quadrant multipliers entry seen. Unexpected.");
  ------------------
  |  |   38|      5|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      5|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      5|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      5|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  318|    146|      if (iiq.quadrantMultipliers)
  ------------------
  |  Branch (318:11): [True: 146, False: 0]
  ------------------
  319|    146|        CorrectQuadrantMultipliersCombined(meta_data.getSubStream(offset, len),
  320|    146|                                           split_row, split_col);
  321|    146|      QuadrantMultipliersSeen = true;
  322|    146|      break;
  323|  23.7k|    default:
  ------------------
  |  Branch (323:5): [True: 23.7k, False: 739]
  ------------------
  324|  23.7k|      break;
  325|  24.5k|    }
  326|  24.5k|  }
  327|    326|}
_ZNK8rawspeed10IiqDecoder34CorrectQuadrantMultipliersCombinedENS_10ByteStreamEjj:
  339|    146|                                                    uint32_t split_col) const {
  340|    146|  std::array<uint32_t, 9> shared_x_coords;
  341|       |
  342|       |  // Read the middle seven points from the file
  343|    146|  std::generate_n(std::next(shared_x_coords.begin()), 7,
  344|    146|                  [&data] { return data.getU32(); });
  345|       |
  346|       |  // All the curves include (0, 0) and (65535, 65535),
  347|       |  // so the first and last points are predefined
  348|    146|  shared_x_coords.front() = 0;
  349|    146|  shared_x_coords.back() = 65535;
  350|       |
  351|       |  // Check that the middle coordinates make sense.
  352|    146|  if (std::adjacent_find(shared_x_coords.cbegin(), shared_x_coords.cend(),
  ------------------
  |  Branch (352:7): [True: 107, False: 39]
  ------------------
  353|    146|                         std::greater_equal<>()) != shared_x_coords.cend())
  354|    146|    ThrowRDE("The X coordinates must all be strictly increasing");
  ------------------
  |  |   38|    107|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|    107|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|    107|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|    107|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  355|       |
  356|     39|  std::array<std::array<std::vector<iPoint2D>, 2>, 2> control_points;
  357|     64|  for (auto& quadRow : control_points) {
  ------------------
  |  Branch (357:22): [True: 64, False: 22]
  ------------------
  358|    115|    for (auto& quadrant : quadRow) {
  ------------------
  |  Branch (358:25): [True: 115, False: 47]
  ------------------
  359|    115|      quadrant.reserve(9);
  360|    115|      quadrant.emplace_back(0, 0);
  361|       |
  362|    838|      for (int i = 1; i < 8; i++) {
  ------------------
  |  Branch (362:23): [True: 739, False: 99]
  ------------------
  363|       |        // These multipliers are expressed in ten-thousandths in the
  364|       |        // file
  365|    739|        const uint64_t y_coord =
  366|    739|            (uint64_t(data.getU32()) * shared_x_coords[i]) / 10000ULL;
  367|    739|        if (y_coord > 65535)
  ------------------
  |  Branch (367:13): [True: 16, False: 723]
  ------------------
  368|    739|          ThrowRDE("The Y coordinate %" PRIu64 " is too large", y_coord);
  ------------------
  |  |   38|     16|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     16|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     16|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     16|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  369|    723|        quadrant.emplace_back(shared_x_coords[i], y_coord);
  370|    723|      }
  371|       |
  372|     99|      quadrant.emplace_back(65535, 65535);
  373|     99|      assert(quadrant.size() == 9);
  ------------------
  |  Branch (373:7): [True: 98, False: 1]
  ------------------
  374|     99|    }
  375|     64|  }
  376|       |
  377|     66|  for (int quadRow = 0; quadRow < 2; quadRow++) {
  ------------------
  |  Branch (377:25): [True: 44, False: 22]
  ------------------
  378|    132|    for (int quadCol = 0; quadCol < 2; quadCol++) {
  ------------------
  |  Branch (378:27): [True: 88, False: 44]
  ------------------
  379|     88|      const Array2DRef<uint16_t> img(mRaw->getU16DataAsUncroppedArray2DRef());
  380|       |
  381|     88|      const Spline<> s(control_points[quadRow][quadCol]);
  382|     88|      const std::vector<uint16_t> curve = s.calculateCurve();
  383|       |
  384|     88|      int row_start = quadRow == 0 ? 0 : split_row;
  ------------------
  |  Branch (384:23): [True: 44, False: 44]
  ------------------
  385|     88|      int row_end = quadRow == 0 ? split_row : img.height();
  ------------------
  |  Branch (385:21): [True: 44, False: 44]
  ------------------
  386|     88|      int col_start = quadCol == 0 ? 0 : split_col;
  ------------------
  |  Branch (386:23): [True: 44, False: 44]
  ------------------
  387|     88|      int col_end = quadCol == 0 ? split_col : img.width();
  ------------------
  |  Branch (387:21): [True: 44, False: 44]
  ------------------
  388|       |
  389|    266|      for (int row = row_start; row < row_end; row++) {
  ------------------
  |  Branch (389:33): [True: 178, False: 88]
  ------------------
  390|  1.75k|        for (int col = col_start; col < col_end; col++) {
  ------------------
  |  Branch (390:35): [True: 1.57k, False: 178]
  ------------------
  391|  1.57k|          uint16_t& pixel = img(row, col);
  392|       |          // This adjustment is expected to be made with the
  393|       |          // black-level already subtracted from the pixel values.
  394|       |          // Because this is kept as metadata and not subtracted at
  395|       |          // this point, to make the correction work we subtract the
  396|       |          // appropriate amount before indexing into the curve and
  397|       |          // then add it back so that subtracting the black level
  398|       |          // later will work as expected
  399|  1.57k|          const uint16_t diff = pixel < black_level
  ------------------
  |  Branch (399:33): [True: 624, False: 954]
  ------------------
  400|  1.57k|                                    ? pixel
  401|  1.57k|                                    : implicit_cast<uint16_t>(black_level);
  402|  1.57k|          pixel = curve[pixel - diff] + diff;
  403|  1.57k|        }
  404|    178|      }
  405|     88|    }
  406|     44|  }
  407|     22|}
IiqDecoder.cpp:_ZZNK8rawspeed10IiqDecoder34CorrectQuadrantMultipliersCombinedENS_10ByteStreamEjjENK3$_0clEv:
  344|  1.02k|                  [&data] { return data.getU32(); });
_ZNK8rawspeed10IiqDecoder17PhaseOneFlatFieldENS_10ByteStreamENS0_7IiqCorrE:
  412|    516|void IiqDecoder::PhaseOneFlatField(ByteStream data, IiqCorr corr) const {
  413|    516|  const Array2DRef<uint16_t> img(mRaw->getU16DataAsUncroppedArray2DRef());
  414|       |
  415|    516|  int nc = [corr]() {
  416|    516|    switch (corr) {
  417|    516|    case IiqCorr::LUMA:
  418|    516|      return 2;
  419|    516|    case IiqCorr::CHROMA:
  420|    516|      return 4;
  421|    516|    }
  422|    516|    ThrowRDE("Unsupported IIQ correction");
  423|    516|  }();
  424|       |
  425|    516|  std::array<uint16_t, 8> head;
  426|  4.64k|  for (int i = 0; i < 8; i++)
  ------------------
  |  Branch (426:19): [True: 4.12k, False: 516]
  ------------------
  427|  4.12k|    head[i] = data.getU16();
  428|       |
  429|    516|  if (head[2] == 0 || head[3] == 0 || head[4] == 0 || head[5] == 0)
  ------------------
  |  Branch (429:7): [True: 63, False: 453]
  |  Branch (429:23): [True: 53, False: 400]
  |  Branch (429:39): [True: 68, False: 332]
  |  Branch (429:55): [True: 66, False: 266]
  ------------------
  430|    250|    return;
  431|       |
  432|    266|  auto wide = implicit_cast<int>(roundUpDivisionSafe(head[2], head[4]));
  433|    266|  auto high = implicit_cast<int>(roundUpDivisionSafe(head[3], head[5]));
  434|       |
  435|    266|  std::vector<float> mrow_storage;
  436|    266|  Array2DRef<float> mrow = Array2DRef<float>::create(
  437|    266|      mrow_storage, /*width=*/wide * nc, /*height=*/1);
  438|    266|  mrow = Array2DRef<float>(mrow_storage.data(), /*width=*/nc, /*height=*/wide);
  439|       |
  440|  24.6k|  for (int y = 0; y < high; y++) {
  ------------------
  |  Branch (440:19): [True: 24.4k, False: 266]
  ------------------
  441|  67.0k|    for (int x = 0; x < wide; x++) {
  ------------------
  |  Branch (441:21): [True: 42.5k, False: 24.4k]
  ------------------
  442|  86.7k|      for (int c = 0; c < nc; c += 2) {
  ------------------
  |  Branch (442:23): [True: 44.1k, False: 42.5k]
  ------------------
  443|  44.1k|        float num = data.getU16() / 32768.0F;
  444|  44.1k|        if (y == 0)
  ------------------
  |  Branch (444:13): [True: 9.53k, False: 34.6k]
  ------------------
  445|  9.53k|          mrow(x, c) = num;
  446|  34.6k|        else
  447|  34.6k|          mrow(x, c + 1) = (num - mrow(x, c)) / head[5];
  448|  44.1k|      }
  449|  42.5k|    }
  450|  24.4k|    if (y == 0)
  ------------------
  |  Branch (450:9): [True: 257, False: 24.1k]
  ------------------
  451|    257|      continue;
  452|  24.1k|    for (int rend = head[1] + (y * head[5]), row = rend - head[5];
  453|  25.6k|         row < mRaw->dim.y && row < rend && row < (head[1] + head[3] - head[5]);
  ------------------
  |  Branch (453:10): [True: 1.59k, False: 24.0k]
  |  Branch (453:31): [True: 1.46k, False: 126]
  |  Branch (453:45): [True: 1.43k, False: 34]
  ------------------
  454|  24.1k|         row++) {
  455|  57.2k|      for (int x = 1; x < wide; x++) {
  ------------------
  |  Branch (455:23): [True: 55.8k, False: 1.43k]
  ------------------
  456|  55.8k|        std::array<float, 4> mult;
  457|   112k|        for (int c = 0; c < nc; c += 2) {
  ------------------
  |  Branch (457:25): [True: 56.7k, False: 55.8k]
  ------------------
  458|  56.7k|          mult[c] = mrow(x - 1, c);
  459|  56.7k|          mult[c + 1] = (mrow(x, c) - mult[c]) / head[4];
  460|  56.7k|        }
  461|  55.8k|        for (int cend = head[0] + (x * head[4]), col = cend - head[4];
  462|  58.9k|             col < mRaw->dim.x && col < cend &&
  ------------------
  |  Branch (462:14): [True: 3.40k, False: 55.5k]
  |  Branch (462:35): [True: 3.31k, False: 85]
  ------------------
  463|  3.31k|             col < head[0] + head[2] - head[4];
  ------------------
  |  Branch (463:14): [True: 3.13k, False: 188]
  ------------------
  464|  55.8k|             col++) {
  465|  3.13k|          if (int c =
  466|  3.13k|                  nc > 2 ? static_cast<unsigned>(mRaw->cfa.getColorAt(row, col))
  ------------------
  |  Branch (466:19): [True: 2, False: 3.12k]
  ------------------
  467|  3.13k|                         : 0;
  468|  3.13k|              !(c & 1)) {
  ------------------
  |  Branch (468:15): [True: 3.12k, False: 2]
  ------------------
  469|  3.12k|            auto val = implicit_cast<unsigned>(img(row, col) * mult[c]);
  470|  3.12k|            img(row, col) = implicit_cast<uint16_t>(std::min(val, 0xFFFFU));
  471|  3.12k|          }
  472|  6.25k|          for (int c = 0; c < nc; c += 2)
  ------------------
  |  Branch (472:27): [True: 3.12k, False: 3.13k]
  ------------------
  473|  3.12k|            mult[c] += mult[c + 1];
  474|  3.13k|        }
  475|  55.8k|      }
  476|  58.7k|      for (int x = 0; x < wide; x++)
  ------------------
  |  Branch (476:23): [True: 57.2k, False: 1.43k]
  ------------------
  477|   116k|        for (int c = 0; c < nc; c += 2)
  ------------------
  |  Branch (477:25): [True: 58.7k, False: 57.2k]
  ------------------
  478|  58.7k|          mrow(x, c) += mrow(x, c + 1);
  479|  1.43k|    }
  480|  24.1k|  }
  481|    266|}
IiqDecoder.cpp:_ZZNK8rawspeed10IiqDecoder17PhaseOneFlatFieldENS_10ByteStreamENS0_7IiqCorrEENK3$_0clEv:
  415|    516|  int nc = [corr]() {
  416|    516|    switch (corr) {
  ------------------
  |  Branch (416:13): [True: 516, False: 0]
  ------------------
  417|    308|    case IiqCorr::LUMA:
  ------------------
  |  Branch (417:5): [True: 308, False: 208]
  ------------------
  418|    308|      return 2;
  419|    208|    case IiqCorr::CHROMA:
  ------------------
  |  Branch (419:5): [True: 208, False: 308]
  ------------------
  420|    208|      return 4;
  421|    516|    }
  422|      0|    ThrowRDE("Unsupported IIQ correction");
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  423|    516|  }();
_ZN8rawspeed10IiqDecoder22decodeMetaDataInternalEPKNS_14CameraMetaDataE:
  494|      9|void IiqDecoder::decodeMetaDataInternal(const CameraMetaData* meta) {
  495|      9|  setMetaData(meta, "", 0);
  496|       |
  497|      9|  if (black_level)
  ------------------
  |  Branch (497:7): [True: 6, False: 3]
  ------------------
  498|      6|    mRaw->blackLevel = black_level;
  499|      9|}
_ZNK8rawspeed10IiqDecoder20correctSensorDefectsENS_10ByteStreamE:
  501|     54|void IiqDecoder::correctSensorDefects(ByteStream data) const {
  502|   145k|  while (data.getRemainSize() != 0) {
  ------------------
  |  Branch (502:10): [True: 145k, False: 13]
  ------------------
  503|   145k|    const uint16_t col = data.getU16();
  504|   145k|    const uint16_t row = data.getU16();
  505|   145k|    const uint16_t type = data.getU16();
  506|   145k|    data.skipBytes(2); // Ignore unknown/unused bits.
  507|       |
  508|   145k|    if (col >= mRaw->dim.x) // Value for col is outside the raw image.
  ------------------
  |  Branch (508:9): [True: 56.4k, False: 89.1k]
  ------------------
  509|  56.4k|      continue;
  510|  89.1k|    switch (type) {
  511|    124|    case 131: // bad column
  ------------------
  |  Branch (511:5): [True: 124, False: 88.9k]
  ------------------
  512|    510|    case 137: // bad column
  ------------------
  |  Branch (512:5): [True: 386, False: 88.7k]
  ------------------
  513|    510|      correctBadColumn(col);
  514|    510|      break;
  515|    940|    case 129: // bad pixel
  ------------------
  |  Branch (515:5): [True: 940, False: 88.1k]
  ------------------
  516|    940|      handleBadPixel(col, row);
  517|    940|      break;
  518|  87.6k|    default: // Oooh, a sensor defect not in dcraw!
  ------------------
  |  Branch (518:5): [True: 87.6k, False: 1.49k]
  ------------------
  519|  87.6k|      break;
  520|  89.1k|    }
  521|  89.1k|  }
  522|     54|}
_ZNK8rawspeed10IiqDecoder14handleBadPixelEtt:
  524|    940|void IiqDecoder::handleBadPixel(const uint16_t col, const uint16_t row) const {
  525|    940|  MutexLocker guard(&mRaw->mBadPixelMutex);
  526|    940|  mRaw->mBadPixelPositions.insert(mRaw->mBadPixelPositions.end(),
  527|    940|                                  (static_cast<uint32_t>(row) << 16) + col);
  528|    940|}
_ZNK8rawspeed10IiqDecoder16correctBadColumnEt:
  530|    510|void IiqDecoder::correctBadColumn(const uint16_t col) const {
  531|    510|  const Array2DRef<uint16_t> img(mRaw->getU16DataAsUncroppedArray2DRef());
  532|       |
  533|    511|  for (int row = 2; row < mRaw->dim.y - 2; row++) {
  ------------------
  |  Branch (533:21): [True: 1, False: 510]
  ------------------
  534|      1|    if (mRaw->cfa.getColorAt(col, row) == CFAColor::GREEN) {
  ------------------
  |  Branch (534:9): [True: 0, False: 1]
  ------------------
  535|       |      /* Do green pixels. Let's pretend we are in "G" pixel, in the middle:
  536|       |       *   G=G
  537|       |       *   BGB
  538|       |       *   G0G
  539|       |       * We accumulate the values 4 "G" pixels form diagonals, then check which
  540|       |       * of 4 values is most distant from the mean of those 4 values, subtract
  541|       |       * it from the sum, average (divide by 3) and round to nearest int.
  542|       |       */
  543|      0|      int max = 0;
  544|      0|      std::array<uint16_t, 4> val;
  545|      0|      std::array<int32_t, 4> dev;
  546|      0|      int32_t sum = 0;
  547|      0|      sum += val[0] = img(row - 1, col - 1);
  548|      0|      sum += val[1] = img(row + 1, col - 1);
  549|      0|      sum += val[2] = img(row - 1, col + 1);
  550|      0|      sum += val[3] = img(row + 1, col + 1);
  551|      0|      for (int i = 0; i < 4; i++) {
  ------------------
  |  Branch (551:23): [True: 0, False: 0]
  ------------------
  552|      0|        dev[i] = std::abs((val[i] * 4) - sum);
  553|      0|        if (dev[max] < dev[i])
  ------------------
  |  Branch (553:13): [True: 0, False: 0]
  ------------------
  554|      0|          max = i;
  555|      0|      }
  556|      0|      const int three_pixels = sum - val[max];
  557|       |      // This is `std::lround(three_pixels / 3.0)`, but without FP.
  558|      0|      img(row, col) = implicit_cast<uint16_t>((three_pixels + 1) / 3);
  559|      1|    } else {
  560|       |      /*
  561|       |       * Do non-green pixels. Let's pretend we are in "R" pixel, in the middle:
  562|       |       *   RG=GR
  563|       |       *   GB=BG
  564|       |       *   RGRGR
  565|       |       *   GB0BG
  566|       |       *   RG0GR
  567|       |       * We have 6 other "R" pixels - 2 by horizontal, 4 by diagonals.
  568|       |       * We need to combine them, to get the value of the pixel we are in.
  569|       |       */
  570|      1|      uint32_t diags = img(row + 2, col - 2) + img(row - 2, col - 2) +
  571|      1|                       img(row + 2, col + 2) + img(row - 2, col + 2);
  572|      1|      uint32_t horiz = img(row, col - 2) + img(row, col + 2);
  573|       |      // But this is not just averaging, we bias towards the horizontal pixels.
  574|      1|      img(row, col) = implicit_cast<uint16_t>(
  575|      1|          std::lround((diags * 0.0732233) + (horiz * 0.3535534)));
  576|      1|    }
  577|      1|  }
  578|    510|}

_ZN8rawspeed10IiqDecoderC2EONSt3__110unique_ptrINS_11TiffRootIFDENS1_14default_deleteIS3_EEEENS_6BufferE:
   57|  1.15k|      : AbstractTiffDecoder(std::move(rootIFD), file) {}
_ZN8rawspeed10IiqDecoder9IiqOffsetC2Ejj:
   45|   105k|    IiqOffset(uint32_t block, uint32_t offset_) : n(block), offset(offset_) {}

_ZN8rawspeed10KdcDecoder20isAppropriateDecoderEPKNS_11TiffRootIFDENS_6BufferE:
   48|    829|                                      [[maybe_unused]] Buffer file) {
   49|    829|  const auto id = rootIFD->getID();
   50|    829|  const std::string& make = id.make;
   51|       |
   52|       |  // FIXME: magic
   53|       |
   54|    829|  return make == "EASTMAN KODAK COMPANY";
   55|    829|}
_ZNK8rawspeed10KdcDecoder14getInputBufferEv:
   57|     34|Buffer KdcDecoder::getInputBuffer() const {
   58|     34|  const TiffEntry* offset =
   59|     34|      mRootIFD->getEntryRecursive(TiffTag::KODAK_KDC_OFFSET);
   60|     34|  if (!offset || offset->count < 13)
  ------------------
  |  Branch (60:7): [True: 1, False: 33]
  |  Branch (60:18): [True: 1, False: 32]
  ------------------
   61|     34|    ThrowRDE("Couldn't find the KDC offset");
  ------------------
  |  |   38|      2|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      2|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      2|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      2|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   62|       |
   63|     34|  assert(offset != nullptr);
  ------------------
  |  Branch (63:3): [True: 32, False: 0]
  ------------------
   64|     32|  uint64_t off = uint64_t(offset->getU32(4)) + uint64_t(offset->getU32(12));
   65|     32|  if (off > std::numeric_limits<uint32_t>::max())
  ------------------
  |  Branch (65:7): [True: 3, False: 29]
  ------------------
   66|     32|    ThrowRDE("Offset is too large.");
  ------------------
  |  |   38|      3|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      3|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      3|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      3|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   67|       |
   68|       |  // Offset hardcoding gotten from dcraw
   69|     29|  if (hints.contains("easyshare_offset_hack"))
  ------------------
  |  Branch (69:7): [True: 0, False: 29]
  ------------------
   70|      0|    off = off < 0x15000 ? 0x15000 : 0x17000;
  ------------------
  |  Branch (70:11): [True: 0, False: 0]
  ------------------
   71|       |
   72|     29|  return mFile.getSubView(implicit_cast<Buffer::size_type>(off));
   73|     32|}
_ZN8rawspeed10KdcDecoder17decodeRawInternalEv:
   75|     87|RawImage KdcDecoder::decodeRawInternal() {
   76|     87|  if (!mRootIFD->hasEntryRecursive(TiffTag::COMPRESSION))
  ------------------
  |  Branch (76:7): [True: 3, False: 84]
  ------------------
   77|     87|    ThrowRDE("Couldn't find compression setting");
  ------------------
  |  |   38|      3|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      3|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      3|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      3|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   78|       |
   79|     84|  if (auto compression =
   80|     84|          mRootIFD->getEntryRecursive(TiffTag::COMPRESSION)->getU32();
   81|     84|      7 != compression)
  ------------------
  |  Branch (81:7): [True: 25, False: 59]
  ------------------
   82|     84|    ThrowRDE("Unsupported compression %u", compression);
  ------------------
  |  |   38|     25|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     25|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     25|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     25|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   83|       |
   84|     59|  const TiffEntry* ifdoffset = mRootIFD->getEntryRecursive(TiffTag::KODAK_IFD2);
   85|     59|  if (!ifdoffset)
  ------------------
  |  Branch (85:7): [True: 1, False: 58]
  ------------------
   86|     59|    ThrowRDE("Couldn't find the Kodak IFD offset");
  ------------------
  |  |   38|      1|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      1|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      1|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      1|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   87|       |
   88|     58|  NORangesSet<Buffer> ifds;
   89|       |
   90|     58|  assert(ifdoffset != nullptr);
  ------------------
  |  Branch (90:3): [True: 58, False: 0]
  ------------------
   91|     58|  TiffRootIFD kodakifd(nullptr, &ifds, ifdoffset->getRootIfdData(),
   92|     58|                       ifdoffset->getU32());
   93|       |
   94|     58|  const TiffEntry* ew =
   95|     58|      kodakifd.getEntryRecursive(TiffTag::KODAK_KDC_SENSOR_WIDTH);
   96|     58|  const TiffEntry* eh =
   97|     58|      kodakifd.getEntryRecursive(TiffTag::KODAK_KDC_SENSOR_HEIGHT);
   98|     58|  if (!ew || !eh)
  ------------------
  |  Branch (98:7): [True: 2, False: 56]
  |  Branch (98:14): [True: 2, False: 54]
  ------------------
   99|     58|    ThrowRDE("Unable to retrieve image size");
  ------------------
  |  |   38|      3|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      3|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      3|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      3|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  100|       |
  101|     55|  uint32_t width = ew->getU32();
  102|     55|  uint32_t height = eh->getU32();
  103|       |
  104|     55|  mRaw->dim = iPoint2D(width, height);
  105|       |
  106|     55|  if (!mRaw->dim.hasPositiveArea() || !(mRaw->dim <= iPoint2D(4304, 3221)))
  ------------------
  |  Branch (106:7): [True: 7, False: 48]
  |  Branch (106:7): [True: 19, False: 36]
  |  Branch (106:39): [True: 14, False: 34]
  ------------------
  107|     55|    ThrowRDE("Unexpected image dimensions found: (%d; %d)", mRaw->dim.x,
  ------------------
  |  |   38|     19|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     19|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     19|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     19|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  108|     36|             mRaw->dim.y);
  109|       |
  110|     36|  const Buffer inputBuffer = KdcDecoder::getInputBuffer();
  111|       |
  112|     36|  UncompressedDecompressor u(
  113|     36|      ByteStream(DataBuffer(inputBuffer, Endianness::little)), mRaw,
  114|     36|      iRectangle2D({0, 0}, iPoint2D(width, height)), 12 * width / 8, 12,
  115|     36|      BitOrder::MSB);
  116|     36|  mRaw->createData();
  117|     36|  u.readUncompressedRaw();
  118|       |
  119|     36|  return mRaw;
  120|     55|}
_ZN8rawspeed10KdcDecoder22decodeMetaDataInternalEPKNS_14CameraMetaDataE:
  122|     11|void KdcDecoder::decodeMetaDataInternal(const CameraMetaData* meta) {
  123|     11|  setMetaData(meta, "", 0);
  124|       |
  125|       |  // Try the kodak hidden IFD for WB
  126|     11|  if (mRootIFD->hasEntryRecursive(TiffTag::KODAK_IFD2)) {
  ------------------
  |  Branch (126:7): [True: 11, False: 0]
  ------------------
  127|     11|    const TiffEntry* ifdoffset =
  128|     11|        mRootIFD->getEntryRecursive(TiffTag::KODAK_IFD2);
  129|     11|    try {
  130|     11|      NORangesSet<Buffer> ifds;
  131|       |
  132|     11|      TiffRootIFD kodakifd(nullptr, &ifds, ifdoffset->getRootIfdData(),
  133|     11|                           ifdoffset->getU32());
  134|       |
  135|     11|      if (kodakifd.hasEntryRecursive(TiffTag::KODAK_KDC_WB)) {
  ------------------
  |  Branch (135:11): [True: 3, False: 8]
  ------------------
  136|      3|        const TiffEntry* wb = kodakifd.getEntryRecursive(TiffTag::KODAK_KDC_WB);
  137|      3|        if (wb->count == 3) {
  ------------------
  |  Branch (137:13): [True: 2, False: 1]
  ------------------
  138|      2|          std::array<float, 4> wbCoeffs = {};
  139|      2|          wbCoeffs[0] = wb->getFloat(0);
  140|      2|          wbCoeffs[1] = wb->getFloat(1);
  141|      2|          wbCoeffs[2] = wb->getFloat(2);
  142|      2|          mRaw->metadata.wbCoeffs = wbCoeffs;
  143|      2|        }
  144|      3|      }
  145|     11|    } catch (const TiffParserException& e) {
  146|      2|      mRaw->setError(e.what());
  147|      2|    }
  148|     11|  }
  149|       |
  150|       |  // Use the normal WB if available
  151|     11|  if (mRootIFD->hasEntryRecursive(TiffTag::KODAKWB)) {
  ------------------
  |  Branch (151:7): [True: 8, False: 3]
  ------------------
  152|      8|    const TiffEntry* wb = mRootIFD->getEntryRecursive(TiffTag::KODAKWB);
  153|      8|    if (wb->count == 734 || wb->count == 1502) {
  ------------------
  |  Branch (153:9): [True: 1, False: 7]
  |  Branch (153:29): [True: 1, False: 6]
  ------------------
  154|      2|      std::array<float, 4> wbCoeffs = {};
  155|      2|      wbCoeffs[0] =
  156|      2|          static_cast<float>(((static_cast<uint16_t>(wb->getByte(148))) << 8) |
  157|      2|                             wb->getByte(149)) /
  158|      2|          256.0F;
  159|      2|      wbCoeffs[1] = 1.0F;
  160|      2|      wbCoeffs[2] =
  161|      2|          static_cast<float>(((static_cast<uint16_t>(wb->getByte(150))) << 8) |
  162|      2|                             wb->getByte(151)) /
  163|      2|          256.0F;
  164|      2|      mRaw->metadata.wbCoeffs = wbCoeffs;
  165|      2|    }
  166|      8|  }
  167|     11|}

_ZN8rawspeed10KdcDecoderC2EONSt3__110unique_ptrINS_11TiffRootIFDENS1_14default_deleteIS3_EEEENS_6BufferE:
   40|     87|      : AbstractTiffDecoder(std::move(root), file) {}

_ZN8rawspeed10MefDecoder20isAppropriateDecoderEPKNS_11TiffRootIFDENS_6BufferE:
   38|  1.26k|                                      [[maybe_unused]] Buffer file) {
   39|  1.26k|  const auto id = rootIFD->getID();
   40|  1.26k|  const std::string& make = id.make;
   41|       |
   42|       |  // FIXME: magic
   43|       |
   44|  1.26k|  return make == "Mamiya-OP Co.,Ltd.";
   45|  1.26k|}
_ZN8rawspeed10MefDecoder20checkImageDimensionsEv:
   47|     58|void MefDecoder::checkImageDimensions() {
   48|     58|  if (width > 4016 || height > 5344)
  ------------------
  |  Branch (48:7): [True: 20, False: 38]
  |  Branch (48:23): [True: 25, False: 13]
  ------------------
   49|     58|    ThrowRDE("Unexpected image dimensions found: (%u; %u)", width, height);
  ------------------
  |  |   38|     45|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     45|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     45|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     45|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   50|     58|}
_ZN8rawspeed10MefDecoder17decodeRawInternalEv:
   52|     61|RawImage MefDecoder::decodeRawInternal() {
   53|     61|  SimpleTiffDecoder::prepareForRawDecoding();
   54|       |
   55|     61|  UncompressedDecompressor u(
   56|     61|      ByteStream(DataBuffer(mFile.getSubView(off), Endianness::little)), mRaw,
   57|     61|      iRectangle2D({0, 0}, iPoint2D(width, height)), 12 * width / 8, 12,
   58|     61|      BitOrder::MSB);
   59|     61|  mRaw->createData();
   60|     61|  u.readUncompressedRaw();
   61|       |
   62|     61|  return mRaw;
   63|     61|}
_ZN8rawspeed10MefDecoder22decodeMetaDataInternalEPKNS_14CameraMetaDataE:
   65|      6|void MefDecoder::decodeMetaDataInternal(const CameraMetaData* meta) {
   66|      6|  setMetaData(meta, "", 0);
   67|      6|}

_ZN8rawspeed10MefDecoderC2EONSt3__110unique_ptrINS_11TiffRootIFDENS1_14default_deleteIS3_EEEENS_6BufferE:
   41|     61|      : SimpleTiffDecoder(std::move(root), file) {}

_ZN8rawspeed10MosDecoder20isAppropriateDecoderEPKNS_11TiffRootIFDENS_6BufferE:
   55|  8.86k|bool MosDecoder::isAppropriateDecoder(const TiffRootIFD* rootIFD, Buffer file) {
   56|  8.86k|  try {
   57|  8.86k|    const auto id = rootIFD->getID();
   58|  8.86k|    const std::string& make = id.make;
   59|       |
   60|       |    // This is messy. see https://github.com/darktable-org/rawspeed/issues/116
   61|       |    // Old Leafs are MOS, new ones are IIQ. Use IIQ's magic to differentiate.
   62|  8.86k|    return make == "Leaf" && !IiqDecoder::isAppropriateDecoder(file);
  ------------------
  |  Branch (62:12): [True: 656, False: 8.20k]
  |  Branch (62:30): [True: 497, False: 159]
  ------------------
   63|  8.86k|  } catch (const TiffParserException&) {
   64|       |    // Last ditch effort to identify Leaf cameras that don't have a Tiff Make
   65|       |    // set
   66|    785|    const TiffEntry* softwareIFD =
   67|    785|        rootIFD->getEntryRecursive(TiffTag::SOFTWARE);
   68|    785|    if (!softwareIFD)
  ------------------
  |  Branch (68:9): [True: 517, False: 268]
  ------------------
   69|    517|      return false;
   70|       |
   71|    268|    const std::string software = trimSpaces(softwareIFD->getString());
   72|    268|    return software == "Camera Library";
   73|    785|  }
   74|  8.86k|}
_ZN8rawspeed10MosDecoderC2EONSt3__110unique_ptrINS_11TiffRootIFDENS1_14default_deleteIS3_EEEENS_6BufferE:
   77|    581|    : AbstractTiffDecoder(std::move(rootIFD), file) {
   78|    581|  if (mRootIFD->getEntryRecursive(TiffTag::MAKE)) {
  ------------------
  |  Branch (78:7): [True: 498, False: 83]
  ------------------
   79|    498|    auto id = mRootIFD->getID();
   80|    498|    make = id.make;
   81|    498|    model = id.model;
   82|    498|  } else {
   83|     83|    const TiffEntry* xmp = mRootIFD->getEntryRecursive(TiffTag::XMP);
   84|     83|    if (!xmp)
  ------------------
  |  Branch (84:9): [True: 1, False: 82]
  ------------------
   85|     83|      ThrowRDE("Couldn't find the XMP");
  ------------------
  |  |   38|      1|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      1|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      1|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      1|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   86|       |
   87|     83|    assert(xmp != nullptr);
  ------------------
  |  Branch (87:5): [True: 82, False: 0]
  ------------------
   88|     82|    std::string xmpText = xmp->getString();
   89|     82|    make = getXMPTag(xmpText, "Make");
   90|     82|    model = getXMPTag(xmpText, "Model");
   91|     82|  }
   92|    581|}
_ZN8rawspeed10MosDecoder9getXMPTagENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEES5_:
   94|    140|std::string MosDecoder::getXMPTag(std::string_view xmp, std::string_view tag) {
   95|    140|  std::string::size_type start = xmp.find("<tiff:" + std::string(tag) + ">");
   96|    140|  std::string::size_type end = xmp.find("</tiff:" + std::string(tag) + ">");
   97|    140|  if (start == std::string::npos || end == std::string::npos || end <= start)
  ------------------
  |  Branch (97:7): [True: 42, False: 98]
  |  Branch (97:37): [True: 13, False: 85]
  |  Branch (97:65): [True: 1, False: 84]
  ------------------
   98|    140|    ThrowRDE("Couldn't find tag '%s' in the XMP", tag.data());
  ------------------
  |  |   38|     56|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     56|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     56|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     56|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   99|     84|  auto startlen = implicit_cast<int>(tag.size() + 7);
  100|     84|  return std::string(xmp.substr(start + startlen, end - start - startlen));
  101|    140|}
_ZN8rawspeed10MosDecoder17decodeRawInternalEv:
  103|    522|RawImage MosDecoder::decodeRawInternal() {
  104|    522|  uint32_t off = 0;
  105|       |
  106|    522|  const TiffIFD* raw = nullptr;
  107|       |
  108|    522|  if (mRootIFD->hasEntryRecursive(TiffTag::TILEOFFSETS)) {
  ------------------
  |  Branch (108:7): [True: 452, False: 70]
  ------------------
  109|    452|    raw = mRootIFD->getIFDWithTag(TiffTag::TILEOFFSETS);
  110|    452|    off = raw->getEntry(TiffTag::TILEOFFSETS)->getU32();
  111|    452|  } else {
  112|     70|    raw = mRootIFD->getIFDWithTag(TiffTag::CFAPATTERN);
  113|     70|    off = raw->getEntry(TiffTag::STRIPOFFSETS)->getU32();
  114|     70|  }
  115|       |
  116|    522|  uint32_t width = raw->getEntry(TiffTag::IMAGEWIDTH)->getU32();
  117|    522|  uint32_t height = raw->getEntry(TiffTag::IMAGELENGTH)->getU32();
  118|       |
  119|       |  // FIXME: could be wrong. max "active pixels" - "80 MP"
  120|    522|  if (width == 0 || height == 0 || width > 10328 || height > 7760)
  ------------------
  |  Branch (120:7): [True: 72, False: 450]
  |  Branch (120:21): [True: 1, False: 449]
  |  Branch (120:36): [True: 28, False: 421]
  |  Branch (120:53): [True: 16, False: 405]
  ------------------
  121|    522|    ThrowRDE("Unexpected image dimensions found: (%u; %u)", width, height);
  ------------------
  |  |   38|     46|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     46|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     46|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     46|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  122|       |
  123|    476|  mRaw->dim = iPoint2D(width, height);
  124|       |
  125|    476|  const ByteStream bs(DataBuffer(mFile.getSubView(off), Endianness::little));
  126|    476|  if (bs.getRemainSize() == 0)
  ------------------
  |  Branch (126:7): [True: 1, False: 475]
  ------------------
  127|    476|    ThrowRDE("Input buffer is empty");
  ------------------
  |  |   38|      1|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      1|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      1|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      1|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  128|       |
  129|    475|  if (int compression = raw->getEntry(TiffTag::COMPRESSION)->getU32();
  130|    475|      1 == compression) {
  ------------------
  |  Branch (130:7): [True: 332, False: 143]
  ------------------
  131|    332|    const Endianness endianness =
  132|    332|        getTiffByteOrder(ByteStream(DataBuffer(mFile, Endianness::little)), 0);
  133|    332|    UncompressedDecompressor u(
  134|    332|        bs, mRaw, iRectangle2D({0, 0}, iPoint2D(width, height)), 2 * width, 16,
  135|    332|        endianness == Endianness::big ? BitOrder::MSB : BitOrder::LSB);
  ------------------
  |  Branch (135:9): [True: 11, False: 321]
  ------------------
  136|    332|    mRaw->createData();
  137|    332|    u.readUncompressedRaw();
  138|    332|  } else if (99 == compression || 7 == compression) {
  ------------------
  |  Branch (138:14): [True: 107, False: 36]
  |  Branch (138:35): [True: 1, False: 35]
  ------------------
  139|      2|    ThrowRDE("Leaf LJpeg not yet supported");
  ------------------
  |  |   38|      2|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      2|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      2|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      2|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  140|       |    // LJpegPlain l(mFile, mRaw);
  141|       |    // l.startDecoder(off, mFile.getSize()-off, 0, 0);
  142|    141|  } else {
  143|    141|    ThrowRDE("Unsupported compression: %d", compression);
  ------------------
  |  |   38|    141|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|    141|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|    141|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|    141|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  144|    141|  }
  145|       |
  146|    332|  return mRaw;
  147|    475|}
_ZN8rawspeed10MosDecoder22decodeMetaDataInternalEPKNS_14CameraMetaDataE:
  153|    327|void MosDecoder::decodeMetaDataInternal(const CameraMetaData* meta) {
  154|    327|  RawDecoder::setMetaData(meta, make, model, "", 0);
  155|       |
  156|       |  // Fetch the white balance (see dcraw.c parse_mos for more metadata that can
  157|       |  // be gotten)
  158|    327|  if (mRootIFD->hasEntryRecursive(TiffTag::LEAFMETADATA)) {
  ------------------
  |  Branch (158:7): [True: 322, False: 5]
  ------------------
  159|    322|    ByteStream bs =
  160|    322|        mRootIFD->getEntryRecursive(TiffTag::LEAFMETADATA)->getData();
  161|       |
  162|       |    // We need at least a couple of bytes:
  163|       |    // "NeutObj_neutrals" + 28 bytes binary + 4x uint as strings + 3x space + \0
  164|    322|    const uint32_t minSize = 16 + 28 + 4 + 3 + 1;
  165|       |
  166|       |    // dcraw does actual parsing, since we just want one field we bruteforce it
  167|   845k|    while (bs.getRemainSize() > minSize) {
  ------------------
  |  Branch (167:12): [True: 845k, False: 51]
  ------------------
  168|   845k|      if (bs.skipPrefix("NeutObj_neutrals")) {
  ------------------
  |  Branch (168:11): [True: 271, False: 845k]
  ------------------
  169|    271|        bs.skipBytes(28);
  170|       |        // check for nulltermination of string inside bounds
  171|    271|        if (!memchr(bs.peekData(bs.getRemainSize()), 0, bs.getRemainSize()))
  ------------------
  |  Branch (171:13): [True: 1, False: 270]
  ------------------
  172|      1|          break;
  173|    270|        std::array<uint32_t, 4> tmp = {{}};
  174|    270|        const std::string tmpString(bs.peekString());
  175|    270|        std::istringstream iss(tmpString);
  176|    270|        iss >> tmp[0] >> tmp[1] >> tmp[2] >> tmp[3];
  177|    270|        if (!iss.fail() && tmp[0] > 0 && tmp[1] > 0 && tmp[2] > 0 &&
  ------------------
  |  Branch (177:13): [True: 96, False: 174]
  |  Branch (177:28): [True: 89, False: 7]
  |  Branch (177:42): [True: 79, False: 10]
  |  Branch (177:56): [True: 68, False: 11]
  ------------------
  178|     68|            tmp[3] > 0) {
  ------------------
  |  Branch (178:13): [True: 54, False: 14]
  ------------------
  179|     54|          std::array<float, 4> wbCoeffs = {};
  180|     54|          wbCoeffs[0] =
  181|     54|              static_cast<float>(tmp[0]) / implicit_cast<float>(tmp[1]);
  182|     54|          wbCoeffs[1] =
  183|     54|              static_cast<float>(tmp[0]) / implicit_cast<float>(tmp[2]);
  184|     54|          wbCoeffs[2] =
  185|     54|              static_cast<float>(tmp[0]) / implicit_cast<float>(tmp[3]);
  186|     54|          mRaw->metadata.wbCoeffs = wbCoeffs;
  187|     54|        }
  188|    270|        break;
  189|    271|      }
  190|   845k|      bs.skipBytes(1);
  191|   845k|    }
  192|    322|  }
  193|    327|}

_ZN8rawspeed10NefDecoder20isAppropriateDecoderEPKNS_11TiffRootIFDENS_6BufferE:
   64|  5.34k|                                      [[maybe_unused]] Buffer file) {
   65|  5.34k|  const auto id = rootIFD->getID();
   66|  5.34k|  const std::string& make = id.make;
   67|       |
   68|       |  // FIXME: magic
   69|       |
   70|  5.34k|  return make == "NIKON CORPORATION" || make == "NIKON";
  ------------------
  |  Branch (70:10): [True: 33, False: 5.31k]
  |  Branch (70:41): [True: 830, False: 4.48k]
  ------------------
   71|  5.34k|}
_ZN8rawspeed10NefDecoder17decodeRawInternalEv:
   73|    863|RawImage NefDecoder::decodeRawInternal() {
   74|    863|  const auto* raw = mRootIFD->getIFDWithTag(TiffTag::CFAPATTERN);
   75|    863|  auto compression = raw->getEntry(TiffTag::COMPRESSION)->getU32();
   76|       |
   77|    863|  const TiffEntry* offsets = raw->getEntry(TiffTag::STRIPOFFSETS);
   78|    863|  const TiffEntry* counts = raw->getEntry(TiffTag::STRIPBYTECOUNTS);
   79|       |
   80|    863|  if (mRootIFD->getEntryRecursive(TiffTag::MODEL)->getString() ==
  ------------------
  |  Branch (80:7): [True: 42, False: 821]
  ------------------
   81|    863|      "NIKON D100 ") { /**Sigh**/
   82|     42|    if (!mFile.isValid(offsets->getU32()))
  ------------------
  |  Branch (82:9): [True: 18, False: 24]
  ------------------
   83|     42|      ThrowRDE("Image data outside of file.");
  ------------------
  |  |   38|     18|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     18|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     18|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     18|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   84|     24|    if (!D100IsCompressed(offsets->getU32())) {
  ------------------
  |  Branch (84:9): [True: 7, False: 17]
  ------------------
   85|      7|      DecodeD100Uncompressed();
   86|      7|      return mRaw;
   87|      7|    }
   88|     24|  }
   89|       |
   90|    838|  if (compression == 1 || (hints.contains("force_uncompressed")) ||
  ------------------
  |  Branch (90:7): [True: 114, False: 724]
  |  Branch (90:7): [True: 207, False: 631]
  |  Branch (90:27): [True: 0, False: 724]
  ------------------
   91|    724|      NEFIsUncompressed(raw)) {
  ------------------
  |  Branch (91:7): [True: 120, False: 604]
  ------------------
   92|    207|    DecodeUncompressed();
   93|    207|    return mRaw;
   94|    207|  }
   95|       |
   96|    631|  if (NEFIsUncompressedRGB(raw)) {
  ------------------
  |  Branch (96:7): [True: 268, False: 363]
  ------------------
   97|    268|    DecodeSNefUncompressed();
   98|    268|    return mRaw;
   99|    268|  }
  100|       |
  101|    363|  if (offsets->count != 1) {
  ------------------
  |  Branch (101:7): [True: 13, False: 350]
  ------------------
  102|     13|    ThrowRDE("Multiple Strips found: %u", offsets->count);
  ------------------
  |  |   38|     13|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     13|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     13|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     13|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  103|     13|  }
  104|    350|  if (counts->count != offsets->count) {
  ------------------
  |  Branch (104:7): [True: 68, False: 282]
  ------------------
  105|     68|    ThrowRDE(
  ------------------
  |  |   38|     68|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     68|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     68|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     68|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  106|     68|        "Byte count number does not match strip size: count:%u, strips:%u ",
  107|     68|        counts->count, offsets->count);
  108|     68|  }
  109|    282|  if (!mFile.isValid(offsets->getU32(), counts->getU32()))
  ------------------
  |  Branch (109:7): [True: 32, False: 250]
  ------------------
  110|    282|    ThrowRDE("Invalid strip byte count. File probably truncated.");
  ------------------
  |  |   38|     32|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     32|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     32|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     32|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  111|       |
  112|    250|  if (34713 != compression)
  ------------------
  |  Branch (112:7): [True: 4, False: 246]
  ------------------
  113|    250|    ThrowRDE("Unsupported compression");
  ------------------
  |  |   38|      4|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      4|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      4|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      4|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  114|       |
  115|    246|  uint32_t width = raw->getEntry(TiffTag::IMAGEWIDTH)->getU32();
  116|    246|  uint32_t height = raw->getEntry(TiffTag::IMAGELENGTH)->getU32();
  117|    246|  uint32_t bitPerPixel = raw->getEntry(TiffTag::BITSPERSAMPLE)->getU32();
  118|       |
  119|    246|  mRaw->dim = iPoint2D(width, height);
  120|       |
  121|    246|  const TiffEntry* meta =
  122|    246|      mRootIFD->getEntryRecursive(static_cast<TiffTag>(0x96));
  123|    246|  if (!meta) {
  ------------------
  |  Branch (123:7): [True: 100, False: 146]
  ------------------
  124|    100|    meta = mRootIFD->getEntryRecursive(static_cast<TiffTag>(0x8c)); // Fall back
  125|    100|    if (!meta) {
  ------------------
  |  Branch (125:9): [True: 1, False: 99]
  ------------------
  126|      1|      ThrowRDE("Missing linearization table.");
  ------------------
  |  |   38|      1|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      1|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      1|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      1|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  127|      1|    }
  128|    100|  }
  129|       |
  130|    245|  const auto input =
  131|    245|      mFile.getSubView(offsets->getU32(), counts->getU32()).getAsArray1DRef();
  132|       |
  133|    245|  NikonDecompressor n(mRaw, meta->getData(), bitPerPixel);
  134|    245|  mRaw->createData();
  135|    245|  n.decompress(input, uncorrectedRawValues);
  136|       |
  137|    245|  return mRaw;
  138|    246|}
_ZNK8rawspeed10NefDecoder16D100IsCompressedEj:
  145|     24|bool NefDecoder::D100IsCompressed(uint32_t offset) const {
  146|     24|  const auto test = mFile.getSubView(offset, 256);
  147|    269|  for (int i = 15; i < 256; i += 16)
  ------------------
  |  Branch (147:20): [True: 262, False: 7]
  ------------------
  148|    262|    if (test[i])
  ------------------
  |  Branch (148:9): [True: 17, False: 245]
  ------------------
  149|     17|      return true;
  150|       |
  151|      7|  return false;
  152|     24|}
_ZN8rawspeed10NefDecoder17NEFIsUncompressedEPKNS_7TiffIFDE:
  157|    821|bool NefDecoder::NEFIsUncompressed(const TiffIFD* raw) {
  158|    821|  const TiffEntry* counts = raw->getEntry(TiffTag::STRIPBYTECOUNTS);
  159|    821|  uint32_t width = raw->getEntry(TiffTag::IMAGEWIDTH)->getU32();
  160|    821|  uint32_t height = raw->getEntry(TiffTag::IMAGELENGTH)->getU32();
  161|    821|  uint32_t bitPerPixel = raw->getEntry(TiffTag::BITSPERSAMPLE)->getU32();
  162|       |
  163|    821|  if (!width || !height || !bitPerPixel)
  ------------------
  |  Branch (163:7): [True: 26, False: 795]
  |  Branch (163:17): [True: 4, False: 791]
  |  Branch (163:28): [True: 137, False: 654]
  ------------------
  164|    144|    return false;
  165|       |
  166|    677|  const auto avaliableInputBytes = counts->getU32(0);
  167|    677|  const auto requiredPixels = iPoint2D(width, height).area();
  168|       |
  169|       |  // Now, there can be three situations.
  170|       |
  171|       |  // We might have not enough input to produce the requested image size.
  172|    677|  const uint64_t avaliableInputBits = uint64_t(8) * avaliableInputBytes;
  173|    677|  const auto avaliablePixels = avaliableInputBits / bitPerPixel; // round down!
  174|    677|  if (avaliablePixels < requiredPixels)
  ------------------
  |  Branch (174:7): [True: 380, False: 297]
  ------------------
  175|    380|    return false;
  176|       |
  177|       |  // We might have exactly enough input with no padding whatsoever.
  178|    297|  if (avaliablePixels == requiredPixels)
  ------------------
  |  Branch (178:7): [True: 71, False: 226]
  ------------------
  179|     71|    return true;
  180|       |
  181|       |  // Or, we might have too much input. And sadly this is the worst case.
  182|       |  // We can't just accept this. Some *compressed* NEF's also pass this check :(
  183|       |  // Thus, let's accept *some* *small* padding.
  184|    226|  const auto requiredInputBits = bitPerPixel * requiredPixels;
  185|    226|  const auto requiredInputBytes = roundUpDivisionSafe(requiredInputBits, 8);
  186|       |  // While we might have more *pixels* than needed, it does not nessesairly mean
  187|       |  // that we have more input *bytes*. We might be off by a few pixels, and with
  188|       |  // small image dimensions and bpp, we might still be in the same byte.
  189|    226|  assert(avaliableInputBytes >= requiredInputBytes);
  ------------------
  |  Branch (189:3): [True: 203, False: 23]
  ------------------
  190|    203|  const auto totalPadding = avaliableInputBytes - requiredInputBytes;
  191|    203|  if (totalPadding % height != 0)
  ------------------
  |  Branch (191:7): [True: 62, False: 141]
  ------------------
  192|     62|    return false; // Inconsistent padding makes no sense here.
  193|    141|  const auto perRowPadding = totalPadding / height;
  194|    141|  return perRowPadding < 16;
  195|    203|}
_ZN8rawspeed10NefDecoder20NEFIsUncompressedRGBEPKNS_7TiffIFDE:
  200|    797|bool NefDecoder::NEFIsUncompressedRGB(const TiffIFD* raw) {
  201|    797|  uint32_t byteCount = raw->getEntry(TiffTag::STRIPBYTECOUNTS)->getU32(0);
  202|    797|  uint32_t width = raw->getEntry(TiffTag::IMAGEWIDTH)->getU32();
  203|    797|  uint32_t height = raw->getEntry(TiffTag::IMAGELENGTH)->getU32();
  204|       |
  205|    797|  if (byteCount % 3 != 0)
  ------------------
  |  Branch (205:7): [True: 199, False: 598]
  ------------------
  206|    199|    return false;
  207|       |
  208|    598|  return byteCount / 3 == iPoint2D(width, height).area();
  209|    797|}
_ZNK8rawspeed10NefDecoder18DecodeUncompressedEv:
  211|    207|void NefDecoder::DecodeUncompressed() const {
  212|    207|  const auto* raw = getIFDWithLargestImage(TiffTag::CFAPATTERN);
  213|    207|  const TiffEntry* offsets = raw->getEntry(TiffTag::STRIPOFFSETS);
  214|    207|  const TiffEntry* counts = raw->getEntry(TiffTag::STRIPBYTECOUNTS);
  215|    207|  uint32_t yPerSlice = raw->getEntry(TiffTag::ROWSPERSTRIP)->getU32();
  216|    207|  uint32_t width = raw->getEntry(TiffTag::IMAGEWIDTH)->getU32();
  217|    207|  uint32_t height = raw->getEntry(TiffTag::IMAGELENGTH)->getU32();
  218|    207|  uint32_t bitPerPixel = raw->getEntry(TiffTag::BITSPERSAMPLE)->getU32();
  219|       |
  220|    207|  mRaw->dim = iPoint2D(width, height);
  221|       |
  222|    207|  if (width == 0 || height == 0 || width > 8288 || height > 5520)
  ------------------
  |  Branch (222:7): [True: 4, False: 203]
  |  Branch (222:21): [True: 1, False: 202]
  |  Branch (222:36): [True: 2, False: 200]
  |  Branch (222:52): [True: 20, False: 180]
  ------------------
  223|    207|    ThrowRDE("Unexpected image dimensions found: (%u; %u)", width, height);
  ------------------
  |  |   38|     24|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     24|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     24|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     24|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  224|       |
  225|    183|  if (counts->count != offsets->count) {
  ------------------
  |  Branch (225:7): [True: 1, False: 182]
  ------------------
  226|      1|    ThrowRDE("Byte count number does not match strip size: "
  ------------------
  |  |   38|      1|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      1|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      1|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      1|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  227|      1|             "count:%u, stips:%u ",
  228|      1|             counts->count, offsets->count);
  229|      1|  }
  230|       |
  231|    182|  if (yPerSlice == 0 || yPerSlice > static_cast<uint32_t>(mRaw->dim.y) ||
  ------------------
  |  Branch (231:7): [True: 4, False: 178]
  |  Branch (231:25): [True: 42, False: 136]
  ------------------
  232|    136|      roundUpDivisionSafe(mRaw->dim.y, yPerSlice) != counts->count) {
  ------------------
  |  Branch (232:7): [True: 6, False: 130]
  ------------------
  233|     49|    ThrowRDE("Invalid y per slice %u or strip count %u (height = %i)",
  ------------------
  |  |   38|     49|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     49|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     49|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     49|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  234|     49|             yPerSlice, counts->count, mRaw->dim.y);
  235|     49|  }
  236|       |
  237|    133|  vector<NefSlice> slices;
  238|    133|  slices.reserve(counts->count);
  239|    133|  uint32_t offY = 0;
  240|       |
  241|    255|  for (uint32_t s = 0; s < counts->count; s++) {
  ------------------
  |  Branch (241:24): [True: 170, False: 85]
  ------------------
  242|    170|    NefSlice slice;
  243|    170|    slice.offset = offsets->getU32(s);
  244|    170|    slice.count = counts->getU32(s);
  245|       |
  246|    170|    if (slice.count < 1)
  ------------------
  |  Branch (246:9): [True: 1, False: 169]
  ------------------
  247|    170|      ThrowRDE("Slice %u is empty", s);
  ------------------
  |  |   38|      1|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      1|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      1|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      1|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  248|       |
  249|    169|    if (offY + yPerSlice > height)
  ------------------
  |  Branch (249:9): [True: 3, False: 166]
  ------------------
  250|      3|      slice.h = height - offY;
  251|    166|    else
  252|    166|      slice.h = yPerSlice;
  253|       |
  254|    169|    offY = min(height, offY + yPerSlice);
  255|       |
  256|    169|    if (!mFile.isValid(slice.offset, slice.count))
  ------------------
  |  Branch (256:9): [True: 47, False: 122]
  ------------------
  257|    169|      ThrowRDE("Slice offset/count invalid");
  ------------------
  |  |   38|     47|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     47|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     47|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     47|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  258|       |
  259|    122|    slices.push_back(slice);
  260|    122|  }
  261|       |
  262|     85|  if (slices.empty())
  ------------------
  |  Branch (262:7): [True: 0, False: 85]
  ------------------
  263|     85|    ThrowRDE("No valid slices found. File probably truncated.");
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  264|       |
  265|     85|  assert(height == offY);
  ------------------
  |  Branch (265:3): [True: 81, False: 4]
  ------------------
  266|     85|  assert(slices.size() == counts->count);
  ------------------
  |  Branch (266:3): [True: 81, False: 0]
  ------------------
  267|       |
  268|     81|  if (bitPerPixel == 14 && width * slices[0].h * 2 == slices[0].count)
  ------------------
  |  Branch (268:7): [True: 60, False: 21]
  |  Branch (268:28): [True: 42, False: 18]
  ------------------
  269|     42|    bitPerPixel = 16; // D3 & D810
  270|       |
  271|     81|  mRaw->createData();
  272|     81|  bitPerPixel = hints.get("real_bpp", bitPerPixel);
  273|       |
  274|     81|  switch (bitPerPixel) {
  275|      5|  case 12:
  ------------------
  |  Branch (275:3): [True: 5, False: 76]
  ------------------
  276|     23|  case 14:
  ------------------
  |  Branch (276:3): [True: 18, False: 63]
  ------------------
  277|     80|  case 16:
  ------------------
  |  Branch (277:3): [True: 57, False: 24]
  ------------------
  278|     80|    break;
  279|      1|  default:
  ------------------
  |  Branch (279:3): [True: 1, False: 80]
  ------------------
  280|      1|    ThrowRDE("Invalid bpp found: %u", bitPerPixel);
  ------------------
  |  |   38|      1|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      1|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      1|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      1|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  281|     81|  }
  282|       |
  283|     80|  offY = 0;
  284|     97|  for (const NefSlice& slice : slices) {
  ------------------
  |  Branch (284:30): [True: 97, False: 78]
  ------------------
  285|     97|    ByteStream in(DataBuffer(mFile.getSubView(slice.offset, slice.count),
  286|     97|                             Endianness::little));
  287|     97|    iPoint2D size(width, slice.h);
  288|     97|    iPoint2D pos(0, offY);
  289|       |
  290|     97|    if (hints.contains("coolpixmangled")) {
  ------------------
  |  Branch (290:9): [True: 0, False: 97]
  ------------------
  291|      0|      UncompressedDecompressor u(in, mRaw, iRectangle2D(pos, size),
  292|      0|                                 width * bitPerPixel / 8, 12, BitOrder::MSB32);
  293|      0|      u.readUncompressedRaw();
  294|     97|    } else {
  295|     97|      if (hints.contains("coolpixsplit")) {
  ------------------
  |  Branch (295:11): [True: 0, False: 97]
  ------------------
  296|      0|        readCoolpixSplitRaw(in, size, pos, width * bitPerPixel / 8);
  297|     97|      } else {
  298|     97|        if (in.getSize() % size.y != 0)
  ------------------
  |  Branch (298:13): [True: 2, False: 95]
  ------------------
  299|     97|          ThrowRDE("Inconsistent row size");
  ------------------
  |  |   38|      2|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      2|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      2|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      2|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  300|     95|        const auto inputPitchBytes = in.getSize() / size.y;
  301|     95|        BitOrder bo = (mRootIFD->rootBuffer.getByteOrder() == Endianness::big) ^
  ------------------
  |  Branch (301:23): [True: 11, False: 84]
  ------------------
  302|     95|                              hints.contains("msb_override")
  303|     95|                          ? BitOrder::MSB
  304|     95|                          : BitOrder::LSB;
  305|     95|        UncompressedDecompressor u(in, mRaw, iRectangle2D(pos, size),
  306|     95|                                   inputPitchBytes, bitPerPixel, bo);
  307|     95|        u.readUncompressedRaw();
  308|     95|      }
  309|     97|    }
  310|       |
  311|     95|    offY += slice.h;
  312|     95|  }
  313|     80|}
_ZNK8rawspeed10NefDecoder22DecodeD100UncompressedEv:
  360|      7|void NefDecoder::DecodeD100Uncompressed() const {
  361|      7|  const auto* ifd = mRootIFD->getIFDWithTag(TiffTag::STRIPOFFSETS, 1);
  362|       |
  363|      7|  uint32_t offset = ifd->getEntry(TiffTag::STRIPOFFSETS)->getU32();
  364|       |  // Hardcode the sizes as at least the width is not correctly reported
  365|      7|  uint32_t width = 3040;
  366|      7|  uint32_t height = 2024;
  367|       |
  368|      7|  mRaw->dim = iPoint2D(width, height);
  369|       |
  370|      7|  if (ByteStream bs(DataBuffer(mFile.getSubView(offset), Endianness::little));
  371|      7|      bs.getRemainSize() == 0)
  ------------------
  |  Branch (371:7): [True: 1, False: 6]
  ------------------
  372|      7|    ThrowRDE("No input to decode!");
  ------------------
  |  |   38|      1|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      1|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      1|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      1|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  373|       |
  374|      6|  UncompressedDecompressor u(
  375|      6|      ByteStream(DataBuffer(mFile.getSubView(offset), Endianness::little)),
  376|      6|      mRaw, iRectangle2D({0, 0}, iPoint2D(width, height)),
  377|      6|      (12 * width / 8) + ((width + 2) / 10), 12, BitOrder::MSB);
  378|      6|  mRaw->createData();
  379|       |
  380|      6|  u.decode12BitRawWithControl<Endianness::big>();
  381|      6|}
_ZNK8rawspeed10NefDecoder22DecodeSNefUncompressedEv:
  383|    268|void NefDecoder::DecodeSNefUncompressed() const {
  384|    268|  const auto* raw = getIFDWithLargestImage(TiffTag::CFAPATTERN);
  385|    268|  uint32_t offset = raw->getEntry(TiffTag::STRIPOFFSETS)->getU32();
  386|    268|  uint32_t width = raw->getEntry(TiffTag::IMAGEWIDTH)->getU32();
  387|    268|  uint32_t height = raw->getEntry(TiffTag::IMAGELENGTH)->getU32();
  388|       |
  389|    268|  if (width == 0 || height == 0 || width % 2 != 0 || width > 3680 ||
  ------------------
  |  Branch (389:7): [True: 3, False: 265]
  |  Branch (389:21): [True: 1, False: 264]
  |  Branch (389:36): [True: 13, False: 251]
  |  Branch (389:54): [True: 31, False: 220]
  ------------------
  390|    220|      height > 2456)
  ------------------
  |  Branch (390:7): [True: 15, False: 205]
  ------------------
  391|    268|    ThrowRDE("Unexpected image dimensions found: (%u; %u)", width, height);
  ------------------
  |  |   38|     61|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     61|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     61|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     61|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  392|       |
  393|    207|  mRaw->dim = iPoint2D(width, height);
  394|    207|  mRaw->setCpp(3);
  395|    207|  mRaw->isCFA = false;
  396|    207|  mRaw->createData();
  397|       |
  398|    207|  ByteStream in(DataBuffer(mFile.getSubView(offset), Endianness::little));
  399|    207|  DecodeNikonSNef(in);
  400|    207|}
_ZNK8rawspeed10NefDecoder15getBitPerSampleEv:
  413|     75|int NefDecoder::getBitPerSample() const {
  414|     75|  const auto* raw = getIFDWithLargestImage(TiffTag::CFAPATTERN);
  415|     75|  return raw->getEntry(TiffTag::BITSPERSAMPLE)->getU32();
  416|     75|}
_ZNK8rawspeed10NefDecoder7getModeEv:
  418|    228|std::string NefDecoder::getMode() const {
  419|    228|  ostringstream mode;
  420|    228|  const auto* raw = getIFDWithLargestImage(TiffTag::CFAPATTERN);
  421|    228|  int compression = raw->getEntry(TiffTag::COMPRESSION)->getU32();
  422|    228|  uint32_t bitPerPixel = raw->getEntry(TiffTag::BITSPERSAMPLE)->getU32();
  423|       |
  424|    228|  if (NEFIsUncompressedRGB(raw))
  ------------------
  |  Branch (424:7): [True: 81, False: 147]
  ------------------
  425|     81|    mode << "sNEF-uncompressed";
  426|    147|  else {
  427|    147|    if (1 == compression || NEFIsUncompressed(raw))
  ------------------
  |  Branch (427:9): [True: 50, False: 97]
  |  Branch (427:29): [True: 33, False: 64]
  ------------------
  428|     45|      mode << bitPerPixel << "bit-uncompressed";
  429|    102|    else
  430|    102|      mode << bitPerPixel << "bit-compressed";
  431|    147|  }
  432|    228|  return mode.str();
  433|    228|}
_ZNK8rawspeed10NefDecoder15getExtendedModeERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  435|    190|std::string NefDecoder::getExtendedMode(const std::string& mode) const {
  436|    190|  ostringstream extended_mode;
  437|       |
  438|    190|  const auto* ifd = mRootIFD->getIFDWithTag(TiffTag::CFAPATTERN);
  439|    190|  uint32_t width = ifd->getEntry(TiffTag::IMAGEWIDTH)->getU32();
  440|    190|  uint32_t height = ifd->getEntry(TiffTag::IMAGELENGTH)->getU32();
  441|       |
  442|    190|  extended_mode << width << "x" << height << "-" << mode;
  443|    190|  return extended_mode.str();
  444|    190|}
_ZNK8rawspeed10NefDecoder17parseWhiteBalanceEv:
  494|    247|void NefDecoder::parseWhiteBalance() const {
  495|       |  // Read the whitebalance
  496|       |
  497|    247|  if (mRootIFD->hasEntryRecursive(static_cast<TiffTag>(12))) {
  ------------------
  |  Branch (497:7): [True: 162, False: 85]
  ------------------
  498|    162|    const TiffEntry* wb = mRootIFD->getEntryRecursive(static_cast<TiffTag>(12));
  499|    162|    if (wb->count == 4) {
  ------------------
  |  Branch (499:9): [True: 160, False: 2]
  ------------------
  500|    160|      std::array<float, 4> wbCoeffs = {};
  501|    160|      wbCoeffs[0] = wb->getFloat(0);
  502|    160|      wbCoeffs[1] = wb->getFloat(2);
  503|    160|      wbCoeffs[2] = wb->getFloat(1);
  504|    160|      if (wbCoeffs[1] <= 0.0F)
  ------------------
  |  Branch (504:11): [True: 2, False: 158]
  ------------------
  505|      2|        wbCoeffs[1] = 1.0F;
  506|    160|      mRaw->metadata.wbCoeffs = wbCoeffs;
  507|    160|    }
  508|    162|  } else if (mRootIFD->hasEntryRecursive(static_cast<TiffTag>(0x0097))) {
  ------------------
  |  Branch (508:14): [True: 41, False: 44]
  ------------------
  509|     41|    const TiffEntry* wb =
  510|     41|        mRootIFD->getEntryRecursive(static_cast<TiffTag>(0x0097));
  511|     41|    if (wb->count > 4) {
  ------------------
  |  Branch (511:9): [True: 40, False: 1]
  ------------------
  512|     40|      uint32_t version = 0;
  513|    179|      for (uint32_t i = 0; i < 4; i++) {
  ------------------
  |  Branch (513:28): [True: 146, False: 33]
  ------------------
  514|    146|        const auto v = wb->getByte(i);
  515|    146|        if (v < '0' || v > '9')
  ------------------
  |  Branch (515:13): [True: 4, False: 142]
  |  Branch (515:24): [True: 4, False: 138]
  ------------------
  516|    146|          ThrowRDE("Bad version component: %c - not a digit", v);
  ------------------
  |  |   38|      7|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      7|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      7|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      7|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  517|    139|        version = (version << 4) + v - '0';
  518|    139|      }
  519|       |
  520|     33|      if (version == 0x100 && wb->count >= 80 &&
  ------------------
  |  Branch (520:11): [True: 3, False: 30]
  |  Branch (520:31): [True: 2, False: 1]
  ------------------
  521|      2|          wb->type == TiffDataType::UNDEFINED) {
  ------------------
  |  Branch (521:11): [True: 1, False: 1]
  ------------------
  522|      1|        std::array<float, 4> wbCoeffs = {};
  523|      1|        wbCoeffs[0] = static_cast<float>(wb->getU16(36));
  524|      1|        wbCoeffs[2] = static_cast<float>(wb->getU16(37));
  525|      1|        wbCoeffs[1] = static_cast<float>(wb->getU16(38));
  526|      1|        mRaw->metadata.wbCoeffs = wbCoeffs;
  527|     32|      } else if (version == 0x103 && wb->count >= 26 &&
  ------------------
  |  Branch (527:18): [True: 3, False: 29]
  |  Branch (527:38): [True: 2, False: 1]
  ------------------
  528|      2|                 wb->type == TiffDataType::UNDEFINED) {
  ------------------
  |  Branch (528:18): [True: 1, False: 1]
  ------------------
  529|      1|        std::array<float, 4> wbCoeffs = {};
  530|      1|        wbCoeffs[0] = static_cast<float>(wb->getU16(10));
  531|      1|        wbCoeffs[1] = static_cast<float>(wb->getU16(11));
  532|      1|        wbCoeffs[2] = static_cast<float>(wb->getU16(12));
  533|      1|        mRaw->metadata.wbCoeffs = wbCoeffs;
  534|     31|      } else if (((version == 0x204 && wb->count >= 564) ||
  ------------------
  |  Branch (534:20): [True: 1, False: 30]
  |  Branch (534:40): [True: 0, False: 1]
  ------------------
  535|     30|                  (version == 0x205 && wb->count >= 284)) &&
  ------------------
  |  Branch (535:20): [True: 18, False: 12]
  |  Branch (535:40): [True: 17, False: 1]
  ------------------
  536|     17|                 mRootIFD->hasEntryRecursive(static_cast<TiffTag>(0x001d)) &&
  ------------------
  |  Branch (536:18): [True: 16, False: 1]
  ------------------
  537|     16|                 mRootIFD->hasEntryRecursive(static_cast<TiffTag>(0x00a7))) {
  ------------------
  |  Branch (537:18): [True: 15, False: 1]
  ------------------
  538|       |        // Get the serial number
  539|     15|        std::string serial =
  540|     15|            mRootIFD->getEntryRecursive(static_cast<TiffTag>(0x001d))
  541|     15|                ->getString();
  542|     15|        if (serial.length() > 9)
  ------------------
  |  Branch (542:13): [True: 2, False: 13]
  ------------------
  543|     15|          ThrowRDE("Serial number is too long (%zu)", serial.length());
  ------------------
  |  |   38|      2|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      2|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      2|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      2|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  544|     13|        uint32_t serialno = 0;
  545|     72|        for (unsigned char c : serial) {
  ------------------
  |  Branch (545:30): [True: 72, False: 13]
  ------------------
  546|     72|          if (c >= '0' && c <= '9')
  ------------------
  |  Branch (546:15): [True: 44, False: 28]
  |  Branch (546:27): [True: 21, False: 23]
  ------------------
  547|     21|            serialno = serialno * 10 + c - '0';
  548|     51|          else
  549|     51|            serialno = serialno * 10 + c % 10;
  550|     72|        }
  551|       |
  552|       |        // Get the decryption key
  553|     13|        const TiffEntry* key =
  554|     13|            mRootIFD->getEntryRecursive(static_cast<TiffTag>(0x00a7));
  555|     13|        const auto keydata = key->getData().getBuffer(4);
  556|     13|        uint32_t keyno = keydata[0] ^ keydata[1] ^ keydata[2] ^ keydata[3];
  557|       |
  558|       |        // "Decrypt" the block using the serial and key
  559|     13|        uint8_t ci = serialmap[serialno & 0xff];
  560|     13|        uint8_t cj = keymap[keyno & 0xff];
  561|     13|        uint8_t ck = 0x60;
  562|       |
  563|     13|        ByteStream bs = wb->getData();
  564|     13|        bs.skipBytes(version == 0x204 ? 284 : 4);
  ------------------
  |  Branch (564:22): [True: 0, False: 13]
  ------------------
  565|       |
  566|     13|        std::array<uint8_t, 14 + 8> buf;
  567|     88|        for (unsigned char& i : buf) {
  ------------------
  |  Branch (567:31): [True: 88, False: 13]
  ------------------
  568|     88|          cj = uint8_t(cj + (ci * ck)); // modulo arithmetics.
  569|     88|          i = bs.getByte() ^ cj;
  570|     88|          ck++;
  571|     88|        }
  572|       |
  573|       |        // Finally set the WB coeffs
  574|     13|        uint32_t off = (version == 0x204) ? 6 : 14;
  ------------------
  |  Branch (574:24): [True: 0, False: 13]
  ------------------
  575|     13|        std::array<float, 4> wbCoeffs = {};
  576|       |
  577|     13|        wbCoeffs[0] = static_cast<float>(getU16BE(&buf[off + 0]));
  578|     13|        wbCoeffs[1] = static_cast<float>(getU16BE(&buf[off + 2]));
  579|     13|        wbCoeffs[2] = static_cast<float>(getU16BE(&buf[off + 6]));
  580|     13|        mRaw->metadata.wbCoeffs = wbCoeffs;
  581|     13|      }
  582|     33|    }
  583|     44|  } else if (mRootIFD->hasEntryRecursive(static_cast<TiffTag>(0x0014))) {
  ------------------
  |  Branch (583:14): [True: 13, False: 31]
  ------------------
  584|     13|    const TiffEntry* wb =
  585|     13|        mRootIFD->getEntryRecursive(static_cast<TiffTag>(0x0014));
  586|     13|    ByteStream bs = wb->getData();
  587|     13|    if (wb->count == 2560 && wb->type == TiffDataType::UNDEFINED) {
  ------------------
  |  Branch (587:9): [True: 3, False: 10]
  |  Branch (587:30): [True: 1, False: 2]
  ------------------
  588|      1|      bs.skipBytes(1248);
  589|      1|      bs.setByteOrder(Endianness::big);
  590|      1|      std::array<float, 4> wbCoeffs = {};
  591|      1|      wbCoeffs[0] = static_cast<float>(bs.getU16()) / 256.0F;
  592|      1|      wbCoeffs[1] = 1.0F;
  593|      1|      wbCoeffs[2] = static_cast<float>(bs.getU16()) / 256.0F;
  594|      1|      mRaw->metadata.wbCoeffs = wbCoeffs;
  595|     12|    } else if (bs.hasPatternAt("NRW ", 0)) {
  ------------------
  |  Branch (595:16): [True: 3, False: 9]
  ------------------
  596|      3|      uint32_t offset = 0;
  597|      3|      if (!bs.hasPatternAt("0100", 4) && wb->count > 72)
  ------------------
  |  Branch (597:11): [True: 3, False: 0]
  |  Branch (597:42): [True: 1, False: 2]
  ------------------
  598|      1|        offset = 56;
  599|      2|      else if (wb->count > 1572)
  ------------------
  |  Branch (599:16): [True: 0, False: 2]
  ------------------
  600|      0|        offset = 1556;
  601|       |
  602|      3|      if (offset) {
  ------------------
  |  Branch (602:11): [True: 1, False: 2]
  ------------------
  603|      1|        bs.skipBytes(offset);
  604|      1|        bs.setByteOrder(Endianness::little);
  605|      1|        std::array<float, 4> wbCoeffs = {};
  606|      1|        wbCoeffs[0] = 4.0F * implicit_cast<float>(bs.getU32());
  607|      1|        wbCoeffs[1] = implicit_cast<float>(bs.getU32());
  608|      1|        wbCoeffs[1] += implicit_cast<float>(bs.getU32());
  609|      1|        wbCoeffs[2] = 4.0F * implicit_cast<float>(bs.getU32());
  610|      1|        mRaw->metadata.wbCoeffs = wbCoeffs;
  611|      1|      }
  612|      3|    }
  613|     13|  }
  614|       |
  615|    238|  if (hints.contains("nikon_wb_adjustment") && mRaw->metadata.wbCoeffs) {
  ------------------
  |  Branch (615:7): [True: 0, False: 238]
  |  Branch (615:7): [True: 0, False: 238]
  |  Branch (615:48): [True: 0, False: 0]
  ------------------
  616|      0|    (*mRaw->metadata.wbCoeffs)[0] *= 256.0F / 527.0F;
  617|      0|    (*mRaw->metadata.wbCoeffs)[2] *= 256.0F / 317.0F;
  618|      0|  }
  619|    238|}
_ZN8rawspeed10NefDecoder22decodeMetaDataInternalEPKNS_14CameraMetaDataE:
  621|    247|void NefDecoder::decodeMetaDataInternal(const CameraMetaData* meta) {
  622|    247|  int iso = 0;
  623|    247|  mRaw->cfa.setCFA(iPoint2D(2, 2), CFAColor::RED, CFAColor::GREEN,
  624|    247|                   CFAColor::GREEN, CFAColor::BLUE);
  625|       |
  626|    247|  auto makernotesWhite = mRaw->whitePoint;
  627|    247|  int makernotesBlack = mRaw->blackLevel;
  628|       |
  629|    247|  if (mRootIFD->hasEntryRecursive(TiffTag::ISOSPEEDRATINGS))
  ------------------
  |  Branch (629:7): [True: 2, False: 245]
  ------------------
  630|      2|    iso = mRootIFD->getEntryRecursive(TiffTag::ISOSPEEDRATINGS)->getU32();
  631|       |
  632|    247|  parseWhiteBalance();
  633|       |
  634|    247|  auto id = mRootIFD->getID();
  635|    247|  std::string mode = getMode();
  636|    247|  std::string extended_mode = getExtendedMode(mode);
  637|       |
  638|       |  // Read black levels (seem to be recorded for 14bit always)
  639|    247|  if (mRootIFD->hasEntryRecursive(TiffTag::NIKON_BLACKLEVEL)) {
  ------------------
  |  Branch (639:7): [True: 84, False: 163]
  ------------------
  640|     84|    const TiffEntry* bl =
  641|     84|        mRootIFD->getEntryRecursive(TiffTag::NIKON_BLACKLEVEL);
  642|     84|    if (bl->count != 4)
  ------------------
  |  Branch (642:9): [True: 9, False: 75]
  ------------------
  643|     84|      ThrowRDE("BlackLevel has %u entries instead of 4", bl->count);
  ------------------
  |  |   38|      9|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      9|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      9|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      9|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  644|     75|    uint32_t bitPerPixel = getBitPerSample();
  645|     75|    if (bitPerPixel != 12 && bitPerPixel != 14)
  ------------------
  |  Branch (645:9): [True: 74, False: 1]
  |  Branch (645:30): [True: 71, False: 3]
  ------------------
  646|     75|      ThrowRDE("Bad bit per pixel: %u", bitPerPixel);
  ------------------
  |  |   38|     71|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     71|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     71|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     71|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  647|      4|    const int sh = 14 - bitPerPixel;
  648|      4|    mRaw->blackLevelSeparate =
  649|      4|        Array2DRef(mRaw->blackLevelSeparateStorage.data(), 2, 2);
  650|      4|    auto blackLevelSeparate1D = *mRaw->blackLevelSeparate->getAsArray1DRef();
  651|      4|    blackLevelSeparate1D(0) = bl->getU16(0) >> sh;
  652|      4|    blackLevelSeparate1D(1) = bl->getU16(1) >> sh;
  653|      4|    blackLevelSeparate1D(2) = bl->getU16(2) >> sh;
  654|      4|    blackLevelSeparate1D(3) = bl->getU16(3) >> sh;
  655|      4|  }
  656|       |
  657|    167|  if (meta->hasCamera(id.make, id.model, extended_mode)) {
  ------------------
  |  Branch (657:7): [True: 0, False: 167]
  ------------------
  658|      0|    setMetaData(meta, id, extended_mode, iso);
  659|    167|  } else if (meta->hasCamera(id.make, id.model, mode)) {
  ------------------
  |  Branch (659:14): [True: 0, False: 167]
  ------------------
  660|      0|    setMetaData(meta, id, mode, iso);
  661|    167|  } else {
  662|    167|    setMetaData(meta, id, "", iso);
  663|    167|  }
  664|       |
  665|    167|  if (makernotesWhite)
  ------------------
  |  Branch (665:7): [True: 0, False: 167]
  ------------------
  666|      0|    mRaw->whitePoint = *makernotesWhite;
  667|    167|  if (makernotesBlack != -1)
  ------------------
  |  Branch (667:7): [True: 0, False: 167]
  ------------------
  668|      0|    mRaw->blackLevel = makernotesBlack;
  669|    167|}
_ZNK8rawspeed10NefDecoder15DecodeNikonSNefENS_10ByteStreamE:
  675|    174|void NefDecoder::DecodeNikonSNef(ByteStream input) const {
  676|    174|  if (mRaw->dim.x < 6)
  ------------------
  |  Branch (676:7): [True: 1, False: 173]
  ------------------
  677|    174|    ThrowIOE("got a %i wide sNEF, aborting", mRaw->dim.x);
  ------------------
  |  |   37|      1|#define ThrowIOE(...) ThrowExceptionHelper(rawspeed::IOException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      1|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      1|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      1|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  678|       |
  679|       |  // We need to read the applied whitebalance, since we should return
  680|       |  // data before whitebalance, so we "unapply" it.
  681|    173|  const TiffEntry* wb = mRootIFD->getEntryRecursive(static_cast<TiffTag>(12));
  682|    173|  if (!wb)
  ------------------
  |  Branch (682:7): [True: 1, False: 172]
  ------------------
  683|    173|    ThrowRDE("Unable to locate whitebalance needed for decompression");
  ------------------
  |  |   38|      1|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      1|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      1|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      1|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  684|       |
  685|    173|  assert(wb != nullptr);
  ------------------
  |  Branch (685:3): [True: 172, False: 0]
  ------------------
  686|    172|  if (wb->count != 4 || wb->type != TiffDataType::RATIONAL)
  ------------------
  |  Branch (686:7): [True: 1, False: 171]
  |  Branch (686:25): [True: 1, False: 170]
  ------------------
  687|    172|    ThrowRDE("Whitebalance has unknown count or type");
  ------------------
  |  |   38|      2|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      2|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      2|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      2|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  688|       |
  689|    170|  float wb_r = wb->getFloat(0);
  690|    170|  float wb_b = wb->getFloat(1);
  691|       |
  692|       |  // ((1024/x)*((1<<16)-1)+(1<<9))<=((1<<31)-1), x>0  gives: (0.0312495)
  693|    170|  if (const auto lower_limit =
  694|    170|          implicit_cast<float>(13'421'568.0 / 429'496'627.0);
  695|    170|      wb_r < lower_limit || wb_b < lower_limit || wb_r > 10.0F || wb_b > 10.0F)
  ------------------
  |  Branch (695:7): [True: 1, False: 169]
  |  Branch (695:29): [True: 1, False: 168]
  |  Branch (695:51): [True: 1, False: 167]
  |  Branch (695:67): [True: 1, False: 166]
  ------------------
  696|    170|    ThrowRDE("Whitebalance has bad values (%f, %f)",
  ------------------
  |  |   38|      4|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      4|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      4|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      4|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  697|    166|             implicit_cast<double>(wb_r), implicit_cast<double>(wb_b));
  698|       |
  699|    166|  std::array<float, 4> wbCoeffs = {};
  700|    166|  wbCoeffs[0] = wb_r;
  701|    166|  wbCoeffs[1] = 1.0F;
  702|    166|  wbCoeffs[2] = wb_b;
  703|    166|  mRaw->metadata.wbCoeffs = wbCoeffs;
  704|       |
  705|    166|  auto inv_wb_r = static_cast<int>(1024.0F / wb_r);
  706|    166|  auto inv_wb_b = static_cast<int>(1024.0F / wb_b);
  707|       |
  708|    166|  auto curve = gammaCurve(1 / 2.4, 12.92, 4095);
  709|       |
  710|       |  // Scale output values to 16 bits.
  711|   680k|  for (int i = 0; i < 4096; i++) {
  ------------------
  |  Branch (711:19): [True: 679k, False: 166]
  ------------------
  712|   679k|    curve[i] = clampBits(static_cast<int>(curve[i]) << 2, 16);
  713|   679k|  }
  714|       |
  715|    166|  curve.resize(4095);
  716|       |
  717|    166|  RawImageCurveGuard curveHandler(&mRaw, curve, false);
  718|       |
  719|    166|  uint16_t tmp;
  720|    166|  auto* tmpch = reinterpret_cast<std::byte*>(&tmp);
  721|       |
  722|    166|  const Array2DRef<uint16_t> out(mRaw->getU16DataAsUncroppedArray2DRef());
  723|    166|  const auto in = Array2DRef(input.peekData(out.width() * out.height()),
  724|    166|                             out.width(), out.height());
  725|       |
  726|  7.56k|  for (int row = 0; row < out.height(); row++) {
  ------------------
  |  Branch (726:21): [True: 7.39k, False: 166]
  ------------------
  727|  7.39k|    uint32_t random = in(row, 0) + (in(row, 1) << 8) + (in(row, 2) << 16);
  728|   107k|    for (int col = 0; col < out.width(); col += 6) {
  ------------------
  |  Branch (728:23): [True: 99.7k, False: 7.39k]
  ------------------
  729|  99.7k|      uint32_t g1 = in(row, col + 0);
  730|  99.7k|      uint32_t g2 = in(row, col + 1);
  731|  99.7k|      uint32_t g3 = in(row, col + 2);
  732|  99.7k|      uint32_t g4 = in(row, col + 3);
  733|  99.7k|      uint32_t g5 = in(row, col + 4);
  734|  99.7k|      uint32_t g6 = in(row, col + 5);
  735|       |
  736|  99.7k|      auto y1 = static_cast<float>(g1 | ((g2 & 0x0f) << 8));
  737|  99.7k|      auto y2 = static_cast<float>((g2 >> 4) | (g3 << 4));
  738|  99.7k|      auto cb = static_cast<float>(g4 | ((g5 & 0x0f) << 8));
  739|  99.7k|      auto cr = static_cast<float>((g5 >> 4) | (g6 << 4));
  740|       |
  741|  99.7k|      float cb2 = cb;
  742|  99.7k|      float cr2 = cr;
  743|       |      // Interpolate right pixel. We assume the sample is aligned with left
  744|       |      // pixel.
  745|  99.7k|      if ((col + 6) < out.width()) {
  ------------------
  |  Branch (745:11): [True: 92.3k, False: 7.39k]
  ------------------
  746|  92.3k|        g4 = in(row, col + 6 + 3);
  747|  92.3k|        g5 = in(row, col + 6 + 4);
  748|  92.3k|        g6 = in(row, col + 6 + 5);
  749|  92.3k|        cb2 = (static_cast<float>((g4 | ((g5 & 0x0f) << 8))) + cb) * 0.5F;
  750|  92.3k|        cr2 = (static_cast<float>(((g5 >> 4) | (g6 << 4))) + cr) * 0.5F;
  751|  92.3k|      }
  752|       |
  753|  99.7k|      cb -= 2048;
  754|  99.7k|      cr -= 2048;
  755|  99.7k|      cb2 -= 2048;
  756|  99.7k|      cr2 -= 2048;
  757|       |
  758|  99.7k|      mRaw->setWithLookUp(
  759|  99.7k|          clampBits(static_cast<int>(implicit_cast<double>(y1) +
  760|  99.7k|                                     (1.370705 * implicit_cast<double>(cr))),
  761|  99.7k|                    12),
  762|  99.7k|          tmpch, &random);
  763|  99.7k|      out(row, col) = clampBits((inv_wb_r * tmp + (1 << 9)) >> 10, 15);
  764|       |
  765|  99.7k|      mRaw->setWithLookUp(
  766|  99.7k|          clampBits(static_cast<int>(implicit_cast<double>(y1) -
  767|  99.7k|                                     (0.337633 * implicit_cast<double>(cb)) -
  768|  99.7k|                                     (0.698001 * implicit_cast<double>(cr))),
  769|  99.7k|                    12),
  770|  99.7k|          reinterpret_cast<std::byte*>(&out(row, col + 1)), &random);
  771|       |
  772|  99.7k|      mRaw->setWithLookUp(
  773|  99.7k|          clampBits(
  774|  99.7k|              static_cast<int>(implicit_cast<double>(y1) +
  775|  99.7k|                               (1.732446 // NOLINT(modernize-use-std-numbers)
  776|  99.7k|                                * implicit_cast<double>(cb))),
  777|  99.7k|              12),
  778|  99.7k|          tmpch, &random);
  779|  99.7k|      out(row, col + 2) = clampBits((inv_wb_b * tmp + (1 << 9)) >> 10, 15);
  780|       |
  781|  99.7k|      mRaw->setWithLookUp(
  782|  99.7k|          clampBits(static_cast<int>(implicit_cast<double>(y2) +
  783|  99.7k|                                     (1.370705 * implicit_cast<double>(cr2))),
  784|  99.7k|                    12),
  785|  99.7k|          tmpch, &random);
  786|  99.7k|      out(row, col + 3) = clampBits((inv_wb_r * tmp + (1 << 9)) >> 10, 15);
  787|       |
  788|  99.7k|      mRaw->setWithLookUp(
  789|  99.7k|          clampBits(static_cast<int>(implicit_cast<double>(y2) -
  790|  99.7k|                                     (0.337633 * implicit_cast<double>(cb2)) -
  791|  99.7k|                                     (0.698001 * implicit_cast<double>(cr2))),
  792|  99.7k|                    12),
  793|  99.7k|          reinterpret_cast<std::byte*>(&out(row, col + 4)), &random);
  794|       |
  795|  99.7k|      mRaw->setWithLookUp(
  796|  99.7k|          clampBits(
  797|  99.7k|              static_cast<int>(implicit_cast<double>(y2) +
  798|  99.7k|                               (1.732446 // NOLINT(modernize-use-std-numbers)
  799|  99.7k|                                * implicit_cast<double>(cb2))),
  800|  99.7k|              12),
  801|  99.7k|          tmpch, &random);
  802|  99.7k|      out(row, col + 5) = clampBits((inv_wb_b * tmp + (1 << 9)) >> 10, 15);
  803|  99.7k|    }
  804|  7.39k|  }
  805|    166|}
_ZN8rawspeed10NefDecoder10gammaCurveEddi:
  809|    166|std::vector<uint16_t> NefDecoder::gammaCurve(double pwr, double ts, int imax) {
  810|    166|  std::vector<uint16_t> curve(65536);
  811|       |
  812|    166|  int i;
  813|    166|  std::array<double, 6> g;
  814|    166|  std::array<double, 2> bnd = {{}};
  815|    166|  g[0] = pwr;
  816|    166|  g[1] = ts;
  817|    166|  g[2] = g[3] = g[4] = 0;
  818|    166|  bnd[g[1] >= 1] = 1;
  819|    166|  if (std::abs(g[1]) > 0 && (g[1] - 1) * (g[0] - 1) <= 0) {
  ------------------
  |  Branch (819:7): [True: 166, False: 0]
  |  Branch (819:29): [True: 166, False: 0]
  ------------------
  820|  8.13k|    for (i = 0; i < 48; i++) {
  ------------------
  |  Branch (820:17): [True: 7.96k, False: 166]
  ------------------
  821|  7.96k|      g[2] = (bnd[0] + bnd[1]) / 2;
  822|  7.96k|      if (std::abs(g[0]) > 0)
  ------------------
  |  Branch (822:11): [True: 7.96k, False: 0]
  ------------------
  823|  7.96k|        bnd[(pow(g[2] / g[1], -g[0]) - 1) / g[0] - 1 / g[2] > -1] = g[2];
  824|      0|      else
  825|      0|        bnd[g[2] / exp(1 - (1 / g[2])) < g[1]] = g[2];
  826|  7.96k|    }
  827|    166|    g[3] = g[2] / g[1];
  828|    166|    if (std::abs(g[0]) > 0)
  ------------------
  |  Branch (828:9): [True: 166, False: 0]
  ------------------
  829|    166|      g[4] = g[2] * (1 / g[0] - 1);
  830|    166|  }
  831|    166|  if (std::abs(g[0]) > 0) {
  ------------------
  |  Branch (831:7): [True: 166, False: 0]
  ------------------
  832|    166|    g[5] = 1 / (g[1] * SQR(g[3]) / 2 - g[4] * (1 - g[3]) +
  ------------------
  |  |  808|    166|#define SQR(x) ((x) * (x))
  ------------------
  833|    166|                (1 - pow(g[3], 1 + g[0])) * (1 + g[4]) / (1 + g[0])) -
  834|    166|           1;
  835|    166|  } else {
  836|      0|    g[5] = 1 / (g[1] * SQR(g[3]) / 2 + 1 - g[2] - g[3] -
  ------------------
  |  |  808|      0|#define SQR(x) ((x) * (x))
  ------------------
  837|      0|                g[2] * g[3] * (log(g[3]) - 1)) -
  838|      0|           1;
  839|      0|  }
  840|       |
  841|  10.8M|  for (i = 0; i < 0x10000; i++) {
  ------------------
  |  Branch (841:15): [True: 10.8M, False: 166]
  ------------------
  842|  10.8M|    curve[i] = 0xffff;
  843|  10.8M|    const double r = static_cast<double>(i) / imax;
  844|  10.8M|    if (r >= 1)
  ------------------
  |  Branch (844:9): [True: 10.1M, False: 679k]
  ------------------
  845|  10.1M|      continue;
  846|   679k|    double v;
  847|   679k|    if (r < g[2]) {
  ------------------
  |  Branch (847:9): [True: 26.7k, False: 653k]
  ------------------
  848|  26.7k|      v = r / g[1];
  849|   653k|    } else {
  850|   653k|      if (std::abs(g[0]) > 0) {
  ------------------
  |  Branch (850:11): [True: 653k, False: 0]
  ------------------
  851|   653k|        v = pow((r + g[4]) / (1 + g[4]), 1 / g[0]);
  852|   653k|      } else {
  853|      0|        v = exp((r - 1) / g[2]);
  854|      0|      }
  855|   653k|    }
  856|   679k|    curve[i] = static_cast<uint16_t>(0x10000 * v);
  857|   679k|  }
  858|       |
  859|    166|  assert(curve.size() == 65536);
  ------------------
  |  Branch (859:3): [True: 166, False: 0]
  ------------------
  860|       |
  861|    166|  return curve;
  862|    166|}

_ZN8rawspeed10NefDecoderC2EONSt3__110unique_ptrINS_11TiffRootIFDENS1_14default_deleteIS3_EEEENS_6BufferE:
   45|    863|      : AbstractTiffDecoder(std::move(root), file) {}

_ZN8rawspeed10OrfDecoder20isAppropriateDecoderEPKNS_11TiffRootIFDENS_6BufferE:
   54|  4.48k|                                      [[maybe_unused]] Buffer file) {
   55|  4.48k|  const auto id = rootIFD->getID();
   56|  4.48k|  const std::string& make = id.make;
   57|       |
   58|       |  // FIXME: magic
   59|       |
   60|  4.48k|  return make == "OLYMPUS IMAGING CORP." || make == "OLYMPUS CORPORATION" ||
  ------------------
  |  Branch (60:10): [True: 18, False: 4.46k]
  |  Branch (60:45): [True: 119, False: 4.34k]
  ------------------
   61|  4.34k|         make == "OLYMPUS OPTICAL CO.,LTD" || make == "OM Digital Solutions";
  ------------------
  |  Branch (61:10): [True: 192, False: 4.15k]
  |  Branch (61:47): [True: 0, False: 4.15k]
  ------------------
   62|  4.48k|}
_ZNK8rawspeed10OrfDecoder12handleSlicesEv:
   64|    277|ByteStream OrfDecoder::handleSlices() const {
   65|    277|  const auto* raw = mRootIFD->getIFDWithTag(TiffTag::STRIPOFFSETS);
   66|       |
   67|    277|  const TiffEntry* offsets = raw->getEntry(TiffTag::STRIPOFFSETS);
   68|    277|  const TiffEntry* counts = raw->getEntry(TiffTag::STRIPBYTECOUNTS);
   69|       |
   70|    277|  if (counts->count != offsets->count) {
  ------------------
  |  Branch (70:7): [True: 10, False: 267]
  ------------------
   71|     10|    ThrowRDE(
  ------------------
  |  |   38|     10|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     10|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     10|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     10|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   72|     10|        "Byte count number does not match strip size: count:%u, strips:%u ",
   73|     10|        counts->count, offsets->count);
   74|     10|  }
   75|       |
   76|    267|  const uint32_t off = offsets->getU32(0);
   77|    267|  uint32_t size = counts->getU32(0);
   78|    267|  auto end = [&off, &size]() { return off + size; };
   79|       |
   80|    560|  for (uint32_t i = 0; i < counts->count; i++) {
  ------------------
  |  Branch (80:24): [True: 333, False: 227]
  ------------------
   81|    333|    const auto offset = offsets->getU32(i);
   82|    333|    const auto count = counts->getU32(i);
   83|    333|    if (!mFile.isValid(offset, count))
  ------------------
  |  Branch (83:9): [True: 37, False: 296]
  ------------------
   84|    333|      ThrowRDE("Truncated file");
  ------------------
  |  |   38|     37|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     37|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     37|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     37|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   85|       |
   86|    296|    if (count < 1)
  ------------------
  |  Branch (86:9): [True: 2, False: 294]
  ------------------
   87|    296|      ThrowRDE("Empty slice");
  ------------------
  |  |   38|      2|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      2|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      2|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      2|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   88|       |
   89|    294|    if (i == 0)
  ------------------
  |  Branch (89:9): [True: 251, False: 43]
  ------------------
   90|    251|      continue;
   91|       |
   92|     43|    if (offset < end())
  ------------------
  |  Branch (92:9): [True: 1, False: 42]
  ------------------
   93|     43|      ThrowRDE("Slices overlap");
  ------------------
  |  |   38|      1|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      1|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      1|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      1|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   94|       |
   95|       |    // Now, everything would be great, but some uncompressed raws
   96|       |    // (packed_with_control i believe) have "padding" between at least
   97|       |    // the first two slices, and we need to account for it.
   98|     42|    const uint32_t padding = offset - end();
   99|       |
  100|     42|    size += padding;
  101|     42|    size += count;
  102|     42|  }
  103|       |
  104|    227|  ByteStream input(offsets->getRootIfdData());
  105|    227|  input.setPosition(off);
  106|       |
  107|    227|  return input.getStream(size);
  108|    267|}
OrfDecoder.cpp:_ZZNK8rawspeed10OrfDecoder12handleSlicesEvENK3$_0clEv:
   78|     85|  auto end = [&off, &size]() { return off + size; };
_ZN8rawspeed10OrfDecoder17decodeRawInternalEv:
  110|    329|RawImage OrfDecoder::decodeRawInternal() {
  111|    329|  const auto* raw = mRootIFD->getIFDWithTag(TiffTag::STRIPOFFSETS);
  112|       |
  113|    329|  if (int compression = raw->getEntry(TiffTag::COMPRESSION)->getU32();
  114|    329|      1 != compression)
  ------------------
  |  Branch (114:7): [True: 3, False: 326]
  ------------------
  115|    329|    ThrowRDE("Unsupported compression");
  ------------------
  |  |   38|      3|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      3|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      3|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      3|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  116|       |
  117|    326|  uint32_t width = raw->getEntry(TiffTag::IMAGEWIDTH)->getU32();
  118|    326|  uint32_t height = raw->getEntry(TiffTag::IMAGELENGTH)->getU32();
  119|       |
  120|    326|  if (!width || !height || width % 2 != 0 || width > 10400 || height > 7796)
  ------------------
  |  Branch (120:7): [True: 6, False: 320]
  |  Branch (120:17): [True: 1, False: 319]
  |  Branch (120:28): [True: 3, False: 316]
  |  Branch (120:46): [True: 14, False: 302]
  |  Branch (120:63): [True: 25, False: 277]
  ------------------
  121|    326|    ThrowRDE("Unexpected image dimensions found: (%u; %u)", width, height);
  ------------------
  |  |   38|     44|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     44|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     44|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     44|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  122|       |
  123|    282|  mRaw->dim = iPoint2D(width, height);
  124|       |
  125|    282|  ByteStream input(handleSlices());
  126|       |
  127|    282|  if (decodeUncompressed(input, width, height, input.getSize()))
  ------------------
  |  Branch (127:7): [True: 61, False: 221]
  ------------------
  128|     61|    return mRaw;
  129|       |
  130|    221|  if (raw->getEntry(TiffTag::STRIPOFFSETS)->count != 1)
  ------------------
  |  Branch (130:7): [True: 1, False: 220]
  ------------------
  131|    221|    ThrowRDE("%u stripes, and not uncompressed. Unsupported.",
  ------------------
  |  |   38|      1|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      1|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      1|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      1|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  132|    220|             raw->getEntry(TiffTag::STRIPOFFSETS)->count);
  133|       |
  134|    220|  if (const int bitsPerPixel = getBitsPerPixel(); bitsPerPixel == 12) {
  ------------------
  |  Branch (134:51): [True: 142, False: 78]
  ------------------
  135|    142|    input.skipBytes(7);
  136|    142|  } else if (bitsPerPixel == 14) {
  ------------------
  |  Branch (136:14): [True: 0, False: 78]
  ------------------
  137|      0|    input.skipBytes(8);
  138|     78|  } else {
  139|     78|    ThrowRDE("%i-bit images are not supported currently.", bitsPerPixel);
  ------------------
  |  |   38|     78|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     78|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     78|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     78|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  140|     78|  }
  141|       |
  142|    142|  const OlympusDecompressor o(mRaw);
  143|    142|  mRaw->createData();
  144|    142|  o.decompress(input);
  145|       |
  146|    142|  return mRaw;
  147|    220|}
_ZNK8rawspeed10OrfDecoder15getBitsPerPixelEv:
  149|    145|int OrfDecoder::getBitsPerPixel() const {
  150|    145|  int result = 12;
  151|    145|  if (mRootIFD->hasEntryRecursive(TiffTag::OLYMPUSIMAGEPROCESSING)) {
  ------------------
  |  Branch (151:7): [True: 11, False: 134]
  ------------------
  152|       |    // Newer cameras process the Image Processing SubIFD in the makernote
  153|     11|    const TiffEntry* img_entry =
  154|     11|        mRootIFD->getEntryRecursive(TiffTag::OLYMPUSIMAGEPROCESSING);
  155|       |    // get makernote ifd with containing Buffer
  156|     11|    NORangesSet<Buffer> ifds;
  157|       |
  158|     11|    TiffRootIFD image_processing(nullptr, &ifds, img_entry->getRootIfdData(),
  159|     11|                                 img_entry->getU32());
  160|       |
  161|     11|    if (image_processing.hasEntry(static_cast<TiffTag>(0x0611))) {
  ------------------
  |  Branch (161:9): [True: 1, False: 10]
  ------------------
  162|      1|      const TiffEntry* validBits =
  163|      1|          image_processing.getEntry(static_cast<TiffTag>(0x0611));
  164|      1|      result = validBits->getU16();
  165|      1|    }
  166|     11|  }
  167|    145|  return result;
  168|    145|}
_ZNK8rawspeed10OrfDecoder29decodeUncompressedInterleavedENS_10ByteStreamEjjj:
  172|     46|                                               uint32_t size) const {
  173|     46|  int inputPitchBits = 12 * w;
  174|     46|  assert(inputPitchBits % 8 == 0);
  ------------------
  |  Branch (174:3): [True: 46, False: 0]
  ------------------
  175|       |
  176|     46|  int inputPitchBytes = inputPitchBits / 8;
  177|       |
  178|     46|  const auto numEvenLines = implicit_cast<int>(roundUpDivisionSafe(h, 2));
  179|     46|  const auto evenLinesInput = s.getStream(numEvenLines, inputPitchBytes)
  180|     46|                                  .peekRemainingBuffer()
  181|     46|                                  .getAsArray1DRef();
  182|       |
  183|     46|  const auto oddLinesInputBegin =
  184|     46|      implicit_cast<int>(roundUp(evenLinesInput.size(), 1U << 11U));
  185|     46|  assert(oddLinesInputBegin >= evenLinesInput.size());
  ------------------
  |  Branch (185:3): [True: 46, False: 0]
  ------------------
  186|     46|  int padding = oddLinesInputBegin - evenLinesInput.size();
  187|     46|  assert(padding >= 0);
  ------------------
  |  Branch (187:3): [True: 46, False: 0]
  ------------------
  188|     46|  s.skipBytes(padding);
  189|       |
  190|     46|  const int numOddLines = h - numEvenLines;
  191|     46|  const auto oddLinesInput = s.getStream(numOddLines, inputPitchBytes)
  192|     46|                                 .peekRemainingBuffer()
  193|     46|                                 .getAsArray1DRef();
  194|       |
  195|       |  // By now we know we have enough input to produce the image.
  196|     46|  mRaw->createData();
  197|       |
  198|     46|  const Array2DRef<uint16_t> out(mRaw->getU16DataAsUncroppedArray2DRef());
  199|     46|  {
  200|     46|    BitStreamerMSB bs(evenLinesInput);
  201|  8.43k|    for (int i = 0; i != numEvenLines; ++i) {
  ------------------
  |  Branch (201:21): [True: 8.39k, False: 46]
  ------------------
  202|   203k|      for (unsigned col = 0; col != w; ++col) {
  ------------------
  |  Branch (202:30): [True: 195k, False: 8.39k]
  ------------------
  203|   195k|        int row = 2 * i;
  204|   195k|        out(row, col) = implicit_cast<uint16_t>(bs.getBits(12));
  205|   195k|      }
  206|  8.39k|    }
  207|     46|  }
  208|     46|  {
  209|     46|    BitStreamerMSB bs(oddLinesInput);
  210|  8.41k|    for (int i = 0; i != numOddLines; ++i) {
  ------------------
  |  Branch (210:21): [True: 8.36k, False: 46]
  ------------------
  211|   197k|      for (unsigned col = 0; col != w; ++col) {
  ------------------
  |  Branch (211:30): [True: 189k, False: 8.36k]
  ------------------
  212|   189k|        int row = 1 + (2 * i);
  213|   189k|        out(row, col) = implicit_cast<uint16_t>(bs.getBits(12));
  214|   189k|      }
  215|  8.36k|    }
  216|     46|  }
  217|     46|}
_ZNK8rawspeed10OrfDecoder18decodeUncompressedENS_10ByteStreamEjjj:
  220|    225|                                    uint32_t size) const {
  221|       |  // FIXME: most of this logic should be in UncompressedDecompressor,
  222|       |  // one way or another.
  223|       |
  224|    225|  if (size == h * ((w * 12 / 8) + ((w + 2) / 10))) {
  ------------------
  |  Branch (224:7): [True: 15, False: 210]
  ------------------
  225|       |    // 12-bit  packed 'with control' raw
  226|     15|    UncompressedDecompressor u(s, mRaw, iRectangle2D({0, 0}, iPoint2D(w, h)),
  227|     15|                               (12 * w / 8) + ((w + 2) / 10), 12,
  228|     15|                               BitOrder::LSB);
  229|     15|    mRaw->createData();
  230|     15|    u.decode12BitRawWithControl<Endianness::little>();
  231|     15|    return true;
  232|     15|  }
  233|       |
  234|    210|  iPoint2D dimensions(w, h);
  235|    210|  iPoint2D pos(0, 0);
  236|    210|  if (size == w * h * 12 / 8) { // We're in a 12-bit packed raw
  ------------------
  |  Branch (236:7): [True: 18, False: 192]
  ------------------
  237|     18|    UncompressedDecompressor u(s, mRaw, iRectangle2D(pos, dimensions),
  238|     18|                               w * 12 / 8, 12, BitOrder::MSB32);
  239|     18|    mRaw->createData();
  240|     18|    u.readUncompressedRaw();
  241|     18|    return true;
  242|     18|  }
  243|       |
  244|    192|  if (size == w * h * 2) { // We're in an unpacked raw
  ------------------
  |  Branch (244:7): [True: 1, False: 191]
  ------------------
  245|       |    // FIXME: seems fishy
  246|      1|    if (s.getByteOrder() == getHostEndianness()) {
  ------------------
  |  Branch (246:9): [True: 1, False: 0]
  ------------------
  247|      1|      UncompressedDecompressor u(s, mRaw, iRectangle2D({0, 0}, iPoint2D(w, h)),
  248|      1|                                 16 * w / 8, 16, BitOrder::LSB);
  249|      1|      mRaw->createData();
  250|      1|      u.decode12BitRawUnpackedLeftAligned<Endianness::little>();
  251|      1|    } else {
  252|      0|      UncompressedDecompressor u(s, mRaw, iRectangle2D({0, 0}, iPoint2D(w, h)),
  253|      0|                                 16 * w / 8, 16, BitOrder::MSB);
  254|      0|      mRaw->createData();
  255|      0|      u.decode12BitRawUnpackedLeftAligned<Endianness::big>();
  256|      0|    }
  257|      1|    return true;
  258|      1|  }
  259|       |
  260|    191|  if (size > w * h * 3 / 2) {
  ------------------
  |  Branch (260:7): [True: 46, False: 145]
  ------------------
  261|       |    // We're in one of those weird interlaced packed raws
  262|     46|    decodeUncompressedInterleaved(s, w, h, size);
  263|     46|    return true;
  264|     46|  }
  265|       |
  266|       |  // Does not appear to be uncomporessed. Maybe it's compressed?
  267|    145|  return false;
  268|    191|}
_ZNK8rawspeed10OrfDecoder8parseCFAEv:
  270|     63|void OrfDecoder::parseCFA() const {
  271|     63|  if (!mRootIFD->hasEntryRecursive(TiffTag::EXIFCFAPATTERN))
  ------------------
  |  Branch (271:7): [True: 37, False: 26]
  ------------------
  272|     63|    ThrowRDE("No EXIFCFAPATTERN entry found!");
  ------------------
  |  |   38|     37|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     37|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     37|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     37|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  273|       |
  274|     26|  const TiffEntry* CFA = mRootIFD->getEntryRecursive(TiffTag::EXIFCFAPATTERN);
  275|     26|  if (CFA->type != TiffDataType::UNDEFINED || CFA->count != 8) {
  ------------------
  |  Branch (275:7): [True: 1, False: 25]
  |  Branch (275:47): [True: 1, False: 24]
  ------------------
  276|      2|    ThrowRDE("Bad EXIFCFAPATTERN entry (type %u, count %u).",
  ------------------
  |  |   38|      2|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      2|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      2|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      2|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  277|      2|             static_cast<unsigned>(CFA->type), CFA->count);
  278|      2|  }
  279|       |
  280|     24|  iPoint2D cfaSize(CFA->getU16(0), CFA->getU16(1));
  281|     24|  if (cfaSize != iPoint2D{2, 2})
  ------------------
  |  Branch (281:7): [True: 2, False: 22]
  ------------------
  282|     24|    ThrowRDE("Bad CFA size: (%i, %i)", cfaSize.x, cfaSize.y);
  ------------------
  |  |   38|      2|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      2|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      2|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      2|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  283|       |
  284|     22|  mRaw->cfa.setSize(cfaSize);
  285|       |
  286|     22|  auto int2enum = [](uint8_t i) {
  287|     22|    switch (i) {
  288|     22|      using enum CFAColor;
  289|     22|    case 0:
  290|     22|      return RED;
  291|     22|    case 1:
  292|     22|      return GREEN;
  293|     22|    case 2:
  294|     22|      return BLUE;
  295|     22|    default:
  296|     22|      ThrowRDE("Unexpected CFA color: %u", i);
  297|     22|    }
  298|     22|  };
  299|       |
  300|     66|  for (int y = 0; y < cfaSize.y; y++) {
  ------------------
  |  Branch (300:19): [True: 44, False: 22]
  ------------------
  301|    131|    for (int x = 0; x < cfaSize.x; x++) {
  ------------------
  |  Branch (301:21): [True: 87, False: 44]
  ------------------
  302|     87|      uint8_t c1 = CFA->getByte(4 + x + (y * cfaSize.x));
  303|     87|      CFAColor c2 = int2enum(c1);
  304|     87|      mRaw->cfa.setColorAt(iPoint2D(x, y), c2);
  305|     87|    }
  306|     44|  }
  307|     22|}
OrfDecoder.cpp:_ZZNK8rawspeed10OrfDecoder8parseCFAEvENK3$_0clEh:
  286|     87|  auto int2enum = [](uint8_t i) {
  287|     87|    switch (i) {
  288|      0|      using enum CFAColor;
  289|     57|    case 0:
  ------------------
  |  Branch (289:5): [True: 57, False: 30]
  ------------------
  290|     57|      return RED;
  291|     19|    case 1:
  ------------------
  |  Branch (291:5): [True: 19, False: 68]
  ------------------
  292|     19|      return GREEN;
  293|     10|    case 2:
  ------------------
  |  Branch (293:5): [True: 10, False: 77]
  ------------------
  294|     10|      return BLUE;
  295|      1|    default:
  ------------------
  |  Branch (295:5): [True: 1, False: 86]
  ------------------
  296|      1|      ThrowRDE("Unexpected CFA color: %u", i);
  ------------------
  |  |   38|      1|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      1|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      1|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      1|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  297|     87|    }
  298|     87|  };
_ZN8rawspeed10OrfDecoder22decodeMetaDataInternalEPKNS_14CameraMetaDataE:
  309|     63|void OrfDecoder::decodeMetaDataInternal(const CameraMetaData* meta) {
  310|     63|  mRaw->whitePoint = (1U << 12) - 1;
  311|       |
  312|     63|  int iso = 0;
  313|       |
  314|     63|  if (mRootIFD->hasEntryRecursive(TiffTag::ISOSPEEDRATINGS))
  ------------------
  |  Branch (314:7): [True: 1, False: 62]
  ------------------
  315|      1|    iso = mRootIFD->getEntryRecursive(TiffTag::ISOSPEEDRATINGS)->getU32();
  316|       |
  317|     63|  parseCFA();
  318|       |
  319|     63|  setMetaData(meta, "", iso);
  320|       |
  321|     63|  if (mRootIFD->hasEntryRecursive(TiffTag::OLYMPUSREDMULTIPLIER) &&
  ------------------
  |  Branch (321:7): [True: 5, False: 58]
  ------------------
  322|      5|      mRootIFD->hasEntryRecursive(TiffTag::OLYMPUSBLUEMULTIPLIER)) {
  ------------------
  |  Branch (322:7): [True: 0, False: 5]
  ------------------
  323|      0|    std::array<float, 4> wbCoeffs = {};
  324|      0|    wbCoeffs[0] = static_cast<float>(
  325|      0|        mRootIFD->getEntryRecursive(TiffTag::OLYMPUSREDMULTIPLIER)->getU16());
  326|      0|    wbCoeffs[1] = 256.0F;
  327|      0|    wbCoeffs[2] = static_cast<float>(
  328|      0|        mRootIFD->getEntryRecursive(TiffTag::OLYMPUSBLUEMULTIPLIER)->getU16());
  329|      0|    mRaw->metadata.wbCoeffs = wbCoeffs;
  330|     63|  } else if (mRootIFD->hasEntryRecursive(TiffTag::OLYMPUSIMAGEPROCESSING)) {
  ------------------
  |  Branch (330:14): [True: 20, False: 43]
  ------------------
  331|       |    // Newer cameras process the Image Processing SubIFD in the makernote
  332|     20|    const TiffEntry* img_entry =
  333|     20|        mRootIFD->getEntryRecursive(TiffTag::OLYMPUSIMAGEPROCESSING);
  334|       |    // get makernote ifd with containing Buffer
  335|     20|    NORangesSet<Buffer> ifds;
  336|       |
  337|     20|    TiffRootIFD image_processing(nullptr, &ifds, img_entry->getRootIfdData(),
  338|     20|                                 img_entry->getU32());
  339|       |
  340|       |    // Get the WB
  341|     20|    if (image_processing.hasEntry(static_cast<TiffTag>(0x0100))) {
  ------------------
  |  Branch (341:9): [True: 9, False: 11]
  ------------------
  342|      9|      const TiffEntry* wb =
  343|      9|          image_processing.getEntry(static_cast<TiffTag>(0x0100));
  344|      9|      if (wb->count == 2 || wb->count == 4) {
  ------------------
  |  Branch (344:11): [True: 2, False: 7]
  |  Branch (344:29): [True: 2, False: 5]
  ------------------
  345|      4|        std::array<float, 4> wbCoeffs = {};
  346|      4|        wbCoeffs[0] = wb->getFloat(0);
  347|      4|        wbCoeffs[1] = 256.0F;
  348|      4|        wbCoeffs[2] = wb->getFloat(1);
  349|      4|        mRaw->metadata.wbCoeffs = wbCoeffs;
  350|      4|      }
  351|      9|    }
  352|       |
  353|       |    // Get the black levels
  354|     20|    if (image_processing.hasEntry(static_cast<TiffTag>(0x0600))) {
  ------------------
  |  Branch (354:9): [True: 6, False: 14]
  ------------------
  355|      6|      const TiffEntry* blackEntry =
  356|      6|          image_processing.getEntry(static_cast<TiffTag>(0x0600));
  357|       |      // Order is assumed to be RGGB
  358|      6|      if (blackEntry->count == 4) {
  ------------------
  |  Branch (358:11): [True: 5, False: 1]
  ------------------
  359|      5|        mRaw->blackLevelSeparate =
  360|      5|            Array2DRef(mRaw->blackLevelSeparateStorage.data(), 2, 2);
  361|      5|        auto blackLevelSeparate1D =
  362|      5|            *mRaw->blackLevelSeparate->getAsArray1DRef();
  363|     19|        for (int i = 0; i < 4; i++) {
  ------------------
  |  Branch (363:25): [True: 14, False: 5]
  ------------------
  364|     14|          auto c = mRaw->cfa.getColorAt(i & 1, i >> 1);
  365|     14|          int j;
  366|     14|          switch (c) {
  367|      0|            using enum CFAColor;
  368|      8|          case RED:
  ------------------
  |  Branch (368:11): [True: 8, False: 6]
  ------------------
  369|      8|            j = 0;
  370|      8|            break;
  371|      3|          case GREEN:
  ------------------
  |  Branch (371:11): [True: 3, False: 11]
  ------------------
  372|      3|            j = i < 2 ? 1 : 2;
  ------------------
  |  Branch (372:17): [True: 2, False: 1]
  ------------------
  373|      3|            break;
  374|      3|          case BLUE:
  ------------------
  |  Branch (374:11): [True: 3, False: 11]
  ------------------
  375|      3|            j = 3;
  376|      3|            break;
  377|      0|          default:
  ------------------
  |  Branch (377:11): [True: 0, False: 14]
  ------------------
  378|      0|            ThrowRDE("Unexpected CFA color: %u", static_cast<unsigned>(c));
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  379|     14|          }
  380|       |
  381|     14|          blackLevelSeparate1D(i) = blackEntry->getU16(j);
  382|     14|        }
  383|       |        // Adjust whitelevel based on the read black (we assume the dynamic
  384|       |        // range is the same)
  385|      5|        mRaw->whitePoint =
  386|      5|            *mRaw->whitePoint - (mRaw->blackLevel - blackLevelSeparate1D(0));
  387|      5|        if (getBitsPerPixel() == 14) {
  ------------------
  |  Branch (387:13): [True: 0, False: 5]
  ------------------
  388|      0|          mRaw->whitePoint = *mRaw->whitePoint * 4;
  389|      0|          mRaw->blackLevel = mRaw->blackLevel * 4;
  390|      0|          for (int i = 0; i < 4; i++) {
  ------------------
  |  Branch (390:27): [True: 0, False: 0]
  ------------------
  391|      0|            blackLevelSeparate1D(i) = blackLevelSeparate1D(i) * 4;
  392|      0|          }
  393|      0|        }
  394|      5|      }
  395|      6|    }
  396|     20|  }
  397|     63|}

_ZN8rawspeed10OrfDecoderC2EONSt3__110unique_ptrINS_11TiffRootIFDENS1_14default_deleteIS3_EEEENS_6BufferE:
   43|    329|      : AbstractTiffDecoder(std::move(root), file) {}

_ZN8rawspeed10PefDecoder20isAppropriateDecoderEPKNS_11TiffRootIFDENS_6BufferE:
   48|  2.82k|                                      [[maybe_unused]] Buffer file) {
   49|  2.82k|  const auto id = rootIFD->getID();
   50|  2.82k|  const std::string& make = id.make;
   51|       |
   52|       |  // FIXME: magic
   53|       |
   54|  2.82k|  return make == "PENTAX Corporation" ||
  ------------------
  |  Branch (54:10): [True: 23, False: 2.80k]
  ------------------
   55|  2.80k|         make == "RICOH IMAGING COMPANY, LTD." || make == "PENTAX" ||
  ------------------
  |  Branch (55:10): [True: 1, False: 2.80k]
  |  Branch (55:51): [True: 281, False: 2.52k]
  ------------------
   56|  2.52k|         make == "SAMSUNG TECHWIN";
  ------------------
  |  Branch (56:10): [True: 1, False: 2.52k]
  ------------------
   57|  2.82k|}
_ZN8rawspeed10PefDecoder17decodeRawInternalEv:
   59|    306|RawImage PefDecoder::decodeRawInternal() {
   60|    306|  const auto* raw = mRootIFD->getIFDWithTag(TiffTag::STRIPOFFSETS);
   61|       |
   62|    306|  int compression = raw->getEntry(TiffTag::COMPRESSION)->getU32();
   63|       |
   64|    306|  if (1 == compression || compression == 32773) {
  ------------------
  |  Branch (64:7): [True: 90, False: 216]
  |  Branch (64:27): [True: 1, False: 215]
  ------------------
   65|     87|    decodeUncompressed(raw, BitOrder::MSB);
   66|     87|    return mRaw;
   67|     87|  }
   68|       |
   69|    219|  if (65535 != compression)
  ------------------
  |  Branch (69:7): [True: 30, False: 189]
  ------------------
   70|    219|    ThrowRDE("Unsupported compression");
  ------------------
  |  |   38|     30|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     30|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     30|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     30|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   71|       |
   72|    189|  if (raw->hasEntry(TiffTag::PHOTOMETRICINTERPRETATION)) {
  ------------------
  |  Branch (72:7): [True: 2, False: 187]
  ------------------
   73|      2|    mRaw->isCFA =
   74|      2|        (raw->getEntry(TiffTag::PHOTOMETRICINTERPRETATION)->getU16() != 34892);
   75|      2|  }
   76|       |
   77|    189|  if (mRaw->isCFA)
  ------------------
  |  Branch (77:7): [True: 185, False: 4]
  ------------------
   78|    185|    writeLog(DEBUG_PRIO::EXTRA, "This is a CFA image");
   79|      4|  else {
   80|      4|    writeLog(DEBUG_PRIO::EXTRA, "This is NOT a CFA image");
   81|      4|  }
   82|       |
   83|    189|  const TiffEntry* offsets = raw->getEntry(TiffTag::STRIPOFFSETS);
   84|    189|  const TiffEntry* counts = raw->getEntry(TiffTag::STRIPBYTECOUNTS);
   85|       |
   86|    189|  if (offsets->count != 1) {
  ------------------
  |  Branch (86:7): [True: 2, False: 187]
  ------------------
   87|      2|    ThrowRDE("Multiple Strips found: %u", offsets->count);
  ------------------
  |  |   38|      2|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      2|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      2|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      2|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   88|      2|  }
   89|    187|  if (counts->count != offsets->count) {
  ------------------
  |  Branch (89:7): [True: 1, False: 186]
  ------------------
   90|      1|    ThrowRDE(
  ------------------
  |  |   38|      1|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      1|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      1|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      1|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   91|      1|        "Byte count number does not match strip size: count:%u, strips:%u ",
   92|      1|        counts->count, offsets->count);
   93|      1|  }
   94|    186|  ByteStream bs(
   95|    186|      DataBuffer(mFile.getSubView(offsets->getU32(), counts->getU32()),
   96|    186|                 Endianness::little));
   97|       |
   98|    186|  uint32_t width = raw->getEntry(TiffTag::IMAGEWIDTH)->getU32();
   99|    186|  uint32_t height = raw->getEntry(TiffTag::IMAGELENGTH)->getU32();
  100|       |
  101|    186|  mRaw->dim = iPoint2D(width, height);
  102|       |
  103|    186|  Optional<ByteStream> metaData;
  104|    186|  if (getRootIFD()->hasEntryRecursive(static_cast<TiffTag>(0x220))) {
  ------------------
  |  Branch (104:7): [True: 51, False: 135]
  ------------------
  105|       |    /* Attempt to read huffman table, if found in makernote */
  106|     51|    const TiffEntry* t =
  107|     51|        getRootIFD()->getEntryRecursive(static_cast<TiffTag>(0x220));
  108|     51|    if (t->type != TiffDataType::UNDEFINED)
  ------------------
  |  Branch (108:9): [True: 1, False: 50]
  ------------------
  109|     51|      ThrowRDE("Unknown Huffman table type.");
  ------------------
  |  |   38|      1|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      1|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      1|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      1|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  110|       |
  111|     50|    metaData = t->getData();
  112|     50|  }
  113|       |
  114|    185|  PentaxDecompressor p(mRaw, metaData);
  115|    185|  mRaw->createData();
  116|    185|  p.decompress(bs);
  117|       |
  118|    185|  return mRaw;
  119|    186|}
_ZN8rawspeed10PefDecoder22decodeMetaDataInternalEPKNS_14CameraMetaDataE:
  121|     10|void PefDecoder::decodeMetaDataInternal(const CameraMetaData* meta) {
  122|     10|  int iso = 0;
  123|     10|  mRaw->cfa.setCFA(iPoint2D(2, 2), CFAColor::RED, CFAColor::GREEN,
  124|     10|                   CFAColor::GREEN, CFAColor::BLUE);
  125|       |
  126|     10|  if (mRootIFD->hasEntryRecursive(TiffTag::ISOSPEEDRATINGS))
  ------------------
  |  Branch (126:7): [True: 1, False: 9]
  ------------------
  127|      1|    iso = mRootIFD->getEntryRecursive(TiffTag::ISOSPEEDRATINGS)->getU32();
  128|       |
  129|     10|  setMetaData(meta, "", iso);
  130|       |
  131|       |  // Read black level
  132|     10|  if (mRootIFD->hasEntryRecursive(static_cast<TiffTag>(0x200))) {
  ------------------
  |  Branch (132:7): [True: 3, False: 7]
  ------------------
  133|      3|    const TiffEntry* black =
  134|      3|        mRootIFD->getEntryRecursive(static_cast<TiffTag>(0x200));
  135|      3|    if (black->count == 4) {
  ------------------
  |  Branch (135:9): [True: 2, False: 1]
  ------------------
  136|      2|      mRaw->blackLevelSeparate =
  137|      2|          Array2DRef(mRaw->blackLevelSeparateStorage.data(), 2, 2);
  138|      2|      auto blackLevelSeparate1D = *mRaw->blackLevelSeparate->getAsArray1DRef();
  139|      4|      for (int i = 0; i < 4; i++)
  ------------------
  |  Branch (139:23): [True: 2, False: 2]
  ------------------
  140|      2|        blackLevelSeparate1D(i) = black->getU32(i);
  141|      2|    }
  142|      3|  }
  143|       |
  144|       |  // Set the whitebalance
  145|     10|  if (mRootIFD->hasEntryRecursive(static_cast<TiffTag>(0x0201))) {
  ------------------
  |  Branch (145:7): [True: 2, False: 8]
  ------------------
  146|      2|    const TiffEntry* wb =
  147|      2|        mRootIFD->getEntryRecursive(static_cast<TiffTag>(0x0201));
  148|      2|    if (wb->count == 4) {
  ------------------
  |  Branch (148:9): [True: 1, False: 1]
  ------------------
  149|      1|      std::array<float, 4> wbCoeffs = {};
  150|      1|      wbCoeffs[0] = implicit_cast<float>(wb->getU32(0));
  151|      1|      wbCoeffs[1] = implicit_cast<float>(wb->getU32(1));
  152|      1|      wbCoeffs[2] = implicit_cast<float>(wb->getU32(3));
  153|      1|      mRaw->metadata.wbCoeffs = wbCoeffs;
  154|      1|    }
  155|      2|  }
  156|     10|}

_ZN8rawspeed10PefDecoderC2EONSt3__110unique_ptrINS_11TiffRootIFDENS1_14default_deleteIS3_EEEENS_6BufferE:
   38|    306|      : AbstractTiffDecoder(std::move(root), file) {}

_ZN8rawspeed10RawDecoderC2ENS_6BufferE:
   54|  11.6k|RawDecoder::RawDecoder(Buffer file) : mFile(file) {}
_ZNK8rawspeed10RawDecoder18decodeUncompressedEPKNS_7TiffIFDENS_8BitOrderE:
   57|     96|                                    BitOrder order) const {
   58|     96|  const TiffEntry* offsets = rawIFD->getEntry(TiffTag::STRIPOFFSETS);
   59|     96|  const TiffEntry* counts = rawIFD->getEntry(TiffTag::STRIPBYTECOUNTS);
   60|     96|  uint32_t yPerSlice = rawIFD->getEntry(TiffTag::ROWSPERSTRIP)->getU32();
   61|     96|  uint32_t width = rawIFD->getEntry(TiffTag::IMAGEWIDTH)->getU32();
   62|     96|  uint32_t height = rawIFD->getEntry(TiffTag::IMAGELENGTH)->getU32();
   63|     96|  uint32_t bitPerPixel = rawIFD->getEntry(TiffTag::BITSPERSAMPLE)->getU32();
   64|       |
   65|     96|  if (width == 0 || height == 0 || width > 5632 || height > 3720)
  ------------------
  |  Branch (65:7): [True: 12, False: 84]
  |  Branch (65:21): [True: 1, False: 83]
  |  Branch (65:36): [True: 3, False: 80]
  |  Branch (65:52): [True: 5, False: 75]
  ------------------
   66|     96|    ThrowRDE("Unexpected image dimensions found: (%u; %u)", width, height);
  ------------------
  |  |   38|     10|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     10|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     10|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     10|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   67|       |
   68|     86|  mRaw->dim = iPoint2D(width, height);
   69|       |
   70|     86|  if (counts->count != offsets->count) {
  ------------------
  |  Branch (70:7): [True: 1, False: 85]
  ------------------
   71|      1|    ThrowRDE("Byte count number does not match strip size: "
  ------------------
  |  |   38|      1|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      1|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      1|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      1|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   72|      1|             "count:%u, stips:%u ",
   73|      1|             counts->count, offsets->count);
   74|      1|  }
   75|       |
   76|     85|  if (yPerSlice == 0 || yPerSlice > static_cast<uint32_t>(mRaw->dim.y) ||
  ------------------
  |  Branch (76:7): [True: 12, False: 73]
  |  Branch (76:25): [True: 20, False: 53]
  ------------------
   77|     53|      roundUpDivisionSafe(mRaw->dim.y, yPerSlice) != counts->count) {
  ------------------
  |  Branch (77:7): [True: 7, False: 46]
  ------------------
   78|     28|    ThrowRDE("Invalid y per slice %u or strip count %u (height = %d)",
  ------------------
  |  |   38|     28|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     28|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     28|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     28|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   79|     28|             yPerSlice, counts->count, mRaw->dim.y);
   80|     28|  }
   81|       |
   82|     57|  switch (bitPerPixel) {
   83|     20|  case 12:
  ------------------
  |  Branch (83:3): [True: 20, False: 37]
  ------------------
   84|     45|  case 14:
  ------------------
  |  Branch (84:3): [True: 25, False: 32]
  ------------------
   85|     45|    break;
   86|      1|  default:
  ------------------
  |  Branch (86:3): [True: 1, False: 56]
  ------------------
   87|      1|    ThrowRDE("Unexpected bits per pixel: %u.", bitPerPixel);
  ------------------
  |  |   38|      1|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      1|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      1|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      1|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   88|     57|  }
   89|       |
   90|     45|  vector<RawSlice> slices;
   91|     45|  slices.reserve(counts->count);
   92|     45|  uint32_t offY = 0;
   93|       |
   94|    323|  for (uint32_t s = 0; s < counts->count; s++) {
  ------------------
  |  Branch (94:24): [True: 311, False: 12]
  ------------------
   95|    311|    RawSlice slice;
   96|    311|    slice.offset = offsets->getU32(s);
   97|    311|    slice.count = counts->getU32(s);
   98|       |
   99|    311|    if (slice.count < 1)
  ------------------
  |  Branch (99:9): [True: 2, False: 309]
  ------------------
  100|    311|      ThrowRDE("Slice %u is empty", s);
  ------------------
  |  |   38|      2|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      2|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      2|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      2|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  101|       |
  102|    309|    if (offY + yPerSlice > height)
  ------------------
  |  Branch (102:9): [True: 5, False: 304]
  ------------------
  103|      5|      slice.h = height - offY;
  104|    304|    else
  105|    304|      slice.h = yPerSlice;
  106|       |
  107|    309|    offY += yPerSlice;
  108|       |
  109|    309|    if (!mFile.isValid(slice.offset, slice.count))
  ------------------
  |  Branch (109:9): [True: 31, False: 278]
  ------------------
  110|    309|      ThrowRDE("Slice offset/count invalid");
  ------------------
  |  |   38|     31|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     31|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     31|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     31|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  111|       |
  112|    278|    slices.push_back(slice);
  113|    278|  }
  114|       |
  115|     12|  if (slices.empty())
  ------------------
  |  Branch (115:7): [True: 0, False: 12]
  ------------------
  116|     12|    ThrowRDE("No valid slices found. File probably truncated.");
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  117|       |
  118|     12|  assert(height <= offY);
  ------------------
  |  Branch (118:3): [True: 11, False: 1]
  ------------------
  119|     12|  assert(slices.size() == counts->count);
  ------------------
  |  Branch (119:3): [True: 11, False: 0]
  ------------------
  120|       |
  121|     11|  mRaw->createData();
  122|       |
  123|       |  // Default white level is (2 ** BitsPerSample) - 1
  124|     11|  mRaw->whitePoint = implicit_cast<int>((1UL << bitPerPixel) - 1UL);
  125|       |
  126|     11|  offY = 0;
  127|    107|  for (const RawSlice& slice : slices) {
  ------------------
  |  Branch (127:30): [True: 107, False: 6]
  ------------------
  128|    107|    iPoint2D size(width, slice.h);
  129|    107|    iPoint2D pos(0, offY);
  130|    107|    bitPerPixel = implicit_cast<uint32_t>(
  131|    107|        (static_cast<uint64_t>(slice.count) * 8U) / (slice.h * width));
  132|    107|    const auto inputPitch = width * bitPerPixel / 8;
  133|    107|    if (!inputPitch)
  ------------------
  |  Branch (133:9): [True: 5, False: 102]
  ------------------
  134|    107|      ThrowRDE("Bad input pitch. Can not decode anything.");
  ------------------
  |  |   38|      5|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      5|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      5|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      5|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  135|       |
  136|    102|    UncompressedDecompressor u(
  137|    102|        ByteStream(DataBuffer(mFile.getSubView(slice.offset, slice.count),
  138|    102|                              Endianness::little)),
  139|    102|        mRaw, iRectangle2D(pos, size), inputPitch, bitPerPixel, order);
  140|    102|    u.readUncompressedRaw();
  141|       |
  142|    102|    offY += slice.h;
  143|    102|  }
  144|     11|}
_ZN8rawspeed10RawDecoder19handleCameraSupportEPKNS_14CameraMetaDataERKNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEESC_SC_:
  149|    787|                                     const std::string& mode) {
  150|    787|  Camera::SupportStatus supportStatus = Camera::SupportStatus::UnknownCamera;
  151|    787|  const Camera* cam = meta->getCamera(make, model, mode);
  152|    787|  if (cam)
  ------------------
  |  Branch (152:7): [True: 0, False: 787]
  ------------------
  153|      0|    supportStatus = cam->supportStatus;
  154|       |
  155|       |  // Sample beggary block.
  156|    787|  switch (supportStatus) {
  ------------------
  |  Branch (156:11): [True: 787, False: 0]
  ------------------
  157|      0|    using enum Camera::SupportStatus;
  158|    787|  case UnknownCamera:
  ------------------
  |  Branch (158:3): [True: 787, False: 0]
  ------------------
  159|    787|    if ("dng" != mode) {
  ------------------
  |  Branch (159:9): [True: 787, False: 0]
  ------------------
  160|    787|      noSamples = true;
  161|    787|      writeLog(DEBUG_PRIO::WARNING,
  162|    787|               "Unable to find camera in database: '%s' '%s' '%s'\nPlease "
  163|    787|               "consider providing samples on <https://raw.pixls.us/>, thanks!",
  164|    787|               make.c_str(), model.c_str(), mode.c_str());
  165|    787|    }
  166|    787|    break;
  167|      0|  case UnknownNoSamples:
  ------------------
  |  Branch (167:3): [True: 0, False: 787]
  ------------------
  168|      0|  case SupportedNoSamples:
  ------------------
  |  Branch (168:3): [True: 0, False: 787]
  ------------------
  169|      0|    noSamples = true;
  170|      0|    writeLog(DEBUG_PRIO::WARNING,
  171|      0|             "Camera support status is unknown: '%s' '%s' '%s'\n"
  172|      0|             "Please consider providing samples on <https://raw.pixls.us/> "
  173|      0|             "if you wish for the support to not be discontinued, thanks!",
  174|      0|             make.c_str(), model.c_str(), mode.c_str());
  175|      0|    break; // WYSIWYG.
  176|      0|  case Supported:
  ------------------
  |  Branch (176:3): [True: 0, False: 787]
  ------------------
  177|      0|  case Unknown:
  ------------------
  |  Branch (177:3): [True: 0, False: 787]
  ------------------
  178|      0|  case Unsupported:
  ------------------
  |  Branch (178:3): [True: 0, False: 787]
  ------------------
  179|      0|    break; // All these imply existence of a sample on RPU.
  180|    787|  }
  181|       |
  182|       |  // Actual support handling.
  183|    787|  switch (supportStatus) {
  ------------------
  |  Branch (183:11): [True: 787, False: 0]
  ------------------
  184|      0|    using enum Camera::SupportStatus;
  185|      0|  case Supported:
  ------------------
  |  Branch (185:3): [True: 0, False: 787]
  ------------------
  186|      0|  case SupportedNoSamples:
  ------------------
  |  Branch (186:3): [True: 0, False: 787]
  ------------------
  187|      0|    return true; // Explicitly supported.
  188|      0|  case Unsupported:
  ------------------
  |  Branch (188:3): [True: 0, False: 787]
  ------------------
  189|      0|    ThrowRDE("Camera not supported (explicit). Sorry.");
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  190|    787|  case UnknownCamera:
  ------------------
  |  Branch (190:3): [True: 787, False: 0]
  ------------------
  191|    787|  case UnknownNoSamples:
  ------------------
  |  Branch (191:3): [True: 0, False: 787]
  ------------------
  192|    787|  case Unknown:
  ------------------
  |  Branch (192:3): [True: 0, False: 787]
  ------------------
  193|    787|    if (failOnUnknown) {
  ------------------
  |  Branch (193:9): [True: 0, False: 787]
  ------------------
  194|      0|      ThrowRDE("Camera '%s' '%s', mode '%s' not supported, and not allowed to "
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  195|      0|               "guess. Sorry.",
  196|      0|               make.c_str(), model.c_str(), mode.c_str());
  197|      0|    }
  198|    787|    return cam; // Might be implicitly supported.
  199|    787|  }
  200|       |
  201|      0|  return true;
  202|    787|}
_ZN8rawspeed10RawDecoder20checkCameraSupportedEPKNS_14CameraMetaDataERKNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEESC_SC_:
  207|     39|                                      const std::string& mode) {
  208|     39|  mRaw->metadata.make = make;
  209|     39|  mRaw->metadata.model = model;
  210|       |
  211|     39|  if (!handleCameraSupport(meta, make, model, mode))
  ------------------
  |  Branch (211:7): [True: 39, False: 0]
  ------------------
  212|     39|    return false;
  213|       |
  214|      0|  const Camera* cam = meta->getCamera(make, model, mode);
  215|      0|  assert(cam);
  ------------------
  |  Branch (215:3): [True: 0, False: 0]
  ------------------
  216|       |
  217|      0|  if (cam->decoderVersion > getDecoderVersion())
  ------------------
  |  Branch (217:7): [True: 0, False: 0]
  ------------------
  218|      0|    ThrowRDE(
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  219|      0|        "Camera not supported in this version. Update RawSpeed for support.");
  220|       |
  221|      0|  hints = cam->hints;
  222|      0|  return true;
  223|      0|}
_ZN8rawspeed10RawDecoder11setMetaDataEPKNS_14CameraMetaDataERKNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEESC_SC_i:
  227|    748|                             const std::string& mode, int iso_speed) {
  228|    748|  mRaw->metadata.isoSpeed = iso_speed;
  229|       |
  230|    748|  if (!handleCameraSupport(meta, make, model, mode))
  ------------------
  |  Branch (230:7): [True: 748, False: 0]
  ------------------
  231|    748|    return;
  232|       |
  233|      0|  const Camera* cam = meta->getCamera(make, model, mode);
  234|      0|  assert(cam);
  ------------------
  |  Branch (234:3): [True: 0, False: 0]
  ------------------
  235|       |
  236|       |  // Only final CFA with the data from cameras.xml if it actually contained
  237|       |  // the CFA.
  238|      0|  if (cam->cfa.getSize().area() > 0)
  ------------------
  |  Branch (238:7): [True: 0, False: 0]
  ------------------
  239|      0|    mRaw->cfa = cam->cfa;
  240|       |
  241|      0|  if (!cam->color_matrix.empty())
  ------------------
  |  Branch (241:7): [True: 0, False: 0]
  ------------------
  242|      0|    mRaw->metadata.colorMatrix = cam->color_matrix;
  243|       |
  244|      0|  mRaw->metadata.canonical_make = cam->canonical_make;
  245|      0|  mRaw->metadata.canonical_model = cam->canonical_model;
  246|      0|  mRaw->metadata.canonical_alias = cam->canonical_alias;
  247|      0|  mRaw->metadata.canonical_id = cam->canonical_id;
  248|      0|  mRaw->metadata.make = make;
  249|      0|  mRaw->metadata.model = model;
  250|      0|  mRaw->metadata.mode = mode;
  251|       |
  252|      0|  if (applyCrop) {
  ------------------
  |  Branch (252:7): [True: 0, False: 0]
  ------------------
  253|      0|    if (cam->cropAvailable) {
  ------------------
  |  Branch (253:9): [True: 0, False: 0]
  ------------------
  254|      0|      iPoint2D new_size = cam->cropSize;
  255|       |
  256|       |      // If crop size is negative, use relative cropping
  257|      0|      if (new_size.x <= 0)
  ------------------
  |  Branch (257:11): [True: 0, False: 0]
  ------------------
  258|      0|        new_size.x = mRaw->dim.x - cam->cropPos.x + new_size.x;
  259|       |
  260|      0|      if (new_size.y <= 0)
  ------------------
  |  Branch (260:11): [True: 0, False: 0]
  ------------------
  261|      0|        new_size.y = mRaw->dim.y - cam->cropPos.y + new_size.y;
  262|       |
  263|      0|      mRaw->subFrame(iRectangle2D(cam->cropPos, new_size));
  264|      0|    } else {
  265|      0|      mRaw->subFrame(getDefaultCrop());
  266|      0|    }
  267|      0|  }
  268|       |
  269|      0|  mRaw->blackAreas = cam->blackAreas;
  270|      0|  if (const CameraSensorInfo* sensor = cam->getSensorInfo(iso_speed)) {
  ------------------
  |  Branch (270:31): [True: 0, False: 0]
  ------------------
  271|      0|    mRaw->blackLevel = sensor->mBlackLevel;
  272|      0|    mRaw->whitePoint = sensor->mWhiteLevel;
  273|      0|    if (mRaw->blackAreas.empty() && !sensor->mBlackLevelSeparate.empty()) {
  ------------------
  |  Branch (273:9): [True: 0, False: 0]
  |  Branch (273:37): [True: 0, False: 0]
  ------------------
  274|      0|      auto cfaArea = implicit_cast<int>(mRaw->cfa.getSize().area());
  275|      0|      if (mRaw->isCFA &&
  ------------------
  |  Branch (275:11): [True: 0, False: 0]
  ------------------
  276|      0|          cfaArea <= implicit_cast<int>(sensor->mBlackLevelSeparate.size())) {
  ------------------
  |  Branch (276:11): [True: 0, False: 0]
  ------------------
  277|      0|        mRaw->blackLevelSeparate =
  278|      0|            Array2DRef(mRaw->blackLevelSeparateStorage.data(), 2, 2);
  279|      0|        auto blackLevelSeparate1D =
  280|      0|            *mRaw->blackLevelSeparate->getAsArray1DRef();
  281|      0|        for (int i = 0; i < cfaArea; i++) {
  ------------------
  |  Branch (281:25): [True: 0, False: 0]
  ------------------
  282|      0|          blackLevelSeparate1D(i) = sensor->mBlackLevelSeparate[i];
  283|      0|        }
  284|      0|      } else if (!mRaw->isCFA &&
  ------------------
  |  Branch (284:18): [True: 0, False: 0]
  ------------------
  285|      0|                 mRaw->getCpp() <= sensor->mBlackLevelSeparate.size()) {
  ------------------
  |  Branch (285:18): [True: 0, False: 0]
  ------------------
  286|      0|        mRaw->blackLevelSeparate =
  287|      0|            Array2DRef(mRaw->blackLevelSeparateStorage.data(), 2, 2);
  288|      0|        auto blackLevelSeparate1D =
  289|      0|            *mRaw->blackLevelSeparate->getAsArray1DRef();
  290|      0|        for (uint32_t i = 0; i < mRaw->getCpp(); i++) {
  ------------------
  |  Branch (290:30): [True: 0, False: 0]
  ------------------
  291|      0|          blackLevelSeparate1D(i) = sensor->mBlackLevelSeparate[i];
  292|      0|        }
  293|      0|      }
  294|      0|    }
  295|      0|  }
  296|       |
  297|       |  // Allow overriding individual blacklevels. Values are in CFA order
  298|       |  // (the same order as the in the CFA tag)
  299|       |  // A hint could be:
  300|       |  // <Hint name="final_cfa_black" value="10,20,30,20"/>
  301|      0|  std::string cfa_black = hints.get("final_cfa_black", std::string());
  302|      0|  if (!cfa_black.empty()) {
  ------------------
  |  Branch (302:7): [True: 0, False: 0]
  ------------------
  303|      0|    vector<std::string> v = splitString(cfa_black, ',');
  304|      0|    if (v.size() != 4) {
  ------------------
  |  Branch (304:9): [True: 0, False: 0]
  ------------------
  305|      0|      mRaw->setError("Expected 4 values '10,20,30,20' as values for "
  306|      0|                     "final_cfa_black hint.");
  307|      0|    } else {
  308|      0|      auto blackLevelSeparate1D = *mRaw->blackLevelSeparate->getAsArray1DRef();
  309|      0|      for (int i = 0; i < 4; i++) {
  ------------------
  |  Branch (309:23): [True: 0, False: 0]
  ------------------
  310|      0|        blackLevelSeparate1D(i) = stoi(v[i]);
  311|      0|      }
  312|      0|    }
  313|      0|  }
  314|      0|}
_ZN8rawspeed10RawDecoder9decodeRawEv:
  320|  11.6k|rawspeed::RawImage RawDecoder::decodeRaw() {
  321|  11.6k|  try {
  322|  11.6k|    RawImage raw = decodeRawInternal();
  323|  11.6k|    MSan::CheckMemIsInitialized(raw->getByteDataAsUncroppedArray2DRef());
  324|       |
  325|  11.6k|    raw->metadata.pixelAspectRatio =
  326|  11.6k|        hints.get("pixel_aspect_ratio", raw->metadata.pixelAspectRatio);
  327|  11.6k|    if (interpolateBadPixels) {
  ------------------
  |  Branch (327:9): [True: 0, False: 11.6k]
  ------------------
  328|      0|      raw->fixBadPixels();
  329|      0|      MSan::CheckMemIsInitialized(raw->getByteDataAsUncroppedArray2DRef());
  330|      0|    }
  331|       |
  332|  11.6k|    return raw;
  333|  11.6k|  } catch (const TiffParserException& e) {
  334|    372|    ThrowRDE("%s", e.what());
  ------------------
  |  |   38|    372|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|    372|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|    372|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|    372|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  335|    372|  } catch (const FileIOException& e) {
  336|      0|    ThrowRDE("%s", e.what());
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  337|  1.85k|  } catch (const IOException& e) {
  338|  1.85k|    ThrowRDE("%s", e.what());
  ------------------
  |  |   38|  1.85k|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|  1.85k|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|  1.85k|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|  1.85k|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  339|  1.85k|  }
  340|  11.6k|}
_ZN8rawspeed10RawDecoder14decodeMetaDataEPKNS_14CameraMetaDataE:
  342|  3.07k|void RawDecoder::decodeMetaData(const CameraMetaData* meta) {
  343|  3.07k|  try {
  344|  3.07k|    decodeMetaDataInternal(meta);
  345|  3.07k|  } catch (const TiffParserException& e) {
  346|     75|    ThrowRDE("%s", e.what());
  ------------------
  |  |   38|     75|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     75|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     75|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     75|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  347|     75|  } catch (const FileIOException& e) {
  348|      0|    ThrowRDE("%s", e.what());
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  349|     36|  } catch (const IOException& e) {
  350|     36|    ThrowRDE("%s", e.what());
  ------------------
  |  |   38|     36|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     36|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     36|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     36|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  351|     36|  }
  352|  3.07k|}

_ZNK8rawspeed10RawDecoderUt_cvbEv:
  112|    326|    explicit operator bool() const { return quadrantMultipliers /*|| ...*/; }
_ZN8rawspeed10RawDecoderD2Ev:
   45|  11.6k|  virtual ~RawDecoder() = default;

_ZN8rawspeed10Rw2Decoder20isAppropriateDecoderEPKNS_11TiffRootIFDENS_6BufferE:
   63|  2.52k|                                      [[maybe_unused]] Buffer file) {
   64|  2.52k|  const auto id = rootIFD->getID();
   65|  2.52k|  const std::string& make = id.make;
   66|       |
   67|       |  // FIXME: magic
   68|       |
   69|  2.52k|  return make == "Panasonic" || make == "LEICA" || make == "LEICA CAMERA AG";
  ------------------
  |  Branch (69:10): [True: 707, False: 1.81k]
  |  Branch (69:33): [True: 2, False: 1.81k]
  |  Branch (69:52): [True: 0, False: 1.81k]
  ------------------
   70|  2.52k|}
_ZNK8rawspeed10Rw2Decoder11decodeRawV8ERKNS_7TiffIFDE:
  243|      6|RawImage Rw2Decoder::decodeRawV8(const TiffIFD& raw) const {
  244|      6|  parseCFA();
  245|      6|  if (getAsBayerPhase(mRaw->cfa) != BayerPhase::RGGB)
  ------------------
  |  Branch (245:7): [True: 3, False: 3]
  ------------------
  246|      6|    ThrowRDE("Unexpected CFA, only RGGB is supported");
  ------------------
  |  |   38|      3|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      3|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      3|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      3|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  247|       |
  248|      3|  const DecompressorV8Params mParams(raw);
  249|      3|  populateGammaLUT(mParams, raw);
  250|      3|  const std::vector<Array1DRef<const uint8_t>> mStrips =
  251|      3|      getInputStrips(mParams, mFile);
  252|       |
  253|      3|  PanasonicV8Decompressor::DecompressorParamsBuilder b(
  254|      3|      mRaw->dim, mParams.initialPrediction, getAsArray1DRef(mStrips),
  255|      3|      getAsArray1DRef(mParams.stripLineOffsets),
  256|      3|      getAsArray1DRef(mParams.stripWidths),
  257|      3|      getAsArray1DRef(mParams.stripHeights),
  258|      3|      raw.getEntry(TiffTag::PANASONIC_V8_HUF_TABLE)->getData());
  259|       |
  260|      3|  PanasonicV8Decompressor v8(mRaw, b.getDecompressorParams());
  261|      3|  mRaw->createData();
  262|      3|  v8.decompress();
  263|      3|  return mRaw;
  264|      6|}
Rw2Decoder.cpp:_ZN8rawspeed12_GLOBAL__N_120DecompressorV8ParamsC2ERKNS_7TiffIFDE:
  145|      2|DecompressorV8Params::DecompressorV8Params(const TiffIFD& ifd) {
  146|       |  // NOLINTBEGIN(cppcoreguidelines-prefer-member-initializer)
  147|      2|  horizontalStripCount =
  148|      2|      ifd.getEntry(TiffTag::PANASONIC_V8_NUMBER_OF_STRIPS_H)->getU16();
  149|      2|  verticalStripCount =
  150|      2|      ifd.getEntry(TiffTag::PANASONIC_V8_NUMBER_OF_STRIPS_V)->getU16();
  151|       |
  152|      2|  getPanasonicTiffVector(ifd, TiffTag::PANASONIC_V8_STRIP_BYTE_OFFSETS,
  153|      2|                         stripByteOffsets);
  154|      2|  getPanasonicTiffVector(ifd, TiffTag::PANASONIC_V8_STRIP_LINE_OFFSETS,
  155|      2|                         stripLineOffsets);
  156|      2|  getPanasonicTiffVector(ifd, TiffTag::PANASONIC_V8_STRIP_DATA_SIZE,
  157|      2|                         stripBitLengths);
  158|      2|  getPanasonicTiffVector(ifd, TiffTag::PANASONIC_V8_STRIP_WIDTHS, stripWidths);
  159|      2|  getPanasonicTiffVector(ifd, TiffTag::PANASONIC_V8_STRIP_HEIGHTS,
  160|      2|                         stripHeights);
  161|       |
  162|       |  // Get decoder's initial prediction value:
  163|       |  // Note, the positions of the green samples are swapped. This is intentional,
  164|       |  // the original implementation did this each swap redundantly during decoding
  165|       |  // of each tile.
  166|      2|  initialPrediction[0] =
  167|      2|      ifd.getEntry(TiffTag::PANASONIC_V8_INIT_PRED_RED)->getU16();
  168|      2|  initialPrediction[2] =
  169|      2|      ifd.getEntry(TiffTag::PANASONIC_V8_INIT_PRED_GREEN1)->getU16();
  170|      2|  initialPrediction[1] =
  171|      2|      ifd.getEntry(TiffTag::PANASONIC_V8_INIT_PRED_GREEN2)->getU16();
  172|      2|  initialPrediction[3] =
  173|      2|      ifd.getEntry(TiffTag::PANASONIC_V8_INIT_PRED_BLUE)->getU16();
  174|       |
  175|      2|  getPanasonicTiffVector(ifd, TiffTag::PANASONIC_V8_HUF_SHIFT_DOWN, shiftDown);
  176|       |
  177|      2|  gammaClipVal = ifd.getEntry(TiffTag::PANASONIC_V8_CLIP_VAL)->getU16();
  178|       |  // NOLINTEND(cppcoreguidelines-prefer-member-initializer)
  179|       |
  180|      2|  validate();
  181|      2|}
Rw2Decoder.cpp:_ZN8rawspeed12_GLOBAL__N_122getPanasonicTiffVectorIjEEvRKNS_7TiffIFDENS_7TiffTagERNSt3__16vectorIT_NS6_9allocatorIS8_EEEE:
   77|      1|                            std::vector<T>& output) {
   78|      1|  ByteStream bs = ifd.getEntry(tag)->getData();
   79|      1|  output.resize(bs.getU16());
   80|       |
   81|       |  // Note: Relying on ByteStream and its parent classes to prevent out-of-bounds
   82|       |  // reading.
   83|      1|  for (T& v : output)
  ------------------
  |  Branch (83:13): [True: 0, False: 1]
  ------------------
   84|      0|    v = bs.get<T>();
   85|      1|}
_ZN8rawspeed10Rw2Decoder17decodeRawInternalEv:
  266|    709|RawImage Rw2Decoder::decodeRawInternal() {
  267|       |
  268|    709|  const TiffIFD* raw = nullptr;
  269|    709|  bool isOldPanasonic =
  270|    709|      !mRootIFD->hasEntryRecursive(TiffTag::PANASONIC_STRIPOFFSET);
  271|       |
  272|    709|  if (!isOldPanasonic)
  ------------------
  |  Branch (272:7): [True: 365, False: 344]
  ------------------
  273|    365|    raw = mRootIFD->getIFDWithTag(TiffTag::PANASONIC_STRIPOFFSET);
  274|    344|  else
  275|    344|    raw = mRootIFD->getIFDWithTag(TiffTag::STRIPOFFSETS);
  276|       |
  277|    709|  uint32_t height = raw->getEntry(static_cast<TiffTag>(3))->getU16();
  278|    709|  uint32_t width = raw->getEntry(static_cast<TiffTag>(2))->getU16();
  279|       |
  280|    709|  if (isOldPanasonic) {
  ------------------
  |  Branch (280:7): [True: 341, False: 368]
  ------------------
  281|    341|    if (width == 0 || height == 0 || width > 4330 || height > 2751)
  ------------------
  |  Branch (281:9): [True: 1, False: 340]
  |  Branch (281:23): [True: 2, False: 338]
  |  Branch (281:38): [True: 10, False: 328]
  |  Branch (281:54): [True: 9, False: 319]
  ------------------
  282|    341|      ThrowRDE("Unexpected image dimensions found: (%u; %u)", width, height);
  ------------------
  |  |   38|     22|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     22|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     22|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     22|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  283|       |
  284|    319|    const TiffEntry* offsets = raw->getEntry(TiffTag::STRIPOFFSETS);
  285|       |
  286|    319|    if (offsets->count != 1) {
  ------------------
  |  Branch (286:9): [True: 2, False: 317]
  ------------------
  287|      2|      ThrowRDE("Multiple Strips found: %u", offsets->count);
  ------------------
  |  |   38|      2|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      2|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      2|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      2|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  288|      2|    }
  289|    317|    uint32_t offset = offsets->getU32();
  290|    317|    if (!mFile.isValid(offset))
  ------------------
  |  Branch (290:9): [True: 42, False: 275]
  ------------------
  291|    317|      ThrowRDE("Invalid image data offset, cannot decode.");
  ------------------
  |  |   38|     42|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     42|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     42|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     42|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  292|       |
  293|    275|    mRaw->dim = iPoint2D(width, height);
  294|       |
  295|    275|    uint32_t size = mFile.getSize() - offset;
  296|       |
  297|    275|    if (size >= width * height * 2) {
  ------------------
  |  Branch (297:9): [True: 72, False: 203]
  ------------------
  298|       |      // It's completely unpacked little-endian
  299|     72|      UncompressedDecompressor u(
  300|     72|          ByteStream(DataBuffer(mFile.getSubView(offset), Endianness::little)),
  301|     72|          mRaw, iRectangle2D({0, 0}, iPoint2D(width, height)), 16 * width / 8,
  302|     72|          16, BitOrder::LSB);
  303|     72|      mRaw->createData();
  304|     72|      u.decode12BitRawUnpackedLeftAligned<Endianness::little>();
  305|    203|    } else if (size >= width * height * 3 / 2) {
  ------------------
  |  Branch (305:16): [True: 51, False: 152]
  ------------------
  306|       |      // It's a packed format
  307|     51|      UncompressedDecompressor u(
  308|     51|          ByteStream(DataBuffer(mFile.getSubView(offset), Endianness::little)),
  309|     51|          mRaw, iRectangle2D({0, 0}, iPoint2D(width, height)),
  310|     51|          (12 * width / 8) + ((width + 2) / 10), 12, BitOrder::LSB);
  311|     51|      mRaw->createData();
  312|     51|      u.decode12BitRawWithControl<Endianness::little>();
  313|    152|    } else {
  314|    152|      uint32_t section_split_offset = 0;
  315|    152|      PanasonicV4Decompressor p(
  316|    152|          mRaw,
  317|    152|          ByteStream(DataBuffer(mFile.getSubView(offset), Endianness::little)),
  318|    152|          hints.contains("zero_is_not_bad"), section_split_offset);
  319|    152|      mRaw->createData();
  320|    152|      p.decompress();
  321|    152|    }
  322|    368|  } else {
  323|    368|    mRaw->dim = iPoint2D(width, height);
  324|       |
  325|    368|    const TiffEntry* offsets = raw->getEntry(TiffTag::PANASONIC_STRIPOFFSET);
  326|       |
  327|    368|    if (offsets->count != 1) {
  ------------------
  |  Branch (327:9): [True: 1, False: 367]
  ------------------
  328|      1|      ThrowRDE("Multiple Strips found: %u", offsets->count);
  ------------------
  |  |   38|      1|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      1|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      1|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      1|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  329|      1|    }
  330|       |
  331|    367|    uint32_t offset = offsets->getU32();
  332|       |
  333|    367|    ByteStream bs(DataBuffer(mFile.getSubView(offset), Endianness::little));
  334|       |
  335|    367|    uint16_t bitsPerSample = 12;
  336|    367|    if (raw->hasEntry(TiffTag::PANASONIC_BITSPERSAMPLE))
  ------------------
  |  Branch (336:9): [True: 165, False: 202]
  ------------------
  337|    165|      bitsPerSample = raw->getEntry(TiffTag::PANASONIC_BITSPERSAMPLE)->getU16();
  338|       |
  339|    367|    switch (uint16_t version =
  340|    367|                raw->getEntry(TiffTag::PANASONIC_RAWFORMAT)->getU16()) {
  341|     31|    case 4: {
  ------------------
  |  Branch (341:5): [True: 31, False: 336]
  ------------------
  342|     31|      uint32_t section_split_offset = 0x1FF8;
  343|     31|      PanasonicV4Decompressor p(mRaw, bs, hints.contains("zero_is_not_bad"),
  344|     31|                                section_split_offset);
  345|     31|      mRaw->createData();
  346|     31|      p.decompress();
  347|     31|      return mRaw;
  348|      0|    }
  349|    116|    case 5: {
  ------------------
  |  Branch (349:5): [True: 116, False: 251]
  ------------------
  350|    116|      PanasonicV5Decompressor v5(mRaw, bs, bitsPerSample);
  351|    116|      mRaw->createData();
  352|    116|      v5.decompress();
  353|    116|      return mRaw;
  354|      0|    }
  355|    122|    case 6: {
  ------------------
  |  Branch (355:5): [True: 122, False: 245]
  ------------------
  356|    122|      if (bitsPerSample != 14 && bitsPerSample != 12)
  ------------------
  |  Branch (356:11): [True: 75, False: 47]
  |  Branch (356:34): [True: 1, False: 74]
  ------------------
  357|    122|        ThrowRDE("Version %i: unexpected bits per sample: %i", version,
  ------------------
  |  |   38|      1|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      1|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      1|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      1|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  358|    121|                 bitsPerSample);
  359|       |
  360|    121|      PanasonicV6Decompressor v6(mRaw, bs, bitsPerSample);
  361|    121|      mRaw->createData();
  362|    121|      v6.decompress();
  363|    121|      return mRaw;
  364|    122|    }
  365|     73|    case 7: {
  ------------------
  |  Branch (365:5): [True: 73, False: 294]
  ------------------
  366|     73|      if (bitsPerSample != 14)
  ------------------
  |  Branch (366:11): [True: 9, False: 64]
  ------------------
  367|     73|        ThrowRDE("Version %i: unexpected bits per sample: %i", version,
  ------------------
  |  |   38|      9|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      9|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      9|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      9|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  368|     64|                 bitsPerSample);
  369|     64|      PanasonicV7Decompressor v7(mRaw, bs);
  370|     64|      mRaw->createData();
  371|     64|      v7.decompress();
  372|     64|      return mRaw;
  373|     73|    }
  374|      7|    case 8: {
  ------------------
  |  Branch (374:5): [True: 7, False: 360]
  ------------------
  375|       |      // Known values are 12, 14, and 16. Other less than 16 should decompress
  376|       |      // fine.
  377|      7|      if (bitsPerSample > 16)
  ------------------
  |  Branch (377:11): [True: 1, False: 6]
  ------------------
  378|      7|        ThrowRDE("Version %i: unexpected bits per sample: %i", version,
  ------------------
  |  |   38|      1|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      1|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      1|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      1|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  379|      6|                 bitsPerSample);
  380|      6|      return decodeRawV8(*raw);
  381|      7|    }
  382|      1|    default:
  ------------------
  |  Branch (382:5): [True: 1, False: 366]
  ------------------
  383|      1|      ThrowRDE("Version %i is unsupported", version);
  ------------------
  |  |   38|      1|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      1|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      1|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      1|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  384|    367|    }
  385|    367|  }
  386|       |
  387|    275|  return mRaw;
  388|    709|}
_ZNK8rawspeed10Rw2Decoder8parseCFAEv:
  396|    488|void Rw2Decoder::parseCFA() const {
  397|    488|  if (!mRootIFD->hasEntryRecursive(TiffTag::PANASONIC_CFAPATTERN))
  ------------------
  |  Branch (397:7): [True: 438, False: 50]
  ------------------
  398|    488|    ThrowRDE("No PANASONIC_CFAPATTERN entry found!");
  ------------------
  |  |   38|    438|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|    438|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|    438|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|    438|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  399|       |
  400|     50|  const TiffEntry* CFA =
  401|     50|      mRootIFD->getEntryRecursive(TiffTag::PANASONIC_CFAPATTERN);
  402|     50|  if (CFA->type != TiffDataType::SHORT || CFA->count != 1) {
  ------------------
  |  Branch (402:7): [True: 3, False: 47]
  |  Branch (402:43): [True: 1, False: 46]
  ------------------
  403|      4|    ThrowRDE("Bad PANASONIC_CFAPATTERN entry (type %u, count %u).",
  ------------------
  |  |   38|      4|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      4|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      4|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      4|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  404|      4|             static_cast<unsigned>(CFA->type), CFA->count);
  405|      4|  }
  406|       |
  407|     46|  switch (auto i = CFA->getU16()) {
  408|      0|    using enum CFAColor;
  409|     13|  case 1:
  ------------------
  |  Branch (409:3): [True: 13, False: 33]
  ------------------
  410|     13|    mRaw->cfa.setCFA(iPoint2D(2, 2), RED, GREEN, GREEN, BLUE);
  411|     13|    break;
  412|      8|  case 2:
  ------------------
  |  Branch (412:3): [True: 8, False: 38]
  ------------------
  413|      8|    mRaw->cfa.setCFA(iPoint2D(2, 2), GREEN, RED, BLUE, GREEN);
  414|      8|    break;
  415|     19|  case 3:
  ------------------
  |  Branch (415:3): [True: 19, False: 27]
  ------------------
  416|     19|    mRaw->cfa.setCFA(iPoint2D(2, 2), GREEN, BLUE, RED, GREEN);
  417|     19|    break;
  418|      5|  case 4:
  ------------------
  |  Branch (418:3): [True: 5, False: 41]
  ------------------
  419|      5|    mRaw->cfa.setCFA(iPoint2D(2, 2), BLUE, GREEN, GREEN, RED);
  420|      5|    break;
  421|      1|  default:
  ------------------
  |  Branch (421:3): [True: 1, False: 45]
  ------------------
  422|      1|    ThrowRDE("Unexpected CFA pattern: %u", i);
  ------------------
  |  |   38|      1|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      1|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      1|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      1|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  423|     46|  }
  424|     46|}
_ZNK8rawspeed10Rw2Decoder6getRawEv:
  426|     39|const TiffIFD* Rw2Decoder::getRaw() const {
  427|     39|  return mRootIFD->hasEntryRecursive(TiffTag::PANASONIC_STRIPOFFSET)
  ------------------
  |  Branch (427:10): [True: 1, False: 38]
  ------------------
  428|     39|             ? mRootIFD->getIFDWithTag(TiffTag::PANASONIC_STRIPOFFSET)
  429|     39|             : mRootIFD->getIFDWithTag(TiffTag::STRIPOFFSETS);
  430|     39|}
_ZN8rawspeed10Rw2Decoder22decodeMetaDataInternalEPKNS_14CameraMetaDataE:
  432|    482|void Rw2Decoder::decodeMetaDataInternal(const CameraMetaData* meta) {
  433|    482|  parseCFA();
  434|       |
  435|    482|  auto id = mRootIFD->getID();
  436|    482|  std::string mode = guessMode();
  437|    482|  int iso = 0;
  438|    482|  if (mRootIFD->hasEntryRecursive(TiffTag::PANASONIC_ISO_SPEED))
  ------------------
  |  Branch (438:7): [True: 3, False: 479]
  ------------------
  439|      3|    iso = mRootIFD->getEntryRecursive(TiffTag::PANASONIC_ISO_SPEED)->getU32();
  440|       |
  441|    482|  if (this->checkCameraSupported(meta, id, mode)) {
  ------------------
  |  Branch (441:7): [True: 0, False: 482]
  ------------------
  442|      0|    setMetaData(meta, id, mode, iso);
  443|    482|  } else {
  444|    482|    mRaw->metadata.mode = mode;
  445|    482|    writeLog(DEBUG_PRIO::EXTRA, "Mode not found in DB: %s", mode.c_str());
  446|    482|    setMetaData(meta, id, "", iso);
  447|    482|  }
  448|       |
  449|    482|  const TiffIFD* raw = getRaw();
  450|       |
  451|       |  // Read blacklevels
  452|    482|  if (raw->hasEntry(static_cast<TiffTag>(0x1c)) &&
  ------------------
  |  Branch (452:7): [True: 20, False: 462]
  ------------------
  453|     20|      raw->hasEntry(static_cast<TiffTag>(0x1d)) &&
  ------------------
  |  Branch (453:7): [True: 11, False: 9]
  ------------------
  454|     11|      raw->hasEntry(static_cast<TiffTag>(0x1e))) {
  ------------------
  |  Branch (454:7): [True: 6, False: 5]
  ------------------
  455|      6|    auto blackLevelsNeedOffsetting = [&]() {
  456|      6|      bool isOldPanasonic =
  457|      6|          !mRootIFD->hasEntryRecursive(TiffTag::PANASONIC_STRIPOFFSET);
  458|      6|      if (isOldPanasonic)
  459|      6|        return true;
  460|      6|      const uint16_t version =
  461|      6|          raw->getEntry(TiffTag::PANASONIC_RAWFORMAT)->getU16();
  462|       |      // After version 4 the black levels appears to be correct.
  463|      6|      return version <= 4;
  464|      6|    };
  465|      6|    const auto getBlack = [&raw, blackLevelsNeedOffsetting](TiffTag t) {
  466|      6|      const int val = raw->getEntry(t)->getU16();
  467|      6|      if (!blackLevelsNeedOffsetting())
  468|      6|        return val;
  469|       |      // Continue adding 15 for older raw versions.
  470|      6|      int out;
  471|      6|      if (__builtin_sadd_overflow(val, 15, &out))
  472|      6|        ThrowRDE("Integer overflow when calculating black level");
  473|      6|      return out;
  474|      6|    };
  475|       |
  476|      6|    const int blackRed = getBlack(static_cast<TiffTag>(0x1c));
  477|      6|    const int blackGreen = getBlack(static_cast<TiffTag>(0x1d));
  478|      6|    const int blackBlue = getBlack(static_cast<TiffTag>(0x1e));
  479|       |
  480|      6|    mRaw->blackLevelSeparate =
  481|      6|        Array2DRef(mRaw->blackLevelSeparateStorage.data(), 2, 2);
  482|      6|    auto blackLevelSeparate1D = *mRaw->blackLevelSeparate->getAsArray1DRef();
  483|     12|    for (int i = 0; i < 2; i++) {
  ------------------
  |  Branch (483:21): [True: 6, False: 6]
  ------------------
  484|     18|      for (int j = 0; j < 2; j++) {
  ------------------
  |  Branch (484:23): [True: 12, False: 6]
  ------------------
  485|     12|        const int k = i + (2 * j);
  486|     12|        const CFAColor c = mRaw->cfa.getColorAt(i, j);
  487|     12|        switch (c) {
  488|      3|        case CFAColor::RED:
  ------------------
  |  Branch (488:9): [True: 3, False: 9]
  ------------------
  489|      3|          blackLevelSeparate1D(k) = blackRed;
  490|      3|          break;
  491|      6|        case CFAColor::GREEN:
  ------------------
  |  Branch (491:9): [True: 6, False: 6]
  ------------------
  492|      6|          blackLevelSeparate1D(k) = blackGreen;
  493|      6|          break;
  494|      3|        case CFAColor::BLUE:
  ------------------
  |  Branch (494:9): [True: 3, False: 9]
  ------------------
  495|      3|          blackLevelSeparate1D(k) = blackBlue;
  496|      3|          break;
  497|      0|        default:
  ------------------
  |  Branch (497:9): [True: 0, False: 12]
  ------------------
  498|      0|          ThrowRDE("Unexpected CFA color %s.",
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  499|     12|                   ColorFilterArray::colorToString(c).c_str());
  500|     12|        }
  501|     12|      }
  502|      6|    }
  503|      6|  }
  504|       |
  505|       |  // Read WB levels
  506|    482|  if (raw->hasEntry(static_cast<TiffTag>(0x0024)) &&
  ------------------
  |  Branch (506:7): [True: 10, False: 472]
  ------------------
  507|     10|      raw->hasEntry(static_cast<TiffTag>(0x0025)) &&
  ------------------
  |  Branch (507:7): [True: 6, False: 4]
  ------------------
  508|      6|      raw->hasEntry(static_cast<TiffTag>(0x0026))) {
  ------------------
  |  Branch (508:7): [True: 1, False: 5]
  ------------------
  509|      1|    std::array<float, 4> wbCoeffs = {};
  510|      1|    wbCoeffs[0] = static_cast<float>(
  511|      1|        raw->getEntry(static_cast<TiffTag>(0x0024))->getU16());
  512|      1|    wbCoeffs[1] = static_cast<float>(
  513|      1|        raw->getEntry(static_cast<TiffTag>(0x0025))->getU16());
  514|      1|    wbCoeffs[2] = static_cast<float>(
  515|      1|        raw->getEntry(static_cast<TiffTag>(0x0026))->getU16());
  516|      1|    mRaw->metadata.wbCoeffs = wbCoeffs;
  517|    481|  } else if (raw->hasEntry(static_cast<TiffTag>(0x0011)) &&
  ------------------
  |  Branch (517:14): [True: 7, False: 474]
  ------------------
  518|      7|             raw->hasEntry(static_cast<TiffTag>(0x0012))) {
  ------------------
  |  Branch (518:14): [True: 3, False: 4]
  ------------------
  519|      3|    std::array<float, 4> wbCoeffs = {};
  520|      3|    wbCoeffs[0] = static_cast<float>(
  521|      3|        raw->getEntry(static_cast<TiffTag>(0x0011))->getU16());
  522|      3|    wbCoeffs[1] = 256.0F;
  523|      3|    wbCoeffs[2] = static_cast<float>(
  524|      3|        raw->getEntry(static_cast<TiffTag>(0x0012))->getU16());
  525|      3|    mRaw->metadata.wbCoeffs = wbCoeffs;
  526|      3|  }
  527|    482|}
Rw2Decoder.cpp:_ZZN8rawspeed10Rw2Decoder22decodeMetaDataInternalEPKNS_14CameraMetaDataEENK3$_1clENS_7TiffTagE:
  465|     15|    const auto getBlack = [&raw, blackLevelsNeedOffsetting](TiffTag t) {
  466|     15|      const int val = raw->getEntry(t)->getU16();
  467|     15|      if (!blackLevelsNeedOffsetting())
  ------------------
  |  Branch (467:11): [True: 0, False: 15]
  ------------------
  468|      0|        return val;
  469|       |      // Continue adding 15 for older raw versions.
  470|     15|      int out;
  471|     15|      if (__builtin_sadd_overflow(val, 15, &out))
  ------------------
  |  Branch (471:11): [True: 0, False: 15]
  ------------------
  472|     15|        ThrowRDE("Integer overflow when calculating black level");
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  473|     15|      return out;
  474|     15|    };
Rw2Decoder.cpp:_ZZN8rawspeed10Rw2Decoder22decodeMetaDataInternalEPKNS_14CameraMetaDataEENK3$_0clEv:
  455|     12|    auto blackLevelsNeedOffsetting = [&]() {
  456|     12|      bool isOldPanasonic =
  457|     12|          !mRootIFD->hasEntryRecursive(TiffTag::PANASONIC_STRIPOFFSET);
  458|     12|      if (isOldPanasonic)
  ------------------
  |  Branch (458:11): [True: 12, False: 0]
  ------------------
  459|     12|        return true;
  460|      0|      const uint16_t version =
  461|      0|          raw->getEntry(TiffTag::PANASONIC_RAWFORMAT)->getU16();
  462|       |      // After version 4 the black levels appears to be correct.
  463|      0|      return version <= 4;
  464|     12|    };
_ZNK8rawspeed10Rw2Decoder9guessModeEv:
  529|     40|std::string Rw2Decoder::guessMode() const {
  530|     40|  float ratio = 3.0F / 2.0F; // Default
  531|       |
  532|     40|  if (!mRaw->isAllocated())
  ------------------
  |  Branch (532:7): [True: 0, False: 40]
  ------------------
  533|      0|    return "";
  534|       |
  535|     40|  ratio = static_cast<float>(mRaw->dim.x) / static_cast<float>(mRaw->dim.y);
  536|       |
  537|     40|  float min_diff = fabs(ratio - (16.0F / 9.0F));
  538|     40|  std::string closest_match = "16:9";
  539|       |
  540|     40|  float t = fabs(ratio - (3.0F / 2.0F));
  541|     40|  if (t < min_diff) {
  ------------------
  |  Branch (541:7): [True: 14, False: 26]
  ------------------
  542|     14|    closest_match = "3:2";
  543|     14|    min_diff = t;
  544|     14|  }
  545|       |
  546|     40|  t = fabs(ratio - (4.0F / 3.0F));
  547|     40|  if (t < min_diff) {
  ------------------
  |  Branch (547:7): [True: 14, False: 26]
  ------------------
  548|     14|    closest_match = "4:3";
  549|     14|    min_diff = t;
  550|     14|  }
  551|       |
  552|     40|  t = fabs(ratio - 1.0F);
  553|     40|  if (t < min_diff) {
  ------------------
  |  Branch (553:7): [True: 13, False: 27]
  ------------------
  554|     13|    closest_match = "1:1";
  555|     13|    min_diff = t;
  556|     13|  }
  557|     40|  writeLog(DEBUG_PRIO::EXTRA, "Mode guess: '%s'", closest_match.c_str());
  558|     40|  return closest_match;
  559|     40|}

_ZN8rawspeed10Rw2DecoderC2EONSt3__110unique_ptrINS_11TiffRootIFDENS1_14default_deleteIS3_EEEENS_6BufferE:
   41|    709|      : AbstractTiffDecoder(std::move(root), file) {}

_ZN8rawspeed17SimpleTiffDecoder21prepareForRawDecodingEv:
   39|    492|void SimpleTiffDecoder::prepareForRawDecoding() {
   40|    492|  raw = getIFDWithLargestImage();
   41|    492|  width = raw->getEntry(TiffTag::IMAGEWIDTH)->getU32();
   42|    492|  height = raw->getEntry(TiffTag::IMAGELENGTH)->getU32();
   43|    492|  off = raw->getEntry(TiffTag::STRIPOFFSETS)->getU32();
   44|    492|  c2 = raw->getEntry(TiffTag::STRIPBYTECOUNTS)->getU32();
   45|       |
   46|    492|  if (!mFile.isValid(off, c2))
  ------------------
  |  Branch (46:7): [True: 39, False: 453]
  ------------------
   47|    492|    ThrowRDE("Image is truncated.");
  ------------------
  |  |   38|     39|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     39|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     39|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     39|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   48|       |
   49|    453|  if (c2 == 0)
  ------------------
  |  Branch (49:7): [True: 1, False: 452]
  ------------------
   50|    453|    ThrowRDE("No image data found.");
  ------------------
  |  |   38|      1|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      1|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      1|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      1|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   51|       |
   52|    452|  if (0 == width || 0 == height)
  ------------------
  |  Branch (52:7): [True: 18, False: 434]
  |  Branch (52:21): [True: 1, False: 433]
  ------------------
   53|    452|    ThrowRDE("Image has zero size.");
  ------------------
  |  |   38|      2|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      2|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      2|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      2|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   54|       |
   55|    450|  checkImageDimensions();
   56|       |
   57|    450|  mRaw->dim = iPoint2D(width, height);
   58|    450|}

_ZN8rawspeed17SimpleTiffDecoderC2EONSt3__110unique_ptrINS_11TiffRootIFDENS1_14default_deleteIS3_EEEENS_6BufferE:
   42|    492|      : AbstractTiffDecoder(std::move(root), file) {}

_ZN8rawspeed10SrwDecoder20isAppropriateDecoderEPKNS_11TiffRootIFDENS_6BufferE:
   47|  1.81k|                                      [[maybe_unused]] Buffer file) {
   48|  1.81k|  const auto id = rootIFD->getID();
   49|  1.81k|  const std::string& make = id.make;
   50|       |
   51|       |  // FIXME: magic
   52|       |
   53|  1.81k|  return make == "SAMSUNG";
   54|  1.81k|}
_ZN8rawspeed10SrwDecoder17decodeRawInternalEv:
   56|    544|RawImage SrwDecoder::decodeRawInternal() {
   57|    544|  const auto* raw = mRootIFD->getIFDWithTag(TiffTag::STRIPOFFSETS);
   58|       |
   59|    544|  int compression = raw->getEntry(TiffTag::COMPRESSION)->getU32();
   60|    544|  const int bits = raw->getEntry(TiffTag::BITSPERSAMPLE)->getU32();
   61|       |
   62|    544|  if (12 != bits && 14 != bits)
  ------------------
  |  Branch (62:7): [True: 232, False: 312]
  |  Branch (62:21): [True: 30, False: 202]
  ------------------
   63|    544|    ThrowRDE("Unsupported bits per sample");
  ------------------
  |  |   38|     30|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     30|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     30|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     30|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   64|       |
   65|    514|  if (32769 != compression && 32770 != compression && 32772 != compression &&
  ------------------
  |  Branch (65:7): [True: 508, False: 6]
  |  Branch (65:31): [True: 342, False: 166]
  |  Branch (65:55): [True: 244, False: 98]
  ------------------
   66|    244|      32773 != compression)
  ------------------
  |  Branch (66:7): [True: 27, False: 217]
  ------------------
   67|    514|    ThrowRDE("Unsupported compression");
  ------------------
  |  |   38|     27|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     27|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     27|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     27|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   68|       |
   69|    487|  if (uint32_t nslices = raw->getEntry(TiffTag::STRIPOFFSETS)->count;
   70|    487|      nslices != 1)
  ------------------
  |  Branch (70:7): [True: 1, False: 486]
  ------------------
   71|    487|    ThrowRDE("Only one slice supported, found %u", nslices);
  ------------------
  |  |   38|      1|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      1|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      1|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      1|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   72|       |
   73|    486|  if (const auto wrongComp =
   74|    486|          32770 == compression && !raw->hasEntry(static_cast<TiffTag>(40976));
  ------------------
  |  Branch (74:11): [True: 166, False: 320]
  |  Branch (74:35): [True: 8, False: 158]
  ------------------
   75|    486|      32769 == compression || wrongComp) {
  ------------------
  |  Branch (75:7): [True: 6, False: 480]
  |  Branch (75:31): [True: 8, False: 472]
  ------------------
   76|      9|    bool bit_order = hints.get("msb_override", wrongComp ? bits == 12 : false);
  ------------------
  |  Branch (76:48): [True: 8, False: 1]
  ------------------
   77|      9|    this->decodeUncompressed(raw, bit_order ? BitOrder::MSB : BitOrder::LSB);
  ------------------
  |  Branch (77:35): [True: 5, False: 4]
  ------------------
   78|      9|    return mRaw;
   79|      9|  }
   80|       |
   81|    477|  const uint32_t width = raw->getEntry(TiffTag::IMAGEWIDTH)->getU32();
   82|    477|  const uint32_t height = raw->getEntry(TiffTag::IMAGELENGTH)->getU32();
   83|    477|  mRaw->dim = iPoint2D(width, height);
   84|       |
   85|    477|  if (32770 == compression) {
  ------------------
  |  Branch (85:7): [True: 158, False: 319]
  ------------------
   86|    158|    const TiffEntry* sliceOffsets = raw->getEntry(static_cast<TiffTag>(40976));
   87|    158|    if (sliceOffsets->type != TiffDataType::LONG || sliceOffsets->count != 1)
  ------------------
  |  Branch (87:9): [True: 1, False: 157]
  |  Branch (87:53): [True: 1, False: 156]
  ------------------
   88|    158|      ThrowRDE("Entry 40976 is corrupt");
  ------------------
  |  |   38|      2|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      2|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      2|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      2|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   89|       |
   90|    156|    ByteStream bso(DataBuffer(mFile, Endianness::little));
   91|    156|    bso.skipBytes(sliceOffsets->getU32());
   92|    156|    bso = bso.getStream(height, 4);
   93|       |
   94|    156|    const uint32_t offset = raw->getEntry(TiffTag::STRIPOFFSETS)->getU32();
   95|    156|    const uint32_t count = raw->getEntry(TiffTag::STRIPBYTECOUNTS)->getU32();
   96|    156|    Buffer rbuf(mFile.getSubView(offset, count));
   97|    156|    ByteStream bsr(DataBuffer(rbuf, Endianness::little));
   98|       |
   99|    156|    SamsungV0Decompressor s0(mRaw, bso, bsr);
  100|       |
  101|    156|    mRaw->createData();
  102|       |
  103|    156|    s0.decompress();
  104|       |
  105|    156|    return mRaw;
  106|    158|  }
  107|    319|  if (32772 == compression) {
  ------------------
  |  Branch (107:7): [True: 98, False: 221]
  ------------------
  108|     98|    uint32_t offset = raw->getEntry(TiffTag::STRIPOFFSETS)->getU32();
  109|     98|    uint32_t count = raw->getEntry(TiffTag::STRIPBYTECOUNTS)->getU32();
  110|     98|    const ByteStream bs(
  111|     98|        DataBuffer(mFile.getSubView(offset, count), Endianness::little));
  112|       |
  113|     98|    SamsungV1Decompressor s1(mRaw, bs, bits);
  114|       |
  115|     98|    mRaw->createData();
  116|       |
  117|     98|    s1.decompress();
  118|       |
  119|     98|    return mRaw;
  120|     98|  }
  121|    221|  if (32773 == compression) {
  ------------------
  |  Branch (121:7): [True: 216, False: 5]
  ------------------
  122|    216|    uint32_t offset = raw->getEntry(TiffTag::STRIPOFFSETS)->getU32();
  123|    216|    uint32_t count = raw->getEntry(TiffTag::STRIPBYTECOUNTS)->getU32();
  124|    216|    const ByteStream bs(
  125|    216|        DataBuffer(mFile.getSubView(offset, count), Endianness::little));
  126|       |
  127|    216|    SamsungV2Decompressor s2(mRaw, bs, bits);
  128|       |
  129|    216|    mRaw->createData();
  130|       |
  131|    216|    s2.decompress();
  132|       |
  133|    216|    return mRaw;
  134|    216|  }
  135|      5|  ThrowRDE("Unsupported compression");
  ------------------
  |  |   38|      5|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      5|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      5|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      5|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  136|    221|}
_ZNK8rawspeed10SrwDecoder7getModeEv:
  138|     35|std::string SrwDecoder::getMode() const {
  139|     35|  std::vector<const TiffIFD*> data =
  140|     35|      mRootIFD->getIFDsWithTag(TiffTag::CFAPATTERN);
  141|     35|  std::ostringstream mode;
  142|     35|  if (!data.empty() && data[0]->hasEntryRecursive(TiffTag::BITSPERSAMPLE)) {
  ------------------
  |  Branch (142:7): [True: 5, False: 30]
  |  Branch (142:24): [True: 3, False: 2]
  ------------------
  143|      3|    mode << data[0]->getEntryRecursive(TiffTag::BITSPERSAMPLE)->getU32()
  144|      3|         << "bit";
  145|      3|    return mode.str();
  146|      3|  }
  147|     32|  return "";
  148|     35|}
_ZN8rawspeed10SrwDecoder22decodeMetaDataInternalEPKNS_14CameraMetaDataE:
  159|     35|void SrwDecoder::decodeMetaDataInternal(const CameraMetaData* meta) {
  160|     35|  int iso = 0;
  161|     35|  if (mRootIFD->hasEntryRecursive(TiffTag::ISOSPEEDRATINGS))
  ------------------
  |  Branch (161:7): [True: 1, False: 34]
  ------------------
  162|      1|    iso = mRootIFD->getEntryRecursive(TiffTag::ISOSPEEDRATINGS)->getU32();
  163|       |
  164|     35|  auto id = mRootIFD->getID();
  165|     35|  if (std::string mode = getMode(); meta->hasCamera(id.make, id.model, mode))
  ------------------
  |  Branch (165:37): [True: 0, False: 35]
  ------------------
  166|      0|    setMetaData(meta, id, mode, iso);
  167|     35|  else
  168|     35|    setMetaData(meta, id, "", iso);
  169|       |
  170|       |  // Set the whitebalance
  171|     35|  if (mRootIFD->hasEntryRecursive(TiffTag::SAMSUNG_WB_RGGBLEVELSUNCORRECTED) &&
  ------------------
  |  Branch (171:7): [True: 8, False: 27]
  ------------------
  172|      8|      mRootIFD->hasEntryRecursive(TiffTag::SAMSUNG_WB_RGGBLEVELSBLACK)) {
  ------------------
  |  Branch (172:7): [True: 5, False: 3]
  ------------------
  173|      5|    const TiffEntry* wb_levels =
  174|      5|        mRootIFD->getEntryRecursive(TiffTag::SAMSUNG_WB_RGGBLEVELSUNCORRECTED);
  175|      5|    const TiffEntry* wb_black =
  176|      5|        mRootIFD->getEntryRecursive(TiffTag::SAMSUNG_WB_RGGBLEVELSBLACK);
  177|      5|    if (wb_levels->count == 4 && wb_black->count == 4) {
  ------------------
  |  Branch (177:9): [True: 3, False: 2]
  |  Branch (177:34): [True: 1, False: 2]
  ------------------
  178|      1|      std::array<float, 4> wbCoeffs = {};
  179|      1|      wbCoeffs[0] = wb_levels->getFloat(0) - wb_black->getFloat(0);
  180|      1|      wbCoeffs[1] = wb_levels->getFloat(1) - wb_black->getFloat(1);
  181|      1|      wbCoeffs[2] = wb_levels->getFloat(3) - wb_black->getFloat(3);
  182|      1|      mRaw->metadata.wbCoeffs = wbCoeffs;
  183|      1|    }
  184|      5|  }
  185|     35|}

_ZN8rawspeed10SrwDecoderC2EONSt3__110unique_ptrINS_11TiffRootIFDENS1_14default_deleteIS3_EEEENS_6BufferE:
   39|    544|      : AbstractTiffDecoder(std::move(root), file) {}

_ZN8rawspeed10StiDecoder20isAppropriateDecoderEPKNS_11TiffRootIFDENS_6BufferE:
   43|    689|                                      [[maybe_unused]] Buffer file) {
   44|    689|  const auto id = rootIFD->getID();
   45|    689|  const std::string& make = id.make;
   46|       |
   47|       |  // FIXME: magic
   48|       |
   49|    689|  return make == "Sinar AG";
   50|    689|}
_ZN8rawspeed10StiDecoder17decodeRawInternalEv:
   52|     26|RawImage StiDecoder::decodeRawInternal() {
   53|     26|  const auto* raw = mRootIFD->getIFDWithTag(TiffTag::TILEOFFSETS, 0);
   54|     26|  uint32_t width = raw->getEntry(TiffTag::IMAGEWIDTH)->getU32();
   55|     26|  uint32_t height = raw->getEntry(TiffTag::IMAGELENGTH)->getU32();
   56|     26|  uint32_t compression = raw->getEntry(TiffTag::COMPRESSION)->getU32();
   57|       |
   58|     26|  mRaw->dim = iPoint2D(width, height);
   59|       |
   60|     26|  if (1 != compression)
  ------------------
  |  Branch (60:7): [True: 3, False: 23]
  ------------------
   61|     26|    ThrowRDE("Unexpected compression type.");
  ------------------
  |  |   38|      3|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      3|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      3|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      3|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   62|       |
   63|     23|  DecodeUncompressed(raw);
   64|     23|  return mRaw;
   65|     26|}
_ZNK8rawspeed10StiDecoder18DecodeUncompressedEPKNS_7TiffIFDE:
   67|     22|void StiDecoder::DecodeUncompressed(const TiffIFD* raw) const {
   68|     22|  if (mRaw->getDataType() != RawImageType::UINT16)
  ------------------
  |  Branch (68:7): [True: 0, False: 22]
  ------------------
   69|     22|    ThrowRDE("Unexpected data type");
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   70|       |
   71|     22|  if (mRaw->getCpp() != 1 || mRaw->getBpp() != sizeof(uint16_t))
  ------------------
  |  Branch (71:7): [True: 0, False: 22]
  |  Branch (71:30): [True: 0, False: 22]
  ------------------
   72|     22|    ThrowRDE("Unexpected cpp: %u", mRaw->getCpp());
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   73|       |
   74|       |  // FIXME: could be wrong.
   75|     22|  if (!mRaw->dim.hasPositiveArea() || mRaw->dim.x % 2 != 0 ||
  ------------------
  |  Branch (75:7): [True: 12, False: 10]
  |  Branch (75:39): [True: 1, False: 9]
  ------------------
   76|     20|      mRaw->dim.y % 2 != 0 || mRaw->dim.x > 4992 || mRaw->dim.y > 6668) {
  ------------------
  |  Branch (76:7): [True: 1, False: 8]
  |  Branch (76:31): [True: 5, False: 3]
  |  Branch (76:53): [True: 1, False: 2]
  ------------------
   77|     20|    ThrowRDE("Unexpected image dimensions found: (%d; %d)", mRaw->dim.x,
  ------------------
  |  |   38|     20|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     20|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     20|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     20|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   78|     20|             mRaw->dim.y);
   79|     20|  }
   80|       |
   81|      2|  uint32_t off = raw->getEntry(TiffTag::TILEOFFSETS)->getU32();
   82|      2|  uint32_t count = raw->getEntry(TiffTag::TILEBYTECOUNTS)->getU32();
   83|       |
   84|      2|  const ByteStream bs(
   85|      2|      DataBuffer(mFile.getSubView(off, count), Endianness::little));
   86|       |
   87|      2|  UncompressedDecompressor u(bs, mRaw, iRectangle2D({0, 0}, mRaw->dim),
   88|      2|                             2 * mRaw->dim.x, 16, BitOrder::MSB);
   89|      2|  mRaw->createData();
   90|      2|  u.readUncompressedRaw();
   91|      2|}

_ZN8rawspeed10StiDecoderC2EONSt3__110unique_ptrINS_11TiffRootIFDENS1_14default_deleteIS3_EEEENS_6BufferE:
   38|     26|      : AbstractTiffDecoder(std::move(root), file) {}

_ZN8rawspeed14ThreefrDecoder20isAppropriateDecoderEPKNS_11TiffRootIFDENS_6BufferE:
   47|    663|                                          [[maybe_unused]] Buffer file) {
   48|    663|  const auto id = rootIFD->getID();
   49|    663|  const std::string& make = id.make;
   50|       |
   51|       |  // FIXME: magic
   52|       |
   53|    663|  return make == "Hasselblad";
   54|    663|}
_ZN8rawspeed14ThreefrDecoder17decodeRawInternalEv:
   56|    230|RawImage ThreefrDecoder::decodeRawInternal() {
   57|    230|  const auto* raw = mRootIFD->getIFDWithTag(TiffTag::STRIPOFFSETS, 1);
   58|    230|  uint32_t width = raw->getEntry(TiffTag::IMAGEWIDTH)->getU32();
   59|    230|  uint32_t height = raw->getEntry(TiffTag::IMAGELENGTH)->getU32();
   60|    230|  uint32_t compression = raw->getEntry(TiffTag::COMPRESSION)->getU32();
   61|       |
   62|    230|  mRaw->dim = iPoint2D(width, height);
   63|       |
   64|    230|  if (1 == compression) {
  ------------------
  |  Branch (64:7): [True: 48, False: 182]
  ------------------
   65|     48|    DecodeUncompressed(raw);
   66|     48|    return mRaw;
   67|     48|  }
   68|       |
   69|    182|  if (compression != 7) // LJpeg
  ------------------
  |  Branch (69:7): [True: 4, False: 178]
  ------------------
   70|    182|    ThrowRDE("Unexpected compression type.");
  ------------------
  |  |   38|      4|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      4|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      4|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      4|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   71|       |
   72|    178|  uint32_t off = raw->getEntry(TiffTag::STRIPOFFSETS)->getU32();
   73|       |  // STRIPBYTECOUNTS is strange/invalid for the existing (compressed?) 3FR
   74|       |  // samples...
   75|       |
   76|    178|  const ByteStream bs(DataBuffer(mFile.getSubView(off), Endianness::little));
   77|       |
   78|    178|  HasselbladLJpegDecoder l(bs, mRaw);
   79|    178|  mRaw->createData();
   80|       |
   81|    178|  l.decode();
   82|       |
   83|    178|  return mRaw;
   84|    182|}
_ZNK8rawspeed14ThreefrDecoder18DecodeUncompressedEPKNS_7TiffIFDE:
   86|     48|void ThreefrDecoder::DecodeUncompressed(const TiffIFD* raw) const {
   87|     48|  if (mRaw->getDataType() != RawImageType::UINT16)
  ------------------
  |  Branch (87:7): [True: 0, False: 48]
  ------------------
   88|     48|    ThrowRDE("Unexpected data type");
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   89|       |
   90|     48|  if (mRaw->getCpp() != 1 || mRaw->getBpp() != sizeof(uint16_t))
  ------------------
  |  Branch (90:7): [True: 0, False: 48]
  |  Branch (90:30): [True: 0, False: 48]
  ------------------
   91|     48|    ThrowRDE("Unexpected cpp: %u", mRaw->getCpp());
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   92|       |
   93|       |  // FIXME: could be wrong. max "active pixels" - "100 MP"
   94|     48|  if (!mRaw->dim.hasPositiveArea() || mRaw->dim.x % 2 != 0 ||
  ------------------
  |  Branch (94:7): [True: 25, False: 23]
  |  Branch (94:39): [True: 1, False: 22]
  ------------------
   95|     36|      mRaw->dim.x > 12000 || mRaw->dim.y > 8842) {
  ------------------
  |  Branch (95:7): [True: 1, False: 21]
  |  Branch (95:30): [True: 9, False: 12]
  ------------------
   96|     36|    ThrowRDE("Unexpected image dimensions found: (%d; %d)", mRaw->dim.x,
  ------------------
  |  |   38|     36|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     36|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     36|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     36|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   97|     36|             mRaw->dim.y);
   98|     36|  }
   99|       |
  100|     12|  uint32_t off = raw->getEntry(TiffTag::STRIPOFFSETS)->getU32();
  101|       |  // STRIPBYTECOUNTS looks valid for the existing uncompressed 3FR samples
  102|     12|  uint32_t count = raw->getEntry(TiffTag::STRIPBYTECOUNTS)->getU32();
  103|       |
  104|     12|  const ByteStream bs(
  105|     12|      DataBuffer(mFile.getSubView(off, count), Endianness::little));
  106|       |
  107|     12|  UncompressedDecompressor u(bs, mRaw, iRectangle2D({0, 0}, mRaw->dim),
  108|     12|                             2 * mRaw->dim.x, 16, BitOrder::LSB);
  109|     12|  mRaw->createData();
  110|     12|  u.readUncompressedRaw();
  111|     12|}
_ZN8rawspeed14ThreefrDecoder22decodeMetaDataInternalEPKNS_14CameraMetaDataE:
  113|      8|void ThreefrDecoder::decodeMetaDataInternal(const CameraMetaData* meta) {
  114|      8|  mRaw->cfa.setCFA(iPoint2D(2, 2), CFAColor::RED, CFAColor::GREEN,
  115|      8|                   CFAColor::GREEN, CFAColor::BLUE);
  116|       |
  117|      8|  setMetaData(meta, "", 0);
  118|       |
  119|      8|  if (mRootIFD->hasEntryRecursive(TiffTag::BLACKLEVEL)) {
  ------------------
  |  Branch (119:7): [True: 2, False: 6]
  ------------------
  120|      2|    const TiffEntry* bl = mRootIFD->getEntryRecursive(TiffTag::BLACKLEVEL);
  121|      2|    if (bl->count == 1)
  ------------------
  |  Branch (121:9): [True: 1, False: 1]
  ------------------
  122|      1|      mRaw->blackLevel = implicit_cast<int>(bl->getFloat());
  123|      2|  }
  124|       |
  125|      8|  if (mRootIFD->hasEntryRecursive(TiffTag::WHITELEVEL)) {
  ------------------
  |  Branch (125:7): [True: 2, False: 6]
  ------------------
  126|      2|    const TiffEntry* wl = mRootIFD->getEntryRecursive(TiffTag::WHITELEVEL);
  127|      2|    if (wl->count == 1)
  ------------------
  |  Branch (127:9): [True: 1, False: 1]
  ------------------
  128|      1|      mRaw->whitePoint = implicit_cast<int>(wl->getFloat());
  129|      2|  }
  130|       |
  131|       |  // Fetch the white balance
  132|      8|  if (mRootIFD->hasEntryRecursive(TiffTag::ASSHOTNEUTRAL)) {
  ------------------
  |  Branch (132:7): [True: 5, False: 3]
  ------------------
  133|      5|    const TiffEntry* wb = mRootIFD->getEntryRecursive(TiffTag::ASSHOTNEUTRAL);
  134|      5|    if (wb->count == 3) {
  ------------------
  |  Branch (134:9): [True: 5, False: 0]
  ------------------
  135|      5|      std::array<float, 4> wbCoeffs = {};
  136|     12|      for (uint32_t i = 0; i < 3; i++) {
  ------------------
  |  Branch (136:28): [True: 11, False: 1]
  ------------------
  137|     11|        const float div = wb->getFloat(i);
  138|     11|        if (div == 0.0F)
  ------------------
  |  Branch (138:13): [True: 4, False: 7]
  ------------------
  139|     11|          ThrowRDE("Can not decode WB, multiplier is zero/");
  ------------------
  |  |   38|      4|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      4|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      4|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      4|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  140|       |
  141|      7|        wbCoeffs[i] = 1.0F / div;
  142|      7|      }
  143|      1|      mRaw->metadata.wbCoeffs = wbCoeffs;
  144|      1|    }
  145|      5|  }
  146|      8|}

_ZN8rawspeed14ThreefrDecoderC2EONSt3__110unique_ptrINS_11TiffRootIFDENS1_14default_deleteIS3_EEEENS_6BufferE:
   39|    230|      : AbstractTiffDecoder(std::move(root), file) {}

_ZNK8rawspeed23AbstractDngDecompressor16decompressThreadILi1EEEvv:
   54|  29.6k|template <> void AbstractDngDecompressor::decompressThread<1>() const noexcept {
   55|  29.6k|#ifdef HAVE_OPENMP
   56|  29.6k|#pragma omp for schedule(static)
   57|  29.6k|#endif
   58|  29.6k|  for (const auto& e :
   59|  29.6k|       Array1DRef(slices.data(), implicit_cast<int>(slices.size()))) {
   60|  29.6k|    try {
   61|  29.6k|      iPoint2D tileSize(e.width, e.height);
   62|  29.6k|      iPoint2D pos(e.offX, e.offY);
   63|       |
   64|  29.6k|      bool big_endian = e.bs.getByteOrder() == Endianness::big;
   65|       |
   66|       |      // DNG spec says that if not 8/16/32 bit/sample, always use big endian.
   67|       |      // It's not very obvious, but that does not appear to apply to FP.
   68|  29.6k|      switch (mBps) {
   69|  29.6k|      case 8:
   70|  29.6k|      case 16:
   71|  29.6k|      case 32:
   72|  29.6k|        break;
   73|  29.6k|      default:
   74|  29.6k|        if (mRaw->getDataType() == RawImageType::UINT16)
   75|  29.6k|          big_endian = true;
   76|  29.6k|        break;
   77|  29.6k|      }
   78|       |
   79|  29.6k|      const uint32_t inputPixelBits = mRaw->getCpp() * mBps;
   80|       |
   81|  29.6k|      if (e.dsc.tileW > std::numeric_limits<int>::max() / inputPixelBits)
   82|  29.6k|        ThrowIOE("Integer overflow when calculating input pitch");
   83|       |
   84|  29.6k|      const int inputPitchBits = inputPixelBits * e.dsc.tileW;
   85|  29.6k|      invariant(inputPitchBits > 0);
   86|       |
   87|  29.6k|      if (inputPitchBits % 8 != 0) {
   88|  29.6k|        ThrowRDE("Bad combination of cpp (%u), bps (%u) and width (%u), the "
   89|  29.6k|                 "pitch is %d bits, which is not a multiple of 8 (1 byte)",
   90|  29.6k|                 mRaw->getCpp(), mBps, e.width, inputPitchBits);
   91|  29.6k|      }
   92|       |
   93|  29.6k|      const int inputPitch = inputPitchBits / 8;
   94|  29.6k|      if (inputPitch == 0)
   95|  29.6k|        ThrowRDE("Data input pitch is too short. Can not decode!");
   96|       |
   97|  29.6k|      UncompressedDecompressor decompressor(
   98|  29.6k|          e.bs, mRaw, iRectangle2D(pos, tileSize), inputPitch, mBps,
   99|  29.6k|          big_endian ? BitOrder::MSB : BitOrder::LSB);
  100|  29.6k|      decompressor.readUncompressedRaw();
  101|  29.6k|    } catch (const RawDecoderException& err) {
  102|  29.6k|      mRaw->setError(err.what());
  103|  29.6k|    } catch (const IOException& err) {
  104|  29.6k|      mRaw->setError(err.what());
  105|  29.6k|    } catch (...) {
  106|       |      // We should not get any other exception type here.
  107|  29.6k|      __builtin_unreachable();
  108|  29.6k|    }
  109|  29.6k|  }
  110|  29.6k|}
_ZNK8rawspeed23AbstractDngDecompressor16decompressThreadILi7EEEvv:
  112|  11.9k|template <> void AbstractDngDecompressor::decompressThread<7>() const noexcept {
  113|  11.9k|#ifdef HAVE_OPENMP
  114|  11.9k|#pragma omp for schedule(static)
  115|  11.9k|#endif
  116|  11.9k|  for (const auto& e :
  117|  11.9k|       Array1DRef(slices.data(), implicit_cast<int>(slices.size()))) {
  118|  11.9k|    try {
  119|  11.9k|      LJpegDecoder d(e.bs, mRaw);
  120|  11.9k|      d.decode(e.offX, e.offY, e.width, e.height,
  121|  11.9k|               iPoint2D(e.dsc.tileW, e.dsc.tileH), mFixLjpeg);
  122|  11.9k|    } catch (const RawDecoderException& err) {
  123|  11.9k|      mRaw->setError(err.what());
  124|  11.9k|    } catch (const IOException& err) {
  125|  11.9k|      mRaw->setError(err.what());
  126|  11.9k|    } catch (...) {
  127|       |      // We should not get any other exception type here.
  128|  11.9k|      __builtin_unreachable();
  129|  11.9k|    }
  130|  11.9k|  }
  131|  11.9k|}
_ZNK8rawspeed23AbstractDngDecompressor16decompressThreadILi9EEEvv:
  161|  9.27k|template <> void AbstractDngDecompressor::decompressThread<9>() const noexcept {
  162|  9.27k|#ifdef HAVE_OPENMP
  163|  9.27k|#pragma omp for schedule(static)
  164|  9.27k|#endif
  165|  9.27k|  for (const auto& e :
  166|  9.27k|       Array1DRef(slices.data(), implicit_cast<int>(slices.size()))) {
  167|  9.27k|    try {
  168|  9.27k|      VC5Decompressor d(e.bs, mRaw);
  169|  9.27k|      d.decode(e.offX, e.offY, e.width, e.height);
  170|  9.27k|    } catch (const RawDecoderException& err) {
  171|  9.27k|      mRaw->setError(err.what());
  172|  9.27k|    } catch (const IOException& err) {
  173|  9.27k|      mRaw->setError(err.what());
  174|  9.27k|    } catch (...) {
  175|       |      // We should not get any other exception type here.
  176|  9.27k|      __builtin_unreachable();
  177|  9.27k|    }
  178|  9.27k|  }
  179|  9.27k|}
_ZNK8rawspeed23AbstractDngDecompressor16decompressThreadEv:
  204|  14.1k|void AbstractDngDecompressor::decompressThread() const noexcept {
  205|  14.1k|  invariant(mRaw->dim.x > 0);
  ------------------
  |  |   27|  14.1k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (205:3): [True: 14.1k, False: 31]
  ------------------
  206|  14.1k|  invariant(mRaw->dim.y > 0);
  ------------------
  |  |   27|  14.1k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (206:3): [True: 13.8k, False: 233]
  ------------------
  207|  13.8k|  invariant(mRaw->getCpp() > 0 && mRaw->getCpp() <= 4);
  ------------------
  |  |   27|  13.8k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (207:3): [True: 13.7k, False: 98]
  |  Branch (207:3): [True: 13.6k, False: 134]
  |  Branch (207:3): [True: 13.6k, False: 225]
  ------------------
  208|  13.6k|  invariant(mBps > 0 && mBps <= 32);
  ------------------
  |  |   27|  13.6k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (208:3): [True: 13.6k, False: 18.4E]
  |  Branch (208:3): [True: 13.6k, False: 18.4E]
  |  Branch (208:3): [True: 13.6k, False: 18.4E]
  ------------------
  209|       |
  210|  13.6k|  if (compression == 1) {
  ------------------
  |  Branch (210:7): [True: 5.34k, False: 8.31k]
  ------------------
  211|       |    /* Uncompressed */
  212|  5.34k|    decompressThread<1>();
  213|  8.31k|  } else if (compression == 7) {
  ------------------
  |  Branch (213:14): [True: 4.55k, False: 3.76k]
  ------------------
  214|       |    /* Lossless JPEG */
  215|  4.55k|    decompressThread<7>();
  216|  4.55k|  } else if (compression == 8) {
  ------------------
  |  Branch (216:14): [True: 0, False: 3.76k]
  ------------------
  217|       |    /* Deflate compression */
  218|       |#ifdef HAVE_ZLIB
  219|       |    decompressThread<8>();
  220|       |#else
  221|      0|#pragma message                                                                \
  222|      0|    "ZLIB is not present! Deflate compression will not be supported!"
  223|      0|    mRaw->setError("deflate support is disabled.");
  224|      0|#endif
  225|  3.76k|  } else if (compression == 9) {
  ------------------
  |  Branch (225:14): [True: 3.76k, False: 5]
  ------------------
  226|       |    /* GOPRO VC-5 */
  227|  3.76k|    decompressThread<9>();
  228|  3.76k|  } else if (compression == 0x884c) {
  ------------------
  |  Branch (228:14): [True: 0, False: 5]
  ------------------
  229|       |    /* Lossy DNG */
  230|       |#ifdef HAVE_JPEG
  231|       |    decompressThread<0x884c>();
  232|       |#else
  233|      0|#pragma message "JPEG is not present! Lossy JPEG DNG will not be supported!"
  234|      0|    mRaw->setError("jpeg support is disabled.");
  235|      0|#endif
  236|      5|  } else {
  237|      5|    mRaw->setError("AbstractDngDecompressor: Unknown compression");
  238|      5|  }
  239|  13.6k|}
_ZNK8rawspeed23AbstractDngDecompressor10decompressEv:
  241|  3.36k|void AbstractDngDecompressor::decompress() const {
  242|  3.36k|#ifdef HAVE_OPENMP
  243|  3.36k|#pragma omp parallel default(none) num_threads(                                \
  244|  3.36k|        rawspeed_get_number_of_processor_cores()) if (slices.size() > 1)
  245|  3.36k|#endif
  246|  3.36k|  decompressThread();
  247|       |
  248|  3.36k|  std::string firstErr;
  249|  3.36k|  if (mRaw->isTooManyErrors(1, &firstErr)) {
  ------------------
  |  Branch (249:7): [True: 824, False: 2.54k]
  ------------------
  250|    824|    ThrowRDE("Too many errors encountered. Giving up. First Error:\n%s",
  ------------------
  |  |   38|    824|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|    824|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|    824|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|    824|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  251|    824|             firstErr.c_str());
  252|    824|  }
  253|  3.36k|}
AbstractDngDecompressor.cpp:_ZNK8rawspeed23AbstractDngDecompressor10decompressEv.omp_outlined_debug__:
  246|  14.1k|  decompressThread();

_ZN8rawspeed20DngTilingDescriptionC2ERKNS_8iPoint2DEjj:
   57|  3.41k|      : dim(dim_), tileW(tileW_), tileH(tileH_),
   58|  3.41k|        tilesX(implicit_cast<uint32_t>(roundUpDivisionSafe(dim.x, tileW))),
   59|  3.41k|        tilesY(implicit_cast<uint32_t>(roundUpDivisionSafe(dim.y, tileH))),
   60|  3.41k|        numTiles(tilesX * tilesY) {
   61|  3.41k|    invariant(dim.area() > 0);
  ------------------
  |  |   27|  3.41k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (61:5): [True: 3.41k, False: 0]
  ------------------
   62|  3.41k|    invariant(tileW > 0);
  ------------------
  |  |   27|  3.41k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (62:5): [True: 3.41k, False: 0]
  ------------------
   63|  3.41k|    invariant(tileH > 0);
  ------------------
  |  |   27|  3.41k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (63:5): [True: 3.41k, False: 0]
  ------------------
   64|  3.41k|    invariant(tilesX > 0);
  ------------------
  |  |   27|  3.41k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (64:5): [True: 3.41k, False: 0]
  ------------------
   65|  3.41k|    invariant(tilesY > 0);
  ------------------
  |  |   27|  3.41k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (65:5): [True: 3.41k, False: 0]
  ------------------
   66|  3.41k|    invariant(tileW * tilesX >= static_cast<unsigned>(dim.x));
  ------------------
  |  |   27|  3.41k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (66:5): [True: 3.41k, False: 0]
  ------------------
   67|  3.41k|    invariant(tileH * tilesY >= static_cast<unsigned>(dim.y));
  ------------------
  |  |   27|  3.41k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (67:5): [True: 3.41k, False: 0]
  ------------------
   68|  3.41k|    invariant(tileW * (tilesX - 1) < static_cast<unsigned>(dim.x));
  ------------------
  |  |   27|  3.41k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (68:5): [True: 3.41k, False: 0]
  ------------------
   69|  3.41k|    invariant(tileH * (tilesY - 1) < static_cast<unsigned>(dim.y));
  ------------------
  |  |   27|  3.41k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (69:5): [True: 3.41k, False: 0]
  ------------------
   70|  3.41k|    invariant(numTiles > 0);
  ------------------
  |  |   27|  3.41k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (70:5): [True: 3.41k, False: 0]
  ------------------
   71|  3.41k|  }
_ZN8rawspeed23AbstractDngDecompressorC2ENS_8RawImageERKNS_20DngTilingDescriptionEibjj:
  138|  3.41k|      : mRaw(std::move(img)), dsc(dsc_), compression(compression_),
  139|  3.41k|        mFixLjpeg(mFixLjpeg_), mBps(mBps_), mPredictor(mPredictor_) {}
_ZN8rawspeed15DngSliceElementC2ERKNS_20DngTilingDescriptionEjNS_10ByteStreamE:
  105|  4.52k|      : dsc(dsc_), n(n_), bs(bs_), column(n % dsc.tilesX), row(n / dsc.tilesX),
  106|  4.52k|        lastColumn((column + 1) == dsc.tilesX),
  107|  4.52k|        lastRow((row + 1) == dsc.tilesY), offX(dsc.tileW * column),
  108|  4.52k|        offY(dsc.tileH * row),
  109|  4.52k|        width(!lastColumn ? dsc.tileW : dsc.dim.x - offX),
  ------------------
  |  Branch (109:15): [True: 238, False: 4.28k]
  ------------------
  110|  4.52k|        height(!lastRow ? dsc.tileH : dsc.dim.y - offY) {
  ------------------
  |  Branch (110:16): [True: 1.03k, False: 3.49k]
  ------------------
  111|  4.52k|    invariant(n < dsc.numTiles);
  ------------------
  |  |   27|  4.52k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (111:5): [True: 4.52k, False: 0]
  ------------------
  112|  4.52k|    invariant(bs.getRemainSize() > 0);
  ------------------
  |  |   27|  4.52k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (112:5): [True: 4.52k, False: 0]
  ------------------
  113|  4.52k|    invariant(column < dsc.tilesX);
  ------------------
  |  |   27|  4.52k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (113:5): [True: 4.52k, False: 0]
  ------------------
  114|  4.52k|    invariant(row < dsc.tilesY);
  ------------------
  |  |   27|  4.52k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (114:5): [True: 4.52k, False: 0]
  ------------------
  115|  4.52k|    invariant(offX < static_cast<unsigned>(dsc.dim.x));
  ------------------
  |  |   27|  4.52k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (115:5): [True: 4.52k, False: 0]
  ------------------
  116|  4.52k|    invariant(offY < static_cast<unsigned>(dsc.dim.y));
  ------------------
  |  |   27|  4.52k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (116:5): [True: 4.52k, False: 0]
  ------------------
  117|  4.52k|    invariant(width > 0);
  ------------------
  |  |   27|  4.52k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (117:5): [True: 4.52k, False: 0]
  ------------------
  118|  4.52k|    invariant(height > 0);
  ------------------
  |  |   27|  4.52k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (118:5): [True: 4.52k, False: 0]
  ------------------
  119|  4.52k|    invariant(offX + width <= static_cast<unsigned>(dsc.dim.x));
  ------------------
  |  |   27|  4.52k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (119:5): [True: 4.52k, False: 0]
  ------------------
  120|  4.52k|    invariant(offY + height <= static_cast<unsigned>(dsc.dim.y));
  ------------------
  |  |   27|  4.52k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (120:5): [True: 4.52k, False: 0]
  ------------------
  121|  4.52k|    invariant(!lastColumn ||
  ------------------
  |  |   27|  4.52k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (121:5): [True: 238, False: 4.28k]
  |  Branch (121:5): [True: 4.28k, False: 0]
  |  Branch (121:5): [True: 4.52k, False: 0]
  ------------------
  122|  4.52k|              (offX + width == static_cast<unsigned>(dsc.dim.x)));
  123|  4.52k|    invariant(!lastRow || (offY + height == static_cast<unsigned>(dsc.dim.y)));
  ------------------
  |  |   27|  4.52k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (123:5): [True: 1.03k, False: 3.49k]
  |  Branch (123:5): [True: 3.49k, False: 0]
  |  Branch (123:5): [True: 4.52k, False: 0]
  ------------------
  124|  4.52k|  }

_ZN8rawspeed20AbstractLJpegDecoderC2ENS_10ByteStreamENS_8RawImageE:
   50|  2.08k|    : input(bs), mRaw(std::move(img)) {
   51|  2.08k|  input.setByteOrder(Endianness::big);
   52|       |
   53|  2.08k|  if (!mRaw->dim.hasPositiveArea())
  ------------------
  |  Branch (53:7): [True: 29, False: 2.05k]
  ------------------
   54|  2.08k|    ThrowRDE("Image has zero size");
  ------------------
  |  |   38|     29|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     29|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     29|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     29|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   55|       |
   56|  2.05k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
   57|       |  // Yeah, sure, here it would be just dumb to leave this for production :)
   58|  2.05k|  if (mRaw->dim.x > 19440 || mRaw->dim.y > 8842) {
  ------------------
  |  Branch (58:7): [True: 13, False: 2.04k]
  |  Branch (58:30): [True: 20, False: 2.02k]
  ------------------
   59|     23|    ThrowRDE("Unexpected image dimensions found: (%i; %i)", mRaw->dim.x,
  ------------------
  |  |   38|     23|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     23|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     23|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     23|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   60|     23|             mRaw->dim.y);
   61|     23|  }
   62|  2.05k|#endif
   63|  2.05k|}
_ZN8rawspeed20AbstractLJpegDecoder9decodeSOIEv:
   65|  1.93k|void AbstractLJpegDecoder::decodeSOI() {
   66|  1.93k|  if (getNextMarker(false) != JpegMarker::SOI)
  ------------------
  |  Branch (66:7): [True: 27, False: 1.90k]
  ------------------
   67|  1.93k|    ThrowRDE("Image did not start with SOI. Probably not an LJPEG");
  ------------------
  |  |   38|     27|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     27|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     27|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     27|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   68|       |
   69|  1.90k|  struct {
   70|  1.90k|    bool DRI = false;
   71|  1.90k|    bool DHT = false;
   72|  1.90k|    bool SOF = false;
   73|  1.90k|    bool SOS = false;
   74|  1.90k|  } FoundMarkers;
   75|       |
   76|  5.80k|  for (JpegMarker m; (m = getNextMarker(true)) != JpegMarker::EOI;) {
  ------------------
  |  Branch (76:22): [True: 5.25k, False: 557]
  ------------------
   77|  5.25k|    ByteStream data(input.getStream(input.peekU16()));
   78|  5.25k|    data.skipBytes(2); // headerLength
   79|       |
   80|  5.25k|    switch (m) {
   81|  2.12k|    case JpegMarker::DHT:
  ------------------
  |  Branch (81:5): [True: 2.12k, False: 3.12k]
  ------------------
   82|  2.12k|      if (FoundMarkers.SOS)
  ------------------
  |  Branch (82:11): [True: 3, False: 2.12k]
  ------------------
   83|  2.12k|        ThrowRDE("Found second DHT marker after SOS");
  ------------------
  |  |   38|      3|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      3|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      3|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      3|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   84|       |      // there can be more than one DHT markers.
   85|       |      // FIXME: do we really want to reparse and use the last one?
   86|  2.12k|      parseDHT(data);
   87|  2.12k|      FoundMarkers.DHT = true;
   88|  2.12k|      break;
   89|  1.26k|    case JpegMarker::SOF3:
  ------------------
  |  Branch (89:5): [True: 1.26k, False: 3.98k]
  ------------------
   90|  1.26k|      if (FoundMarkers.SOS)
  ------------------
  |  Branch (90:11): [True: 6, False: 1.26k]
  ------------------
   91|  1.26k|        ThrowRDE("Found second SOF marker after SOS");
  ------------------
  |  |   38|      6|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      6|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      6|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      6|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   92|  1.26k|      if (FoundMarkers.SOF)
  ------------------
  |  Branch (92:11): [True: 1, False: 1.26k]
  ------------------
   93|  1.26k|        ThrowRDE("Found second SOF marker");
  ------------------
  |  |   38|      1|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      1|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      1|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      1|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   94|       |      // SOF is not required to be after DHT
   95|  1.26k|      parseSOF(data, &frame);
   96|  1.26k|      FoundMarkers.SOF = true;
   97|  1.26k|      break;
   98|  1.15k|    case JpegMarker::SOS:
  ------------------
  |  Branch (98:5): [True: 1.15k, False: 4.09k]
  ------------------
   99|  1.15k|      if (FoundMarkers.SOS)
  ------------------
  |  Branch (99:11): [True: 1, False: 1.15k]
  ------------------
  100|  1.15k|        ThrowRDE("Found second SOS marker");
  ------------------
  |  |   38|      1|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      1|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      1|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      1|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  101|  1.15k|      if (!FoundMarkers.DHT)
  ------------------
  |  Branch (101:11): [True: 1, False: 1.15k]
  ------------------
  102|  1.15k|        ThrowRDE("Did not find DHT marker before SOS.");
  ------------------
  |  |   38|      1|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      1|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      1|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      1|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  103|  1.15k|      if (!FoundMarkers.SOF)
  ------------------
  |  Branch (103:11): [True: 4, False: 1.15k]
  ------------------
  104|  1.15k|        ThrowRDE("Did not find SOF marker before SOS.");
  ------------------
  |  |   38|      4|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      4|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      4|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      4|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  105|  1.15k|      parseSOS(data);
  106|  1.15k|      FoundMarkers.SOS = true;
  107|  1.15k|      if (erratumImplicitEOIMarkerAfterScan())
  ------------------
  |  Branch (107:11): [True: 0, False: 1.15k]
  ------------------
  108|      0|        return;
  109|  1.15k|      break;
  110|  1.15k|    case JpegMarker::DQT:
  ------------------
  |  Branch (110:5): [True: 2, False: 5.25k]
  ------------------
  111|      2|      ThrowRDE("Not a valid RAW file.");
  ------------------
  |  |   38|      2|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      2|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      2|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      2|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  112|     22|    case JpegMarker::DRI:
  ------------------
  |  Branch (112:5): [True: 22, False: 5.23k]
  ------------------
  113|     22|      if (FoundMarkers.DRI)
  ------------------
  |  Branch (113:11): [True: 1, False: 21]
  ------------------
  114|     22|        ThrowRDE("Found second DRI marker");
  ------------------
  |  |   38|      1|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      1|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      1|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      1|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  115|     21|      parseDRI(data);
  116|     21|      FoundMarkers.DRI = true;
  117|     21|      break;
  118|    605|    default: // Just let it skip to next marker
  ------------------
  |  Branch (118:5): [True: 605, False: 4.64k]
  ------------------
  119|    605|      break;
  120|  5.25k|    }
  121|  5.25k|  }
  122|       |
  123|    557|  if (!FoundMarkers.SOS)
  ------------------
  |  Branch (123:7): [True: 7, False: 550]
  ------------------
  124|    557|    ThrowRDE("Did not find SOS marker.");
  ------------------
  |  |   38|      7|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      7|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      7|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      7|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  125|    557|}
_ZN8rawspeed20AbstractLJpegDecoder8parseSOFENS_10ByteStreamEPNS_7SOFInfoE:
  127|  1.26k|void AbstractLJpegDecoder::parseSOF(ByteStream sofInput, SOFInfo* sof) {
  128|  1.26k|  sof->prec = sofInput.getByte();
  129|  1.26k|  sof->h = sofInput.getU16();
  130|  1.26k|  sof->w = sofInput.getU16();
  131|  1.26k|  sof->cps = sofInput.getByte();
  132|       |
  133|  1.26k|  if (sof->prec < 2 || sof->prec > 16)
  ------------------
  |  Branch (133:7): [True: 3, False: 1.25k]
  |  Branch (133:24): [True: 4, False: 1.25k]
  ------------------
  134|  1.26k|    ThrowRDE("Invalid precision (%u).", sof->prec);
  ------------------
  |  |   38|      5|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      5|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      5|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      5|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  135|       |
  136|  1.25k|  if (sof->h == 0 || sof->w == 0)
  ------------------
  |  Branch (136:7): [True: 3, False: 1.25k]
  |  Branch (136:22): [True: 1, False: 1.25k]
  ------------------
  137|  1.25k|    ThrowRDE("Frame width or height set to zero");
  ------------------
  |  |   38|      2|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      2|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      2|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      2|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  138|       |
  139|  1.25k|  if (sof->cps > 4 || sof->cps < 1)
  ------------------
  |  Branch (139:7): [True: 8, False: 1.24k]
  |  Branch (139:23): [True: 1, False: 1.24k]
  ------------------
  140|  1.25k|    ThrowRDE("Only from 1 to 4 components are supported.");
  ------------------
  |  |   38|      7|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      7|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      7|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      7|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  141|       |
  142|  1.24k|  if (sof->cps < mRaw->getCpp()) {
  ------------------
  |  Branch (142:7): [True: 1, False: 1.24k]
  ------------------
  143|      1|    ThrowRDE("Component count should be no less than sample count (%u vs %u).",
  ------------------
  |  |   38|      1|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      1|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      1|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      1|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  144|      1|             sof->cps, mRaw->getCpp());
  145|      1|  }
  146|       |
  147|  1.24k|  if (sof->cps > static_cast<uint32_t>(mRaw->dim.x)) {
  ------------------
  |  Branch (147:7): [True: 1, False: 1.24k]
  ------------------
  148|      1|    ThrowRDE("Component count should be no greater than row length (%u vs %d).",
  ------------------
  |  |   38|      1|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      1|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      1|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      1|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  149|      1|             sof->cps, mRaw->dim.x);
  150|      1|  }
  151|       |
  152|  1.24k|  if (sofInput.getRemainSize() != 3 * sof->cps)
  ------------------
  |  Branch (152:7): [True: 8, False: 1.23k]
  ------------------
  153|  1.24k|    ThrowRDE("Header size mismatch.");
  ------------------
  |  |   38|      8|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      8|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      8|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      8|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  154|       |
  155|  4.48k|  for (uint32_t i = 0; i < sof->cps; i++) {
  ------------------
  |  Branch (155:24): [True: 3.26k, False: 1.21k]
  ------------------
  156|  3.26k|    sof->compInfo[i].componentId = sofInput.getByte();
  157|       |
  158|  3.26k|    uint32_t subs = sofInput.getByte();
  159|  3.26k|    frame.compInfo[i].superV = subs & 0xf;
  160|  3.26k|    frame.compInfo[i].superH = subs >> 4;
  161|       |
  162|  3.26k|    if (frame.compInfo[i].superV < 1 || frame.compInfo[i].superV > 4)
  ------------------
  |  Branch (162:9): [True: 4, False: 3.26k]
  |  Branch (162:41): [True: 8, False: 3.25k]
  ------------------
  163|  3.26k|      ThrowRDE("Horizontal sampling factor is invalid.");
  ------------------
  |  |   38|     10|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     10|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     10|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     10|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  164|       |
  165|  3.25k|    if (frame.compInfo[i].superH < 1 || frame.compInfo[i].superH > 4)
  ------------------
  |  Branch (165:9): [True: 3, False: 3.25k]
  |  Branch (165:41): [True: 4, False: 3.25k]
  ------------------
  166|  3.25k|      ThrowRDE("Horizontal sampling factor is invalid.");
  ------------------
  |  |   38|      5|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      5|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      5|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      5|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  167|       |
  168|  3.25k|    uint32_t Tq = sofInput.getByte();
  169|  3.25k|    if (Tq != 0)
  ------------------
  |  Branch (169:9): [True: 8, False: 3.24k]
  ------------------
  170|  3.25k|      ThrowRDE("Quantized components not supported.");
  ------------------
  |  |   38|      8|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      8|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      8|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      8|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  171|  3.25k|  }
  172|       |
  173|  1.21k|  if (static_cast<int>(sof->compInfo[0].superH) !=
  ------------------
  |  Branch (173:7): [True: 4, False: 1.21k]
  ------------------
  174|  1.21k|          mRaw->metadata.subsampling.x ||
  175|  1.21k|      static_cast<int>(sof->compInfo[0].superV) != mRaw->metadata.subsampling.y)
  ------------------
  |  Branch (175:7): [True: 2, False: 1.20k]
  ------------------
  176|  1.21k|    ThrowRDE("LJpeg's subsampling does not match image's subsampling.");
  ------------------
  |  |   38|      3|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      3|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      3|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      3|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  177|       |
  178|  1.21k|  sof->initialized = true;
  179|  1.21k|}
_ZN8rawspeed20AbstractLJpegDecoder8parseSOSENS_10ByteStreamE:
  181|  1.15k|void AbstractLJpegDecoder::parseSOS(ByteStream sos) {
  182|  1.15k|  invariant(frame.initialized);
  ------------------
  |  |   27|  1.15k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (182:3): [True: 1.15k, False: 0]
  ------------------
  183|       |
  184|  1.15k|  if (sos.getRemainSize() != 1 + 2 * frame.cps + 3)
  ------------------
  |  Branch (184:7): [True: 15, False: 1.13k]
  ------------------
  185|  1.15k|    ThrowRDE("Invalid SOS header length.");
  ------------------
  |  |   38|     15|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     15|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     15|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     15|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  186|       |
  187|  1.13k|  if (uint32_t soscps = sos.getByte(); frame.cps != soscps)
  ------------------
  |  Branch (187:40): [True: 2, False: 1.13k]
  ------------------
  188|  1.13k|    ThrowRDE("Component number mismatch.");
  ------------------
  |  |   38|      2|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      2|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      2|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      2|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  189|       |
  190|  4.07k|  for (uint32_t i = 0; i < frame.cps; i++) {
  ------------------
  |  Branch (190:24): [True: 2.96k, False: 1.10k]
  ------------------
  191|  2.96k|    uint32_t cs = sos.getByte();
  192|  2.96k|    uint32_t td = sos.getByte() >> 4;
  193|       |
  194|  2.96k|    if (td >= huff.size() || !huff[td])
  ------------------
  |  Branch (194:9): [True: 2, False: 2.96k]
  |  Branch (194:30): [True: 2, False: 2.95k]
  ------------------
  195|  2.96k|      ThrowRDE("Invalid Huffman table selection.");
  ------------------
  |  |   38|      4|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      4|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      4|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      4|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  196|       |
  197|  2.95k|    int ciIndex = -1;
  198|  12.0k|    for (uint32_t j = 0; j < frame.cps; ++j) {
  ------------------
  |  Branch (198:26): [True: 9.12k, False: 2.95k]
  ------------------
  199|  9.12k|      if (frame.compInfo[j].componentId == cs)
  ------------------
  |  Branch (199:11): [True: 2.94k, False: 6.17k]
  ------------------
  200|  2.94k|        ciIndex = j;
  201|  9.12k|    }
  202|       |
  203|  2.95k|    if (ciIndex == -1)
  ------------------
  |  Branch (203:9): [True: 20, False: 2.93k]
  ------------------
  204|  2.95k|      ThrowRDE("Invalid Component Selector");
  ------------------
  |  |   38|     20|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     20|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     20|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     20|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  205|       |
  206|  2.93k|    frame.compInfo[ciIndex].dcTblNo = td;
  207|  2.93k|  }
  208|       |
  209|       |  // Get predictor, see table H.1 from the JPEG spec
  210|  1.10k|  predictorMode = sos.getByte();
  211|       |  // The spec says predictoreMode is in [0..7], but Hasselblad uses '8'.
  212|  1.10k|  if (predictorMode > 8)
  ------------------
  |  Branch (212:7): [True: 1, False: 1.10k]
  ------------------
  213|  1.10k|    ThrowRDE("Invalid predictor mode.");
  ------------------
  |  |   38|      1|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      1|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      1|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      1|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  214|       |
  215|       |  // Se + Ah Not used in LJPEG
  216|  1.10k|  if (sos.getByte() != 0)
  ------------------
  |  Branch (216:7): [True: 1, False: 1.10k]
  ------------------
  217|  1.10k|    ThrowRDE("Se/Ah not zero.");
  ------------------
  |  |   38|      1|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      1|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      1|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      1|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  218|       |
  219|  1.10k|  Pt = sos.getByte(); // Point Transform
  220|  1.10k|  if (Pt > 15)
  ------------------
  |  Branch (220:7): [True: 2, False: 1.10k]
  ------------------
  221|  1.10k|    ThrowRDE("Invalid Point transform.");
  ------------------
  |  |   38|      2|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      2|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      2|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      2|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  222|  1.10k|  if (Pt != 0)
  ------------------
  |  Branch (222:7): [True: 2, False: 1.10k]
  ------------------
  223|  1.10k|    ThrowRDE("Point transform not supported.");
  ------------------
  |  |   38|      2|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      2|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      2|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      2|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  224|       |
  225|  1.10k|  const auto scanLength = decodeScan();
  226|       |  // FIXME: invariant(scanLength != 0);
  227|  1.10k|  input.skipBytes(scanLength);
  228|  1.10k|}
_ZN8rawspeed20AbstractLJpegDecoder8parseDHTENS_10ByteStreamE:
  230|  2.12k|void AbstractLJpegDecoder::parseDHT(ByteStream dht) {
  231|  4.00k|  while (dht.getRemainSize() > 0) {
  ------------------
  |  Branch (231:10): [True: 2.03k, False: 1.97k]
  ------------------
  232|  2.03k|    uint32_t b = dht.getByte();
  233|       |
  234|  2.03k|    if (uint32_t htClass = b >> 4; htClass != 0)
  ------------------
  |  Branch (234:36): [True: 17, False: 2.01k]
  ------------------
  235|  2.03k|      ThrowRDE("Unsupported Table class.");
  ------------------
  |  |   38|     17|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     17|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     17|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     17|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  236|       |
  237|  2.01k|    uint32_t htIndex = b & 0xf;
  238|  2.01k|    if (htIndex >= huff.size())
  ------------------
  |  Branch (238:9): [True: 10, False: 2.00k]
  ------------------
  239|  2.01k|      ThrowRDE("Invalid huffman table destination id.");
  ------------------
  |  |   38|     10|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     10|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     10|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     10|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  240|       |
  241|  2.00k|    if (huff[htIndex] != nullptr)
  ------------------
  |  Branch (241:9): [True: 41, False: 1.96k]
  ------------------
  242|  2.00k|      ThrowRDE("Duplicate table definition");
  ------------------
  |  |   38|     41|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     41|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     41|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     41|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  243|       |
  244|       |    // Temporary table, used during parsing LJpeg.
  245|  1.96k|    HuffmanCode<BaselineCodeTag> hc;
  246|       |
  247|       |    // copy 16 bytes from input stream to number of codes per length table
  248|  1.96k|    uint32_t nCodes = hc.setNCodesPerLength(dht.getBuffer(16));
  249|       |
  250|       |    // spec says 16 different codes is max but Hasselblad violates that -> 17
  251|  1.96k|    if (nCodes > 17)
  ------------------
  |  Branch (251:9): [True: 13, False: 1.95k]
  ------------------
  252|  1.96k|      ThrowRDE("Invalid DHT table.");
  ------------------
  |  |   38|     13|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     13|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     13|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     13|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  253|       |
  254|       |    // copy nCodes bytes from input stream to code values table
  255|  1.95k|    const auto codesBuf = dht.getBuffer(nCodes);
  256|  1.95k|    hc.setCodeValues(codesBuf.getAsArray1DRef());
  257|       |
  258|       |    // see if we already have a PrefixCodeDecoder with the same codes
  259|  1.95k|    assert(PrefixCodeDecoderStore.size() == huffmanCodeStore.size());
  ------------------
  |  Branch (259:5): [True: 1.88k, False: 64]
  ------------------
  260|  2.63k|    for (unsigned index = 0; index != PrefixCodeDecoderStore.size(); ++index) {
  ------------------
  |  Branch (260:30): [True: 746, False: 1.88k]
  ------------------
  261|    746|      if (*huffmanCodeStore[index] == hc)
  ------------------
  |  Branch (261:11): [True: 122, False: 624]
  ------------------
  262|    122|        huff[htIndex] = PrefixCodeDecoderStore[index].get();
  263|    746|    }
  264|       |
  265|  1.88k|    if (!huff[htIndex]) {
  ------------------
  |  Branch (265:9): [True: 1.76k, False: 124]
  ------------------
  266|  1.76k|      huffmanCodeStore.emplace_back(std::make_unique<decltype(hc)>(hc));
  267|       |      // setup new hc and put it into the store
  268|  1.76k|      auto dHT = std::make_unique<PrefixCodeDecoder<>>(std::move(hc));
  269|  1.76k|      dHT->setup(fullDecodeHT, fixDng16Bug);
  270|  1.76k|      huff[htIndex] = dHT.get();
  271|  1.76k|      PrefixCodeDecoderStore.emplace_back(std::move(dHT));
  272|  1.76k|    }
  273|  1.88k|  }
  274|  2.12k|}
_ZN8rawspeed20AbstractLJpegDecoder8parseDRIENS_10ByteStreamE:
  276|     21|void AbstractLJpegDecoder::parseDRI(ByteStream dri) {
  277|     21|  if (dri.getRemainSize() != 2)
  ------------------
  |  Branch (277:7): [True: 3, False: 18]
  ------------------
  278|     21|    ThrowRDE("Invalid DRI header length.");
  ------------------
  |  |   38|      3|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      3|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      3|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      3|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  279|     18|  numMCUsPerRestartInterval = dri.getU16();
  280|     18|}
_ZN8rawspeed20AbstractLJpegDecoder13getNextMarkerEb:
  282|  7.38k|JpegMarker AbstractLJpegDecoder::getNextMarker(bool allowskip) {
  283|  7.38k|  if (Optional<ByteStream> markerPos = advanceToNextMarker(input, allowskip))
  ------------------
  |  Branch (283:28): [True: 6.88k, False: 496]
  ------------------
  284|  6.88k|    input = *markerPos;
  285|    496|  else
  286|  7.38k|    ThrowRDE("(Noskip) Expected marker not found. Probably corrupt file.");
  ------------------
  |  |   38|    496|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|    496|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|    496|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|    496|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  287|       |
  288|  6.88k|  JpegMarker m = *peekMarker(input);
  289|  6.88k|  input.skipBytes(2); // Skip the bytes we've just consumed.
  290|  6.88k|  return m;
  291|  7.38k|}

_ZN8rawspeed20AbstractLJpegDecoderD2Ev:
   92|  2.03k|  virtual ~AbstractLJpegDecoder() = default;
_ZNK8rawspeed20AbstractLJpegDecoder18getSamplePrecisionEv:
   90|     41|  [[nodiscard]] int getSamplePrecision() const { return frame.prec; }
_ZNK8rawspeed20AbstractLJpegDecoder33erratumImplicitEOIMarkerAfterScanEv:
  101|    126|  [[nodiscard]] virtual bool erratumImplicitEOIMarkerAfterScan() const {
  102|    126|    return false;
  103|    126|  }
_ZNK8rawspeed20AbstractLJpegDecoder21getPrefixCodeDecodersEi:
  113|  1.07k|  getPrefixCodeDecoders(int N_COMP) const {
  114|  1.07k|    std::vector<const PrefixCodeDecoder<>*> ht(N_COMP);
  115|  3.62k|    for (int i = 0; i < N_COMP; ++i) {
  ------------------
  |  Branch (115:21): [True: 2.55k, False: 1.07k]
  ------------------
  116|  2.55k|      const unsigned dcTblNo = frame.compInfo[i].dcTblNo;
  117|  2.55k|      if (const auto dcTbls = implicit_cast<unsigned>(huff.size());
  118|  2.55k|          dcTblNo >= dcTbls) {
  ------------------
  |  Branch (118:11): [True: 6, False: 2.54k]
  ------------------
  119|      6|        ThrowRDE("Decoding table %u for comp %i does not exist (tables = %u)",
  ------------------
  |  |   38|      6|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      6|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      6|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      6|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  120|      6|                 dcTblNo, i, dcTbls);
  121|      6|      }
  122|  2.54k|      ht[i] = huff[dcTblNo];
  123|  2.54k|    }
  124|       |
  125|  1.07k|    return ht;
  126|  1.07k|  }
_ZNK8rawspeed20AbstractLJpegDecoder20getInitialPredictorsEi:
  128|  1.07k|  [[nodiscard]] std::vector<uint16_t> getInitialPredictors(int N_COMP) const {
  129|  1.07k|    std::vector<uint16_t> pred(N_COMP);
  130|  1.07k|    if (frame.prec < (Pt + 1)) {
  ------------------
  |  Branch (130:9): [True: 0, False: 1.07k]
  ------------------
  131|      0|      ThrowRDE("Invalid precision (%u) and point transform (%u) combination!",
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  132|      0|               frame.prec, Pt);
  133|      0|    }
  134|  1.07k|    std::fill(pred.begin(), pred.end(), 1 << (frame.prec - Pt - 1));
  135|  1.07k|    return pred;
  136|  1.07k|  }

_ZN8rawspeed27AbstractSamsungDecompressorC2ENS_8RawImageE:
   34|    460|  explicit AbstractSamsungDecompressor(RawImage raw) : mRaw(std::move(raw)) {}

_ZN8rawspeed14Cr2SliceWidthsC2Ettt:
   65|    948|      : numSlices(numSlices_), sliceWidth(sliceWidth_),
   66|    948|        lastSliceWidth(lastSliceWidth_) {
   67|    948|    if (numSlices < 1)
  ------------------
  |  Branch (67:9): [True: 1, False: 947]
  ------------------
   68|    948|      ThrowRDE("Bad slice count: %d", numSlices);
  ------------------
  |  |   38|      1|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      1|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      1|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      1|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   69|    948|  }
_ZN8rawspeed14Cr2SliceWidthsC2Ev:
   61|  1.06k|  Cr2SliceWidths() = default;
_ZNK8rawspeed14Cr2SliceWidths5emptyEv:
   71|    592|  [[nodiscard]] bool empty() const {
   72|    592|    return 0 == numSlices && 0 == sliceWidth && 0 == lastSliceWidth;
  ------------------
  |  Branch (72:12): [True: 12, False: 580]
  |  Branch (72:30): [True: 12, False: 0]
  |  Branch (72:49): [True: 12, False: 0]
  ------------------
   73|    592|  }
_ZNK8rawspeed14Cr2SliceWidths12widthOfSliceEi:
   75|  3.11M|  [[nodiscard]] int widthOfSlice(int sliceId) const {
   76|  3.11M|    invariant(sliceId >= 0 && sliceId < numSlices);
  ------------------
  |  |   27|  3.11M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (76:5): [True: 3.11M, False: 0]
  |  Branch (76:5): [True: 3.11M, False: 0]
  |  Branch (76:5): [True: 3.11M, False: 0]
  ------------------
   77|  3.11M|    if ((sliceId + 1) == numSlices)
  ------------------
  |  Branch (77:9): [True: 380k, False: 2.73M]
  ------------------
   78|   380k|      return lastSliceWidth;
   79|  2.73M|    return sliceWidth;
   80|  3.11M|  }
_ZN8rawspeed21Cr2SliceWidthIteratorC2ERKNS_14Cr2SliceWidthsEi:
   98|  2.16k|      : slicing(slicing_), sliceId(sliceId_) {
   99|       |    invariant(sliceId >= 0 && sliceId <= slicing.numSlices &&
  ------------------
  |  |   27|  2.16k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (99:5): [True: 2.16k, False: 0]
  |  Branch (99:5): [True: 2.16k, False: 0]
  |  Branch (99:5): [True: 2.16k, Folded]
  |  Branch (99:5): [True: 2.16k, False: 0]
  ------------------
  100|  2.16k|              "Iterator overflow");
  101|  2.16k|  }
_ZNK8rawspeed21Cr2SliceWidthIteratordeEv:
  103|   858k|  value_type operator*() const {
  104|   858k|    invariant(sliceId >= 0 && sliceId < slicing.numSlices &&
  ------------------
  |  |   27|   858k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (104:5): [True: 858k, False: 0]
  |  Branch (104:5): [True: 858k, False: 0]
  |  Branch (104:5): [True: 858k, Folded]
  |  Branch (104:5): [True: 858k, False: 0]
  ------------------
  105|   858k|              "Iterator overflow");
  106|   858k|    return slicing.widthOfSlice(sliceId);
  107|   858k|  }
_ZN8rawspeed21Cr2SliceWidthIteratorppEv:
  108|  66.7k|  Cr2SliceWidthIterator& operator++() {
  109|  66.7k|    ++sliceId;
  110|  66.7k|    return *this;
  111|  66.7k|  }
_ZN8rawspeedeqERKNS_21Cr2SliceWidthIteratorES2_:
  113|   163k|                         const Cr2SliceWidthIterator& b) {
  114|   163k|    invariant(&a.slicing == &b.slicing && "Comparing unrelated iterators.");
  ------------------
  |  |   27|   163k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (114:5): [True: 163k, False: 0]
  |  Branch (114:5): [True: 163k, Folded]
  |  Branch (114:5): [True: 163k, False: 0]
  ------------------
  115|   163k|    return a.sliceId == b.sliceId;
  116|   163k|  }
_ZNK8rawspeed14Cr2SliceWidths5beginEv:
  119|  1.08k|inline Cr2SliceWidthIterator Cr2SliceWidths::begin() const {
  120|  1.08k|  return {*this, 0};
  121|  1.08k|}
_ZNK8rawspeed14Cr2SliceWidths3endEv:
  122|  1.08k|inline Cr2SliceWidthIterator Cr2SliceWidths::end() const {
  123|  1.08k|  return {*this, numSlices};
  124|  1.08k|}

_ZNK8rawspeed15Cr2DecompressorINS_20PrefixCodeLUTDecoderINS_15BaselineCodeTagENS_23PrefixCodeLookupDecoderIS2_EEEEE9getSlicesEv:
  209|  1.08k|Cr2Decompressor<PrefixCodeDecoder>::getSlices() const {
  210|  1.08k|  return {Cr2SliceIterator(slicing.begin(), frame),
  211|  1.08k|          Cr2SliceIterator(slicing.end(), frame)};
  212|  1.08k|}
_ZN8rawspeed16Cr2SliceIteratorC2ERKNS_21Cr2SliceWidthIteratorERKNS_8iPoint2DE:
   89|  2.16k|      : frameHeight(frame.y), widthIter(sliceWidthIter_) {}
_ZNK8rawspeed15Cr2DecompressorINS_20PrefixCodeLUTDecoderINS_15BaselineCodeTagENS_23PrefixCodeLookupDecoderIS2_EEEEE17getAllOutputTilesEv:
  216|  1.08k|Cr2Decompressor<PrefixCodeDecoder>::getAllOutputTiles() const {
  217|  1.08k|  auto slices = getSlices();
  218|  1.08k|  return {Cr2OutputTileIterator(std::begin(slices), dim),
  219|  1.08k|          Cr2OutputTileIterator(std::end(slices), dim)};
  220|  1.08k|}
_ZN8rawspeed21Cr2OutputTileIteratorC2ERKNS_16Cr2SliceIteratorERKNS_8iPoint2DE:
  119|  2.16k|      : imgDim(imgDim_), sliceIter(sliceIter_) {}
_ZNK8rawspeed15Cr2DecompressorINS_20PrefixCodeLUTDecoderINS_15BaselineCodeTagENS_23PrefixCodeLookupDecoderIS2_EEEEE14getOutputTilesEv:
  224|    512|Cr2Decompressor<PrefixCodeDecoder>::getOutputTiles() const {
  225|    512|  auto allOutputTiles = getAllOutputTiles();
  226|    512|  auto first = allOutputTiles.begin();
  227|    512|  auto end = allOutputTiles.end();
  228|    512|  invariant(first != end && "No tiles?");
  ------------------
  |  |   27|    512|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (228:3): [True: 512, False: 0]
  |  Branch (228:3): [True: 512, Folded]
  |  Branch (228:3): [True: 512, False: 0]
  ------------------
  229|    512|  auto last = first;
  230|  75.8k|  while (std::next(last) != end && (*last).getBottomRight() != dim)
  ------------------
  |  Branch (230:10): [True: 75.8k, False: 2]
  |  Branch (230:10): [True: 75.3k, False: 512]
  |  Branch (230:36): [True: 75.3k, False: 510]
  ------------------
  231|  75.3k|    ++last;
  232|    512|  assert((*last).getBottomRight() == dim && "Bad tiling");
  ------------------
  |  Branch (232:3): [True: 512, False: 0]
  |  Branch (232:3): [True: 512, Folded]
  |  Branch (232:3): [True: 512, False: 0]
  ------------------
  233|    512|  return {first, ++last};
  234|    512|}
_ZN8rawspeedeqERKNS_21Cr2OutputTileIteratorES2_:
  149|   163k|                                           const Cr2OutputTileIterator& b) {
  150|   163k|    invariant(&a.imgDim == &b.imgDim && "Unrelated iterators.");
  ------------------
  |  |   27|   163k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (150:5): [True: 163k, False: 0]
  |  Branch (150:5): [True: 163k, Folded]
  |  Branch (150:5): [True: 163k, False: 0]
  ------------------
  151|       |    // NOTE: outPos is correctly omitted here.
  152|   163k|    return a.sliceIter == b.sliceIter && a.sliceRow == b.sliceRow;
  ------------------
  |  Branch (152:12): [True: 5.52k, False: 157k]
  |  Branch (152:42): [True: 2.38k, False: 3.13k]
  ------------------
  153|   163k|  }
_ZN8rawspeedeqERKNS_16Cr2SliceIteratorES2_:
   98|   163k|  friend bool operator==(const Cr2SliceIterator& a, const Cr2SliceIterator& b) {
   99|   163k|    invariant(a.frameHeight == b.frameHeight && "Unrelated iterators.");
  ------------------
  |  |   27|   163k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (99:5): [True: 163k, False: 0]
  |  Branch (99:5): [True: 163k, Folded]
  |  Branch (99:5): [True: 163k, False: 0]
  ------------------
  100|   163k|    return a.widthIter == b.widthIter;
  101|   163k|  }
_ZNK8rawspeed21Cr2OutputTileIteratordeEv:
  121|   392k|  value_type operator*() const {
  122|       |    // Positioning
  123|   392k|    iRectangle2D tile = {outPos, *sliceIter};
  124|       |    // Clamping
  125|   392k|    int outRowsRemaining = imgDim.y - tile.getTop();
  126|   392k|    invariant(outRowsRemaining >= 0);
  ------------------
  |  |   27|   392k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (126:5): [True: 392k, False: 0]
  ------------------
  127|   392k|    int tileRowsRemaining = tile.getHeight() - sliceRow;
  128|   392k|    invariant(tileRowsRemaining >= 0);
  ------------------
  |  |   27|   392k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (128:5): [True: 392k, False: 0]
  ------------------
  129|   392k|    const int tileHeight = std::min(outRowsRemaining, tileRowsRemaining);
  130|   392k|    tile.dim.y = tileHeight;
  131|   392k|    return tile;
  132|   392k|  }
_ZNK8rawspeed16Cr2SliceIteratordeEv:
   91|   858k|  value_type RAWSPEED_READONLY operator*() const {
   92|   858k|    return {*widthIter, frameHeight};
   93|   858k|  }
_ZN8rawspeed21Cr2OutputTileIteratorppEv:
  133|   233k|  Cr2OutputTileIterator& operator++() {
  134|   233k|    const iRectangle2D currTile = operator*();
  135|   233k|    sliceRow += currTile.getHeight();
  136|   233k|    outPos = currTile.getBottomLeft();
  137|   233k|    invariant(sliceRow >= 0 && sliceRow <= (*sliceIter).y && "Overflow");
  ------------------
  |  |   27|   233k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (137:5): [True: 233k, False: 0]
  |  Branch (137:5): [True: 233k, False: 0]
  |  Branch (137:5): [True: 233k, Folded]
  |  Branch (137:5): [True: 233k, False: 0]
  ------------------
  138|   233k|    if (sliceRow == (*sliceIter).y) {
  ------------------
  |  Branch (138:9): [True: 66.7k, False: 166k]
  ------------------
  139|  66.7k|      ++sliceIter;
  140|  66.7k|      sliceRow = 0;
  141|  66.7k|    }
  142|   233k|    if (outPos.y == imgDim.y) {
  ------------------
  |  Branch (142:9): [True: 175k, False: 57.4k]
  ------------------
  143|   175k|      outPos.y = 0;
  144|   175k|      outPos.x += currTile.getWidth();
  145|   175k|    }
  146|   233k|    return *this;
  147|   233k|  }
_ZN8rawspeed16Cr2SliceIteratorppEv:
   94|  66.7k|  Cr2SliceIterator& operator++() {
   95|  66.7k|    ++widthIter;
   96|  66.7k|    return *this;
   97|  66.7k|  }
_ZNK8rawspeed15Cr2DecompressorINS_20PrefixCodeLUTDecoderINS_15BaselineCodeTagENS_23PrefixCodeLookupDecoderIS2_EEEEE23getVerticalOutputStripsEv:
  238|    512|Cr2Decompressor<PrefixCodeDecoder>::getVerticalOutputStrips() const {
  239|    512|  auto outputTiles = getOutputTiles();
  240|    512|  return {Cr2VerticalOutputStripIterator(std::begin(outputTiles),
  241|    512|                                         std::end(outputTiles)),
  242|    512|          Cr2VerticalOutputStripIterator(std::end(outputTiles),
  243|    512|                                         std::end(outputTiles))};
  244|    512|}
_ZN8rawspeed30Cr2VerticalOutputStripIteratorC2ERKNS_21Cr2OutputTileIteratorES3_:
  191|  1.02k|      : outputTileIterator(outputTileIterator_),
  192|  1.02k|        outputTileIterator_end(outputTileIterator_end_) {}
_ZN8rawspeed15Cr2DecompressorINS_20PrefixCodeLUTDecoderINS_15BaselineCodeTagENS_23PrefixCodeLookupDecoderIS2_EEEEEC2ENS_8RawImageENSt3__15tupleIJiiiEEENS_8iPoint2DENS_14Cr2SliceWidthsENS8_6vectorINS6_18PerComponentRecipeENS8_9allocatorISE_EEEENS_10Array1DRefIKhEE:
  285|    576|    : mRaw(std::move(mRaw_)), format(std::move(format_)), frame(frame_),
  286|    576|      slicing(slicing_), rec(std::move(rec_)), input(input_) {
  287|    576|  if (mRaw->getDataType() != RawImageType::UINT16)
  ------------------
  |  Branch (287:7): [True: 0, False: 576]
  ------------------
  288|    576|    ThrowRDE("Unexpected data type");
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  289|       |
  290|    576|  if (mRaw->getCpp() != 1 || mRaw->getBpp() != sizeof(uint16_t))
  ------------------
  |  Branch (290:7): [True: 0, False: 576]
  |  Branch (290:30): [True: 0, False: 576]
  ------------------
  291|    576|    ThrowRDE("Unexpected cpp: %u", mRaw->getCpp());
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  292|       |
  293|    576|  if (!((std::make_tuple(3, 2, 2) == format) ||
  ------------------
  |  Branch (293:7): [True: 0, False: 576]
  |  Branch (293:9): [True: 0, False: 576]
  ------------------
  294|    576|        (std::make_tuple(3, 2, 1) == format) ||
  ------------------
  |  Branch (294:9): [True: 0, False: 576]
  ------------------
  295|    576|        (std::make_tuple(2, 1, 1) == format) ||
  ------------------
  |  Branch (295:9): [True: 323, False: 253]
  ------------------
  296|    253|        (std::make_tuple(4, 1, 1) == format)))
  ------------------
  |  Branch (296:9): [True: 253, False: 0]
  ------------------
  297|    576|    ThrowRDE("Unknown format <%i,%i,%i>", std::get<0>(format),
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  298|    576|             std::get<1>(format), std::get<2>(format));
  299|       |
  300|    576|  const Dsc dsc(format);
  301|       |
  302|    576|  dim = mRaw->dim;
  303|    576|  if (!dim.hasPositiveArea() || dim.x % dsc.groupSize != 0)
  ------------------
  |  Branch (303:7): [True: 0, False: 576]
  |  Branch (303:33): [True: 1, False: 575]
  ------------------
  304|    576|    ThrowRDE("Unexpected image dimension multiplicity");
  ------------------
  |  |   38|      1|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      1|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      1|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      1|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  305|    575|  dim.x /= dsc.groupSize;
  306|       |
  307|    575|  if (!frame.hasPositiveArea() || frame.x % dsc.X_S_F != 0 ||
  ------------------
  |  Branch (307:7): [True: 0, False: 575]
  |  Branch (307:35): [True: 0, False: 575]
  ------------------
  308|    575|      frame.y % dsc.Y_S_F != 0)
  ------------------
  |  Branch (308:7): [True: 0, False: 575]
  ------------------
  309|    575|    ThrowRDE("Unexpected LJpeg frame dimension multiplicity");
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  310|    575|  frame.x /= dsc.X_S_F;
  311|    575|  frame.y /= dsc.Y_S_F;
  312|       |
  313|    575|  if (mRaw->dim.x > 19440 || mRaw->dim.y > 5920) {
  ------------------
  |  Branch (313:7): [True: 0, False: 575]
  |  Branch (313:30): [True: 0, False: 575]
  ------------------
  314|      0|    ThrowRDE("Unexpected image dimensions found: (%d; %d)", mRaw->dim.x,
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  315|      0|             mRaw->dim.y);
  316|      0|  }
  317|       |
  318|  1.10M|  for (auto sliceId = 0; sliceId < slicing.numSlices; sliceId++) {
  ------------------
  |  Branch (318:26): [True: 1.10M, False: 575]
  ------------------
  319|  1.10M|    const auto sliceWidth = slicing.widthOfSlice(sliceId);
  320|  1.10M|    if (sliceWidth <= 0)
  ------------------
  |  Branch (320:9): [True: 0, False: 1.10M]
  ------------------
  321|  1.10M|      ThrowRDE("Bad slice width: %i", sliceWidth);
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  322|  1.10M|  }
  323|       |
  324|    575|  if (dsc.subSampled == mRaw->isCFA)
  ------------------
  |  Branch (324:7): [True: 0, False: 575]
  ------------------
  325|    575|    ThrowRDE("Cannot decode subsampled image to CFA data or vice versa");
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  326|       |
  327|    575|  if (static_cast<int>(rec.size()) != dsc.N_COMP)
  ------------------
  |  Branch (327:7): [True: 0, False: 575]
  ------------------
  328|    575|    ThrowRDE("HT/Initial predictor count does not match component count");
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  329|       |
  330|  1.65k|  for (const auto& recip : rec) {
  ------------------
  |  Branch (330:26): [True: 1.65k, False: 575]
  ------------------
  331|  1.65k|    if (!recip.ht.isFullDecode())
  ------------------
  |  Branch (331:9): [True: 0, False: 1.65k]
  ------------------
  332|  1.65k|      ThrowRDE("Huffman table is not of a full decoding variety");
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  333|  1.65k|  }
  334|       |
  335|  1.14k|  for (auto* width : {&slicing.sliceWidth, &slicing.lastSliceWidth}) {
  ------------------
  |  Branch (335:20): [True: 1.14k, False: 572]
  ------------------
  336|  1.14k|    if (*width % dsc.sliceColStep != 0) {
  ------------------
  |  Branch (336:9): [True: 3, False: 1.14k]
  ------------------
  337|      3|      ThrowRDE("Slice width (%d) should be multiple of pixel group size (%d)",
  ------------------
  |  |   38|      3|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      3|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      3|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      3|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  338|      3|               *width, dsc.sliceColStep);
  339|      3|    }
  340|  1.14k|    *width /= dsc.sliceColStep;
  341|  1.14k|  }
  342|       |
  343|    572|  if (frame.area() < dim.area())
  ------------------
  |  Branch (343:7): [True: 2, False: 570]
  ------------------
  344|    572|    ThrowRDE("Frame area smaller than the image area");
  ------------------
  |  |   38|      2|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      2|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      2|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      2|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  345|       |
  346|    570|  Optional<iRectangle2D> lastTile;
  347|  76.5k|  for (iRectangle2D output : getAllOutputTiles()) {
  ------------------
  |  Branch (347:28): [True: 76.5k, False: 9]
  ------------------
  348|  76.5k|    if (lastTile && evaluateConsecutiveTiles(*lastTile, output) ==
  ------------------
  |  Branch (348:9): [True: 75.9k, False: 570]
  |  Branch (348:21): [True: 1, False: 75.9k]
  ------------------
  349|  75.9k|                        TileSequenceStatus::Invalid)
  350|  76.5k|      ThrowRDE("Invalid tiling - slice width change mid-output row?");
  ------------------
  |  |   38|      1|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      1|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      1|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      1|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  351|  76.5k|    if (output.getBottomRight() <= dim) {
  ------------------
  |  Branch (351:9): [True: 75.9k, False: 560]
  ------------------
  352|  75.9k|      lastTile = output;
  353|  75.9k|      continue; // Tile still inbounds of image.
  354|  75.9k|    }
  355|    560|    if (output.getTopLeft() < dim)
  ------------------
  |  Branch (355:9): [True: 11, False: 549]
  ------------------
  356|    560|      ThrowRDE("Output tile partially outside of image");
  ------------------
  |  |   38|     11|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     11|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     11|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     11|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  357|    549|    break; // Skip the rest of the tiles - they do not contribute to the image.
  358|    560|  }
  359|    558|  if (!lastTile)
  ------------------
  |  Branch (359:7): [True: 0, False: 558]
  ------------------
  360|    558|    ThrowRDE("No tiles are provided");
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  361|    558|  if (lastTile->getBottomRight() != dim)
  ------------------
  |  Branch (361:7): [True: 5, False: 553]
  ------------------
  362|    558|    ThrowRDE("Tiles do not cover the entire image area.");
  ------------------
  |  |   38|      5|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      5|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      5|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      5|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  363|    558|}
Cr2Decompressor.cpp:_ZN8rawspeed12_GLOBAL__N_13DscC2ENSt3__15tupleIJiiiEEE:
  270|    576|      : N_COMP(std::get<0>(format)), X_S_F(std::get<1>(format)),
  271|    576|        Y_S_F(std::get<2>(format)), subSampled(X_S_F != 1 || Y_S_F != 1),
  ------------------
  |  Branch (271:48): [True: 0, False: 576]
  |  Branch (271:62): [True: 0, False: 576]
  ------------------
  272|    576|        sliceColStep(N_COMP * X_S_F), pixelsPerGroup(X_S_F * Y_S_F),
  273|    576|        groupSize(!subSampled ? N_COMP : 2 + pixelsPerGroup),
  ------------------
  |  Branch (273:19): [True: 576, False: 0]
  ------------------
  274|    576|        cpp(!subSampled ? 1 : 3), colsPerGroup(!subSampled ? cpp : groupSize) {}
  ------------------
  |  Branch (274:13): [True: 576, False: 0]
  |  Branch (274:48): [True: 576, False: 0]
  ------------------
Cr2Decompressor.cpp:_ZN8rawspeed12_GLOBAL__N_124evaluateConsecutiveTilesERKNS_12iRectangle2DES3_:
   62|  79.2k|                         const iRectangle2D& nextRect) {
   63|  79.2k|  using enum TileSequenceStatus;
   64|       |  // Are these two are verically-adjacent rectangles of same width?
   65|  79.2k|  if (rect.getBottomLeft() == nextRect.getTopLeft() &&
  ------------------
  |  Branch (65:7): [True: 19.6k, False: 59.5k]
  |  Branch (65:7): [True: 19.6k, False: 59.5k]
  ------------------
   66|  19.6k|      rect.getBottomRight() == nextRect.getTopRight())
  ------------------
  |  Branch (66:7): [True: 19.6k, False: 1]
  ------------------
   67|  19.6k|    return ContinuesColumn;
   68|       |  // Otherwise, the next rectangle should be the first row of next column.
   69|  59.5k|  if (nextRect.getTop() == 0 && nextRect.getLeft() == rect.getRight())
  ------------------
  |  Branch (69:7): [True: 59.5k, False: 1]
  |  Branch (69:33): [True: 59.5k, False: 0]
  ------------------
   70|  59.5k|    return BeginsNewColumn;
   71|      1|  return Invalid;
   72|  59.5k|}
_ZNK8rawspeed15Cr2DecompressorINS_20PrefixCodeLUTDecoderINS_15BaselineCodeTagENS_23PrefixCodeLookupDecoderIS2_EEEEE10decompressEv:
  471|    553|ByteStream::size_type Cr2Decompressor<PrefixCodeDecoder>::decompress() const {
  472|    553|  if (std::make_tuple(3, 2, 2) == format) {
  ------------------
  |  Branch (472:7): [True: 0, False: 553]
  ------------------
  473|      0|    return decompressN_X_Y<3, 2, 2>(); // Cr2 sRaw1/mRaw
  474|      0|  }
  475|    553|  if (std::make_tuple(3, 2, 1) == format) {
  ------------------
  |  Branch (475:7): [True: 0, False: 553]
  ------------------
  476|      0|    return decompressN_X_Y<3, 2, 1>(); // Cr2 sRaw2/sRaw
  477|      0|  }
  478|    553|  if (std::make_tuple(2, 1, 1) == format) {
  ------------------
  |  Branch (478:7): [True: 308, False: 245]
  ------------------
  479|    308|    return decompressN_X_Y<2, 1, 1>();
  480|    308|  }
  481|    245|  if (std::make_tuple(4, 1, 1) == format) {
  ------------------
  |  Branch (481:7): [True: 245, False: 0]
  ------------------
  482|    245|    return decompressN_X_Y<4, 1, 1>();
  483|    245|  }
  484|      0|  __builtin_unreachable();
  485|    245|}
_ZN8rawspeedeqERKNS_30Cr2VerticalOutputStripIteratorES2_:
  200|  1.74k|                         const Cr2VerticalOutputStripIterator& b) {
  201|  1.74k|    invariant(a.outputTileIterator_end == b.outputTileIterator_end &&
  ------------------
  |  |   27|  1.74k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (201:5): [True: 1.74k, False: 0]
  |  Branch (201:5): [True: 1.74k, Folded]
  |  Branch (201:5): [True: 1.74k, False: 0]
  ------------------
  202|  1.74k|              "Comparing unrelated iterators.");
  203|  1.74k|    return a.outputTileIterator == b.outputTileIterator;
  204|  1.74k|  }
_ZNK8rawspeed30Cr2VerticalOutputStripIteratordeEv:
  194|  1.66k|  value_type operator*() const { return coalesce().first; }
_ZNK8rawspeed30Cr2VerticalOutputStripIterator8coalesceEv:
  160|  2.89k|  [[nodiscard]] std::pair<iRectangle2D, int> coalesce() const {
  161|  2.89k|    Cr2OutputTileIterator tmpIter = outputTileIterator;
  162|  2.89k|    invariant(tmpIter != outputTileIterator_end && "Iterator overflow.");
  ------------------
  |  |   27|  2.89k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (162:5): [True: 2.89k, False: 0]
  |  Branch (162:5): [True: 2.89k, Folded]
  |  Branch (162:5): [True: 2.89k, False: 0]
  ------------------
  163|       |
  164|  2.89k|    iRectangle2D rect = *tmpIter;
  165|  2.89k|    int num = 1;
  166|       |
  167|  3.84k|    for (++tmpIter; tmpIter != outputTileIterator_end; ++tmpIter) {
  ------------------
  |  Branch (167:21): [True: 3.28k, False: 558]
  ------------------
  168|  3.28k|      iRectangle2D nextRect = *tmpIter;
  169|  3.28k|      const TileSequenceStatus s = evaluateConsecutiveTiles(rect, nextRect);
  170|  3.28k|      invariant(s != TileSequenceStatus::Invalid && "Bad tiling.");
  ------------------
  |  |   27|  3.28k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (170:7): [True: 3.28k, False: 0]
  |  Branch (170:7): [True: 3.28k, Folded]
  |  Branch (170:7): [True: 3.28k, False: 0]
  ------------------
  171|  3.28k|      if (s == TileSequenceStatus::BeginsNewColumn)
  ------------------
  |  Branch (171:11): [True: 2.33k, False: 950]
  ------------------
  172|  2.33k|        break;
  173|    950|      invariant(s == TileSequenceStatus::ContinuesColumn);
  ------------------
  |  |   27|    950|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (173:7): [True: 950, False: 0]
  ------------------
  174|    950|      rect.dim.y += nextRect.dim.y;
  175|    950|      ++num;
  176|    950|    }
  177|       |
  178|  2.89k|    return {rect, num};
  179|  2.89k|  }
_ZN8rawspeed30Cr2VerticalOutputStripIteratorppEv:
  195|  1.23k|  Cr2VerticalOutputStripIterator& operator++() {
  196|  1.23k|    std::advance(outputTileIterator, coalesce().second);
  197|  1.23k|    return *this;
  198|  1.23k|  }
_ZNK8rawspeed15Cr2DecompressorINS_20PrefixCodeLUTDecoderINS_15BaselineCodeTagENS_23PrefixCodeLookupDecoderIS2_EEEEE15decompressN_X_YILi2ELi1ELi1EEEjv:
  399|    308|Cr2Decompressor<PrefixCodeDecoder>::decompressN_X_Y() const {
  400|    308|  const Array2DRef<uint16_t> out(mRaw->getU16DataAsUncroppedArray2DRef());
  401|       |
  402|       |  // To understand the CR2 slice handling and sampling factor behavior, see
  403|       |  // https://github.com/lclevy/libcraw2/blob/master/docs/cr2_lossless.pdf?raw=true
  404|       |
  405|    308|  constexpr Dsc dsc({N_COMP, X_S_F, Y_S_F});
  406|       |
  407|       |  // inner loop decodes one group of pixels at a time
  408|       |  //  * for <N,1,1>: N  = N*1*1 (full raw)
  409|       |  //  * for <3,2,1>: 6  = 3*2*1
  410|       |  //  * for <3,2,2>: 12 = 3*2*2
  411|       |  // and advances x by N_COMP*X_S_F and y by Y_S_F
  412|       |
  413|    308|  auto ht = getPrefixCodeDecoders<N_COMP>();
  414|    308|  auto pred = getInitialPreds<N_COMP>();
  415|    308|  auto predNext = out[/*row=*/0]
  416|    308|                      .getCrop(/*offset=*/0, /*size=*/dsc.groupSize)
  417|    308|                      .getAsArray1DRef();
  418|       |
  419|    308|  BitStreamerJPEG bs(input);
  420|       |
  421|    308|  int globalFrameCol = 0;
  422|    308|  int globalFrameRow = 0;
  423|    308|  (void)globalFrameRow;
  424|       |
  425|    308|  auto frameColsRemaining = [&]() {
  426|    308|    int r = frame.x - globalFrameCol;
  427|    308|    invariant(r >= 0);
  428|    308|    return r;
  429|    308|  };
  430|       |
  431|  1.32k|  for (iRectangle2D output : getVerticalOutputStrips()) {
  ------------------
  |  Branch (431:28): [True: 1.32k, False: 308]
  ------------------
  432|  8.70k|    for (int row = output.getTop(), rowEnd = output.getBottom(); row != rowEnd;
  ------------------
  |  Branch (432:66): [True: 7.37k, False: 1.32k]
  ------------------
  433|  7.37k|         ++row) {
  434|  7.37k|      for (int col = output.getLeft(), colEnd = output.getRight();
  435|  78.3k|           col != colEnd;) {
  ------------------
  |  Branch (435:12): [True: 70.9k, False: 7.37k]
  ------------------
  436|       |        // check if we processed one full raw row worth of pixels
  437|  70.9k|        if (frameColsRemaining() == 0) {
  ------------------
  |  Branch (437:13): [True: 64.3k, False: 6.60k]
  ------------------
  438|       |          // if yes -> update predictor by going back exactly one row,
  439|       |          // no matter where we are right now.
  440|       |          // makes no sense from an image compression point of view, ask
  441|       |          // Canon.
  442|   193k|          for (int c = 0; c < N_COMP; ++c)
  ------------------
  |  Branch (442:27): [True: 128k, False: 64.3k]
  ------------------
  443|   128k|            pred[c] = predNext(c == 0 ? c : dsc.groupSize - (N_COMP - c));
  ------------------
  |  Branch (443:32): [True: 64.3k, False: 64.3k]
  ------------------
  444|  64.3k|          predNext = out[row]
  445|  64.3k|                         .getBlock(/*size=*/dsc.groupSize,
  446|  64.3k|                                   /*index=*/col)
  447|  64.3k|                         .getAsArray1DRef();
  448|  64.3k|          ++globalFrameRow;
  449|  64.3k|          globalFrameCol = 0;
  450|  64.3k|          invariant(globalFrameRow < frame.y && "Run out of frame");
  ------------------
  |  |   27|  64.3k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (450:11): [True: 64.3k, False: 0]
  |  Branch (450:11): [True: 64.3k, Folded]
  |  Branch (450:11): [True: 64.3k, False: 0]
  ------------------
  451|  64.3k|        }
  452|       |
  453|       |        // How many pixel can we decode until we finish the row of either
  454|       |        // the frame (i.e. predictor change time), or of the current slice?
  455|  70.9k|        for (int colFrameEnd = std::min(colEnd, col + frameColsRemaining());
  456|  2.08M|             col != colFrameEnd; ++col, ++globalFrameCol) {
  ------------------
  |  Branch (456:14): [True: 2.01M, False: 70.9k]
  ------------------
  457|  6.03M|          for (int p = 0; p < dsc.groupSize; ++p) {
  ------------------
  |  Branch (457:27): [True: 4.02M, False: 2.01M]
  ------------------
  458|  4.02M|            int c = p < dsc.pixelsPerGroup ? 0 : p - dsc.pixelsPerGroup + 1;
  ------------------
  |  Branch (458:21): [True: 2.01M, False: 2.01M]
  ------------------
  459|  4.02M|            out(row, (dsc.groupSize * col) + p) = pred[c] +=
  460|  4.02M|                (static_cast<const PrefixCodeDecoder&>(ht[c]))
  461|  4.02M|                    .decodeDifference(bs);
  462|  4.02M|          }
  463|  2.01M|        }
  464|  70.9k|      }
  465|  7.37k|    }
  466|  1.32k|  }
  467|    308|  return bs.getStreamPosition();
  468|    308|}
_ZNK8rawspeed15Cr2DecompressorINS_20PrefixCodeLUTDecoderINS_15BaselineCodeTagENS_23PrefixCodeLookupDecoderIS2_EEEEE21getPrefixCodeDecodersILi2EEENSt3__15arrayINS8_17reference_wrapperIKS5_EEXT_EEEv:
  377|    308|Cr2Decompressor<PrefixCodeDecoder>::getPrefixCodeDecoders() const {
  378|    308|  return getPrefixCodeDecodersImpl<N_COMP>(std::make_index_sequence<N_COMP>{});
  379|    308|}
_ZNK8rawspeed15Cr2DecompressorINS_20PrefixCodeLUTDecoderINS_15BaselineCodeTagENS_23PrefixCodeLookupDecoderIS2_EEEEE25getPrefixCodeDecodersImplILi2EJLm0ELm1EEEENSt3__15arrayINS8_17reference_wrapperIKS5_EEXT_EEENS8_16integer_sequenceImJXspT0_EEEE:
  369|    308|    std::index_sequence<I...> /*unused*/) const {
  370|    308|  return std::array<std::reference_wrapper<const PrefixCodeDecoder>, N_COMP>{
  371|    308|      std::cref(rec[I].ht)...};
  372|    308|}
_ZNK8rawspeed15Cr2DecompressorINS_20PrefixCodeLUTDecoderINS_15BaselineCodeTagENS_23PrefixCodeLookupDecoderIS2_EEEEE15getInitialPredsILi2EEENSt3__15arrayItXT_EEEv:
  384|    308|Cr2Decompressor<PrefixCodeDecoder>::getInitialPreds() const {
  385|    308|  std::array<uint16_t, N_COMP> preds;
  386|    308|  std::transform(
  387|    308|      rec.begin(), rec.end(), preds.begin(),
  388|    308|      [](const PerComponentRecipe& compRec) { return compRec.initPred; });
  389|    308|  return preds;
  390|    308|}
_ZZNK8rawspeed15Cr2DecompressorINS_20PrefixCodeLUTDecoderINS_15BaselineCodeTagENS_23PrefixCodeLookupDecoderIS2_EEEEE15getInitialPredsILi2EEENSt3__15arrayItXT_EEEvENKUlRKNS6_18PerComponentRecipeEE_clESD_:
  388|    616|      [](const PerComponentRecipe& compRec) { return compRec.initPred; });
_ZZNK8rawspeed15Cr2DecompressorINS_20PrefixCodeLUTDecoderINS_15BaselineCodeTagENS_23PrefixCodeLookupDecoderIS2_EEEEE15decompressN_X_YILi2ELi1ELi1EEEjvENKUlvE_clEv:
  425|   141k|  auto frameColsRemaining = [&]() {
  426|   141k|    int r = frame.x - globalFrameCol;
  427|   141k|    invariant(r >= 0);
  ------------------
  |  |   27|   141k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (427:5): [True: 141k, False: 0]
  ------------------
  428|   141k|    return r;
  429|   141k|  };
_ZNK8rawspeed15Cr2DecompressorINS_20PrefixCodeLUTDecoderINS_15BaselineCodeTagENS_23PrefixCodeLookupDecoderIS2_EEEEE15decompressN_X_YILi4ELi1ELi1EEEjv:
  399|    245|Cr2Decompressor<PrefixCodeDecoder>::decompressN_X_Y() const {
  400|    245|  const Array2DRef<uint16_t> out(mRaw->getU16DataAsUncroppedArray2DRef());
  401|       |
  402|       |  // To understand the CR2 slice handling and sampling factor behavior, see
  403|       |  // https://github.com/lclevy/libcraw2/blob/master/docs/cr2_lossless.pdf?raw=true
  404|       |
  405|    245|  constexpr Dsc dsc({N_COMP, X_S_F, Y_S_F});
  406|       |
  407|       |  // inner loop decodes one group of pixels at a time
  408|       |  //  * for <N,1,1>: N  = N*1*1 (full raw)
  409|       |  //  * for <3,2,1>: 6  = 3*2*1
  410|       |  //  * for <3,2,2>: 12 = 3*2*2
  411|       |  // and advances x by N_COMP*X_S_F and y by Y_S_F
  412|       |
  413|    245|  auto ht = getPrefixCodeDecoders<N_COMP>();
  414|    245|  auto pred = getInitialPreds<N_COMP>();
  415|    245|  auto predNext = out[/*row=*/0]
  416|    245|                      .getCrop(/*offset=*/0, /*size=*/dsc.groupSize)
  417|    245|                      .getAsArray1DRef();
  418|       |
  419|    245|  BitStreamerJPEG bs(input);
  420|       |
  421|    245|  int globalFrameCol = 0;
  422|    245|  int globalFrameRow = 0;
  423|    245|  (void)globalFrameRow;
  424|       |
  425|    245|  auto frameColsRemaining = [&]() {
  426|    245|    int r = frame.x - globalFrameCol;
  427|    245|    invariant(r >= 0);
  428|    245|    return r;
  429|    245|  };
  430|       |
  431|    340|  for (iRectangle2D output : getVerticalOutputStrips()) {
  ------------------
  |  Branch (431:28): [True: 340, False: 245]
  ------------------
  432|  2.36k|    for (int row = output.getTop(), rowEnd = output.getBottom(); row != rowEnd;
  ------------------
  |  Branch (432:66): [True: 2.02k, False: 340]
  ------------------
  433|  2.02k|         ++row) {
  434|  2.02k|      for (int col = output.getLeft(), colEnd = output.getRight();
  435|  38.6k|           col != colEnd;) {
  ------------------
  |  Branch (435:12): [True: 36.6k, False: 2.02k]
  ------------------
  436|       |        // check if we processed one full raw row worth of pixels
  437|  36.6k|        if (frameColsRemaining() == 0) {
  ------------------
  |  Branch (437:13): [True: 34.7k, False: 1.94k]
  ------------------
  438|       |          // if yes -> update predictor by going back exactly one row,
  439|       |          // no matter where we are right now.
  440|       |          // makes no sense from an image compression point of view, ask
  441|       |          // Canon.
  442|   173k|          for (int c = 0; c < N_COMP; ++c)
  ------------------
  |  Branch (442:27): [True: 138k, False: 34.7k]
  ------------------
  443|   138k|            pred[c] = predNext(c == 0 ? c : dsc.groupSize - (N_COMP - c));
  ------------------
  |  Branch (443:32): [True: 34.7k, False: 104k]
  ------------------
  444|  34.7k|          predNext = out[row]
  445|  34.7k|                         .getBlock(/*size=*/dsc.groupSize,
  446|  34.7k|                                   /*index=*/col)
  447|  34.7k|                         .getAsArray1DRef();
  448|  34.7k|          ++globalFrameRow;
  449|  34.7k|          globalFrameCol = 0;
  450|  34.7k|          invariant(globalFrameRow < frame.y && "Run out of frame");
  ------------------
  |  |   27|  34.7k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (450:11): [True: 34.7k, False: 0]
  |  Branch (450:11): [True: 34.7k, Folded]
  |  Branch (450:11): [True: 34.7k, False: 0]
  ------------------
  451|  34.7k|        }
  452|       |
  453|       |        // How many pixel can we decode until we finish the row of either
  454|       |        // the frame (i.e. predictor change time), or of the current slice?
  455|  36.6k|        for (int colFrameEnd = std::min(colEnd, col + frameColsRemaining());
  456|   730k|             col != colFrameEnd; ++col, ++globalFrameCol) {
  ------------------
  |  Branch (456:14): [True: 694k, False: 36.6k]
  ------------------
  457|  3.47M|          for (int p = 0; p < dsc.groupSize; ++p) {
  ------------------
  |  Branch (457:27): [True: 2.77M, False: 694k]
  ------------------
  458|  2.77M|            int c = p < dsc.pixelsPerGroup ? 0 : p - dsc.pixelsPerGroup + 1;
  ------------------
  |  Branch (458:21): [True: 694k, False: 2.08M]
  ------------------
  459|  2.77M|            out(row, (dsc.groupSize * col) + p) = pred[c] +=
  460|  2.77M|                (static_cast<const PrefixCodeDecoder&>(ht[c]))
  461|  2.77M|                    .decodeDifference(bs);
  462|  2.77M|          }
  463|   694k|        }
  464|  36.6k|      }
  465|  2.02k|    }
  466|    340|  }
  467|    245|  return bs.getStreamPosition();
  468|    245|}
_ZNK8rawspeed15Cr2DecompressorINS_20PrefixCodeLUTDecoderINS_15BaselineCodeTagENS_23PrefixCodeLookupDecoderIS2_EEEEE21getPrefixCodeDecodersILi4EEENSt3__15arrayINS8_17reference_wrapperIKS5_EEXT_EEEv:
  377|    245|Cr2Decompressor<PrefixCodeDecoder>::getPrefixCodeDecoders() const {
  378|    245|  return getPrefixCodeDecodersImpl<N_COMP>(std::make_index_sequence<N_COMP>{});
  379|    245|}
_ZNK8rawspeed15Cr2DecompressorINS_20PrefixCodeLUTDecoderINS_15BaselineCodeTagENS_23PrefixCodeLookupDecoderIS2_EEEEE25getPrefixCodeDecodersImplILi4EJLm0ELm1ELm2ELm3EEEENSt3__15arrayINS8_17reference_wrapperIKS5_EEXT_EEENS8_16integer_sequenceImJXspT0_EEEE:
  369|    245|    std::index_sequence<I...> /*unused*/) const {
  370|    245|  return std::array<std::reference_wrapper<const PrefixCodeDecoder>, N_COMP>{
  371|    245|      std::cref(rec[I].ht)...};
  372|    245|}
_ZNK8rawspeed15Cr2DecompressorINS_20PrefixCodeLUTDecoderINS_15BaselineCodeTagENS_23PrefixCodeLookupDecoderIS2_EEEEE15getInitialPredsILi4EEENSt3__15arrayItXT_EEEv:
  384|    245|Cr2Decompressor<PrefixCodeDecoder>::getInitialPreds() const {
  385|    245|  std::array<uint16_t, N_COMP> preds;
  386|    245|  std::transform(
  387|    245|      rec.begin(), rec.end(), preds.begin(),
  388|    245|      [](const PerComponentRecipe& compRec) { return compRec.initPred; });
  389|    245|  return preds;
  390|    245|}
_ZZNK8rawspeed15Cr2DecompressorINS_20PrefixCodeLUTDecoderINS_15BaselineCodeTagENS_23PrefixCodeLookupDecoderIS2_EEEEE15getInitialPredsILi4EEENSt3__15arrayItXT_EEEvENKUlRKNS6_18PerComponentRecipeEE_clESD_:
  388|    980|      [](const PerComponentRecipe& compRec) { return compRec.initPred; });
_ZZNK8rawspeed15Cr2DecompressorINS_20PrefixCodeLUTDecoderINS_15BaselineCodeTagENS_23PrefixCodeLookupDecoderIS2_EEEEE15decompressN_X_YILi4ELi1ELi1EEEjvENKUlvE_clEv:
  425|  73.3k|  auto frameColsRemaining = [&]() {
  426|  73.3k|    int r = frame.x - globalFrameCol;
  427|  73.3k|    invariant(r >= 0);
  ------------------
  |  |   27|  73.3k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (427:5): [True: 73.3k, False: 0]
  ------------------
  428|  73.3k|    return r;
  429|  73.3k|  };

_ZN8rawspeed15Cr2LJpegDecoderC2ENS_10ByteStreamERKNS_8RawImageE:
   44|    977|    : AbstractLJpegDecoder(bs, img) {
   45|    977|  if (mRaw->getDataType() != RawImageType::UINT16)
  ------------------
  |  Branch (45:7): [True: 0, False: 977]
  ------------------
   46|    977|    ThrowRDE("Unexpected data type");
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   47|       |
   48|    977|  if (mRaw->getCpp() != 1 || mRaw->getBpp() != sizeof(uint16_t))
  ------------------
  |  Branch (48:7): [True: 16, False: 961]
  |  Branch (48:30): [True: 0, False: 961]
  ------------------
   49|    977|    ThrowRDE("Unexpected cpp: %u", mRaw->getCpp());
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   50|       |
   51|    977|  if (!mRaw->dim.x || !mRaw->dim.y || mRaw->dim.x > 19440 ||
  ------------------
  |  Branch (51:7): [True: 16, False: 961]
  |  Branch (51:23): [True: 0, False: 961]
  |  Branch (51:39): [True: 0, False: 961]
  ------------------
   52|    961|      mRaw->dim.y > 5920) {
  ------------------
  |  Branch (52:7): [True: 8, False: 953]
  ------------------
   53|      8|    ThrowRDE("Unexpected image dimensions found: (%d; %d)", mRaw->dim.x,
  ------------------
  |  |   38|      8|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      8|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      8|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      8|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   54|      8|             mRaw->dim.y);
   55|      8|  }
   56|    977|}
_ZN8rawspeed15Cr2LJpegDecoder10decodeScanEv:
   58|    595|Buffer::size_type Cr2LJpegDecoder::decodeScan() {
   59|    595|  if (numMCUsPerRestartInterval != 0)
  ------------------
  |  Branch (59:7): [True: 2, False: 593]
  ------------------
   60|    595|    ThrowRDE("Non-zero restart interval not supported.");
  ------------------
  |  |   38|      2|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      2|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      2|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      2|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   61|       |
   62|    593|  if (predictorMode != 1)
  ------------------
  |  Branch (62:7): [True: 1, False: 592]
  ------------------
   63|    593|    ThrowRDE("Unsupported predictor mode.");
  ------------------
  |  |   38|      1|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      1|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      1|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      1|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   64|       |
   65|    592|  if (slicing.empty()) {
  ------------------
  |  Branch (65:7): [True: 12, False: 580]
  ------------------
   66|     12|    const int slicesWidth = frame.w * frame.cps;
   67|     12|    if (slicesWidth > mRaw->dim.x)
  ------------------
  |  Branch (67:9): [True: 7, False: 5]
  ------------------
   68|     12|      ThrowRDE("Don't know slicing pattern, and failed to guess it.");
  ------------------
  |  |   38|      7|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      7|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      7|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      7|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   69|       |
   70|      5|    slicing =
   71|      5|        Cr2SliceWidths(/*numSlices=*/1, /*sliceWidth=don't care*/ 0,
   72|      5|                       /*lastSliceWidth=*/implicit_cast<uint16_t>(slicesWidth));
   73|      5|  }
   74|       |
   75|    585|  bool isSubSampled = false;
   76|  2.26k|  for (uint32_t i = 0; i < frame.cps; i++)
  ------------------
  |  Branch (76:24): [True: 1.68k, False: 585]
  ------------------
   77|  1.68k|    isSubSampled = isSubSampled || frame.compInfo[i].superH != 1 ||
  ------------------
  |  Branch (77:20): [True: 3, False: 1.68k]
  |  Branch (77:36): [True: 3, False: 1.67k]
  ------------------
   78|  1.67k|                   frame.compInfo[i].superV != 1;
  ------------------
  |  Branch (78:20): [True: 1, False: 1.67k]
  ------------------
   79|       |
   80|    585|  if (frame.cps != 3 && frame.w * frame.cps > 2 * frame.h) {
  ------------------
  |  Branch (80:7): [True: 584, False: 1]
  |  Branch (80:25): [True: 241, False: 343]
  ------------------
   81|       |    // Fix Canon double height issue where Canon doubled the width and halfed
   82|       |    // the height (e.g. with 5Ds), ask Canon. frame.w needs to stay as is here
   83|       |    // because the number of pixels after which the predictor gets updated is
   84|       |    // still the doubled width.
   85|       |    // see: FIX_CANON_HALF_HEIGHT_DOUBLE_WIDTH
   86|    241|    frame.h *= 2;
   87|    241|  }
   88|       |
   89|    585|  std::tuple<int /*N_COMP*/, int /*X_S_F*/, int /*Y_S_F*/> format;
   90|       |
   91|    585|  if (isSubSampled) {
  ------------------
  |  Branch (91:7): [True: 4, False: 581]
  ------------------
   92|      4|    if (mRaw->isCFA)
  ------------------
  |  Branch (92:9): [True: 4, False: 0]
  ------------------
   93|      4|      ThrowRDE("Cannot decode subsampled image to CFA data");
  ------------------
  |  |   38|      4|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      4|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      4|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      4|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   94|       |
   95|      0|    if (frame.cps != 3)
  ------------------
  |  Branch (95:9): [True: 0, False: 0]
  ------------------
   96|      0|      ThrowRDE("Unsupported number of subsampled components: %u", frame.cps);
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   97|       |
   98|       |    // see http://lclevy.free.fr/cr2/#sraw for overview table
   99|      0|    bool isSupported = frame.compInfo[0].superH == 2;
  100|       |
  101|      0|    isSupported = isSupported && (frame.compInfo[0].superV == 1 ||
  ------------------
  |  Branch (101:19): [True: 0, False: 0]
  |  Branch (101:35): [True: 0, False: 0]
  ------------------
  102|      0|                                  frame.compInfo[0].superV == 2);
  ------------------
  |  Branch (102:35): [True: 0, False: 0]
  ------------------
  103|       |
  104|      0|    for (uint32_t i = 1; i < frame.cps; i++)
  ------------------
  |  Branch (104:26): [True: 0, False: 0]
  ------------------
  105|      0|      isSupported = isSupported && frame.compInfo[i].superH == 1 &&
  ------------------
  |  Branch (105:21): [True: 0, False: 0]
  |  Branch (105:36): [True: 0, False: 0]
  ------------------
  106|      0|                    frame.compInfo[i].superV == 1;
  ------------------
  |  Branch (106:21): [True: 0, False: 0]
  ------------------
  107|       |
  108|      0|    if (!isSupported) {
  ------------------
  |  Branch (108:9): [True: 0, False: 0]
  ------------------
  109|      0|      ThrowRDE("Unsupported subsampling ([[%u, %u], [%u, %u], [%u, %u]])",
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  110|      0|               frame.compInfo[0].superH, frame.compInfo[0].superV,
  111|      0|               frame.compInfo[1].superH, frame.compInfo[1].superV,
  112|      0|               frame.compInfo[2].superH, frame.compInfo[2].superV);
  113|      0|    }
  114|       |
  115|      0|    if (frame.compInfo[0].superV == 2)
  ------------------
  |  Branch (115:9): [True: 0, False: 0]
  ------------------
  116|      0|      format = {3, 2, 2}; // Cr2 sRaw1/mRaw
  117|      0|    else {
  118|      0|      assert(frame.compInfo[0].superV == 1);
  ------------------
  |  Branch (118:7): [True: 0, False: 0]
  ------------------
  119|       |      // fix the inconsistent slice width in sRaw mode, ask Canon.
  120|      0|      for (auto* width : {&slicing.sliceWidth, &slicing.lastSliceWidth})
  ------------------
  |  Branch (120:24): [True: 0, False: 0]
  ------------------
  121|      0|        *width = (*width) * 3 / 2;
  122|      0|      format = {3, 2, 1}; // Cr2 sRaw2/sRaw
  123|      0|    }
  124|    581|  } else {
  125|    581|    switch (frame.cps) {
  126|    324|    case 2:
  ------------------
  |  Branch (126:5): [True: 324, False: 257]
  ------------------
  127|    324|      format = {2, 1, 1};
  128|    324|      break;
  129|    255|    case 4:
  ------------------
  |  Branch (129:5): [True: 255, False: 326]
  ------------------
  130|    255|      format = {4, 1, 1};
  131|    255|      break;
  132|      2|    default:
  ------------------
  |  Branch (132:5): [True: 2, False: 579]
  ------------------
  133|      2|      ThrowRDE("Unsupported number of components: %u", frame.cps);
  ------------------
  |  |   38|      2|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      2|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      2|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      2|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  134|    581|    }
  135|    581|  }
  136|       |
  137|    579|  int N_COMP = std::get<0>(format);
  138|       |
  139|    579|  std::vector<Cr2Decompressor<PrefixCodeDecoder<>>::PerComponentRecipe> rec;
  140|    579|  rec.reserve(N_COMP);
  141|    579|  std::generate_n(
  142|    579|      std::back_inserter(rec), N_COMP,
  143|    579|      [&rec, hts = getPrefixCodeDecoders(N_COMP),
  144|    579|       initPred = getInitialPredictors(N_COMP)]()
  145|    579|          -> Cr2Decompressor<PrefixCodeDecoder<>>::PerComponentRecipe {
  146|    579|        const auto i = implicit_cast<int>(rec.size());
  147|    579|        return {*hts[i], initPred[i]};
  148|    579|      });
  149|       |
  150|    579|  Cr2Decompressor<PrefixCodeDecoder<>> d(
  151|    579|      mRaw, format, iPoint2D(frame.w, frame.h), slicing, rec,
  152|    579|      input.peekRemainingBuffer().getAsArray1DRef());
  153|    579|  return d.decompress();
  154|    585|}
Cr2LJpegDecoder.cpp:_ZZN8rawspeed15Cr2LJpegDecoder10decodeScanEvENK3$_0clEv:
  145|  1.65k|          -> Cr2Decompressor<PrefixCodeDecoder<>>::PerComponentRecipe {
  146|  1.65k|        const auto i = implicit_cast<int>(rec.size());
  147|  1.65k|        return {*hts[i], initPred[i]};
  148|  1.65k|      });
_ZN8rawspeed15Cr2LJpegDecoder6decodeERKNS_14Cr2SliceWidthsE:
  156|    953|void Cr2LJpegDecoder::decode(const Cr2SliceWidths& slicing_) {
  157|    953|  slicing = slicing_;
  158|  1.14M|  for (auto sliceId = 0; sliceId < slicing.numSlices; sliceId++) {
  ------------------
  |  Branch (158:26): [True: 1.14M, False: 953]
  ------------------
  159|  1.14M|    const auto sliceWidth = slicing.widthOfSlice(sliceId);
  160|  1.14M|    if (sliceWidth <= 0)
  ------------------
  |  Branch (160:9): [True: 0, False: 1.14M]
  ------------------
  161|  1.14M|      ThrowRDE("Bad slice width: %i", sliceWidth);
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  162|  1.14M|  }
  163|       |
  164|    953|  AbstractLJpegDecoder::decodeSOI();
  165|    953|}

_ZN8rawspeed22HasselbladDecompressorC2ENS_8RawImageERKNS0_18PerComponentRecipeENS_10Array1DRefIKhEE:
   41|     89|    : mRaw(std::move(mRaw_)), rec(rec_), input(input_) {
   42|     89|  if (mRaw->getDataType() != RawImageType::UINT16)
  ------------------
  |  Branch (42:7): [True: 0, False: 89]
  ------------------
   43|     89|    ThrowRDE("Unexpected data type");
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   44|       |
   45|     89|  if (mRaw->getCpp() != 1 || mRaw->getBpp() != sizeof(uint16_t))
  ------------------
  |  Branch (45:7): [True: 0, False: 89]
  |  Branch (45:30): [True: 0, False: 89]
  ------------------
   46|     89|    ThrowRDE("Unexpected cpp: %u", mRaw->getCpp());
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   47|       |
   48|       |  // FIXME: could be wrong. max "active pixels" - "100 MP"
   49|     89|  if (!mRaw->dim.hasPositiveArea() || mRaw->dim.x % 2 != 0 ||
  ------------------
  |  Branch (49:7): [True: 0, False: 89]
  |  Branch (49:39): [True: 0, False: 89]
  ------------------
   50|     89|      mRaw->dim.x > 12000 || mRaw->dim.y > 8842) {
  ------------------
  |  Branch (50:7): [True: 0, False: 89]
  |  Branch (50:30): [True: 0, False: 89]
  ------------------
   51|      0|    ThrowRDE("Unexpected image dimensions found: (%d; %d)", mRaw->dim.x,
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   52|      0|             mRaw->dim.y);
   53|      0|  }
   54|       |
   55|     89|  if (rec.ht.isFullDecode())
  ------------------
  |  Branch (55:7): [True: 0, False: 89]
  ------------------
   56|     89|    ThrowRDE("Huffman table is of a full decoding variety");
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   57|     89|}
_ZN8rawspeed22HasselbladDecompressor10decompressEv:
   71|     89|ByteStream::size_type HasselbladDecompressor::decompress() {
   72|     89|  const Array2DRef<uint16_t> out(mRaw->getU16DataAsUncroppedArray2DRef());
   73|       |
   74|     89|  invariant(out.height() > 0);
  ------------------
  |  |   27|     89|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (74:3): [True: 89, False: 0]
  ------------------
   75|     89|  invariant(out.width() > 0);
  ------------------
  |  |   27|     89|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (75:3): [True: 89, False: 0]
  ------------------
   76|     89|  invariant(out.width() % 2 == 0);
  ------------------
  |  |   27|     89|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (76:3): [True: 89, False: 0]
  ------------------
   77|       |
   78|     89|  const auto ht = rec.ht;
   79|     89|  ht.verifyCodeValuesAsDiffLengths();
   80|       |
   81|     89|  BitStreamerMSB32 bitStreamer(input);
   82|       |  // Pixels are packed two at a time, not like LJPEG:
   83|       |  // [p1_length_as_huffman][p2_length_as_huffman][p0_diff_with_length][p1_diff_with_length]|NEXT
   84|       |  // PIXELS
   85|    224|  for (int row = 0; row < out.height(); row++) {
  ------------------
  |  Branch (85:21): [True: 135, False: 89]
  ------------------
   86|    135|    int p1 = rec.initPred;
   87|    135|    int p2 = rec.initPred;
   88|  10.6k|    for (int col = 0; col < out.width(); col += 2) {
  ------------------
  |  Branch (88:23): [True: 10.5k, False: 135]
  ------------------
   89|  10.5k|      int len1 = ht.decodeCodeValue(bitStreamer);
   90|  10.5k|      int len2 = ht.decodeCodeValue(bitStreamer);
   91|  10.5k|      p1 += getBits(bitStreamer, len1);
   92|  10.5k|      p2 += getBits(bitStreamer, len2);
   93|       |      // NOTE: this is rather unusual and weird, but appears to be correct.
   94|       |      // clampBits(p, 16) results in completely garbled images.
   95|  10.5k|      out(row, col) = uint16_t(p1);
   96|  10.5k|      out(row, col + 1) = uint16_t(p2);
   97|  10.5k|    }
   98|    135|  }
   99|     89|  return bitStreamer.getStreamPosition();
  100|     89|}
_ZN8rawspeed22HasselbladDecompressor7getBitsERNS_16BitStreamerMSB32Ei:
   61|  20.8k|inline int HasselbladDecompressor::getBits(BitStreamerMSB32& bs, int len) {
   62|  20.8k|  if (!len)
  ------------------
  |  Branch (62:7): [True: 11.1k, False: 9.70k]
  ------------------
   63|  11.1k|    return 0;
   64|  9.70k|  int diff = bs.getBits(len);
   65|  9.70k|  diff = PrefixCodeDecoder<>::extend(diff, len);
   66|  9.70k|  if (diff == 65535)
  ------------------
  |  Branch (66:7): [True: 56, False: 9.64k]
  ------------------
   67|     56|    return -32768;
   68|  9.64k|  return diff;
   69|  9.70k|}

_ZN8rawspeed22HasselbladLJpegDecoderC2ENS_10ByteStreamERKNS_8RawImageE:
   37|    151|    : AbstractLJpegDecoder(bs, img) {
   38|    151|  if (mRaw->getCpp() != 1 || mRaw->getDataType() != RawImageType::UINT16 ||
  ------------------
  |  Branch (38:7): [True: 36, False: 115]
  |  Branch (38:30): [True: 0, False: 115]
  ------------------
   39|    115|      mRaw->getBpp() != sizeof(uint16_t))
  ------------------
  |  Branch (39:7): [True: 0, False: 115]
  ------------------
   40|    151|    ThrowRDE("Unexpected component count / data type");
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   41|       |
   42|       |  // FIXME: could be wrong. max "active pixels" - "100 MP"
   43|    151|  if (!mRaw->dim.hasPositiveArea() || mRaw->dim.x % 2 != 0 ||
  ------------------
  |  Branch (43:7): [True: 36, False: 115]
  |  Branch (43:39): [True: 5, False: 110]
  ------------------
   44|    110|      mRaw->dim.x > 12000 || mRaw->dim.y > 8842) {
  ------------------
  |  Branch (44:7): [True: 1, False: 109]
  |  Branch (44:30): [True: 0, False: 109]
  ------------------
   45|      6|    ThrowRDE("Unexpected image dimensions found: (%d; %d)", mRaw->dim.x,
  ------------------
  |  |   38|      6|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      6|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      6|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      6|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   46|      6|             mRaw->dim.y);
   47|      6|  }
   48|    151|}
_ZN8rawspeed22HasselbladLJpegDecoder10decodeScanEv:
   50|     94|Buffer::size_type HasselbladLJpegDecoder::decodeScan() {
   51|     94|  if (numMCUsPerRestartInterval != 0)
  ------------------
  |  Branch (51:7): [True: 1, False: 93]
  ------------------
   52|     94|    ThrowRDE("Non-zero restart interval not supported.");
  ------------------
  |  |   38|      1|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      1|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      1|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      1|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   53|       |
   54|     93|  if (frame.w != static_cast<unsigned>(mRaw->dim.x) ||
  ------------------
  |  Branch (54:7): [True: 1, False: 92]
  ------------------
   55|     92|      frame.h != static_cast<unsigned>(mRaw->dim.y)) {
  ------------------
  |  Branch (55:7): [True: 2, False: 90]
  ------------------
   56|      3|    ThrowRDE("LJPEG frame does not match EXIF dimensions: (%u; %u) vs (%i; %i)",
  ------------------
  |  |   38|      3|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      3|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      3|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      3|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   57|      3|             frame.w, frame.h, mRaw->dim.x, mRaw->dim.y);
   58|      3|  }
   59|       |
   60|     90|  const HasselbladDecompressor::PerComponentRecipe rec = {
   61|     90|      *getPrefixCodeDecoders(1)[0], getInitialPredictors(1)[0]};
   62|       |
   63|     90|  HasselbladDecompressor d(mRaw, rec,
   64|     90|                           input.peekRemainingBuffer().getAsArray1DRef());
   65|     90|  return d.decompress();
   66|     93|}
_ZN8rawspeed22HasselbladLJpegDecoder6decodeEv:
   68|    109|void HasselbladLJpegDecoder::decode() {
   69|       |  // We cannot use fully decoding huffman table,
   70|       |  // because values are packed two pixels at the time.
   71|    109|  fullDecodeHT = false;
   72|       |
   73|    109|  AbstractLJpegDecoder::decodeSOI();
   74|    109|}

_ZN8rawspeed10peekMarkerENS_10ByteStreamE:
  110|  4.21M|inline Optional<JpegMarker> peekMarker(ByteStream input) {
  111|  4.21M|  uint8_t c0 = input.peekByte(0);
  112|  4.21M|  uint8_t c1 = input.peekByte(1);
  113|       |
  114|  4.21M|  if (c0 == 0xFF && c1 != 0 && c1 != 0xFF)
  ------------------
  |  Branch (114:7): [True: 23.0k, False: 4.18M]
  |  Branch (114:21): [True: 21.8k, False: 1.18k]
  |  Branch (114:32): [True: 13.7k, False: 8.03k]
  ------------------
  115|  13.7k|    return static_cast<JpegMarker>(c1);
  116|  4.19M|  return {};
  117|  4.21M|}
_ZN8rawspeed19advanceToNextMarkerENS_10ByteStreamEb:
  120|  7.38k|                                                bool skipPadding) {
  121|  4.20M|  while (input.getRemainSize() >= 2) {
  ------------------
  |  Branch (121:10): [True: 4.20M, False: 158]
  ------------------
  122|  4.20M|    if (Optional<JpegMarker> m = peekMarker(input))
  ------------------
  |  Branch (122:30): [True: 6.88k, False: 4.19M]
  ------------------
  123|  6.88k|      return input;
  124|       |
  125|       |    // Marker not found. Might there be leading padding bytes?
  126|  4.19M|    if (!skipPadding)
  ------------------
  |  Branch (126:9): [True: 343, False: 4.19M]
  ------------------
  127|    343|      break; // Nope, give up.
  128|       |
  129|       |    // Advance by a single(!) byte and try again.
  130|  4.19M|    input.skipBytes(1);
  131|  4.19M|  }
  132|       |
  133|    501|  return std::nullopt;
  134|  7.38k|}
_ZN8rawspeed22getRestartMarkerNumberENS_10JpegMarkerE:
  137|      8|inline Optional<int> getRestartMarkerNumber(JpegMarker m) {
  138|      8|  switch (m) {
  139|      0|    using enum JpegMarker;
  140|      6|  case RST0:
  ------------------
  |  Branch (140:3): [True: 6, False: 2]
  ------------------
  141|      6|  case RST1:
  ------------------
  |  Branch (141:3): [True: 0, False: 8]
  ------------------
  142|      6|  case RST2:
  ------------------
  |  Branch (142:3): [True: 0, False: 8]
  ------------------
  143|      6|  case RST3:
  ------------------
  |  Branch (143:3): [True: 0, False: 8]
  ------------------
  144|      6|  case RST4:
  ------------------
  |  Branch (144:3): [True: 0, False: 8]
  ------------------
  145|      6|  case RST5:
  ------------------
  |  Branch (145:3): [True: 0, False: 8]
  ------------------
  146|      6|  case RST6:
  ------------------
  |  Branch (146:3): [True: 0, False: 8]
  ------------------
  147|      7|  case RST7:
  ------------------
  |  Branch (147:3): [True: 1, False: 7]
  ------------------
  148|      7|    return static_cast<uint8_t>(m) - static_cast<uint8_t>(RST0);
  149|      1|  default:
  ------------------
  |  Branch (149:3): [True: 1, False: 7]
  ------------------
  150|      1|    return std::nullopt; // Not a restart marker.
  151|      8|  }
  152|      8|}

_ZN8rawspeed17KodakDecompressorC2ENS_8RawImageENS_10ByteStreamEib:
   48|     70|    : mRaw(std::move(img)), input(bs), bps(bps_),
   49|     70|      uncorrectedRawValues(uncorrectedRawValues_) {
   50|     70|  if (mRaw->getCpp() != 1 || mRaw->getDataType() != RawImageType::UINT16 ||
  ------------------
  |  Branch (50:7): [True: 0, False: 70]
  |  Branch (50:30): [True: 0, False: 70]
  ------------------
   51|     70|      mRaw->getBpp() != sizeof(uint16_t))
  ------------------
  |  Branch (51:7): [True: 0, False: 70]
  ------------------
   52|     70|    ThrowRDE("Unexpected component count / data type");
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   53|       |
   54|     70|  if (!mRaw->dim.hasPositiveArea() || mRaw->dim.x % 4 != 0 ||
  ------------------
  |  Branch (54:7): [True: 0, False: 70]
  |  Branch (54:39): [True: 1, False: 69]
  ------------------
   55|     69|      mRaw->dim.x > 4516 || mRaw->dim.y > 3012)
  ------------------
  |  Branch (55:7): [True: 0, False: 69]
  |  Branch (55:29): [True: 0, False: 69]
  ------------------
   56|     70|    ThrowRDE("Unexpected image dimensions found: (%d; %d)", mRaw->dim.x,
  ------------------
  |  |   38|      1|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      1|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      1|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      1|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   57|     69|             mRaw->dim.y);
   58|       |
   59|     69|  if (bps != 10 && bps != 12)
  ------------------
  |  Branch (59:7): [True: 1, False: 68]
  |  Branch (59:20): [True: 0, False: 1]
  ------------------
   60|     69|    ThrowRDE("Unexpected bits per sample: %i", bps);
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   61|       |
   62|       |  // Lower estimate: this decompressor requires *at least* half a byte
   63|       |  // per output pixel
   64|     69|  (void)input.check(implicit_cast<Buffer::size_type>(mRaw->dim.area() / 2ULL));
   65|     69|}
_ZN8rawspeed17KodakDecompressor13decodeSegmentEj:
   68|  1.21k|KodakDecompressor::decodeSegment(const uint32_t bsize) {
   69|  1.21k|  invariant(bsize > 0);
  ------------------
  |  |   27|  1.21k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (69:3): [True: 1.21k, False: 0]
  ------------------
   70|  1.21k|  invariant(bsize % 4 == 0);
  ------------------
  |  |   27|  1.21k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (70:3): [True: 1.21k, False: 0]
  ------------------
   71|  1.21k|  invariant(bsize <= segment_size);
  ------------------
  |  |   27|  1.21k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (71:3): [True: 1.21k, False: 0]
  ------------------
   72|       |
   73|  1.21k|  segment out;
   74|  1.21k|  static_assert(out.size() == segment_size, "Wrong segment size");
   75|       |
   76|       |#if __has_feature(address_sanitizer) || defined(__SANITIZE_ADDRESS__)
   77|       |  // We are to produce only bsize pixels.
   78|       |  __sanitizer_annotate_contiguous_container(out.begin(), out.end(), out.end(),
   79|       |                                            &out[bsize]);
   80|       |#endif
   81|       |
   82|  1.21k|  std::array<uint8_t, 2 * segment_size> blen;
   83|  1.21k|  uint64_t bitbuf = 0;
   84|  1.21k|  uint32_t bits = 0;
   85|       |
   86|  68.2k|  for (uint32_t i = 0; i < bsize; i += 2) {
  ------------------
  |  Branch (86:24): [True: 67.0k, False: 1.21k]
  ------------------
   87|       |    // One byte per two pixels
   88|  67.0k|    blen[i] = input.peekByte() & 15;
   89|  67.0k|    blen[i + 1] = input.getByte() >> 4;
   90|  67.0k|  }
   91|  1.21k|  if ((bsize & 7) == 4) {
  ------------------
  |  Branch (91:7): [True: 495, False: 720]
  ------------------
   92|    495|    bitbuf = (static_cast<uint64_t>(input.getByte())) << 8UL;
   93|    495|    bitbuf += (static_cast<int>(input.getByte()));
   94|    495|    bits = 16;
   95|    495|  }
   96|   134k|  for (uint32_t i = 0; i < bsize; i++) {
  ------------------
  |  Branch (96:24): [True: 133k, False: 1.21k]
  ------------------
   97|   133k|    uint32_t len = blen[i];
   98|   133k|    invariant(len < 16);
  ------------------
  |  |   27|   133k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (98:5): [True: 133k, False: 0]
  ------------------
   99|       |
  100|   133k|    if (bits < len) {
  ------------------
  |  Branch (100:9): [True: 1.16k, False: 132k]
  ------------------
  101|  5.79k|      for (uint32_t j = 0; j < 32; j += 8) {
  ------------------
  |  Branch (101:28): [True: 4.63k, False: 1.16k]
  ------------------
  102|  4.63k|        bitbuf += static_cast<int64_t>(static_cast<int>(input.getByte()))
  103|  4.63k|                  << (bits + (j ^ 8));
  104|  4.63k|      }
  105|  1.16k|      bits += 32;
  106|  1.16k|    }
  107|       |
  108|   133k|    uint32_t diff = static_cast<uint32_t>(bitbuf) &
  109|   133k|                    extractHighBits(0xffffU, len, /*effectiveBitwidth=*/16);
  110|   133k|    bitbuf >>= len;
  111|   133k|    bits -= len;
  112|       |
  113|   133k|    out[i] = implicit_cast<int16_t>(
  114|   133k|        len != 0 ? PrefixCodeDecoder<>::extend(diff, len) : int(diff));
  ------------------
  |  Branch (114:9): [True: 4.97k, False: 128k]
  ------------------
  115|   133k|  }
  116|       |
  117|  1.21k|  return out;
  118|  1.21k|}
_ZN8rawspeed17KodakDecompressor10decompressEv:
  120|     67|void KodakDecompressor::decompress() {
  121|     67|  const Array2DRef<uint16_t> out(mRaw->getU16DataAsUncroppedArray2DRef());
  122|       |
  123|     67|  uint32_t random = 0;
  124|  1.12k|  for (int row = 0; row < out.height(); row++) {
  ------------------
  |  Branch (124:21): [True: 1.11k, False: 8]
  ------------------
  125|  2.27k|    for (int col = 0; col < out.width();) {
  ------------------
  |  Branch (125:23): [True: 1.21k, False: 1.05k]
  ------------------
  126|  1.21k|      const int len = std::min(segment_size, mRaw->dim.x - col);
  127|       |
  128|  1.21k|      const segment buf = decodeSegment(len);
  129|       |
  130|  1.21k|      std::array<int, 2> pred;
  131|  1.21k|      pred.fill(0);
  132|       |
  133|   126k|      for (int i = 0; i < len; ++i, ++col) {
  ------------------
  |  Branch (133:23): [True: 125k, False: 1.15k]
  ------------------
  134|   125k|        pred[i & 1] += buf[i];
  135|       |
  136|   125k|        int value = pred[i & 1];
  137|   125k|        if (!isIntN(value, bps))
  ------------------
  |  Branch (137:13): [True: 59, False: 125k]
  ------------------
  138|   125k|          ThrowRDE("Value out of bounds %d (bps = %i)", value, bps);
  ------------------
  |  |   38|     59|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     59|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     59|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     59|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  139|       |
  140|   125k|        if (uncorrectedRawValues)
  ------------------
  |  Branch (140:13): [True: 0, False: 125k]
  ------------------
  141|      0|          out(row, col) = implicit_cast<uint16_t>(value);
  142|   125k|        else {
  143|   125k|          mRaw->setWithLookUp(implicit_cast<uint16_t>(value),
  144|   125k|                              reinterpret_cast<std::byte*>(&out(row, col)),
  145|   125k|                              &random);
  146|   125k|        }
  147|   125k|      }
  148|  1.21k|    }
  149|  1.11k|  }
  150|     67|}

_ZN8rawspeed12LJpegDecoderC2ENS_10ByteStreamERKNS_8RawImageE:
   44|    952|    : AbstractLJpegDecoder(bs, img) {
   45|    952|  if (mRaw->getDataType() != RawImageType::UINT16)
  ------------------
  |  Branch (45:7): [True: 0, False: 952]
  ------------------
   46|    952|    ThrowRDE("Unexpected data type (%u)",
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   47|    952|             static_cast<unsigned>(mRaw->getDataType()));
   48|       |
   49|    952|  if ((mRaw->getCpp() != 1 || mRaw->getBpp() != sizeof(uint16_t)) &&
  ------------------
  |  Branch (49:8): [True: 624, False: 328]
  |  Branch (49:31): [True: 0, False: 328]
  ------------------
   50|    616|      (mRaw->getCpp() != 2 || mRaw->getBpp() != 2 * sizeof(uint16_t)) &&
  ------------------
  |  Branch (50:8): [True: 480, False: 136]
  |  Branch (50:31): [True: 0, False: 136]
  ------------------
   51|    475|      (mRaw->getCpp() != 3 || mRaw->getBpp() != 3 * sizeof(uint16_t)))
  ------------------
  |  Branch (51:8): [True: 17, False: 458]
  |  Branch (51:31): [True: 3, False: 455]
  ------------------
   52|    952|    ThrowRDE("Unexpected component count (%u)", mRaw->getCpp());
  ------------------
  |  |   38|     10|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     10|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     10|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     10|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   53|       |
   54|    942|  if (!mRaw->dim.hasPositiveArea())
  ------------------
  |  Branch (54:7): [True: 0, False: 942]
  ------------------
   55|    942|    ThrowRDE("Image has zero size");
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   56|       |
   57|    942|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
   58|       |  // Yeah, sure, here it would be just dumb to leave this for production :)
   59|    942|  if (mRaw->dim.x > 9728 || mRaw->dim.y > 6656) {
  ------------------
  |  Branch (59:7): [True: 22, False: 920]
  |  Branch (59:29): [True: 13, False: 907]
  ------------------
   60|     11|    ThrowRDE("Unexpected image dimensions found: (%i; %i)", mRaw->dim.x,
  ------------------
  |  |   38|     11|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     11|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     11|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     11|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   61|     11|             mRaw->dim.y);
   62|     11|  }
   63|    942|#endif
   64|    942|}
_ZN8rawspeed12LJpegDecoder6decodeEjjjjNS_8iPoint2DEb:
   68|    909|                          bool fixDng16Bug_) {
   69|    909|  if (offsetX >= static_cast<unsigned>(mRaw->dim.x))
  ------------------
  |  Branch (69:7): [True: 0, False: 909]
  ------------------
   70|    909|    ThrowRDE("X offset outside of image");
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   71|    909|  if (offsetY >= static_cast<unsigned>(mRaw->dim.y))
  ------------------
  |  Branch (71:7): [True: 0, False: 909]
  ------------------
   72|    909|    ThrowRDE("Y offset outside of image");
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   73|       |
   74|    909|  if (width > static_cast<unsigned>(mRaw->dim.x))
  ------------------
  |  Branch (74:7): [True: 0, False: 909]
  ------------------
   75|    909|    ThrowRDE("Tile wider than image");
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   76|    909|  if (height > static_cast<unsigned>(mRaw->dim.y))
  ------------------
  |  Branch (76:7): [True: 0, False: 909]
  ------------------
   77|    909|    ThrowRDE("Tile taller than image");
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   78|       |
   79|    909|  if (offsetX + width > static_cast<unsigned>(mRaw->dim.x))
  ------------------
  |  Branch (79:7): [True: 0, False: 909]
  ------------------
   80|    909|    ThrowRDE("Tile overflows image horizontally");
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   81|    909|  if (offsetY + height > static_cast<unsigned>(mRaw->dim.y))
  ------------------
  |  Branch (81:7): [True: 0, False: 909]
  ------------------
   82|    909|    ThrowRDE("Tile overflows image vertically");
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   83|       |
   84|    914|  if (width == 0 || height == 0)
  ------------------
  |  Branch (84:7): [True: 18.4E, False: 914]
  |  Branch (84:21): [True: 18.4E, False: 915]
  ------------------
   85|      0|    return; // We do not need anything from this tile.
   86|       |
   87|    909|  if (!maxDim_.hasPositiveArea() ||
  ------------------
  |  Branch (87:7): [True: 34, False: 875]
  ------------------
   88|    875|      implicit_cast<unsigned>(maxDim_.x) < width ||
  ------------------
  |  Branch (88:7): [True: 3, False: 872]
  ------------------
   89|    873|      implicit_cast<unsigned>(maxDim_.y) < height)
  ------------------
  |  Branch (89:7): [True: 2, False: 871]
  ------------------
   90|    909|    ThrowRDE("Requested tile is larger than tile's maximal dimensions");
  ------------------
  |  |   38|     44|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     44|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     44|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     44|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   91|       |
   92|    865|  offX = offsetX;
   93|    865|  offY = offsetY;
   94|    865|  w = width;
   95|    865|  h = height;
   96|       |
   97|    865|  maxDim = maxDim_;
   98|       |
   99|    865|  fixDng16Bug = fixDng16Bug_;
  100|       |
  101|    865|  AbstractLJpegDecoder::decodeSOI();
  102|    865|}
_ZN8rawspeed12LJpegDecoder10decodeScanEv:
  104|    414|Buffer::size_type LJpegDecoder::decodeScan() {
  105|    414|  invariant(frame.cps > 0);
  ------------------
  |  |   27|    414|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (105:3): [True: 414, False: 0]
  ------------------
  106|       |
  107|    414|  if (predictorMode != 1)
  ------------------
  |  Branch (107:7): [True: 4, False: 410]
  ------------------
  108|    414|    ThrowRDE("Unsupported predictor mode: %u", predictorMode);
  ------------------
  |  |   38|      4|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      4|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      4|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      4|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  109|       |
  110|  1.21k|  for (uint32_t i = 0; i < frame.cps; i++)
  ------------------
  |  Branch (110:24): [True: 804, False: 407]
  ------------------
  111|    804|    if (frame.compInfo[i].superH != 1 || frame.compInfo[i].superV != 1)
  ------------------
  |  Branch (111:9): [True: 2, False: 802]
  |  Branch (111:42): [True: 1, False: 801]
  ------------------
  112|    410|      ThrowRDE("Unsupported subsampling");
  ------------------
  |  |   38|      3|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|    413|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|    413|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|    413|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  113|       |
  114|    407|  int N_COMP = frame.cps;
  115|       |
  116|    407|  std::vector<LJpegDecompressor::PerComponentRecipe> rec;
  117|    407|  rec.reserve(N_COMP);
  118|    407|  std::generate_n(std::back_inserter(rec), N_COMP,
  119|    407|                  [&rec, hts = getPrefixCodeDecoders(N_COMP),
  120|    407|                   initPred = getInitialPredictors(
  121|    407|                       N_COMP)]() -> LJpegDecompressor::PerComponentRecipe {
  122|    407|                    const auto i = implicit_cast<int>(rec.size());
  123|    407|                    return {*hts[i], initPred[i]};
  124|    407|                  });
  125|       |
  126|    407|  const iRectangle2D imgFrame = {
  127|    407|      {static_cast<int>(offX), static_cast<int>(offY)},
  128|    407|      {static_cast<int>(w), static_cast<int>(h)}};
  129|    407|  const auto jpegFrameDim = iPoint2D(frame.w, frame.h);
  130|       |
  131|    407|  if (implicit_cast<int64_t>(maxDim.x) * implicit_cast<int>(mRaw->getCpp()) >
  ------------------
  |  Branch (131:7): [True: 0, False: 407]
  ------------------
  132|    407|      std::numeric_limits<int>::max())
  133|    407|    ThrowRDE("Maximal output tile is too large");
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  134|       |
  135|    407|  auto maxRes =
  136|    407|      iPoint2D(implicit_cast<int>(mRaw->getCpp()) * maxDim.x, maxDim.y);
  137|    407|  if (maxRes.area() != N_COMP * jpegFrameDim.area())
  ------------------
  |  Branch (137:7): [True: 42, False: 365]
  ------------------
  138|    407|    ThrowRDE("LJpeg frame area does not match maximal tile area");
  ------------------
  |  |   38|     42|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     42|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     42|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     42|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  139|       |
  140|    365|  if (maxRes.x % jpegFrameDim.x != 0 || maxRes.y % jpegFrameDim.y != 0)
  ------------------
  |  Branch (140:7): [True: 4, False: 361]
  |  Branch (140:41): [True: 1, False: 360]
  ------------------
  141|    365|    ThrowRDE("Maximal output tile size is not a multiple of LJpeg frame size");
  ------------------
  |  |   38|      2|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      2|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      2|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      2|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  142|       |
  143|    363|  auto MCUSize = iPoint2D{maxRes.x / jpegFrameDim.x, maxRes.y / jpegFrameDim.y};
  144|    363|  if (MCUSize.area() != implicit_cast<uint64_t>(N_COMP))
  ------------------
  |  Branch (144:7): [True: 0, False: 363]
  ------------------
  145|    363|    ThrowRDE("Unexpected MCU size, does not match LJpeg component count");
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  146|       |
  147|    363|  const LJpegDecompressor::Frame jpegFrame = {MCUSize, jpegFrameDim};
  148|       |
  149|    363|  int numLJpegRowsPerRestartInterval;
  150|    363|  if (numMCUsPerRestartInterval == 0) {
  ------------------
  |  Branch (150:7): [True: 348, False: 15]
  ------------------
  151|       |    // Restart interval not enabled, so all of the rows
  152|       |    // are contained in the first (implicit) restart interval.
  153|    348|    numLJpegRowsPerRestartInterval = jpegFrameDim.y;
  154|    348|  } else {
  155|     15|    const int numMCUsPerRow = jpegFrameDim.x;
  156|     15|    if (numMCUsPerRestartInterval % numMCUsPerRow != 0)
  ------------------
  |  Branch (156:9): [True: 1, False: 14]
  ------------------
  157|     15|      ThrowRDE("Restart interval is not a multiple of frame row size");
  ------------------
  |  |   38|      1|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      1|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      1|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      1|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  158|     14|    numLJpegRowsPerRestartInterval = numMCUsPerRestartInterval / numMCUsPerRow;
  159|     14|  }
  160|       |
  161|    362|  LJpegDecompressor d(mRaw, imgFrame, jpegFrame, rec,
  162|    362|                      numLJpegRowsPerRestartInterval,
  163|    362|                      input.peekRemainingBuffer().getAsArray1DRef());
  164|    362|  return d.decode();
  165|    363|}
LJpegDecoder.cpp:_ZZN8rawspeed12LJpegDecoder10decodeScanEvENK3$_0clEv:
  121|    790|                       N_COMP)]() -> LJpegDecompressor::PerComponentRecipe {
  122|    790|                    const auto i = implicit_cast<int>(rec.size());
  123|    790|                    return {*hts[i], initPred[i]};
  124|    790|                  });

_ZN8rawspeed17LJpegDecompressorC2ENS_8RawImageENS_12iRectangle2DENS0_5FrameENSt3__16vectorINS0_18PerComponentRecipeENS4_9allocatorIS6_EEEEiNS_10Array1DRefIKhEE:
   57|    360|    : mRaw(std::move(img)), input(input_), imgFrame(imgFrame_),
   58|    360|      frame(std::move(frame_)), rec(std::move(rec_)),
   59|    360|      numLJpegRowsPerRestartInterval(numLJpegRowsPerRestartInterval_) {
   60|       |
   61|    360|  if (mRaw->getDataType() != RawImageType::UINT16)
  ------------------
  |  Branch (61:7): [True: 0, False: 360]
  ------------------
   62|    360|    ThrowRDE("Unexpected data type (%u)",
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   63|    360|             static_cast<unsigned>(mRaw->getDataType()));
   64|       |
   65|    360|  if ((mRaw->getCpp() != 1 || mRaw->getBpp() != sizeof(uint16_t)) &&
  ------------------
  |  Branch (65:8): [True: 130, False: 230]
  |  Branch (65:31): [True: 0, False: 230]
  ------------------
   66|    130|      (mRaw->getCpp() != 2 || mRaw->getBpp() != 2 * sizeof(uint16_t)) &&
  ------------------
  |  Branch (66:8): [True: 128, False: 2]
  |  Branch (66:31): [True: 0, False: 2]
  ------------------
   67|    127|      (mRaw->getCpp() != 3 || mRaw->getBpp() != 3 * sizeof(uint16_t)))
  ------------------
  |  Branch (67:8): [True: 0, False: 127]
  |  Branch (67:31): [True: 0, False: 127]
  ------------------
   68|    360|    ThrowRDE("Unexpected component count (%u)", mRaw->getCpp());
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   69|       |
   70|    360|  if (!mRaw->dim.hasPositiveArea())
  ------------------
  |  Branch (70:7): [True: 0, False: 360]
  ------------------
   71|    360|    ThrowRDE("Image has zero size");
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   72|       |
   73|    360|  if (!imgFrame.hasPositiveArea())
  ------------------
  |  Branch (73:7): [True: 0, False: 360]
  ------------------
   74|    360|    ThrowRDE("Tile has zero size");
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   75|       |
   76|    360|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
   77|       |  // Yeah, sure, here it would be just dumb to leave this for production :)
   78|    360|  if (mRaw->dim.x > 9728 || mRaw->dim.y > 6656) {
  ------------------
  |  Branch (78:7): [True: 1, False: 359]
  |  Branch (78:29): [True: 0, False: 359]
  ------------------
   79|      0|    ThrowRDE("Unexpected image dimensions found: (%i; %i)", mRaw->dim.x,
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   80|      0|             mRaw->dim.y);
   81|      0|  }
   82|    360|#endif
   83|       |
   84|    360|  if (imgFrame.pos.x >= mRaw->dim.x)
  ------------------
  |  Branch (84:7): [True: 0, False: 360]
  ------------------
   85|    360|    ThrowRDE("X offset outside of image");
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   86|    360|  if (imgFrame.pos.y >= mRaw->dim.y)
  ------------------
  |  Branch (86:7): [True: 0, False: 360]
  ------------------
   87|    360|    ThrowRDE("Y offset outside of image");
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   88|       |
   89|    360|  if (imgFrame.dim.x > mRaw->dim.x)
  ------------------
  |  Branch (89:7): [True: 0, False: 360]
  ------------------
   90|    360|    ThrowRDE("Tile wider than image");
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   91|    360|  if (imgFrame.dim.y > mRaw->dim.y)
  ------------------
  |  Branch (91:7): [True: 0, False: 360]
  ------------------
   92|    360|    ThrowRDE("Tile taller than image");
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   93|       |
   94|    360|  if (imgFrame.pos.x + imgFrame.dim.x > mRaw->dim.x)
  ------------------
  |  Branch (94:7): [True: 0, False: 360]
  ------------------
   95|    360|    ThrowRDE("Tile overflows image horizontally");
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   96|    360|  if (imgFrame.pos.y + imgFrame.dim.y > mRaw->dim.y)
  ------------------
  |  Branch (96:7): [True: 0, False: 360]
  ------------------
   97|    360|    ThrowRDE("Tile overflows image vertically");
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   98|       |
   99|    360|  if (!frame.dim.hasPositiveArea())
  ------------------
  |  Branch (99:7): [True: 0, False: 360]
  ------------------
  100|    360|    ThrowRDE("Frame has zero size");
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  101|       |
  102|    360|  if (iPoint2D{1, 1} != frame.mcu && iPoint2D{2, 1} != frame.mcu &&
  ------------------
  |  Branch (102:7): [True: 222, False: 138]
  |  Branch (102:7): [True: 1, False: 359]
  |  Branch (102:38): [True: 129, False: 93]
  ------------------
  103|    129|      iPoint2D{3, 1} != frame.mcu && iPoint2D{4, 1} != frame.mcu &&
  ------------------
  |  Branch (103:7): [True: 1, False: 128]
  |  Branch (103:38): [True: 1, False: 0]
  ------------------
  104|      1|      iPoint2D{2, 2} != frame.mcu)
  ------------------
  |  Branch (104:7): [True: 1, False: 0]
  ------------------
  105|    360|    ThrowRDE("Unexpected MCU size: {%i, %i}", frame.mcu.x, frame.mcu.y);
  ------------------
  |  |   38|      1|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      1|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      1|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      1|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  106|       |
  107|    359|  if (rec.size() != static_cast<unsigned>(frame.mcu.area()))
  ------------------
  |  Branch (107:7): [True: 0, False: 359]
  ------------------
  108|    359|    ThrowRDE("Must have exactly one recepie per component");
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  109|       |
  110|    706|  for (const auto& recip : rec) {
  ------------------
  |  Branch (110:26): [True: 706, False: 359]
  ------------------
  111|    706|    if (!recip.ht.isFullDecode())
  ------------------
  |  Branch (111:9): [True: 0, False: 706]
  ------------------
  112|    706|      ThrowRDE("Huffman table is not of a full decoding variety");
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  113|    706|  }
  114|       |
  115|    359|  if (numLJpegRowsPerRestartInterval < 1)
  ------------------
  |  Branch (115:7): [True: 0, False: 359]
  ------------------
  116|    359|    ThrowRDE("Number of rows per restart interval must be positives");
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  117|       |
  118|    359|  if (static_cast<int64_t>(frame.mcu.x) * frame.dim.x >
  ------------------
  |  Branch (118:7): [True: 0, False: 359]
  ------------------
  119|    359|          std::numeric_limits<int>::max() ||
  120|    359|      static_cast<int64_t>(frame.mcu.y) * frame.dim.y >
  ------------------
  |  Branch (120:7): [True: 0, False: 359]
  ------------------
  121|    359|          std::numeric_limits<int>::max())
  122|    359|    ThrowRDE("LJpeg frame is too big");
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  123|       |
  124|    359|  if (static_cast<int64_t>(mRaw->getCpp()) * imgFrame.dim.x >
  ------------------
  |  Branch (124:7): [True: 0, False: 359]
  ------------------
  125|    359|      std::numeric_limits<int>::max())
  126|    359|    ThrowRDE("Img frame is too big");
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  127|       |
  128|    359|  if (imgFrame.dim.x < frame.mcu.x || imgFrame.dim.y < frame.mcu.y)
  ------------------
  |  Branch (128:7): [True: 0, False: 359]
  |  Branch (128:39): [True: 0, False: 359]
  ------------------
  129|    359|    ThrowRDE("Tile size is smaller than a single frame MCU");
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  130|       |
  131|    359|  if (imgFrame.dim.y % frame.mcu.y != 0)
  ------------------
  |  Branch (131:7): [True: 0, False: 359]
  ------------------
  132|    359|    ThrowRDE("Output row count is not a multiple of MCU row count");
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  133|       |
  134|    359|  const int tileRequiredWidth =
  135|    359|      static_cast<int>(mRaw->getCpp()) * imgFrame.dim.x;
  136|       |
  137|       |  // How many full pixel MCUs do we need to consume for that?
  138|    359|  if (const auto mcusToConsume = implicit_cast<int>(
  139|    359|          roundUpDivisionSafe(tileRequiredWidth, frame.mcu.x));
  140|    359|      frame.dim.x < mcusToConsume ||
  ------------------
  |  Branch (140:7): [True: 1, False: 358]
  ------------------
  141|    358|      frame.mcu.y * frame.dim.y < imgFrame.dim.y ||
  ------------------
  |  Branch (141:7): [True: 18.4E, False: 359]
  ------------------
  142|    359|      frame.mcu.x * frame.dim.x < tileRequiredWidth) {
  ------------------
  |  Branch (142:7): [True: 0, False: 359]
  ------------------
  143|      0|    ThrowRDE("LJpeg frame (%d, %d) is smaller than expected (%d, %d)",
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  144|      0|             frame.mcu.x * frame.dim.x, frame.mcu.y * frame.dim.y,
  145|      0|             tileRequiredWidth, imgFrame.dim.y);
  146|      0|  }
  147|       |
  148|       |  // How many full pixel MCUs will we produce?
  149|    359|  numFullMCUs = tileRequiredWidth / frame.mcu.x; // Truncating division!
  150|       |  // Do we need to also produce part of a MCU?
  151|    359|  trailingPixels = tileRequiredWidth % frame.mcu.x;
  152|    359|}
_ZNK8rawspeed17LJpegDecompressor6decodeEv:
  341|    359|ByteStream::size_type LJpegDecompressor::decode() const {
  342|    359|  switch (frame.mcu.area()) {
  343|    138|  case 1:
  ------------------
  |  Branch (343:3): [True: 138, False: 221]
  ------------------
  344|    138|    if (frame.mcu == MCU<1, 1>) {
  ------------------
  |  Branch (344:9): [True: 138, False: 0]
  ------------------
  345|    138|      return decodeN<MCU<1, 1>>();
  346|    138|    }
  347|      0|    break;
  348|     93|  case 2:
  ------------------
  |  Branch (348:3): [True: 93, False: 266]
  ------------------
  349|     93|    if (frame.mcu == MCU<2, 1>) {
  ------------------
  |  Branch (349:9): [True: 93, False: 0]
  ------------------
  350|     93|      return decodeN<MCU<2, 1>>();
  351|     93|    }
  352|      0|    break;
  353|    127|  case 3:
  ------------------
  |  Branch (353:3): [True: 127, False: 232]
  ------------------
  354|    127|    if (frame.mcu == MCU<3, 1>) {
  ------------------
  |  Branch (354:9): [True: 127, False: 0]
  ------------------
  355|    127|      return decodeN<MCU<3, 1>>();
  356|    127|    }
  357|      0|    break;
  358|      0|  case 4:
  ------------------
  |  Branch (358:3): [True: 0, False: 359]
  ------------------
  359|      0|    if (frame.mcu == MCU<4, 1>) {
  ------------------
  |  Branch (359:9): [True: 0, False: 0]
  ------------------
  360|      0|      return decodeN<MCU<4, 1>>();
  361|      0|    }
  362|      0|    if (frame.mcu == MCU<2, 2>) {
  ------------------
  |  Branch (362:9): [True: 0, False: 0]
  ------------------
  363|      0|      return decodeN<MCU<2, 2>>();
  364|      0|    }
  365|      0|    break;
  366|      0|  default:
  ------------------
  |  Branch (366:3): [True: 0, False: 359]
  ------------------
  367|      0|    __builtin_unreachable();
  368|    359|  }
  369|      0|  __builtin_unreachable();
  370|    359|}
LJpegDecompressor.cpp:_ZNK8rawspeed17LJpegDecompressor7decodeNIL_ZNS_12_GLOBAL__N_13MCUILi1ELi1EEEEEEjv:
  255|    138|ByteStream::size_type LJpegDecompressor::decodeN() const {
  256|    138|  invariant(MCU == this->frame.mcu);
  ------------------
  |  |   27|    138|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (256:3): [True: 138, False: 0]
  ------------------
  257|       |
  258|    138|  invariant(MCU.hasPositiveArea());
  ------------------
  |  |   27|    138|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (258:3): [True: 138, False: 0]
  ------------------
  259|       |  // FIXME: workarounding lack of constexpr std::abs() :(
  260|    138|  constexpr int N_COMP = MCU.x * MCU.y;
  261|       |
  262|    138|  invariant(mRaw->getCpp() > 0);
  ------------------
  |  |   27|    138|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (262:3): [True: 138, False: 0]
  ------------------
  263|       |
  264|    138|  const auto img =
  265|    138|      CroppedArray2DRef(mRaw->getU16DataAsUncroppedArray2DRef(),
  266|    138|                        mRaw->getCpp() * imgFrame.pos.x, imgFrame.pos.y,
  267|    138|                        mRaw->getCpp() * imgFrame.dim.x, imgFrame.dim.y)
  268|    138|          .getAsArray2DRef();
  269|       |
  270|    138|  const auto ht = getPrefixCodeDecoders<N_COMP>();
  271|       |
  272|       |  // A recoded DNG might be split up into tiles of self contained LJpeg blobs.
  273|       |  // The tiles at the bottom and the right may extend beyond the dimension of
  274|       |  // the raw image buffer. The excessive content has to be ignored.
  275|       |
  276|    138|  invariant(imgFrame.dim.y % frame.mcu.y == 0);
  ------------------
  |  |   27|    138|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (276:3): [True: 138, False: 0]
  ------------------
  277|    138|  const auto numRestartIntervals = implicit_cast<int>(roundUpDivisionSafe(
  278|    138|      imgFrame.dim.y / frame.mcu.y, numLJpegRowsPerRestartInterval));
  279|    138|  invariant(numRestartIntervals >= 0);
  ------------------
  |  |   27|    138|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (279:3): [True: 138, False: 0]
  ------------------
  280|    138|  invariant(numRestartIntervals != 0);
  ------------------
  |  |   27|    138|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (280:3): [True: 138, False: 0]
  ------------------
  281|       |
  282|    138|  ByteStream inputStream(DataBuffer(input, Endianness::little));
  283|    138|  for (int restartIntervalIndex = 0;
  284|    282|       restartIntervalIndex != numRestartIntervals; ++restartIntervalIndex) {
  ------------------
  |  Branch (284:8): [True: 150, False: 132]
  ------------------
  285|    150|    auto predStorage = getInitialPreds<N_COMP>();
  286|    150|    auto pred = Array2DRef(predStorage.data(), MCU.x, MCU.y);
  287|       |
  288|    150|    if (restartIntervalIndex != 0) {
  ------------------
  |  Branch (288:9): [True: 12, False: 138]
  ------------------
  289|     12|      auto marker = peekMarker(inputStream);
  290|     12|      if (!marker) // FIXME: can there be padding bytes before the marker?
  ------------------
  |  Branch (290:11): [True: 4, False: 8]
  ------------------
  291|     12|        ThrowRDE("Jpeg marker not encountered");
  ------------------
  |  |   38|      4|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      4|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      4|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      4|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  292|      8|      Optional<int> number = getRestartMarkerNumber(*marker);
  293|      8|      if (!number)
  ------------------
  |  Branch (293:11): [True: 1, False: 7]
  ------------------
  294|      8|        ThrowRDE("Not a restart marker!");
  ------------------
  |  |   38|      1|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      1|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      1|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      1|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  295|      7|      if (*number != ((restartIntervalIndex - 1) % 8))
  ------------------
  |  Branch (295:11): [True: 1, False: 6]
  ------------------
  296|      7|        ThrowRDE("Unexpected restart marker found");
  ------------------
  |  |   38|      1|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      1|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      1|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      1|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  297|      6|      inputStream.skipBytes(2); // Good restart marker.
  298|      6|    }
  299|       |
  300|    144|    BitStreamerJPEG bs(inputStream.peekRemainingBuffer().getAsArray1DRef());
  301|       |
  302|    144|    for (int ljpegRowOfRestartInterval = 0;
  303|  10.7k|         ljpegRowOfRestartInterval != numLJpegRowsPerRestartInterval;
  ------------------
  |  Branch (303:10): [True: 10.6k, False: 143]
  ------------------
  304|  10.6k|         ++ljpegRowOfRestartInterval) {
  305|  10.6k|      const int row =
  306|  10.6k|          frame.mcu.y * (numLJpegRowsPerRestartInterval * restartIntervalIndex +
  307|  10.6k|                         ljpegRowOfRestartInterval);
  308|  10.6k|      invariant(row >= 0);
  ------------------
  |  |   27|  10.6k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (308:7): [True: 10.6k, False: 0]
  ------------------
  309|  10.6k|      invariant(row <= imgFrame.dim.y);
  ------------------
  |  |   27|  10.6k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (309:7): [True: 10.6k, False: 0]
  ------------------
  310|       |
  311|       |      // For y, we can simply stop decoding when we reached the border.
  312|  10.6k|      if (row == imgFrame.dim.y) {
  ------------------
  |  Branch (312:11): [True: 1, False: 10.6k]
  ------------------
  313|      1|        invariant((restartIntervalIndex + 1) == numRestartIntervals);
  ------------------
  |  |   27|      1|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (313:9): [True: 1, False: 0]
  ------------------
  314|      1|        break;
  315|      1|      }
  316|       |
  317|  10.6k|      const auto outStripe = CroppedArray2DRef(img,
  318|  10.6k|                                               /*offsetCols=*/0,
  319|  10.6k|                                               /*offsetRows=*/row,
  320|  10.6k|                                               /*croppedWidth=*/img.width(),
  321|  10.6k|                                               /*croppedHeight=*/frame.mcu.y)
  322|  10.6k|                                 .getAsArray2DRef();
  323|       |
  324|  10.6k|      decodeRowN<MCU, N_COMP>(outStripe, pred, ht, bs);
  325|       |
  326|       |      // The predictor for the next line is the start of this line.
  327|  10.6k|      pred = CroppedArray2DRef(outStripe,
  328|  10.6k|                               /*offsetCols=*/0,
  329|  10.6k|                               /*offsetRows=*/0,
  330|  10.6k|                               /*croppedWidth=*/MCU.x,
  331|  10.6k|                               /*croppedHeight=*/MCU.y)
  332|  10.6k|                 .getAsArray2DRef();
  333|  10.6k|    }
  334|       |
  335|    144|    inputStream.skipBytes(bs.getStreamPosition());
  336|    144|  }
  337|       |
  338|    132|  return inputStream.getPosition();
  339|    138|}
_ZNK8rawspeed17LJpegDecompressor21getPrefixCodeDecodersILi1EEENSt3__15arrayINS2_17reference_wrapperIKNS_20PrefixCodeLUTDecoderINS_15BaselineCodeTagENS_23PrefixCodeLookupDecoderIS6_EEEEEEXT_EEEv:
  164|    138|LJpegDecompressor::getPrefixCodeDecoders() const {
  165|    138|  return getPrefixCodeDecodersImpl<N_COMP>(std::make_index_sequence<N_COMP>{});
  166|    138|}
_ZNK8rawspeed17LJpegDecompressor25getPrefixCodeDecodersImplILi1EJLm0EEEENSt3__15arrayINS2_17reference_wrapperIKNS_20PrefixCodeLUTDecoderINS_15BaselineCodeTagENS_23PrefixCodeLookupDecoderIS6_EEEEEEXT_EEENS2_16integer_sequenceImJXspT0_EEEE:
  157|    138|    std::index_sequence<I...> /*unused*/) const {
  158|    138|  return std::array<std::reference_wrapper<const PrefixCodeDecoder<>>, N_COMP>{
  159|    138|      std::cref(rec[I].ht)...};
  160|    138|}
_ZNK8rawspeed17LJpegDecompressor15getInitialPredsILi1EEENSt3__15arrayItXT_EEEv:
  169|    150|std::array<uint16_t, N_COMP> LJpegDecompressor::getInitialPreds() const {
  170|    150|  std::array<uint16_t, N_COMP> preds;
  171|    150|  std::transform(
  172|    150|      rec.begin(), rec.end(), preds.begin(),
  173|    150|      [](const PerComponentRecipe& compRec) { return compRec.initPred; });
  174|    150|  return preds;
  175|    150|}
_ZZNK8rawspeed17LJpegDecompressor15getInitialPredsILi1EEENSt3__15arrayItXT_EEEvENKUlRKNS0_18PerComponentRecipeEE_clES7_:
  173|    150|      [](const PerComponentRecipe& compRec) { return compRec.initPred; });
LJpegDecompressor.cpp:_ZNK8rawspeed17LJpegDecompressor10decodeRowNIL_ZNS_12_GLOBAL__N_13MCUILi1ELi1EEEELi1EEEvNS_10Array2DRefItEENS4_IKtEENSt3__15arrayINS8_17reference_wrapperIKNS_20PrefixCodeLUTDecoderINS_15BaselineCodeTagENS_23PrefixCodeLookupDecoderISC_EEEEEEXT0_EEERNS_15BitStreamerJPEGE:
  188|  10.6k|    BitStreamerJPEG& bs) const {
  189|  10.6k|  invariant(MCUSize.area() == N_COMP);
  ------------------
  |  |   27|  10.6k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (189:3): [True: 10.6k, False: 0]
  ------------------
  190|  10.6k|  invariant(outStripe.width() >= MCUSize.x);
  ------------------
  |  |   27|  10.6k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (190:3): [True: 10.6k, False: 0]
  ------------------
  191|  10.6k|  invariant(outStripe.height() == MCUSize.y);
  ------------------
  |  |   27|  10.6k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (191:3): [True: 10.6k, False: 0]
  ------------------
  192|  10.6k|  invariant(pred.width() == MCUSize.x);
  ------------------
  |  |   27|  10.6k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (192:3): [True: 10.6k, False: 0]
  ------------------
  193|  10.6k|  invariant(pred.height() == MCUSize.y);
  ------------------
  |  |   27|  10.6k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (193:3): [True: 10.6k, False: 0]
  ------------------
  194|       |
  195|       |  // FIXME: predictor may have value outside of the uint16_t.
  196|       |  // https://github.com/darktable-org/rawspeed/issues/175
  197|       |
  198|  10.6k|  int mcuIdx = 0;
  199|       |  // For x, we first process all full pixel MCUs within the image buffer ...
  200|  26.4k|  for (; mcuIdx < numFullMCUs; ++mcuIdx) {
  ------------------
  |  Branch (200:10): [True: 15.8k, False: 10.6k]
  ------------------
  201|  15.8k|    const auto outTile = CroppedArray2DRef(outStripe,
  202|  15.8k|                                           /*offsetCols=*/MCUSize.x * mcuIdx,
  203|  15.8k|                                           /*offsetRows=*/0,
  204|  15.8k|                                           /*croppedWidth=*/MCUSize.x,
  205|  15.8k|                                           /*croppedHeight=*/MCUSize.y)
  206|  15.8k|                             .getAsArray2DRef();
  207|  31.6k|    for (int MCURow = 0; MCURow != MCUSize.y; ++MCURow) {
  ------------------
  |  Branch (207:26): [True: 15.8k, False: 15.8k]
  ------------------
  208|  31.6k|      for (int MCUСol = 0; MCUСol != MCUSize.x; ++MCUСol) {
  ------------------
  |  Branch (208:29): [True: 15.8k, False: 15.8k]
  ------------------
  209|  15.8k|        int c = (MCUSize.x * MCURow) + MCUСol;
  210|  15.8k|        int prediction = pred(MCURow, MCUСol);
  211|  15.8k|        int diff = (static_cast<const PrefixCodeDecoder<>&>(ht[c]))
  212|  15.8k|                       .decodeDifference(bs);
  213|  15.8k|        int pix = prediction + diff;
  214|  15.8k|        outTile(MCURow, MCUСol) = uint16_t(pix);
  215|  15.8k|      }
  216|  15.8k|    }
  217|       |    // The predictor for the next MCU of the row is the just-decoded MCU.
  218|  15.8k|    pred = outTile;
  219|  15.8k|  }
  220|       |
  221|       |  // Sometimes we also need to consume one more MCU, and produce part of it.
  222|  10.6k|  if (trailingPixels != 0) {
  ------------------
  |  Branch (222:7): [True: 0, False: 10.6k]
  ------------------
  223|       |    // Some rather esoteric DNG's have odd dimensions, e.g. width % 2 = 1.
  224|       |    // We may end up needing just part of last N_COMP pixels.
  225|      0|    invariant(trailingPixels > 0);
  ------------------
  |  |   27|      0|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (225:5): [True: 0, False: 0]
  ------------------
  226|      0|    invariant(trailingPixels < N_COMP);
  ------------------
  |  |   27|      0|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (226:5): [True: 0, False: 0]
  ------------------
  227|      0|    invariant(N_COMP > 1 && "can't want part of 1-pixel-wide block");
  ------------------
  |  |   27|      0|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (227:5): [Folded, False: 0]
  |  Branch (227:5): [True: 0, Folded]
  |  Branch (227:5): [Folded, False: 0]
  ------------------
  228|       |    // Some rather esoteric DNG's have odd dimensions, e.g. width % 2 = 1.
  229|       |    // We may end up needing just part of last N_COMP pixels.
  230|      0|    for (int MCURow = 0; MCURow != MCUSize.y; ++MCURow) {
  ------------------
  |  Branch (230:26): [True: 0, False: 0]
  ------------------
  231|      0|      for (int MCUСol = 0; MCUСol != MCUSize.x; ++MCUСol) {
  ------------------
  |  Branch (231:29): [True: 0, False: 0]
  ------------------
  232|      0|        int c = (MCUSize.x * MCURow) + MCUСol;
  233|      0|        int prediction = pred(MCURow, MCUСol);
  234|      0|        int diff = (static_cast<const PrefixCodeDecoder<>&>(ht[c]))
  235|      0|                       .decodeDifference(bs);
  236|      0|        int pix = prediction + diff;
  237|      0|        int stripeRow = MCURow;
  238|      0|        int stripeCol = (MCUSize.x * mcuIdx) + MCUСol;
  239|      0|        if (stripeCol < outStripe.width())
  ------------------
  |  Branch (239:13): [True: 0, False: 0]
  ------------------
  240|      0|          outStripe(stripeRow, stripeCol) = uint16_t(pix);
  241|      0|      }
  242|      0|    }
  243|      0|    ++mcuIdx; // We did just process one more MCU.
  244|      0|  }
  245|       |
  246|       |  // ... and discard the rest.
  247|  10.6k|  for (; mcuIdx < frame.dim.x; ++mcuIdx) {
  ------------------
  |  Branch (247:10): [True: 0, False: 10.6k]
  ------------------
  248|      0|    for (int i = 0; i != N_COMP; ++i)
  ------------------
  |  Branch (248:21): [True: 0, False: 0]
  ------------------
  249|      0|      (static_cast<const PrefixCodeDecoder<>&>(ht[i])).decodeDifference(bs);
  250|      0|  }
  251|  10.6k|}
LJpegDecompressor.cpp:_ZNK8rawspeed17LJpegDecompressor7decodeNIL_ZNS_12_GLOBAL__N_13MCUILi2ELi1EEEEEEjv:
  255|     93|ByteStream::size_type LJpegDecompressor::decodeN() const {
  256|     93|  invariant(MCU == this->frame.mcu);
  ------------------
  |  |   27|     93|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (256:3): [True: 93, False: 0]
  ------------------
  257|       |
  258|     93|  invariant(MCU.hasPositiveArea());
  ------------------
  |  |   27|     93|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (258:3): [True: 93, False: 0]
  ------------------
  259|       |  // FIXME: workarounding lack of constexpr std::abs() :(
  260|     93|  constexpr int N_COMP = MCU.x * MCU.y;
  261|       |
  262|     93|  invariant(mRaw->getCpp() > 0);
  ------------------
  |  |   27|     93|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (262:3): [True: 93, False: 0]
  ------------------
  263|       |
  264|     93|  const auto img =
  265|     93|      CroppedArray2DRef(mRaw->getU16DataAsUncroppedArray2DRef(),
  266|     93|                        mRaw->getCpp() * imgFrame.pos.x, imgFrame.pos.y,
  267|     93|                        mRaw->getCpp() * imgFrame.dim.x, imgFrame.dim.y)
  268|     93|          .getAsArray2DRef();
  269|       |
  270|     93|  const auto ht = getPrefixCodeDecoders<N_COMP>();
  271|       |
  272|       |  // A recoded DNG might be split up into tiles of self contained LJpeg blobs.
  273|       |  // The tiles at the bottom and the right may extend beyond the dimension of
  274|       |  // the raw image buffer. The excessive content has to be ignored.
  275|       |
  276|     93|  invariant(imgFrame.dim.y % frame.mcu.y == 0);
  ------------------
  |  |   27|     93|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (276:3): [True: 93, False: 0]
  ------------------
  277|     93|  const auto numRestartIntervals = implicit_cast<int>(roundUpDivisionSafe(
  278|     93|      imgFrame.dim.y / frame.mcu.y, numLJpegRowsPerRestartInterval));
  279|     93|  invariant(numRestartIntervals >= 0);
  ------------------
  |  |   27|     93|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (279:3): [True: 93, False: 0]
  ------------------
  280|     93|  invariant(numRestartIntervals != 0);
  ------------------
  |  |   27|     93|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (280:3): [True: 93, False: 0]
  ------------------
  281|       |
  282|     93|  ByteStream inputStream(DataBuffer(input, Endianness::little));
  283|     93|  for (int restartIntervalIndex = 0;
  284|    186|       restartIntervalIndex != numRestartIntervals; ++restartIntervalIndex) {
  ------------------
  |  Branch (284:8): [True: 93, False: 93]
  ------------------
  285|     93|    auto predStorage = getInitialPreds<N_COMP>();
  286|     93|    auto pred = Array2DRef(predStorage.data(), MCU.x, MCU.y);
  287|       |
  288|     93|    if (restartIntervalIndex != 0) {
  ------------------
  |  Branch (288:9): [True: 0, False: 93]
  ------------------
  289|      0|      auto marker = peekMarker(inputStream);
  290|      0|      if (!marker) // FIXME: can there be padding bytes before the marker?
  ------------------
  |  Branch (290:11): [True: 0, False: 0]
  ------------------
  291|      0|        ThrowRDE("Jpeg marker not encountered");
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  292|      0|      Optional<int> number = getRestartMarkerNumber(*marker);
  293|      0|      if (!number)
  ------------------
  |  Branch (293:11): [True: 0, False: 0]
  ------------------
  294|      0|        ThrowRDE("Not a restart marker!");
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  295|      0|      if (*number != ((restartIntervalIndex - 1) % 8))
  ------------------
  |  Branch (295:11): [True: 0, False: 0]
  ------------------
  296|      0|        ThrowRDE("Unexpected restart marker found");
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  297|      0|      inputStream.skipBytes(2); // Good restart marker.
  298|      0|    }
  299|       |
  300|     93|    BitStreamerJPEG bs(inputStream.peekRemainingBuffer().getAsArray1DRef());
  301|       |
  302|     93|    for (int ljpegRowOfRestartInterval = 0;
  303|    974|         ljpegRowOfRestartInterval != numLJpegRowsPerRestartInterval;
  ------------------
  |  Branch (303:10): [True: 881, False: 93]
  ------------------
  304|    881|         ++ljpegRowOfRestartInterval) {
  305|    881|      const int row =
  306|    881|          frame.mcu.y * (numLJpegRowsPerRestartInterval * restartIntervalIndex +
  307|    881|                         ljpegRowOfRestartInterval);
  308|    881|      invariant(row >= 0);
  ------------------
  |  |   27|    881|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (308:7): [True: 881, False: 0]
  ------------------
  309|    881|      invariant(row <= imgFrame.dim.y);
  ------------------
  |  |   27|    881|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (309:7): [True: 881, False: 0]
  ------------------
  310|       |
  311|       |      // For y, we can simply stop decoding when we reached the border.
  312|    881|      if (row == imgFrame.dim.y) {
  ------------------
  |  Branch (312:11): [True: 0, False: 881]
  ------------------
  313|      0|        invariant((restartIntervalIndex + 1) == numRestartIntervals);
  ------------------
  |  |   27|      0|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (313:9): [True: 0, False: 0]
  ------------------
  314|      0|        break;
  315|      0|      }
  316|       |
  317|    881|      const auto outStripe = CroppedArray2DRef(img,
  318|    881|                                               /*offsetCols=*/0,
  319|    881|                                               /*offsetRows=*/row,
  320|    881|                                               /*croppedWidth=*/img.width(),
  321|    881|                                               /*croppedHeight=*/frame.mcu.y)
  322|    881|                                 .getAsArray2DRef();
  323|       |
  324|    881|      decodeRowN<MCU, N_COMP>(outStripe, pred, ht, bs);
  325|       |
  326|       |      // The predictor for the next line is the start of this line.
  327|    881|      pred = CroppedArray2DRef(outStripe,
  328|    881|                               /*offsetCols=*/0,
  329|    881|                               /*offsetRows=*/0,
  330|    881|                               /*croppedWidth=*/MCU.x,
  331|    881|                               /*croppedHeight=*/MCU.y)
  332|    881|                 .getAsArray2DRef();
  333|    881|    }
  334|       |
  335|     93|    inputStream.skipBytes(bs.getStreamPosition());
  336|     93|  }
  337|       |
  338|     93|  return inputStream.getPosition();
  339|     93|}
_ZNK8rawspeed17LJpegDecompressor21getPrefixCodeDecodersILi2EEENSt3__15arrayINS2_17reference_wrapperIKNS_20PrefixCodeLUTDecoderINS_15BaselineCodeTagENS_23PrefixCodeLookupDecoderIS6_EEEEEEXT_EEEv:
  164|     93|LJpegDecompressor::getPrefixCodeDecoders() const {
  165|     93|  return getPrefixCodeDecodersImpl<N_COMP>(std::make_index_sequence<N_COMP>{});
  166|     93|}
_ZNK8rawspeed17LJpegDecompressor25getPrefixCodeDecodersImplILi2EJLm0ELm1EEEENSt3__15arrayINS2_17reference_wrapperIKNS_20PrefixCodeLUTDecoderINS_15BaselineCodeTagENS_23PrefixCodeLookupDecoderIS6_EEEEEEXT_EEENS2_16integer_sequenceImJXspT0_EEEE:
  157|     93|    std::index_sequence<I...> /*unused*/) const {
  158|     93|  return std::array<std::reference_wrapper<const PrefixCodeDecoder<>>, N_COMP>{
  159|     93|      std::cref(rec[I].ht)...};
  160|     93|}
_ZNK8rawspeed17LJpegDecompressor15getInitialPredsILi2EEENSt3__15arrayItXT_EEEv:
  169|     93|std::array<uint16_t, N_COMP> LJpegDecompressor::getInitialPreds() const {
  170|     93|  std::array<uint16_t, N_COMP> preds;
  171|     93|  std::transform(
  172|     93|      rec.begin(), rec.end(), preds.begin(),
  173|     93|      [](const PerComponentRecipe& compRec) { return compRec.initPred; });
  174|     93|  return preds;
  175|     93|}
_ZZNK8rawspeed17LJpegDecompressor15getInitialPredsILi2EEENSt3__15arrayItXT_EEEvENKUlRKNS0_18PerComponentRecipeEE_clES7_:
  173|    186|      [](const PerComponentRecipe& compRec) { return compRec.initPred; });
LJpegDecompressor.cpp:_ZNK8rawspeed17LJpegDecompressor10decodeRowNIL_ZNS_12_GLOBAL__N_13MCUILi2ELi1EEEELi2EEEvNS_10Array2DRefItEENS4_IKtEENSt3__15arrayINS8_17reference_wrapperIKNS_20PrefixCodeLUTDecoderINS_15BaselineCodeTagENS_23PrefixCodeLookupDecoderISC_EEEEEEXT0_EEERNS_15BitStreamerJPEGE:
  188|    881|    BitStreamerJPEG& bs) const {
  189|    881|  invariant(MCUSize.area() == N_COMP);
  ------------------
  |  |   27|    881|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (189:3): [True: 881, False: 0]
  ------------------
  190|    881|  invariant(outStripe.width() >= MCUSize.x);
  ------------------
  |  |   27|    881|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (190:3): [True: 881, False: 0]
  ------------------
  191|    881|  invariant(outStripe.height() == MCUSize.y);
  ------------------
  |  |   27|    881|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (191:3): [True: 881, False: 0]
  ------------------
  192|    881|  invariant(pred.width() == MCUSize.x);
  ------------------
  |  |   27|    881|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (192:3): [True: 881, False: 0]
  ------------------
  193|    881|  invariant(pred.height() == MCUSize.y);
  ------------------
  |  |   27|    881|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (193:3): [True: 881, False: 0]
  ------------------
  194|       |
  195|       |  // FIXME: predictor may have value outside of the uint16_t.
  196|       |  // https://github.com/darktable-org/rawspeed/issues/175
  197|       |
  198|    881|  int mcuIdx = 0;
  199|       |  // For x, we first process all full pixel MCUs within the image buffer ...
  200|  7.30k|  for (; mcuIdx < numFullMCUs; ++mcuIdx) {
  ------------------
  |  Branch (200:10): [True: 6.42k, False: 881]
  ------------------
  201|  6.42k|    const auto outTile = CroppedArray2DRef(outStripe,
  202|  6.42k|                                           /*offsetCols=*/MCUSize.x * mcuIdx,
  203|  6.42k|                                           /*offsetRows=*/0,
  204|  6.42k|                                           /*croppedWidth=*/MCUSize.x,
  205|  6.42k|                                           /*croppedHeight=*/MCUSize.y)
  206|  6.42k|                             .getAsArray2DRef();
  207|  12.8k|    for (int MCURow = 0; MCURow != MCUSize.y; ++MCURow) {
  ------------------
  |  Branch (207:26): [True: 6.42k, False: 6.42k]
  ------------------
  208|  19.2k|      for (int MCUСol = 0; MCUСol != MCUSize.x; ++MCUСol) {
  ------------------
  |  Branch (208:29): [True: 12.8k, False: 6.42k]
  ------------------
  209|  12.8k|        int c = (MCUSize.x * MCURow) + MCUСol;
  210|  12.8k|        int prediction = pred(MCURow, MCUСol);
  211|  12.8k|        int diff = (static_cast<const PrefixCodeDecoder<>&>(ht[c]))
  212|  12.8k|                       .decodeDifference(bs);
  213|  12.8k|        int pix = prediction + diff;
  214|  12.8k|        outTile(MCURow, MCUСol) = uint16_t(pix);
  215|  12.8k|      }
  216|  6.42k|    }
  217|       |    // The predictor for the next MCU of the row is the just-decoded MCU.
  218|  6.42k|    pred = outTile;
  219|  6.42k|  }
  220|       |
  221|       |  // Sometimes we also need to consume one more MCU, and produce part of it.
  222|    881|  if (trailingPixels != 0) {
  ------------------
  |  Branch (222:7): [True: 0, False: 881]
  ------------------
  223|       |    // Some rather esoteric DNG's have odd dimensions, e.g. width % 2 = 1.
  224|       |    // We may end up needing just part of last N_COMP pixels.
  225|      0|    invariant(trailingPixels > 0);
  ------------------
  |  |   27|      0|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (225:5): [True: 0, False: 0]
  ------------------
  226|      0|    invariant(trailingPixels < N_COMP);
  ------------------
  |  |   27|      0|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (226:5): [True: 0, False: 0]
  ------------------
  227|      0|    invariant(N_COMP > 1 && "can't want part of 1-pixel-wide block");
  ------------------
  |  |   27|      0|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (227:5): [True: 0, Folded]
  |  Branch (227:5): [True: 0, Folded]
  |  Branch (227:5): [True: 0, Folded]
  ------------------
  228|       |    // Some rather esoteric DNG's have odd dimensions, e.g. width % 2 = 1.
  229|       |    // We may end up needing just part of last N_COMP pixels.
  230|      0|    for (int MCURow = 0; MCURow != MCUSize.y; ++MCURow) {
  ------------------
  |  Branch (230:26): [True: 0, False: 0]
  ------------------
  231|      0|      for (int MCUСol = 0; MCUСol != MCUSize.x; ++MCUСol) {
  ------------------
  |  Branch (231:29): [True: 0, False: 0]
  ------------------
  232|      0|        int c = (MCUSize.x * MCURow) + MCUСol;
  233|      0|        int prediction = pred(MCURow, MCUСol);
  234|      0|        int diff = (static_cast<const PrefixCodeDecoder<>&>(ht[c]))
  235|      0|                       .decodeDifference(bs);
  236|      0|        int pix = prediction + diff;
  237|      0|        int stripeRow = MCURow;
  238|      0|        int stripeCol = (MCUSize.x * mcuIdx) + MCUСol;
  239|      0|        if (stripeCol < outStripe.width())
  ------------------
  |  Branch (239:13): [True: 0, False: 0]
  ------------------
  240|      0|          outStripe(stripeRow, stripeCol) = uint16_t(pix);
  241|      0|      }
  242|      0|    }
  243|      0|    ++mcuIdx; // We did just process one more MCU.
  244|      0|  }
  245|       |
  246|       |  // ... and discard the rest.
  247|    881|  for (; mcuIdx < frame.dim.x; ++mcuIdx) {
  ------------------
  |  Branch (247:10): [True: 0, False: 881]
  ------------------
  248|      0|    for (int i = 0; i != N_COMP; ++i)
  ------------------
  |  Branch (248:21): [True: 0, False: 0]
  ------------------
  249|      0|      (static_cast<const PrefixCodeDecoder<>&>(ht[i])).decodeDifference(bs);
  250|      0|  }
  251|    881|}
LJpegDecompressor.cpp:_ZNK8rawspeed17LJpegDecompressor7decodeNIL_ZNS_12_GLOBAL__N_13MCUILi3ELi1EEEEEEjv:
  255|    128|ByteStream::size_type LJpegDecompressor::decodeN() const {
  256|    128|  invariant(MCU == this->frame.mcu);
  ------------------
  |  |   27|    128|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (256:3): [True: 128, False: 0]
  ------------------
  257|       |
  258|    128|  invariant(MCU.hasPositiveArea());
  ------------------
  |  |   27|    128|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (258:3): [True: 128, False: 0]
  ------------------
  259|       |  // FIXME: workarounding lack of constexpr std::abs() :(
  260|    128|  constexpr int N_COMP = MCU.x * MCU.y;
  261|       |
  262|    128|  invariant(mRaw->getCpp() > 0);
  ------------------
  |  |   27|    128|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (262:3): [True: 128, False: 0]
  ------------------
  263|       |
  264|    128|  const auto img =
  265|    128|      CroppedArray2DRef(mRaw->getU16DataAsUncroppedArray2DRef(),
  266|    128|                        mRaw->getCpp() * imgFrame.pos.x, imgFrame.pos.y,
  267|    128|                        mRaw->getCpp() * imgFrame.dim.x, imgFrame.dim.y)
  268|    128|          .getAsArray2DRef();
  269|       |
  270|    128|  const auto ht = getPrefixCodeDecoders<N_COMP>();
  271|       |
  272|       |  // A recoded DNG might be split up into tiles of self contained LJpeg blobs.
  273|       |  // The tiles at the bottom and the right may extend beyond the dimension of
  274|       |  // the raw image buffer. The excessive content has to be ignored.
  275|       |
  276|    128|  invariant(imgFrame.dim.y % frame.mcu.y == 0);
  ------------------
  |  |   27|    128|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (276:3): [True: 127, False: 1]
  ------------------
  277|    127|  const auto numRestartIntervals = implicit_cast<int>(roundUpDivisionSafe(
  278|    127|      imgFrame.dim.y / frame.mcu.y, numLJpegRowsPerRestartInterval));
  279|    127|  invariant(numRestartIntervals >= 0);
  ------------------
  |  |   27|    127|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (279:3): [True: 126, False: 1]
  ------------------
  280|    126|  invariant(numRestartIntervals != 0);
  ------------------
  |  |   27|    126|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (280:3): [True: 126, False: 0]
  ------------------
  281|       |
  282|    126|  ByteStream inputStream(DataBuffer(input, Endianness::little));
  283|    126|  for (int restartIntervalIndex = 0;
  284|    254|       restartIntervalIndex != numRestartIntervals; ++restartIntervalIndex) {
  ------------------
  |  Branch (284:8): [True: 128, False: 126]
  ------------------
  285|    128|    auto predStorage = getInitialPreds<N_COMP>();
  286|    128|    auto pred = Array2DRef(predStorage.data(), MCU.x, MCU.y);
  287|       |
  288|    128|    if (restartIntervalIndex != 0) {
  ------------------
  |  Branch (288:9): [True: 0, False: 128]
  ------------------
  289|      0|      auto marker = peekMarker(inputStream);
  290|      0|      if (!marker) // FIXME: can there be padding bytes before the marker?
  ------------------
  |  Branch (290:11): [True: 0, False: 0]
  ------------------
  291|      0|        ThrowRDE("Jpeg marker not encountered");
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  292|      0|      Optional<int> number = getRestartMarkerNumber(*marker);
  293|      0|      if (!number)
  ------------------
  |  Branch (293:11): [True: 0, False: 0]
  ------------------
  294|      0|        ThrowRDE("Not a restart marker!");
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  295|      0|      if (*number != ((restartIntervalIndex - 1) % 8))
  ------------------
  |  Branch (295:11): [True: 0, False: 0]
  ------------------
  296|      0|        ThrowRDE("Unexpected restart marker found");
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  297|      0|      inputStream.skipBytes(2); // Good restart marker.
  298|      0|    }
  299|       |
  300|    128|    BitStreamerJPEG bs(inputStream.peekRemainingBuffer().getAsArray1DRef());
  301|       |
  302|    128|    for (int ljpegRowOfRestartInterval = 0;
  303|  7.00k|         ljpegRowOfRestartInterval != numLJpegRowsPerRestartInterval;
  ------------------
  |  Branch (303:10): [True: 6.88k, False: 121]
  ------------------
  304|  6.88k|         ++ljpegRowOfRestartInterval) {
  305|  6.88k|      const int row =
  306|  6.88k|          frame.mcu.y * (numLJpegRowsPerRestartInterval * restartIntervalIndex +
  307|  6.88k|                         ljpegRowOfRestartInterval);
  308|  6.88k|      invariant(row >= 0);
  ------------------
  |  |   27|  6.88k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (308:7): [True: 6.88k, False: 0]
  ------------------
  309|  6.88k|      invariant(row <= imgFrame.dim.y);
  ------------------
  |  |   27|  6.88k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (309:7): [True: 6.88k, False: 0]
  ------------------
  310|       |
  311|       |      // For y, we can simply stop decoding when we reached the border.
  312|  6.88k|      if (row == imgFrame.dim.y) {
  ------------------
  |  Branch (312:11): [True: 7, False: 6.87k]
  ------------------
  313|      7|        invariant((restartIntervalIndex + 1) == numRestartIntervals);
  ------------------
  |  |   27|      7|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (313:9): [True: 7, False: 0]
  ------------------
  314|      7|        break;
  315|      7|      }
  316|       |
  317|  6.87k|      const auto outStripe = CroppedArray2DRef(img,
  318|  6.87k|                                               /*offsetCols=*/0,
  319|  6.87k|                                               /*offsetRows=*/row,
  320|  6.87k|                                               /*croppedWidth=*/img.width(),
  321|  6.87k|                                               /*croppedHeight=*/frame.mcu.y)
  322|  6.87k|                                 .getAsArray2DRef();
  323|       |
  324|  6.87k|      decodeRowN<MCU, N_COMP>(outStripe, pred, ht, bs);
  325|       |
  326|       |      // The predictor for the next line is the start of this line.
  327|  6.87k|      pred = CroppedArray2DRef(outStripe,
  328|  6.87k|                               /*offsetCols=*/0,
  329|  6.87k|                               /*offsetRows=*/0,
  330|  6.87k|                               /*croppedWidth=*/MCU.x,
  331|  6.87k|                               /*croppedHeight=*/MCU.y)
  332|  6.87k|                 .getAsArray2DRef();
  333|  6.87k|    }
  334|       |
  335|    128|    inputStream.skipBytes(bs.getStreamPosition());
  336|    128|  }
  337|       |
  338|    126|  return inputStream.getPosition();
  339|    126|}
_ZNK8rawspeed17LJpegDecompressor21getPrefixCodeDecodersILi3EEENSt3__15arrayINS2_17reference_wrapperIKNS_20PrefixCodeLUTDecoderINS_15BaselineCodeTagENS_23PrefixCodeLookupDecoderIS6_EEEEEEXT_EEEv:
  164|    126|LJpegDecompressor::getPrefixCodeDecoders() const {
  165|    126|  return getPrefixCodeDecodersImpl<N_COMP>(std::make_index_sequence<N_COMP>{});
  166|    126|}
_ZNK8rawspeed17LJpegDecompressor25getPrefixCodeDecodersImplILi3EJLm0ELm1ELm2EEEENSt3__15arrayINS2_17reference_wrapperIKNS_20PrefixCodeLUTDecoderINS_15BaselineCodeTagENS_23PrefixCodeLookupDecoderIS6_EEEEEEXT_EEENS2_16integer_sequenceImJXspT0_EEEE:
  157|    127|    std::index_sequence<I...> /*unused*/) const {
  158|    127|  return std::array<std::reference_wrapper<const PrefixCodeDecoder<>>, N_COMP>{
  159|    127|      std::cref(rec[I].ht)...};
  160|    127|}
_ZNK8rawspeed17LJpegDecompressor15getInitialPredsILi3EEENSt3__15arrayItXT_EEEv:
  169|    128|std::array<uint16_t, N_COMP> LJpegDecompressor::getInitialPreds() const {
  170|    128|  std::array<uint16_t, N_COMP> preds;
  171|    128|  std::transform(
  172|    128|      rec.begin(), rec.end(), preds.begin(),
  173|    128|      [](const PerComponentRecipe& compRec) { return compRec.initPred; });
  174|    128|  return preds;
  175|    128|}
_ZZNK8rawspeed17LJpegDecompressor15getInitialPredsILi3EEENSt3__15arrayItXT_EEEvENKUlRKNS0_18PerComponentRecipeEE_clES7_:
  173|    384|      [](const PerComponentRecipe& compRec) { return compRec.initPred; });
LJpegDecompressor.cpp:_ZNK8rawspeed17LJpegDecompressor10decodeRowNIL_ZNS_12_GLOBAL__N_13MCUILi3ELi1EEEELi3EEEvNS_10Array2DRefItEENS4_IKtEENSt3__15arrayINS8_17reference_wrapperIKNS_20PrefixCodeLUTDecoderINS_15BaselineCodeTagENS_23PrefixCodeLookupDecoderISC_EEEEEEXT0_EEERNS_15BitStreamerJPEGE:
  188|  6.87k|    BitStreamerJPEG& bs) const {
  189|  6.87k|  invariant(MCUSize.area() == N_COMP);
  ------------------
  |  |   27|  6.87k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (189:3): [True: 6.87k, False: 0]
  ------------------
  190|  6.87k|  invariant(outStripe.width() >= MCUSize.x);
  ------------------
  |  |   27|  6.87k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (190:3): [True: 6.87k, False: 0]
  ------------------
  191|  6.87k|  invariant(outStripe.height() == MCUSize.y);
  ------------------
  |  |   27|  6.87k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (191:3): [True: 6.87k, False: 1]
  ------------------
  192|  6.87k|  invariant(pred.width() == MCUSize.x);
  ------------------
  |  |   27|  6.87k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (192:3): [True: 6.87k, False: 18.4E]
  ------------------
  193|  6.87k|  invariant(pred.height() == MCUSize.y);
  ------------------
  |  |   27|  6.87k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (193:3): [True: 6.87k, False: 0]
  ------------------
  194|       |
  195|       |  // FIXME: predictor may have value outside of the uint16_t.
  196|       |  // https://github.com/darktable-org/rawspeed/issues/175
  197|       |
  198|  6.87k|  int mcuIdx = 0;
  199|       |  // For x, we first process all full pixel MCUs within the image buffer ...
  200|  1.24M|  for (; mcuIdx < numFullMCUs; ++mcuIdx) {
  ------------------
  |  Branch (200:10): [True: 1.23M, False: 6.87k]
  ------------------
  201|  1.23M|    const auto outTile = CroppedArray2DRef(outStripe,
  202|  1.23M|                                           /*offsetCols=*/MCUSize.x * mcuIdx,
  203|  1.23M|                                           /*offsetRows=*/0,
  204|  1.23M|                                           /*croppedWidth=*/MCUSize.x,
  205|  1.23M|                                           /*croppedHeight=*/MCUSize.y)
  206|  1.23M|                             .getAsArray2DRef();
  207|  2.46M|    for (int MCURow = 0; MCURow != MCUSize.y; ++MCURow) {
  ------------------
  |  Branch (207:26): [True: 1.23M, False: 1.23M]
  ------------------
  208|  4.92M|      for (int MCUСol = 0; MCUСol != MCUSize.x; ++MCUСol) {
  ------------------
  |  Branch (208:29): [True: 3.69M, False: 1.23M]
  ------------------
  209|  3.69M|        int c = (MCUSize.x * MCURow) + MCUСol;
  210|  3.69M|        int prediction = pred(MCURow, MCUСol);
  211|  3.69M|        int diff = (static_cast<const PrefixCodeDecoder<>&>(ht[c]))
  212|  3.69M|                       .decodeDifference(bs);
  213|  3.69M|        int pix = prediction + diff;
  214|  3.69M|        outTile(MCURow, MCUСol) = uint16_t(pix);
  215|  3.69M|      }
  216|  1.23M|    }
  217|       |    // The predictor for the next MCU of the row is the just-decoded MCU.
  218|  1.23M|    pred = outTile;
  219|  1.23M|  }
  220|       |
  221|       |  // Sometimes we also need to consume one more MCU, and produce part of it.
  222|  6.87k|  if (trailingPixels != 0) {
  ------------------
  |  Branch (222:7): [True: 0, False: 6.87k]
  ------------------
  223|       |    // Some rather esoteric DNG's have odd dimensions, e.g. width % 2 = 1.
  224|       |    // We may end up needing just part of last N_COMP pixels.
  225|      0|    invariant(trailingPixels > 0);
  ------------------
  |  |   27|      0|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (225:5): [True: 0, False: 0]
  ------------------
  226|      0|    invariant(trailingPixels < N_COMP);
  ------------------
  |  |   27|      0|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (226:5): [True: 0, False: 0]
  ------------------
  227|      0|    invariant(N_COMP > 1 && "can't want part of 1-pixel-wide block");
  ------------------
  |  |   27|      0|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (227:5): [True: 0, Folded]
  |  Branch (227:5): [True: 0, Folded]
  |  Branch (227:5): [True: 0, Folded]
  ------------------
  228|       |    // Some rather esoteric DNG's have odd dimensions, e.g. width % 2 = 1.
  229|       |    // We may end up needing just part of last N_COMP pixels.
  230|      0|    for (int MCURow = 0; MCURow != MCUSize.y; ++MCURow) {
  ------------------
  |  Branch (230:26): [True: 0, False: 0]
  ------------------
  231|      0|      for (int MCUСol = 0; MCUСol != MCUSize.x; ++MCUСol) {
  ------------------
  |  Branch (231:29): [True: 0, False: 0]
  ------------------
  232|      0|        int c = (MCUSize.x * MCURow) + MCUСol;
  233|      0|        int prediction = pred(MCURow, MCUСol);
  234|      0|        int diff = (static_cast<const PrefixCodeDecoder<>&>(ht[c]))
  235|      0|                       .decodeDifference(bs);
  236|      0|        int pix = prediction + diff;
  237|      0|        int stripeRow = MCURow;
  238|      0|        int stripeCol = (MCUSize.x * mcuIdx) + MCUСol;
  239|      0|        if (stripeCol < outStripe.width())
  ------------------
  |  Branch (239:13): [True: 0, False: 0]
  ------------------
  240|      0|          outStripe(stripeRow, stripeCol) = uint16_t(pix);
  241|      0|      }
  242|      0|    }
  243|      0|    ++mcuIdx; // We did just process one more MCU.
  244|      0|  }
  245|       |
  246|       |  // ... and discard the rest.
  247|  83.2k|  for (; mcuIdx < frame.dim.x; ++mcuIdx) {
  ------------------
  |  Branch (247:10): [True: 76.3k, False: 6.87k]
  ------------------
  248|   305k|    for (int i = 0; i != N_COMP; ++i)
  ------------------
  |  Branch (248:21): [True: 229k, False: 76.3k]
  ------------------
  249|   229k|      (static_cast<const PrefixCodeDecoder<>&>(ht[i])).decodeDifference(bs);
  250|  76.3k|  }
  251|  6.87k|}

_ZN8rawspeed17NikonDecompressor11createCurveERNS_10ByteStreamEjjjPj:
  384|    164|                                                     uint32_t* split) {
  385|       |  // Nikon Z7 12/14 bit compressed hack.
  386|    164|  if (v0 == 68 && v1 == 64)
  ------------------
  |  Branch (386:7): [True: 89, False: 75]
  |  Branch (386:19): [True: 75, False: 14]
  ------------------
  387|     75|    bitsPS -= 2;
  388|       |
  389|       |  // 'curve' will hold a peace wise linearly interpolated function.
  390|       |  // there are 'csize' segments, each is 'step' values long.
  391|       |  // the very last value is not part of the used table but necessary
  392|       |  // to linearly interpolate the last segment, therefore the '+1/-1'
  393|       |  // size adjustments of 'curve'.
  394|    164|  std::vector<uint16_t> curve((1 << bitsPS & 0x7fff) + 1);
  395|    164|  assert(curve.size() > 1);
  ------------------
  |  Branch (395:3): [True: 164, False: 0]
  ------------------
  396|       |
  397|  1.13M|  for (size_t i = 0; i < curve.size(); i++)
  ------------------
  |  Branch (397:22): [True: 1.13M, False: 164]
  ------------------
  398|  1.13M|    curve[i] = implicit_cast<uint16_t>(i);
  399|       |
  400|    164|  uint32_t step = 0;
  401|    164|  uint32_t csize = metadata.getU16();
  402|    164|  if (csize > 1)
  ------------------
  |  Branch (402:7): [True: 145, False: 19]
  ------------------
  403|    145|    step = implicit_cast<uint32_t>(curve.size() / (csize - 1));
  404|       |
  405|    164|  if (v0 == 68 && (v1 == 32 || v1 == 64) && step > 0) {
  ------------------
  |  Branch (405:7): [True: 89, False: 75]
  |  Branch (405:20): [True: 10, False: 79]
  |  Branch (405:32): [True: 75, False: 4]
  |  Branch (405:45): [True: 80, False: 5]
  ------------------
  406|     80|    if ((csize - 1) * step != curve.size() - 1)
  ------------------
  |  Branch (406:9): [True: 1, False: 79]
  ------------------
  407|     80|      ThrowRDE("Bad curve segment count (%u)", csize);
  ------------------
  |  |   38|      1|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      1|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      1|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      1|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  408|       |
  409|  1.09k|    for (size_t i = 0; i < csize; i++)
  ------------------
  |  Branch (409:24): [True: 1.01k, False: 79]
  ------------------
  410|  1.01k|      curve[i * step] = metadata.getU16();
  411|   300k|    for (size_t i = 0; i < curve.size() - 1; i++) {
  ------------------
  |  Branch (411:24): [True: 300k, False: 79]
  ------------------
  412|   300k|      const uint32_t b_scale = i % step;
  413|       |
  414|   300k|      const auto a_pos = implicit_cast<uint32_t>(i - b_scale);
  415|   300k|      const uint32_t b_pos = a_pos + step;
  416|   300k|      assert(a_pos < curve.size());
  ------------------
  |  Branch (416:7): [True: 300k, False: 0]
  ------------------
  417|   300k|      assert(b_pos > 0);
  ------------------
  |  Branch (417:7): [True: 300k, False: 0]
  ------------------
  418|   300k|      assert(b_pos < curve.size());
  ------------------
  |  Branch (418:7): [True: 300k, False: 0]
  ------------------
  419|   300k|      assert(a_pos < b_pos);
  ------------------
  |  Branch (419:7): [True: 300k, False: 0]
  ------------------
  420|       |
  421|   300k|      const uint32_t a_scale = step - b_scale;
  422|   300k|      curve[i] = implicit_cast<uint16_t>(
  423|   300k|          (a_scale * curve[a_pos] + b_scale * curve[b_pos]) / step);
  424|   300k|    }
  425|       |
  426|     79|    metadata.setPosition(562);
  427|     79|    *split = metadata.getU16();
  428|     84|  } else if (v0 != 70) {
  ------------------
  |  Branch (428:14): [True: 69, False: 15]
  ------------------
  429|     69|    if (csize == 0 || csize > 0x4001)
  ------------------
  |  Branch (429:9): [True: 2, False: 67]
  |  Branch (429:23): [True: 2, False: 65]
  ------------------
  430|     69|      ThrowRDE("Don't know how to compute curve! csize = %u", csize);
  ------------------
  |  |   38|      4|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      4|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      4|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      4|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  431|       |
  432|     65|    curve.resize(csize + 1UL);
  433|     65|    assert(curve.size() > 1);
  ------------------
  |  Branch (433:5): [True: 65, False: 0]
  ------------------
  434|       |
  435|  35.4k|    for (uint32_t i = 0; i < csize; i++) {
  ------------------
  |  Branch (435:26): [True: 35.4k, False: 65]
  ------------------
  436|  35.4k|      curve[i] = metadata.getU16();
  437|  35.4k|    }
  438|     65|  }
  439|       |
  440|       |  // and drop the last value
  441|    159|  curve.resize(curve.size() - 1);
  442|    159|  assert(!curve.empty());
  ------------------
  |  Branch (442:3): [True: 130, False: 29]
  ------------------
  443|       |
  444|    130|  return curve;
  445|    159|}
_ZN8rawspeed17NikonDecompressor23createPrefixCodeDecoderINS_20PrefixCodeLUTDecoderINS_15BaselineCodeTagENS_23PrefixCodeLookupDecoderIS3_EEEEEET_j:
  461|    128|    uint32_t huffSelect) {
  462|    128|  HuffmanCode<BaselineCodeTag> hc;
  463|    128|  uint32_t count =
  464|    128|      hc.setNCodesPerLength(Buffer(nikon_tree[huffSelect][0].data(), 16));
  465|    128|  hc.setCodeValues(
  466|    128|      Array1DRef<const uint8_t>(nikon_tree[huffSelect][1].data(), count));
  467|       |
  468|    128|  PrefixCodeDecoder<> ht(std::move(hc));
  469|    128|  ht.setup(true, false);
  470|    128|  return ht;
  471|    128|}
_ZN8rawspeed17NikonDecompressorC2ENS_8RawImageENS_10ByteStreamEj:
  475|    218|    : mRaw(std::move(raw)), bitsPS(bitsPS_) {
  476|    218|  if (mRaw->getCpp() != 1 || mRaw->getDataType() != RawImageType::UINT16 ||
  ------------------
  |  Branch (476:7): [True: 0, False: 218]
  |  Branch (476:30): [True: 0, False: 218]
  ------------------
  477|    218|      mRaw->getBpp() != sizeof(uint16_t))
  ------------------
  |  Branch (477:7): [True: 0, False: 218]
  ------------------
  478|    218|    ThrowRDE("Unexpected component count / data type");
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  479|       |
  480|    218|  if (!mRaw->dim.hasPositiveArea() || mRaw->dim.x % 2 != 0 ||
  ------------------
  |  Branch (480:7): [True: 35, False: 183]
  |  Branch (480:39): [True: 2, False: 181]
  ------------------
  481|    181|      mRaw->dim.x > 8288 || mRaw->dim.y > 5520)
  ------------------
  |  Branch (481:7): [True: 4, False: 177]
  |  Branch (481:29): [True: 7, False: 170]
  ------------------
  482|    218|    ThrowRDE("Unexpected image dimensions found: (%d; %d)", mRaw->dim.x,
  ------------------
  |  |   38|     48|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     48|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     48|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     48|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  483|    170|             mRaw->dim.y);
  484|       |
  485|    170|  switch (bitsPS) {
  486|     87|  case 12:
  ------------------
  |  Branch (486:3): [True: 87, False: 83]
  ------------------
  487|    168|  case 14:
  ------------------
  |  Branch (487:3): [True: 81, False: 89]
  ------------------
  488|    168|    break;
  489|      2|  default:
  ------------------
  |  Branch (489:3): [True: 2, False: 168]
  ------------------
  490|      2|    ThrowRDE("Invalid bpp found: %u", bitsPS);
  ------------------
  |  |   38|      2|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      2|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      2|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      2|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  491|    170|  }
  492|       |
  493|    168|  uint32_t v0 = metadata.getByte();
  494|    168|  uint32_t v1 = metadata.getByte();
  495|       |
  496|    168|  writeLog(DEBUG_PRIO::EXTRA, "Nef version v0:%u, v1:%u", v0, v1);
  497|       |
  498|    168|  if (v0 == 73 || v1 == 88)
  ------------------
  |  Branch (498:7): [True: 15, False: 153]
  |  Branch (498:19): [True: 1, False: 152]
  ------------------
  499|     15|    metadata.skipBytes(2110);
  500|       |
  501|    168|  if (v0 == 70)
  ------------------
  |  Branch (501:7): [True: 15, False: 153]
  ------------------
  502|     15|    huffSelect = 2;
  503|    168|  if (bitsPS == 14)
  ------------------
  |  Branch (503:7): [True: 79, False: 89]
  ------------------
  504|     79|    huffSelect += 3;
  505|       |
  506|    168|  pUp[0][0] = metadata.getU16();
  507|    168|  pUp[1][0] = metadata.getU16();
  508|    168|  pUp[0][1] = metadata.getU16();
  509|    168|  pUp[1][1] = metadata.getU16();
  510|       |
  511|    168|  curve = createCurve(metadata, bitsPS, v0, v1, &split);
  512|       |
  513|       |  // If the 'split' happens outside of the image, it does not actually happen.
  514|    168|  if (split >= static_cast<unsigned>(mRaw->dim.y))
  ------------------
  |  Branch (514:7): [True: 15, False: 153]
  ------------------
  515|     15|    split = 0;
  516|    168|}
_ZN8rawspeed17NikonDecompressor10decompressENS_10Array1DRefIKhEEb:
  544|    130|                                   bool uncorrectedRawValues) {
  545|    130|  RawImageCurveGuard curveHandler(&mRaw, curve, uncorrectedRawValues);
  546|       |
  547|    130|  BitStreamerMSB bits(input);
  548|       |
  549|    130|  random = bits.peekBits(24);
  550|       |
  551|    130|  invariant(split == 0 || split < static_cast<unsigned>(mRaw->dim.y));
  ------------------
  |  |   27|    130|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (551:3): [True: 77, False: 53]
  |  Branch (551:3): [True: 53, False: 0]
  |  Branch (551:3): [True: 128, False: 2]
  ------------------
  552|       |
  553|    128|  if (!split) {
  ------------------
  |  Branch (553:7): [True: 75, False: 53]
  ------------------
  554|     75|    decompress<PrefixCodeDecoder<>>(bits, 0, mRaw->dim.y);
  555|     75|  } else {
  556|     53|    decompress<PrefixCodeDecoder<>>(bits, 0, split);
  557|     53|    huffSelect += 1;
  558|     53|    decompress<NikonLASDecompressor>(bits, split, mRaw->dim.y);
  559|     53|  }
  560|    128|}
_ZN8rawspeed17NikonDecompressor10decompressINS_20PrefixCodeLUTDecoderINS_15BaselineCodeTagENS_23PrefixCodeLookupDecoderIS3_EEEEEEvRNS_14BitStreamerMSBEii:
  520|    128|                                   int end_y) {
  521|    128|  auto ht = createPrefixCodeDecoder<Huffman>(huffSelect);
  522|       |
  523|    128|  const Array2DRef<uint16_t> out(mRaw->getU16DataAsUncroppedArray2DRef());
  524|       |
  525|       |  // allow gcc to devirtualize the calls below
  526|    128|  auto* rawdata = reinterpret_cast<RawImageDataU16*>(mRaw.get());
  527|       |
  528|    128|  invariant(out.width() % 2 == 0);
  ------------------
  |  |   27|    128|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (528:3): [True: 128, False: 0]
  ------------------
  529|    128|  invariant(out.width() >= 2);
  ------------------
  |  |   27|    128|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (529:3): [True: 128, False: 0]
  ------------------
  530|  3.39k|  for (int row = start_y; row < end_y; row++) {
  ------------------
  |  Branch (530:27): [True: 3.27k, False: 128]
  ------------------
  531|  3.27k|    std::array<int, 2> pred = pUp[row & 1];
  532|   379k|    for (int col = 0; col < out.width(); col++) {
  ------------------
  |  Branch (532:23): [True: 375k, False: 3.27k]
  ------------------
  533|   375k|      pred[col & 1] += ht.decodeDifference(bits);
  534|   375k|      if (col < 2)
  ------------------
  |  Branch (534:11): [True: 6.52k, False: 369k]
  ------------------
  535|  6.52k|        pUp[row & 1][col & 1] = pred[col & 1];
  536|   375k|      rawdata->setWithLookUp(clampBits(pred[col & 1], 15),
  537|   375k|                             reinterpret_cast<std::byte*>(&out(row, col)),
  538|   375k|                             &random);
  539|   375k|    }
  540|  3.27k|  }
  541|    128|}
NikonDecompressor.cpp:_ZN8rawspeed17NikonDecompressor10decompressINS_12_GLOBAL__N_120NikonLASDecompressorEEEvRNS_14BitStreamerMSBEii:
  520|     49|                                   int end_y) {
  521|     49|  auto ht = createPrefixCodeDecoder<Huffman>(huffSelect);
  522|       |
  523|     49|  const Array2DRef<uint16_t> out(mRaw->getU16DataAsUncroppedArray2DRef());
  524|       |
  525|       |  // allow gcc to devirtualize the calls below
  526|     49|  auto* rawdata = reinterpret_cast<RawImageDataU16*>(mRaw.get());
  527|       |
  528|     49|  invariant(out.width() % 2 == 0);
  ------------------
  |  |   27|     49|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (528:3): [True: 49, False: 0]
  ------------------
  529|     49|  invariant(out.width() >= 2);
  ------------------
  |  |   27|     49|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (529:3): [True: 49, False: 0]
  ------------------
  530|  1.58k|  for (int row = start_y; row < end_y; row++) {
  ------------------
  |  Branch (530:27): [True: 1.53k, False: 49]
  ------------------
  531|  1.53k|    std::array<int, 2> pred = pUp[row & 1];
  532|   455k|    for (int col = 0; col < out.width(); col++) {
  ------------------
  |  Branch (532:23): [True: 454k, False: 1.53k]
  ------------------
  533|   454k|      pred[col & 1] += ht.decodeDifference(bits);
  534|   454k|      if (col < 2)
  ------------------
  |  Branch (534:11): [True: 3.06k, False: 451k]
  ------------------
  535|  3.06k|        pUp[row & 1][col & 1] = pred[col & 1];
  536|   454k|      rawdata->setWithLookUp(clampBits(pred[col & 1], 15),
  537|   454k|                             reinterpret_cast<std::byte*>(&out(row, col)),
  538|   454k|                             &random);
  539|   454k|    }
  540|  1.53k|  }
  541|     49|}
NikonDecompressor.cpp:_ZN8rawspeed17NikonDecompressor23createPrefixCodeDecoderINS_12_GLOBAL__N_120NikonLASDecompressorEEET_j:
  448|     49|Huffman NikonDecompressor::createPrefixCodeDecoder(uint32_t huffSelect) {
  449|     49|  Huffman ht;
  450|     49|  uint32_t count =
  451|     49|      ht.setNCodesPerLength(Buffer(nikon_tree[huffSelect][0].data(), 16));
  452|     49|  ht.setCodeValues(
  453|     49|      Array1DRef<const uint8_t>(nikon_tree[huffSelect][1].data(), count));
  454|     49|  ht.setup(true, false);
  455|     49|  return ht;
  456|     49|}
NikonDecompressor.cpp:_ZN8rawspeed12_GLOBAL__N_120NikonLASDecompressor18setNCodesPerLengthENS_6BufferE:
  289|     49|  uint32_t setNCodesPerLength(Buffer data) {
  290|     49|    uint32_t acc = 0;
  291|    833|    for (uint32_t i = 0; i < 16; i++) {
  ------------------
  |  Branch (291:26): [True: 784, False: 49]
  ------------------
  292|    784|      dctbl1.bits[i + 1] = data[i];
  293|    784|      acc += dctbl1.bits[i + 1];
  294|    784|    }
  295|     49|    dctbl1.bits[0] = 0;
  296|     49|    return acc;
  297|     49|  }
NikonDecompressor.cpp:_ZN8rawspeed12_GLOBAL__N_120NikonLASDecompressor13setCodeValuesENS_10Array1DRefIKhEE:
  299|     49|  void setCodeValues(Array1DRef<const uint8_t> data) {
  300|    755|    for (int i = 0; i < data.size(); i++)
  ------------------
  |  Branch (300:21): [True: 706, False: 49]
  ------------------
  301|    706|      dctbl1.huffval[i] = data(i);
  302|     49|  }
NikonDecompressor.cpp:_ZN8rawspeed12_GLOBAL__N_120NikonLASDecompressor5setupEbb:
  305|     49|             [[maybe_unused]] bool fixDNGBug16_) {
  306|     49|    createPrefixCodeDecoder();
  307|     49|  }
NikonDecompressor.cpp:_ZN8rawspeed12_GLOBAL__N_120NikonLASDecompressor23createPrefixCodeDecoderEv:
  106|     49|  void createPrefixCodeDecoder() {
  107|     49|    int p;
  108|     49|    int i;
  109|     49|    int l;
  110|     49|    int lastp;
  111|     49|    int si;
  112|     49|    std::array<int8_t, 257> huffsize;
  113|     49|    std::array<uint16_t, 257> huffcode;
  114|     49|    uint16_t code;
  115|     49|    int size;
  116|     49|    int value;
  117|     49|    int ll;
  118|     49|    int ul;
  119|       |
  120|       |    /*
  121|       |     * Figure C.1: make table of Huffman code length for each symbol
  122|       |     * Note that this is in code-length order.
  123|       |     */
  124|     49|    p = 0;
  125|    833|    for (l = 1; l <= 16; l++) {
  ------------------
  |  Branch (125:17): [True: 784, False: 49]
  ------------------
  126|  1.49k|      for (i = 1; i <= static_cast<int>(dctbl1.bits[l]); i++) {
  ------------------
  |  Branch (126:19): [True: 706, False: 784]
  ------------------
  127|    706|        huffsize[p] = static_cast<int8_t>(l);
  128|    706|        ++p;
  129|    706|        if (p > 256)
  ------------------
  |  Branch (129:13): [True: 0, False: 706]
  ------------------
  130|    706|          ThrowRDE("LJpegDecoder::createPrefixCodeDecoder: Code length too "
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  131|    706|                   "long. Corrupt data.");
  132|    706|      }
  133|    784|    }
  134|     49|    huffsize[p] = 0;
  135|     49|    lastp = p;
  136|       |
  137|       |    /*
  138|       |     * Figure C.2: generate the codes themselves
  139|       |     * Note that this is in code-length order.
  140|       |     */
  141|     49|    code = 0;
  142|     49|    si = huffsize[0];
  143|     49|    p = 0;
  144|    510|    while (huffsize[p]) {
  ------------------
  |  Branch (144:12): [True: 461, False: 49]
  ------------------
  145|  1.16k|      while ((static_cast<int>(huffsize[p])) == si) {
  ------------------
  |  Branch (145:14): [True: 706, False: 461]
  ------------------
  146|    706|        huffcode[p] = code;
  147|    706|        ++p;
  148|    706|        code++;
  149|    706|      }
  150|    461|      code <<= 1;
  151|    461|      si++;
  152|    461|      if (p > 256)
  ------------------
  |  Branch (152:11): [True: 0, False: 461]
  ------------------
  153|    461|        ThrowRDE(
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  154|    461|            "createPrefixCodeDecoder: Code length too long. Corrupt data.");
  155|    461|    }
  156|       |
  157|       |    /*
  158|       |     * Figure F.15: generate decoding tables
  159|       |     */
  160|     49|    dctbl1.mincode[0] = 0;
  161|     49|    dctbl1.maxcode[0] = 0;
  162|     49|    p = 0;
  163|    833|    for (l = 1; l <= 16; l++) {
  ------------------
  |  Branch (163:17): [True: 784, False: 49]
  ------------------
  164|    784|      if (dctbl1.bits[l]) {
  ------------------
  |  Branch (164:11): [True: 461, False: 323]
  ------------------
  165|    461|        dctbl1.valptr[l] = implicit_cast<int16_t>(p);
  166|    461|        dctbl1.mincode[l] = huffcode[p];
  167|    461|        p += dctbl1.bits[l];
  168|    461|        dctbl1.maxcode[l] = huffcode[p - 1];
  169|    461|      } else {
  170|    323|        dctbl1.valptr[l] =
  171|    323|            0xff; // This check must be present to avoid crash on junk
  172|    323|        dctbl1.maxcode[l] = -1;
  173|    323|      }
  174|    784|      if (p > 256)
  ------------------
  |  Branch (174:11): [True: 0, False: 784]
  ------------------
  175|    784|        ThrowRDE(
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  176|    784|            "createPrefixCodeDecoder: Code length too long. Corrupt data.");
  177|    784|    }
  178|       |
  179|       |    /*
  180|       |     * We put in this value to ensure HuffDecode terminates.
  181|       |     */
  182|     49|    dctbl1.maxcode[17] = 0xFFFFFL;
  183|       |
  184|       |    /*
  185|       |     * Build the numbits, value lookup tables.
  186|       |     * These table allow us to gather 8 bits from the bits stream,
  187|       |     * and immediately lookup the size and value of the huffman codes.
  188|       |     * If size is zero, it means that more than 8 bits are in the huffman
  189|       |     * code (this happens about 3-4% of the time).
  190|       |     */
  191|     49|    dctbl1.numbits.fill(0);
  192|    755|    for (p = 0; p < lastp; p++) {
  ------------------
  |  Branch (192:17): [True: 706, False: 49]
  ------------------
  193|    706|      size = huffsize[p];
  194|    706|      if (size <= 8) {
  ------------------
  |  Branch (194:11): [True: 539, False: 167]
  ------------------
  195|    539|        value = dctbl1.huffval[p];
  196|    539|        code = huffcode[p];
  197|    539|        ll = code << (8 - size);
  198|    539|        if (size < 8) {
  ------------------
  |  Branch (198:13): [True: 490, False: 49]
  ------------------
  199|    490|          ul = ll | bitMask[24 + size];
  200|    490|        } else {
  201|     49|          ul = ll;
  202|     49|        }
  203|    539|        if (ul > 256 || ll > ul)
  ------------------
  |  Branch (203:13): [True: 0, False: 539]
  |  Branch (203:25): [True: 0, False: 539]
  ------------------
  204|    539|          ThrowRDE(
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  205|    539|              "createPrefixCodeDecoder: Code length too long. Corrupt data.");
  206|  13.0k|        for (i = ll; i <= ul; i++) {
  ------------------
  |  Branch (206:22): [True: 12.4k, False: 539]
  ------------------
  207|  12.4k|          dctbl1.numbits[i] = size | (value << 4);
  208|  12.4k|        }
  209|    539|      }
  210|    706|    }
  211|     49|    if (mUseBigtable)
  ------------------
  |  Branch (211:9): [True: 49, False: 0]
  ------------------
  212|     49|      createBigTable();
  213|     49|    dctbl1.initialized = true;
  214|     49|  }
NikonDecompressor.cpp:_ZN8rawspeed12_GLOBAL__N_120NikonLASDecompressor14createBigTableEv:
  228|     49|  void createBigTable() {
  229|     49|    const uint32_t bits =
  230|     49|        14; // HuffDecode functions must be changed, if this is modified.
  231|     49|    const uint32_t size = 1 << bits;
  232|     49|    int rv = 0;
  233|     49|    int temp;
  234|     49|    uint32_t l;
  235|       |
  236|     49|    dctbl1.bigTable.resize(size);
  237|   802k|    for (uint32_t i = 0; i < size; i++) {
  ------------------
  |  Branch (237:26): [True: 802k, False: 49]
  ------------------
  238|   802k|      auto input = implicit_cast<uint16_t>(i << 2); // Calculate input value
  239|   802k|      int code = input >> 8;                        // Get 8 bits
  240|   802k|      uint32_t val = dctbl1.numbits[code];
  241|   802k|      l = val & 15;
  242|   802k|      if (l) {
  ------------------
  |  Branch (242:11): [True: 799k, False: 3.13k]
  ------------------
  243|   799k|        rv = val >> 4;
  244|   799k|      } else {
  245|  3.13k|        l = 8;
  246|  8.16k|        while (code > dctbl1.maxcode[l]) {
  ------------------
  |  Branch (246:16): [True: 5.02k, False: 3.13k]
  ------------------
  247|  5.02k|          temp = extractHighBits(input, l, /*effectiveBitwidth=*/15) & 1;
  248|  5.02k|          code = (code << 1) | temp;
  249|  5.02k|          l++;
  250|  5.02k|        }
  251|       |
  252|       |        /*
  253|       |         * With garbage input we may reach the sentinel value l = 17.
  254|       |         */
  255|       |
  256|  3.13k|        if (l > 16 || dctbl1.valptr[l] == 0xff) {
  ------------------
  |  Branch (256:13): [True: 0, False: 3.13k]
  |  Branch (256:23): [True: 0, False: 3.13k]
  ------------------
  257|      0|          dctbl1.bigTable[i] = 0xff;
  258|      0|          continue;
  259|      0|        }
  260|  3.13k|        rv = dctbl1.huffval[dctbl1.valptr[l] + (code - dctbl1.mincode[l])];
  261|  3.13k|      }
  262|       |
  263|   802k|      if (rv == 16) {
  ------------------
  |  Branch (263:11): [True: 0, False: 802k]
  ------------------
  264|      0|        if (mDNGCompatible)
  ------------------
  |  Branch (264:13): [True: 0, False: 0]
  ------------------
  265|      0|          dctbl1.bigTable[i] = (-(32768 << 8)) | (16 + l);
  266|      0|        else
  267|      0|          dctbl1.bigTable[i] = (-(32768 << 8)) | l;
  268|      0|        continue;
  269|      0|      }
  270|       |
  271|   802k|      if (rv + l > bits) {
  ------------------
  |  Branch (271:11): [True: 522k, False: 280k]
  ------------------
  272|   522k|        dctbl1.bigTable[i] = 0xff;
  273|   522k|        continue;
  274|   522k|      }
  275|       |
  276|   280k|      if (rv) {
  ------------------
  |  Branch (276:11): [True: 278k, False: 2.17k]
  ------------------
  277|   278k|        int x = extractHighBits(input, l + rv) & ((1 << rv) - 1);
  278|   278k|        if ((x & (1 << (rv - 1))) == 0)
  ------------------
  |  Branch (278:13): [True: 139k, False: 139k]
  ------------------
  279|   139k|          x -= (1 << rv) - 1;
  280|   278k|        dctbl1.bigTable[i] =
  281|   278k|            static_cast<int>((static_cast<unsigned>(x) << 8) | (l + rv));
  282|   278k|      } else {
  283|  2.17k|        dctbl1.bigTable[i] = l;
  284|  2.17k|      }
  285|   280k|    }
  286|     49|  }
NikonDecompressor.cpp:_ZN8rawspeed12_GLOBAL__N_120NikonLASDecompressor16decodeDifferenceERNS_14BitStreamerMSBE:
  325|   454k|  int decodeDifference(BitStreamerMSB& bits) {
  326|   454k|    int rv;
  327|   454k|    int l;
  328|   454k|    int temp;
  329|   454k|    int code;
  330|   454k|    unsigned val;
  331|       |
  332|   454k|    bits.fill();
  333|   454k|    code = bits.peekBitsNoFill(14);
  334|   454k|    val = static_cast<unsigned>(dctbl1.bigTable[code]);
  335|   454k|    if ((val & 0xff) != 0xff) {
  ------------------
  |  Branch (335:9): [True: 292k, False: 161k]
  ------------------
  336|   292k|      bits.skipBitsNoFill(val & 0xff);
  337|   292k|      return static_cast<int>(val) >> 8;
  338|   292k|    }
  339|       |
  340|   161k|    rv = 0;
  341|   161k|    code = bits.peekBitsNoFill(8);
  342|   161k|    val = dctbl1.numbits[code];
  343|   161k|    l = val & 15;
  344|   161k|    if (l) {
  ------------------
  |  Branch (344:9): [True: 152k, False: 9.09k]
  ------------------
  345|   152k|      bits.skipBitsNoFill(l);
  346|   152k|      rv = static_cast<int>(val) >> 4;
  347|   152k|    } else {
  348|  9.09k|      bits.skipBitsNoFill(8);
  349|  9.09k|      l = 8;
  350|  36.0k|      while (code > dctbl1.maxcode[l]) {
  ------------------
  |  Branch (350:14): [True: 26.9k, False: 9.09k]
  ------------------
  351|  26.9k|        temp = bits.getBitsNoFill(1);
  352|  26.9k|        code = (code << 1) | temp;
  353|  26.9k|        l++;
  354|  26.9k|      }
  355|       |
  356|  9.09k|      if (l > 16) {
  ------------------
  |  Branch (356:11): [True: 0, False: 9.09k]
  ------------------
  357|      0|        ThrowRDE("Corrupt JPEG data: bad Huffman code:%d\n", l);
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  358|  9.09k|      } else {
  359|  9.09k|        rv = dctbl1.huffval[dctbl1.valptr[l] + (code - dctbl1.mincode[l])];
  360|  9.09k|      }
  361|  9.09k|    }
  362|       |
  363|   161k|    if (rv == 16)
  ------------------
  |  Branch (363:9): [True: 0, False: 161k]
  ------------------
  364|      0|      return -32768;
  365|       |
  366|       |    /*
  367|       |     * Section F.2.2.1: decode the difference and
  368|       |     * Figure F.12: extend sign bit
  369|       |     */
  370|   161k|    uint32_t len = rv & 15;
  371|   161k|    uint32_t shl = rv >> 4;
  372|   161k|    int diff = ((bits.getBits(len - shl) << 1) + 1) << shl >> 1;
  373|   161k|    if ((diff & (1 << (len - 1))) == 0)
  ------------------
  |  Branch (373:9): [True: 89.0k, False: 72.6k]
  ------------------
  374|  89.0k|      diff -= (1 << len) - !shl;
  375|   161k|    return diff;
  376|   161k|  }

_ZN8rawspeed19OlympusDecompressorC2ENS_8RawImageE:
  218|    142|OlympusDecompressor::OlympusDecompressor(RawImage img) : mRaw(std::move(img)) {
  219|    142|  if (mRaw->getCpp() != 1 || mRaw->getDataType() != RawImageType::UINT16 ||
  ------------------
  |  Branch (219:7): [True: 0, False: 142]
  |  Branch (219:30): [True: 0, False: 142]
  ------------------
  220|    142|      mRaw->getBpp() != sizeof(uint16_t))
  ------------------
  |  Branch (220:7): [True: 0, False: 142]
  ------------------
  221|    142|    ThrowRDE("Unexpected component count / data type");
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  222|       |
  223|    142|  if (!mRaw->dim.hasPositiveArea() || mRaw->dim.x % 2 != 0 ||
  ------------------
  |  Branch (223:7): [True: 0, False: 142]
  |  Branch (223:39): [True: 0, False: 142]
  ------------------
  224|    142|      mRaw->dim.y % 2 != 0 || mRaw->dim.x > 10400 || mRaw->dim.y > 7792)
  ------------------
  |  Branch (224:7): [True: 7, False: 135]
  |  Branch (224:31): [True: 0, False: 135]
  |  Branch (224:54): [True: 2, False: 133]
  ------------------
  225|    142|    ThrowRDE("Unexpected image dimensions found: (%d; %d)", mRaw->dim.x,
  ------------------
  |  |   38|      9|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      9|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      9|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      9|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  226|    142|             mRaw->dim.y);
  227|    142|}
_ZNK8rawspeed19OlympusDecompressor10decompressERKNS_10ByteStreamE:
  229|    133|void OlympusDecompressor::decompress(const ByteStream& input) const {
  230|    133|  OlympusDecompressorImpl(mRaw).decompress(input);
  231|    133|}
OlympusDecompressor.cpp:_ZN8rawspeed12_GLOBAL__N_123OlympusDecompressorImplC2ENS_8RawImageE:
  118|    133|  explicit OlympusDecompressorImpl(RawImage img) : mRaw(std::move(img)) {}
OlympusDecompressor.cpp:_ZNK8rawspeed12_GLOBAL__N_123OlympusDecompressorImpl5numLZMUlmjE_clEmj:
  104|   544k|      [](size_t i, [[maybe_unused]] unsigned tableSize) {
  105|   544k|        return 12 - numActiveBits(i);
  106|   544k|      }};
OlympusDecompressor.cpp:_ZNK8rawspeed12_GLOBAL__N_123OlympusDecompressorImpl10decompressENS_10ByteStreamE:
  205|    133|void OlympusDecompressorImpl::decompress(ByteStream input) const {
  206|    133|  invariant(mRaw->dim.y > 0);
  ------------------
  |  |   27|    133|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (206:3): [True: 133, False: 0]
  ------------------
  207|    133|  invariant(mRaw->dim.x > 0);
  ------------------
  |  |   27|    133|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (207:3): [True: 133, False: 0]
  ------------------
  208|    133|  invariant(mRaw->dim.x % 2 == 0);
  ------------------
  |  |   27|    133|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (208:3): [True: 133, False: 0]
  ------------------
  209|       |
  210|    133|  BitStreamerMSB bits(input.peekRemainingBuffer().getAsArray1DRef());
  211|       |
  212|  12.7k|  for (int y = 0; y < mRaw->dim.y; y++)
  ------------------
  |  Branch (212:19): [True: 12.6k, False: 133]
  ------------------
  213|  12.6k|    decompressRow(bits, y);
  214|    133|}
OlympusDecompressor.cpp:_ZNK8rawspeed12_GLOBAL__N_123OlympusDecompressorImpl13decompressRowERNS_14BitStreamerMSBEi:
  185|  12.6k|                                            int row) const {
  186|  12.6k|  const Array2DRef<uint16_t> out(mRaw->getU16DataAsUncroppedArray2DRef());
  187|       |
  188|  12.6k|  invariant(out.width() > 0);
  ------------------
  |  |   27|  12.6k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (188:3): [True: 12.6k, False: 0]
  ------------------
  189|  12.6k|  invariant(out.width() % 2 == 0);
  ------------------
  |  |   27|  12.6k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (189:3): [True: 12.6k, False: 0]
  ------------------
  190|       |
  191|  12.6k|  std::array<OlympusDifferenceDecoder, 2> acarry{numLZ, numLZ};
  192|       |
  193|  12.6k|  const int numGroups = out.width() / 2;
  194|  12.6k|  int group = 0;
  195|  12.6k|  {
  196|       |    // Process first group separately, allows to unswitch predictor calculation.
  197|  12.6k|    decompressGroup(acarry, bits, row, group);
  198|  12.6k|    ++group;
  199|  12.6k|  }
  200|   728k|  for (; group != numGroups; ++group) {
  ------------------
  |  Branch (200:10): [True: 716k, False: 12.6k]
  ------------------
  201|   716k|    decompressGroup(acarry, bits, row, group);
  202|   716k|  }
  203|  12.6k|}
OlympusDecompressor.cpp:_ZN8rawspeed12_GLOBAL__N_124OlympusDifferenceDecoderC2ERKNS_9SimpleLUTIaLi12EEE:
   56|  25.2k|      : numLZ(numLZ_) {}
OlympusDecompressor.cpp:_ZNK8rawspeed12_GLOBAL__N_123OlympusDecompressorImpl15decompressGroupERNSt3__15arrayINS0_24OlympusDifferenceDecoderELm2EEERNS_14BitStreamerMSBEii:
  170|   728k|    int row, int group) const {
  171|   728k|  const Array2DRef<uint16_t> out(mRaw->getU16DataAsUncroppedArray2DRef());
  172|       |
  173|  2.18M|  for (int c = 0; c != 2; ++c) {
  ------------------
  |  Branch (173:19): [True: 1.45M, False: 728k]
  ------------------
  174|  1.45M|    const int col = (2 * group) + c;
  175|  1.45M|    OlympusDifferenceDecoder& carry = acarry[c];
  176|       |
  177|  1.45M|    int diff = carry.getDiff(bits);
  178|  1.45M|    int pred = getPred(out, row, col);
  179|       |
  180|  1.45M|    out(row, col) = implicit_cast<uint16_t>(pred + diff);
  181|  1.45M|  }
  182|   728k|}
OlympusDecompressor.cpp:_ZN8rawspeed12_GLOBAL__N_124OlympusDifferenceDecoder7getDiffERNS_14BitStreamerMSBE:
   62|  1.45M|OlympusDifferenceDecoder::getDiff(BitStreamerMSB& bits) {
   63|  1.45M|  bits.fill();
   64|       |
   65|  1.45M|  int numLowBitsBias = (carry[2] < 3) ? 2 : 0;
  ------------------
  |  Branch (65:24): [True: 996k, False: 460k]
  ------------------
   66|  1.45M|  int numLowBits = numActiveBits(implicit_cast<uint16_t>(carry[0]));
   67|  1.45M|  numLowBits -= numLowBitsBias;
   68|  1.45M|  numLowBits = std::max(numLowBits, 2 + numLowBitsBias);
   69|  1.45M|  assert(numLowBits >= 2);
  ------------------
  |  Branch (69:3): [True: 1.45M, False: 129]
  ------------------
   70|  1.45M|  assert(numLowBits <= 14);
  ------------------
  |  Branch (70:3): [True: 1.45M, False: 0]
  ------------------
   71|       |
   72|  1.45M|  int b = bits.peekBitsNoFill(15);
   73|  1.45M|  int sign = (b >> 14) * -1;
   74|  1.45M|  int low = (b >> 12) & 3;
   75|  1.45M|  int numLeadingZeros = numLZ[b & 4095];
   76|       |
   77|  1.45M|  int highBits;
   78|       |  // Skip bytes used above or read bits
   79|  1.45M|  if (numLeadingZeros != 12) [[likely]] { // Happens in 99.9% of cases.
  ------------------
  |  Branch (79:7): [True: 1.35M, False: 102k]
  ------------------
   80|  1.35M|    bits.skipBitsNoFill(numLeadingZeros + 1 + 3);
   81|  1.35M|    highBits = numLeadingZeros;
   82|  1.35M|  } else {
   83|   102k|    bits.skipBitsNoFill(15);
   84|   102k|    int numHighBits = 15 - numLowBits;
   85|   102k|    assert(numHighBits >= 1);
  ------------------
  |  Branch (85:5): [True: 102k, False: 0]
  ------------------
   86|   102k|    assert(numHighBits <= 13);
  ------------------
  |  Branch (86:5): [True: 102k, False: 0]
  ------------------
   87|   102k|    highBits = bits.peekBitsNoFill(numHighBits);
   88|   102k|    bits.skipBitsNoFill(1 + numHighBits);
   89|   102k|  }
   90|       |
   91|  1.45M|  carry[0] = (highBits << numLowBits) | bits.getBitsNoFill(numLowBits);
   92|  1.45M|  int diff = (carry[0] ^ sign) + carry[1];
   93|  1.45M|  carry[1] = (diff * 3 + carry[1]) >> 5;
   94|  1.45M|  carry[2] = carry[0] > 16 ? 0 : carry[2] + 1;
  ------------------
  |  Branch (94:14): [True: 641k, False: 815k]
  ------------------
   95|       |
   96|  1.45M|  return (diff * 4) | low;
   97|  1.45M|}
OlympusDecompressor.cpp:_ZN8rawspeed12_GLOBAL__N_123OlympusDecompressorImpl7getPredENS_10Array2DRefItEEii:
  132|  1.45M|                                 int col) {
  133|  1.45M|  auto getLeft = [&]() { return out(row, col - 2); };
  134|  1.45M|  auto getUp = [&]() { return out(row - 2, col); };
  135|  1.45M|  auto getLeftUp = [&]() { return out(row - 2, col - 2); };
  136|       |
  137|  1.45M|  int pred;
  138|  1.45M|  if (row < 2 && col < 2)
  ------------------
  |  Branch (138:7): [True: 93.2k, False: 1.36M]
  |  Branch (138:18): [True: 467, False: 92.8k]
  ------------------
  139|    467|    pred = 0;
  140|  1.45M|  else if (row < 2)
  ------------------
  |  Branch (140:12): [True: 92.8k, False: 1.36M]
  ------------------
  141|  92.8k|    pred = getLeft();
  142|  1.36M|  else if (col < 2)
  ------------------
  |  Branch (142:12): [True: 24.6k, False: 1.33M]
  ------------------
  143|  24.6k|    pred = getUp();
  144|  1.33M|  else {
  145|  1.33M|    int left = getLeft();
  146|  1.33M|    int up = getUp();
  147|  1.33M|    int leftUp = getLeftUp();
  148|       |
  149|  1.33M|    int leftMinusNw = left - leftUp;
  150|  1.33M|    int upMinusNw = up - leftUp;
  151|       |
  152|       |    // Check if sign is different, and they are both not zero
  153|  1.33M|    if ((std::signbit(leftMinusNw) != std::signbit(upMinusNw)) &&
  ------------------
  |  Branch (153:9): [True: 641k, False: 698k]
  ------------------
  154|   641k|        (leftMinusNw != 0 && upMinusNw != 0)) {
  ------------------
  |  Branch (154:10): [True: 622k, False: 18.3k]
  |  Branch (154:30): [True: 619k, False: 3.01k]
  ------------------
  155|   619k|      if (std::abs(leftMinusNw) > 32 || std::abs(upMinusNw) > 32)
  ------------------
  |  Branch (155:11): [True: 471k, False: 148k]
  |  Branch (155:41): [True: 142k, False: 5.44k]
  ------------------
  156|   614k|        pred = left + upMinusNw;
  157|  5.44k|      else
  158|  5.44k|        pred = (left + up) >> 1;
  159|   719k|    } else {
  160|   719k|      pred = std::abs(leftMinusNw) > std::abs(upMinusNw) ? left : up;
  ------------------
  |  Branch (160:14): [True: 128k, False: 590k]
  ------------------
  161|   719k|    }
  162|  1.33M|  }
  163|       |
  164|  1.45M|  return pred;
  165|  1.45M|}
OlympusDecompressor.cpp:_ZZN8rawspeed12_GLOBAL__N_123OlympusDecompressorImpl7getPredENS_10Array2DRefItEEiiENKUlvE_clEv:
  133|  1.43M|  auto getLeft = [&]() { return out(row, col - 2); };
OlympusDecompressor.cpp:_ZZN8rawspeed12_GLOBAL__N_123OlympusDecompressorImpl7getPredENS_10Array2DRefItEEiiENKUlvE0_clEv:
  134|  1.36M|  auto getUp = [&]() { return out(row - 2, col); };
OlympusDecompressor.cpp:_ZZN8rawspeed12_GLOBAL__N_123OlympusDecompressorImpl7getPredENS_10Array2DRefItEEiiENKUlvE1_clEv:
  135|  1.33M|  auto getLeftUp = [&]() { return out(row - 2, col - 2); };

_ZN8rawspeed23PanasonicV4DecompressorC2ENS_8RawImageENS_10ByteStreamEbj:
   53|    183|    : mRaw(std::move(img)), zero_is_bad(!zero_is_not_bad),
   54|    183|      section_split_offset(section_split_offset_) {
   55|    183|  if (mRaw->getCpp() != 1 || mRaw->getDataType() != RawImageType::UINT16 ||
  ------------------
  |  Branch (55:7): [True: 0, False: 183]
  |  Branch (55:30): [True: 0, False: 183]
  ------------------
   56|    183|      mRaw->getBpp() != sizeof(uint16_t))
  ------------------
  |  Branch (56:7): [True: 0, False: 183]
  ------------------
   57|    183|    ThrowRDE("Unexpected component count / data type");
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   58|       |
   59|    183|  if (!mRaw->dim.hasPositiveArea() || mRaw->dim.x % PixelsPerPacket != 0) {
  ------------------
  |  Branch (59:7): [True: 2, False: 181]
  |  Branch (59:39): [True: 8, False: 173]
  ------------------
   60|     10|    ThrowRDE("Unexpected image dimensions found: (%i; %i)", mRaw->dim.x,
  ------------------
  |  |   38|     10|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     10|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     10|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     10|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   61|     10|             mRaw->dim.y);
   62|     10|  }
   63|       |
   64|    173|  if (BlockSize < section_split_offset)
  ------------------
  |  Branch (64:7): [True: 0, False: 173]
  ------------------
   65|    173|    ThrowRDE("Bad section_split_offset: %u, less than BlockSize (%u)",
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   66|    173|             section_split_offset, BlockSize);
   67|       |
   68|       |  // Naive count of bytes that given pixel count requires.
   69|    173|  invariant(mRaw->dim.area() % PixelsPerPacket == 0);
  ------------------
  |  |   27|    173|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (69:3): [True: 173, False: 0]
  ------------------
   70|    173|  const auto bytesTotal = (mRaw->dim.area() / PixelsPerPacket) * BytesPerPacket;
   71|    173|  invariant(bytesTotal > 0);
  ------------------
  |  |   27|    173|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (71:3): [True: 173, False: 0]
  ------------------
   72|       |
   73|       |  // If section_split_offset is zero, then that we need to read the normal
   74|       |  // amount of bytes. But if it is not, then we need to round up to multiple of
   75|       |  // BlockSize, because of splitting&rotation of each BlockSize's slice in half
   76|       |  // at section_split_offset bytes.
   77|    173|  const auto bufSize =
   78|    173|      section_split_offset == 0 ? bytesTotal : roundUp(bytesTotal, BlockSize);
  ------------------
  |  Branch (78:7): [True: 144, False: 29]
  ------------------
   79|       |
   80|    173|  if (bufSize > std::numeric_limits<ByteStream::size_type>::max())
  ------------------
  |  Branch (80:7): [True: 1, False: 172]
  ------------------
   81|    173|    ThrowRDE("Raw dimensions require input buffer larger than supported");
  ------------------
  |  |   38|      1|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      1|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      1|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      1|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   82|       |
   83|    172|  input = input_.peekStream(implicit_cast<Buffer::size_type>(bufSize));
   84|       |
   85|    172|  chopInputIntoBlocks();
   86|    172|}
_ZN8rawspeed23PanasonicV4Decompressor19chopInputIntoBlocksEv:
   88|    151|void PanasonicV4Decompressor::chopInputIntoBlocks() {
   89|    151|  auto pixelToCoordinate = [width = mRaw->dim.x](unsigned pixel) {
   90|    151|    return iPoint2D(pixel % width, pixel / width);
   91|    151|  };
   92|       |
   93|       |  // If section_split_offset == 0, last block may not be full.
   94|    151|  const auto blocksTotal =
   95|    151|      roundUpDivisionSafe(input.getRemainSize(), BlockSize);
   96|    151|  invariant(blocksTotal > 0);
  ------------------
  |  |   27|    151|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (96:3): [True: 151, False: 0]
  ------------------
   97|    151|  invariant(blocksTotal * PixelsPerBlock >= mRaw->dim.area());
  ------------------
  |  |   27|    151|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (97:3): [True: 151, False: 0]
  ------------------
   98|    151|  assert(blocksTotal <= std::numeric_limits<uint32_t>::max());
  ------------------
  |  Branch (98:3): [True: 151, False: 0]
  ------------------
   99|    151|  assert(blocksTotal <= std::numeric_limits<size_t>::max());
  ------------------
  |  Branch (99:3): [True: 151, False: 0]
  ------------------
  100|    151|  blocks.reserve(implicit_cast<size_t>(blocksTotal));
  101|       |
  102|    151|  unsigned currPixel = 0;
  103|    151|  std::generate_n(
  104|    151|      std::back_inserter(blocks), blocksTotal, [&, pixelToCoordinate]() {
  105|    151|        invariant(input.getRemainSize() != 0);
  106|    151|        const auto blockSize = std::min(input.getRemainSize(), BlockSize);
  107|    151|        invariant(blockSize > 0);
  108|    151|        invariant(blockSize % BytesPerPacket == 0);
  109|    151|        const auto packets = blockSize / BytesPerPacket;
  110|    151|        invariant(packets > 0);
  111|    151|        const auto pixels = packets * PixelsPerPacket;
  112|    151|        invariant(pixels > 0);
  113|       |
  114|    151|        ByteStream bs = input.getStream(blockSize);
  115|    151|        iPoint2D beginCoord = pixelToCoordinate(currPixel);
  116|    151|        currPixel += pixels;
  117|    151|        iPoint2D endCoord = pixelToCoordinate(currPixel);
  118|    151|        return Block(bs, beginCoord, endCoord);
  119|    151|      });
  120|    151|  assert(blocks.size() == blocksTotal);
  ------------------
  |  Branch (120:3): [True: 151, False: 0]
  ------------------
  121|    151|  assert(currPixel >= mRaw->dim.area());
  ------------------
  |  Branch (121:3): [True: 151, False: 0]
  ------------------
  122|    151|  assert(input.getRemainSize() == 0);
  ------------------
  |  Branch (122:3): [True: 151, False: 0]
  ------------------
  123|       |
  124|       |  // Clamp the end coordinate for the last block.
  125|    151|  blocks.back().endCoord = mRaw->dim;
  126|    151|  blocks.back().endCoord.y -= 1;
  127|    151|}
PanasonicV4Decompressor.cpp:_ZZN8rawspeed23PanasonicV4Decompressor19chopInputIntoBlocksEvENK3$_0clEv:
  104|  1.05k|      std::back_inserter(blocks), blocksTotal, [&, pixelToCoordinate]() {
  105|  1.05k|        invariant(input.getRemainSize() != 0);
  ------------------
  |  |   27|  1.05k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (105:9): [True: 1.05k, False: 0]
  ------------------
  106|  1.05k|        const auto blockSize = std::min(input.getRemainSize(), BlockSize);
  107|  1.05k|        invariant(blockSize > 0);
  ------------------
  |  |   27|  1.05k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (107:9): [True: 1.05k, False: 0]
  ------------------
  108|  1.05k|        invariant(blockSize % BytesPerPacket == 0);
  ------------------
  |  |   27|  1.05k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (108:9): [True: 1.05k, False: 0]
  ------------------
  109|  1.05k|        const auto packets = blockSize / BytesPerPacket;
  110|  1.05k|        invariant(packets > 0);
  ------------------
  |  |   27|  1.05k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (110:9): [True: 1.05k, False: 0]
  ------------------
  111|  1.05k|        const auto pixels = packets * PixelsPerPacket;
  112|  1.05k|        invariant(pixels > 0);
  ------------------
  |  |   27|  1.05k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (112:9): [True: 1.05k, False: 0]
  ------------------
  113|       |
  114|  1.05k|        ByteStream bs = input.getStream(blockSize);
  115|  1.05k|        iPoint2D beginCoord = pixelToCoordinate(currPixel);
  116|  1.05k|        currPixel += pixels;
  117|  1.05k|        iPoint2D endCoord = pixelToCoordinate(currPixel);
  118|  1.05k|        return Block(bs, beginCoord, endCoord);
  119|  1.05k|      });
PanasonicV4Decompressor.cpp:_ZZN8rawspeed23PanasonicV4Decompressor19chopInputIntoBlocksEvENK3$_1clEj:
   89|  2.10k|  auto pixelToCoordinate = [width = mRaw->dim.x](unsigned pixel) {
   90|  2.10k|    return iPoint2D(pixel % width, pixel / width);
   91|  2.10k|  };
_ZNK8rawspeed23PanasonicV4Decompressor12processBlockERKNS0_5BlockEPNSt3__16vectorIjNS4_9allocatorIjEEEE:
  221|  1.03k|    const Block& block, std::vector<uint32_t>* zero_pos) const noexcept {
  222|  1.03k|  ProxyStream bits(block.bs, section_split_offset);
  223|       |
  224|   689k|  for (int row = block.beginCoord.y; row <= block.endCoord.y; row++) {
  ------------------
  |  Branch (224:38): [True: 687k, False: 1.50k]
  ------------------
  225|   687k|    int col = 0;
  226|       |    // First row may not begin at the first column.
  227|   687k|    if (block.beginCoord.y == row)
  ------------------
  |  Branch (227:9): [True: 1.03k, False: 686k]
  ------------------
  228|  1.03k|      col = block.beginCoord.x;
  229|       |
  230|   687k|    int endCol = mRaw->dim.x;
  231|       |    // Last row may end before the last column.
  232|   687k|    if (block.endCoord.y == row)
  ------------------
  |  Branch (232:9): [True: 1.04k, False: 686k]
  ------------------
  233|  1.04k|      endCol = block.endCoord.x;
  234|       |
  235|   687k|    invariant(col % PixelsPerPacket == 0);
  ------------------
  |  |   27|   687k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (235:5): [True: 688k, False: 18.4E]
  ------------------
  236|   688k|    invariant(endCol % PixelsPerPacket == 0);
  ------------------
  |  |   27|   688k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (236:5): [True: 688k, False: 18.4E]
  ------------------
  237|       |
  238|  1.59M|    for (; col < endCol; col += PixelsPerPacket)
  ------------------
  |  Branch (238:12): [True: 908k, False: 688k]
  ------------------
  239|   908k|      processPixelPacket(bits, row, col, zero_pos);
  240|   688k|  }
  241|  1.03k|}
_ZN8rawspeed23PanasonicV4Decompressor11ProxyStreamC2ENS_10ByteStreamEi:
  162|  1.04k|      : block(block_), section_split_offset(section_split_offset_) {
  163|  1.04k|    parseBlock();
  164|  1.04k|  }
_ZN8rawspeed23PanasonicV4Decompressor11ProxyStream10parseBlockEv:
  136|  1.02k|  void parseBlock() {
  137|  1.02k|    assert(buf.empty());
  ------------------
  |  Branch (137:5): [True: 1.03k, False: 18.4E]
  ------------------
  138|  1.03k|    invariant(block.getRemainSize() <= BlockSize);
  ------------------
  |  |   27|  1.03k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (138:5): [True: 1.03k, False: 2]
  ------------------
  139|  1.03k|    invariant(section_split_offset <= BlockSize);
  ------------------
  |  |   27|  1.03k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (139:5): [True: 1.03k, False: 0]
  ------------------
  140|       |
  141|  1.03k|    Buffer FirstSection = block.getBuffer(section_split_offset);
  142|  1.03k|    Buffer SecondSection = block.getBuffer(block.getRemainSize());
  143|       |
  144|       |    // get one more byte, so the return statement of getBits does not have
  145|       |    // to special case for accessing the last byte
  146|  1.03k|    buf.reserve(BlockSize + 1UL);
  147|       |
  148|       |    // First copy the second section. This makes it the first section.
  149|  1.03k|    buf.insert(buf.end(), SecondSection.begin(), SecondSection.end());
  150|       |    // Now append the original 1'st section right after the new 1'st section.
  151|  1.03k|    buf.insert(buf.end(), FirstSection.begin(), FirstSection.end());
  152|       |
  153|  1.03k|    invariant(block.getRemainSize() == 0);
  ------------------
  |  |   27|  1.03k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (153:5): [True: 1.04k, False: 18.4E]
  ------------------
  154|       |
  155|       |    // get one more byte, so the return statement of getBits does not have
  156|       |    // to special case for accessing the last byte
  157|  1.04k|    buf.emplace_back(0);
  158|  1.04k|  }
_ZNK8rawspeed23PanasonicV4Decompressor18processPixelPacketERNS0_11ProxyStreamEiiPNSt3__16vectorIjNS3_9allocatorIjEEEE:
  175|   908k|    std::vector<uint32_t>* zero_pos) const noexcept {
  176|   908k|  const Array2DRef<uint16_t> out(mRaw->getU16DataAsUncroppedArray2DRef());
  177|       |
  178|   908k|  int sh = 0;
  179|       |
  180|   908k|  std::array<int, 2> pred;
  181|   908k|  pred.fill(0);
  182|       |
  183|   908k|  std::array<int, 2> nonz;
  184|   908k|  nonz.fill(0);
  185|       |
  186|   908k|  int u = 0;
  187|       |
  188|  9.62M|  for (int p = 0; p < PixelsPerPacket; ++p, ++col) {
  ------------------
  |  Branch (188:19): [True: 8.71M, False: 908k]
  ------------------
  189|  8.71M|    const int c = p & 1;
  190|       |
  191|       |    // FIXME: this is actually just `p % 3 == 2`, cleanup after perf is good.
  192|  8.71M|    if (u == 2) {
  ------------------
  |  Branch (192:9): [True: 3.21M, False: 5.50M]
  ------------------
  193|  3.21M|      sh = extractHighBits(4U, bits.getBits(2), /*effectiveBitwidth=*/3);
  194|  3.21M|      u = -1;
  195|  3.21M|    }
  196|       |
  197|  8.71M|    if (nonz[c]) {
  ------------------
  |  Branch (197:9): [True: 3.35M, False: 5.36M]
  ------------------
  198|  3.35M|      int j = bits.getBits(8);
  199|  3.35M|      if (j) {
  ------------------
  |  Branch (199:11): [True: 2.95M, False: 397k]
  ------------------
  200|  2.95M|        pred[c] -= 0x80 << sh;
  201|  2.95M|        if (pred[c] < 0 || sh == 4)
  ------------------
  |  Branch (201:13): [True: 463k, False: 2.49M]
  |  Branch (201:28): [True: 1.08M, False: 1.40M]
  ------------------
  202|  1.79M|          pred[c] &= ~(-(1 << sh));
  203|  2.95M|        pred[c] += j << sh;
  204|  2.95M|      }
  205|  5.36M|    } else {
  206|  5.36M|      nonz[c] = bits.getBits(8);
  207|  6.11M|      if (nonz[c] || p > 11)
  ------------------
  |  Branch (207:11): [True: 18.4E, False: 6.11M]
  |  Branch (207:22): [True: 605k, False: 5.50M]
  ------------------
  208|  1.76M|        pred[c] = nonz[c] << 4 | bits.getBits(4);
  209|  5.36M|    }
  210|       |
  211|  8.71M|    out(row, col) = implicit_cast<uint16_t>(pred[c]);
  212|       |
  213|  8.71M|    if (zero_is_bad && 0 == pred[c])
  ------------------
  |  Branch (213:9): [True: 8.47M, False: 242k]
  |  Branch (213:24): [True: 5.86M, False: 2.61M]
  ------------------
  214|  5.86M|      zero_pos->push_back((row << 16) | col);
  215|       |
  216|  8.71M|    u++;
  217|  8.71M|  }
  218|   908k|}
_ZN8rawspeed23PanasonicV4Decompressor11ProxyStream7getBitsEi:
  166|  11.6M|  uint32_t getBits(int nbits) noexcept {
  167|  11.6M|    vbits = (vbits - nbits) & 0x1ffff;
  168|  11.6M|    int byte = vbits >> 3 ^ 0x3ff0;
  169|  11.6M|    return (buf[byte] | buf[byte + 1UL] << 8) >> (vbits & 7) & ~(-(1 << nbits));
  170|  11.6M|  }
_ZNK8rawspeed23PanasonicV4Decompressor16decompressThreadEv:
  243|  10.5k|void PanasonicV4Decompressor::decompressThread() const noexcept {
  244|  10.5k|  std::vector<uint32_t> zero_pos;
  245|       |
  246|  10.5k|  assert(!blocks.empty());
  ------------------
  |  Branch (246:3): [True: 4.78k, False: 5.72k]
  ------------------
  247|       |
  248|  4.78k|#ifdef HAVE_OPENMP
  249|  4.78k|#pragma omp for schedule(static)
  250|  4.78k|#endif
  251|  4.78k|  for (const auto& block :
  252|  4.78k|       Array1DRef(blocks.data(), implicit_cast<int>(blocks.size()))) {
  253|  4.78k|    try {
  254|  4.78k|      processBlock(block, &zero_pos);
  255|  4.78k|    } catch (...) {
  256|       |      // We should not get any exceptions here.
  257|  4.78k|      __builtin_unreachable();
  258|  4.78k|    }
  259|  4.78k|  }
  260|       |
  261|  4.78k|  if (zero_is_bad && !zero_pos.empty()) {
  ------------------
  |  Branch (261:7): [True: 4.70k, False: 82]
  |  Branch (261:22): [True: 789, False: 3.91k]
  ------------------
  262|    789|    MutexLocker guard(&mRaw->mBadPixelMutex);
  263|    789|    mRaw->mBadPixelPositions.insert(mRaw->mBadPixelPositions.end(),
  264|    789|                                    zero_pos.begin(), zero_pos.end());
  265|    789|  }
  266|  4.78k|}
_ZNK8rawspeed23PanasonicV4Decompressor10decompressEv:
  268|    151|void PanasonicV4Decompressor::decompress() const noexcept {
  269|    151|  assert(!blocks.empty());
  ------------------
  |  Branch (269:3): [True: 151, False: 0]
  ------------------
  270|    151|#ifdef HAVE_OPENMP
  271|    151|#pragma omp parallel default(none)                                             \
  272|    151|    num_threads(rawspeed_get_number_of_processor_cores())
  273|    151|#endif
  274|    151|  decompressThread();
  275|    151|}
PanasonicV4Decompressor.cpp:_ZNK8rawspeed23PanasonicV4Decompressor10decompressEv.omp_outlined_debug__:
  274|  4.75k|  decompressThread();

_ZN8rawspeed23PanasonicV4Decompressor5BlockC2ENS_10ByteStreamENS_8iPoint2DES3_:
   66|  1.05k|        : bs(bs_), beginCoord(beginCoord_), endCoord(endCoord_) {}

_ZN8rawspeed23PanasonicV5DecompressorC2ENS_8RawImageENS_10ByteStreamEj:
   73|    116|    : mRaw(std::move(img)), bps(bps_) {
   74|    116|  if (mRaw->getCpp() != 1 || mRaw->getDataType() != RawImageType::UINT16 ||
  ------------------
  |  Branch (74:7): [True: 0, False: 116]
  |  Branch (74:30): [True: 0, False: 116]
  ------------------
   75|    116|      mRaw->getBpp() != sizeof(uint16_t))
  ------------------
  |  Branch (75:7): [True: 0, False: 116]
  ------------------
   76|    116|    ThrowRDE("Unexpected component count / data type");
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   77|       |
   78|    116|  const PacketDsc* dsc = nullptr;
   79|    116|  switch (bps) {
   80|     72|  case 12:
  ------------------
  |  Branch (80:3): [True: 72, False: 44]
  ------------------
   81|     72|    dsc = &TwelveBitPacket;
   82|     72|    break;
   83|     43|  case 14:
  ------------------
  |  Branch (83:3): [True: 43, False: 73]
  ------------------
   84|     43|    dsc = &FourteenBitPacket;
   85|     43|    break;
   86|      1|  default:
  ------------------
  |  Branch (86:3): [True: 1, False: 115]
  ------------------
   87|      1|    ThrowRDE("Unsupported bps: %u", bps);
  ------------------
  |  |   38|      1|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      1|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      1|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      1|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   88|    116|  }
   89|       |
   90|    115|  if (!mRaw->dim.hasPositiveArea() || mRaw->dim.x % dsc->pixelsPerPacket != 0) {
  ------------------
  |  Branch (90:7): [True: 2, False: 113]
  |  Branch (90:39): [True: 7, False: 106]
  ------------------
   91|      9|    ThrowRDE("Unexpected image dimensions found: (%i; %i)", mRaw->dim.x,
  ------------------
  |  |   38|      9|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      9|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      9|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      9|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   92|      9|             mRaw->dim.y);
   93|      9|  }
   94|       |
   95|       |  // How many pixel packets does the specified pixel count require?
   96|    106|  invariant(mRaw->dim.area() % dsc->pixelsPerPacket == 0);
  ------------------
  |  |   27|    106|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (96:3): [True: 106, False: 0]
  ------------------
   97|    106|  const auto numPackets = mRaw->dim.area() / dsc->pixelsPerPacket;
   98|    106|  invariant(numPackets > 0);
  ------------------
  |  |   27|    106|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (98:3): [True: 106, False: 0]
  ------------------
   99|       |
  100|       |  // And how many blocks that would be? Last block may not be full, pad it.
  101|    106|  numBlocks = roundUpDivisionSafe(numPackets, PacketsPerBlock);
  102|    106|  invariant(numBlocks > 0);
  ------------------
  |  |   27|    106|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (102:3): [True: 106, False: 0]
  ------------------
  103|       |
  104|       |  // Does the input contain enough blocks?
  105|       |  // How many full blocks does the input contain? This is truncating division.
  106|    106|  if (const auto haveBlocks = input_.getRemainSize() / BlockSize;
  107|    106|      haveBlocks < numBlocks)
  ------------------
  |  Branch (107:7): [True: 28, False: 78]
  ------------------
  108|    106|    ThrowRDE("Insufficient count of input blocks for a given image");
  ------------------
  |  |   38|     28|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     28|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     28|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     28|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  109|       |
  110|       |  // We only want those blocks we need, no extras.
  111|     78|  input =
  112|     78|      input_.peekStream(implicit_cast<Buffer::size_type>(numBlocks), BlockSize);
  113|       |
  114|     78|  chopInputIntoBlocks(*dsc);
  115|     78|}
_ZN8rawspeed23PanasonicV5Decompressor19chopInputIntoBlocksERKNS0_9PacketDscE:
  117|     78|void PanasonicV5Decompressor::chopInputIntoBlocks(const PacketDsc& dsc) {
  118|     78|  auto pixelToCoordinate = [width = mRaw->dim.x](unsigned pixel) {
  119|     78|    return iPoint2D(pixel % width, pixel / width);
  120|     78|  };
  121|       |
  122|     78|  invariant(numBlocks * BlockSize == input.getRemainSize());
  ------------------
  |  |   27|     78|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (122:3): [True: 78, False: 0]
  ------------------
  123|     78|  assert(numBlocks <= std::numeric_limits<uint32_t>::max());
  ------------------
  |  Branch (123:3): [True: 78, False: 0]
  ------------------
  124|     78|  assert(numBlocks <= std::numeric_limits<size_t>::max());
  ------------------
  |  Branch (124:3): [True: 78, False: 0]
  ------------------
  125|     78|  blocks.reserve(implicit_cast<size_t>(numBlocks));
  126|       |
  127|     78|  const auto pixelsPerBlock = dsc.pixelsPerPacket * PacketsPerBlock;
  128|     78|  invariant((numBlocks - 1U) * pixelsPerBlock < mRaw->dim.area());
  ------------------
  |  |   27|     78|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (128:3): [True: 78, False: 0]
  ------------------
  129|     78|  invariant(numBlocks * pixelsPerBlock >= mRaw->dim.area());
  ------------------
  |  |   27|     78|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (129:3): [True: 78, False: 0]
  ------------------
  130|       |
  131|     78|  unsigned currPixel = 0;
  132|     78|  std::generate_n(std::back_inserter(blocks), numBlocks,
  133|     78|                  [&, pixelToCoordinate, pixelsPerBlock]() {
  134|     78|                    ByteStream bs = input.getStream(BlockSize);
  135|     78|                    iPoint2D beginCoord = pixelToCoordinate(currPixel);
  136|     78|                    currPixel += pixelsPerBlock;
  137|     78|                    iPoint2D endCoord = pixelToCoordinate(currPixel);
  138|     78|                    return Block(bs, beginCoord, endCoord);
  139|     78|                  });
  140|     78|  assert(blocks.size() == numBlocks);
  ------------------
  |  Branch (140:3): [True: 78, False: 0]
  ------------------
  141|     78|  invariant(currPixel >= mRaw->dim.area());
  ------------------
  |  |   27|     78|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (141:3): [True: 78, False: 0]
  ------------------
  142|     78|  invariant(input.getRemainSize() == 0);
  ------------------
  |  |   27|     78|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (142:3): [True: 78, False: 0]
  ------------------
  143|       |
  144|       |  // Clamp the end coordinate for the last block.
  145|     78|  blocks.back().endCoord = mRaw->dim;
  146|     78|  blocks.back().endCoord.y -= 1;
  147|     78|}
PanasonicV5Decompressor.cpp:_ZZN8rawspeed23PanasonicV5Decompressor19chopInputIntoBlocksERKNS0_9PacketDscEENK3$_0clEv:
  133|    674|                  [&, pixelToCoordinate, pixelsPerBlock]() {
  134|    674|                    ByteStream bs = input.getStream(BlockSize);
  135|    674|                    iPoint2D beginCoord = pixelToCoordinate(currPixel);
  136|    674|                    currPixel += pixelsPerBlock;
  137|    674|                    iPoint2D endCoord = pixelToCoordinate(currPixel);
  138|    674|                    return Block(bs, beginCoord, endCoord);
  139|    674|                  });
PanasonicV5Decompressor.cpp:_ZZN8rawspeed23PanasonicV5Decompressor19chopInputIntoBlocksERKNS0_9PacketDscEENK3$_1clEj:
  118|  1.34k|  auto pixelToCoordinate = [width = mRaw->dim.x](unsigned pixel) {
  119|  1.34k|    return iPoint2D(pixel % width, pixel / width);
  120|  1.34k|  };
_ZNK8rawspeed23PanasonicV5Decompressor10decompressEv:
  253|     78|void PanasonicV5Decompressor::decompress() const noexcept {
  254|     78|  switch (bps) {
  255|     41|  case 12:
  ------------------
  |  Branch (255:3): [True: 41, False: 37]
  ------------------
  256|     41|    decompressInternal<TwelveBitPacket>();
  257|     41|    break;
  258|     37|  case 14:
  ------------------
  |  Branch (258:3): [True: 37, False: 41]
  ------------------
  259|     37|    decompressInternal<FourteenBitPacket>();
  260|     37|    break;
  261|      0|  default:
  ------------------
  |  Branch (261:3): [True: 0, False: 78]
  ------------------
  262|      0|    __builtin_unreachable();
  263|     78|  }
  264|     78|}
_ZNK8rawspeed23PanasonicV5Decompressor18decompressInternalIL_ZNS0_15TwelveBitPacketEEEEvv:
  237|     41|void PanasonicV5Decompressor::decompressInternal() const noexcept {
  238|     41|#ifdef HAVE_OPENMP
  239|     41|#pragma omp parallel for num_threads(rawspeed_get_number_of_processor_cores()) \
  240|     41|    schedule(static) default(none)
  241|     41|#endif
  242|     41|  for (const auto& block :
  243|     41|       Array1DRef(blocks.data(), implicit_cast<int>(blocks.size()))) {
  244|     41|    try {
  245|     41|      processBlock<dsc>(block);
  246|     41|    } catch (...) {
  247|       |      // We should not get any exceptions here.
  248|     41|      __builtin_unreachable();
  249|     41|    }
  250|     41|  }
  251|     41|}
PanasonicV5Decompressor.cpp:_ZNK8rawspeed23PanasonicV5Decompressor18decompressInternalIL_ZNS0_15TwelveBitPacketEEEEvv.omp_outlined_debug__:
  242|  1.27k|  for (const auto& block :
  ------------------
  |  Branch (242:26): [True: 1.27k, False: 367]
  ------------------
  243|  1.27k|       Array1DRef(blocks.data(), implicit_cast<int>(blocks.size()))) {
  244|  1.27k|    try {
  245|  1.27k|      processBlock<dsc>(block);
  246|  1.27k|    } catch (...) {
  247|       |      // We should not get any exceptions here.
  248|      0|      __builtin_unreachable();
  249|      0|    }
  250|  1.27k|  }
_ZNK8rawspeed23PanasonicV5Decompressor12processBlockIL_ZNS0_15TwelveBitPacketEEEEvRKNS0_5BlockE:
  210|    359|void PanasonicV5Decompressor::processBlock(const Block& block) const {
  211|    359|  static_assert(dsc.pixelsPerPacket > 0, "dsc should be compile-time const");
  212|    359|  static_assert(BlockSize % bytesPerPacket == 0);
  213|       |
  214|    359|  ProxyStream proxy(block.bs);
  215|    359|  BitStreamerLSB bs(proxy.getStream().peekRemainingBuffer().getAsArray1DRef());
  216|       |
  217|   332k|  for (int row = block.beginCoord.y; row <= block.endCoord.y; row++) {
  ------------------
  |  Branch (217:38): [True: 332k, False: 403]
  ------------------
  218|   332k|    int col = 0;
  219|       |    // First row may not begin at the first column.
  220|   332k|    if (block.beginCoord.y == row)
  ------------------
  |  Branch (220:9): [True: 339, False: 332k]
  ------------------
  221|    339|      col = block.beginCoord.x;
  222|       |
  223|   332k|    int endx = mRaw->dim.x;
  224|       |    // Last row may end before the last column.
  225|   332k|    if (block.endCoord.y == row)
  ------------------
  |  Branch (225:9): [True: 367, False: 332k]
  ------------------
  226|    367|      endx = block.endCoord.x;
  227|       |
  228|   332k|    invariant(col % dsc.pixelsPerPacket == 0);
  ------------------
  |  |   27|   332k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (228:5): [True: 332k, False: 18.4E]
  ------------------
  229|   332k|    invariant(endx % dsc.pixelsPerPacket == 0);
  ------------------
  |  |   27|   332k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (229:5): [True: 332k, False: 17]
  ------------------
  230|       |
  231|   678k|    for (; col < endx; col += dsc.pixelsPerPacket)
  ------------------
  |  Branch (231:12): [True: 346k, False: 332k]
  ------------------
  232|   346k|      processPixelPacket<dsc>(bs, row, col);
  233|   332k|  }
  234|    359|}
_ZN8rawspeed23PanasonicV5Decompressor11ProxyStreamC2ENS_10ByteStreamE:
  182|    655|  explicit ProxyStream(ByteStream block_) : block(block_) {}
_ZN8rawspeed23PanasonicV5Decompressor11ProxyStream9getStreamEv:
  184|    658|  ByteStream& getStream() {
  185|    658|    parseBlock();
  186|    658|    return input;
  187|    658|  }
_ZN8rawspeed23PanasonicV5Decompressor11ProxyStream10parseBlockEv:
  154|    655|  void parseBlock() {
  155|    655|    assert(buf.empty());
  ------------------
  |  Branch (155:5): [True: 653, False: 2]
  ------------------
  156|    653|    invariant(block.getRemainSize() == BlockSize);
  ------------------
  |  |   27|    653|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (156:5): [True: 651, False: 2]
  ------------------
  157|       |
  158|    651|    static_assert(BlockSize > sectionSplitOffset);
  159|       |
  160|    651|    Buffer FirstSection = block.getBuffer(sectionSplitOffset);
  161|    651|    Buffer SecondSection = block.getBuffer(block.getRemainSize());
  162|    651|    invariant(FirstSection.getSize() < SecondSection.getSize());
  ------------------
  |  |   27|    651|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (162:5): [True: 643, False: 8]
  ------------------
  163|       |
  164|    643|    buf.reserve(BlockSize);
  165|       |
  166|       |    // First copy the second section. This makes it the first section.
  167|    643|    buf.insert(buf.end(), SecondSection.begin(), SecondSection.end());
  168|       |    // Now append the original 1'st section right after the new 1'st section.
  169|    643|    buf.insert(buf.end(), FirstSection.begin(), FirstSection.end());
  170|       |
  171|    643|    assert(buf.size() == BlockSize);
  ------------------
  |  Branch (171:5): [True: 673, False: 18.4E]
  ------------------
  172|    673|    invariant(block.getRemainSize() == 0);
  ------------------
  |  |   27|    673|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (172:5): [True: 665, False: 8]
  ------------------
  173|       |
  174|       |    // And reset the clock.
  175|    665|    input = ByteStream(DataBuffer(
  176|    665|        Buffer(buf.data(), implicit_cast<Buffer::size_type>(buf.size())),
  177|    665|        Endianness::little));
  178|       |    // input.setByteOrder(Endianness::big); // does not seem to matter?!
  179|    665|  }
_ZNK8rawspeed23PanasonicV5Decompressor18processPixelPacketIL_ZNS0_15TwelveBitPacketEEEEvRNS_14BitStreamerLSBEii:
  193|   345k|                                                        int col) const {
  194|   345k|  static_assert(dsc.pixelsPerPacket > 0, "dsc should be compile-time const");
  195|   345k|  static_assert(dsc.bps > 0 && dsc.bps <= 16);
  196|       |
  197|   345k|  const Array2DRef<uint16_t> out(mRaw->getU16DataAsUncroppedArray2DRef());
  198|       |
  199|   345k|  invariant(bs.getFillLevel() == 0);
  ------------------
  |  |   27|   345k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (199:3): [True: 345k, False: 510]
  ------------------
  200|       |
  201|  1.65M|  for (int p = 0; p < dsc.pixelsPerPacket;) {
  ------------------
  |  Branch (201:19): [True: 1.30M, False: 345k]
  ------------------
  202|  1.30M|    bs.fill();
  203|  4.29M|    for (; bs.getFillLevel() >= implicit_cast<int>(dsc.bps); ++p, ++col)
  ------------------
  |  Branch (203:12): [True: 2.98M, False: 1.30M]
  ------------------
  204|  2.98M|      out(row, col) = implicit_cast<uint16_t>(bs.getBitsNoFill(dsc.bps));
  205|  1.30M|  }
  206|   345k|  bs.skipBitsNoFill(bs.getFillLevel()); // get rid of padding.
  207|   345k|}
_ZNK8rawspeed23PanasonicV5Decompressor18decompressInternalIL_ZNS0_17FourteenBitPacketEEEEvv:
  237|     37|void PanasonicV5Decompressor::decompressInternal() const noexcept {
  238|     37|#ifdef HAVE_OPENMP
  239|     37|#pragma omp parallel for num_threads(rawspeed_get_number_of_processor_cores()) \
  240|     37|    schedule(static) default(none)
  241|     37|#endif
  242|     37|  for (const auto& block :
  243|     37|       Array1DRef(blocks.data(), implicit_cast<int>(blocks.size()))) {
  244|     37|    try {
  245|     37|      processBlock<dsc>(block);
  246|     37|    } catch (...) {
  247|       |      // We should not get any exceptions here.
  248|     37|      __builtin_unreachable();
  249|     37|    }
  250|     37|  }
  251|     37|}
PanasonicV5Decompressor.cpp:_ZNK8rawspeed23PanasonicV5Decompressor18decompressInternalIL_ZNS0_17FourteenBitPacketEEEEvv.omp_outlined_debug__:
  242|  1.15k|  for (const auto& block :
  ------------------
  |  Branch (242:26): [True: 1.15k, False: 307]
  ------------------
  243|  1.15k|       Array1DRef(blocks.data(), implicit_cast<int>(blocks.size()))) {
  244|  1.15k|    try {
  245|  1.15k|      processBlock<dsc>(block);
  246|  1.15k|    } catch (...) {
  247|       |      // We should not get any exceptions here.
  248|      0|      __builtin_unreachable();
  249|      0|    }
  250|  1.15k|  }
_ZNK8rawspeed23PanasonicV5Decompressor12processBlockIL_ZNS0_17FourteenBitPacketEEEEvRKNS0_5BlockE:
  210|    293|void PanasonicV5Decompressor::processBlock(const Block& block) const {
  211|    293|  static_assert(dsc.pixelsPerPacket > 0, "dsc should be compile-time const");
  212|    293|  static_assert(BlockSize % bytesPerPacket == 0);
  213|       |
  214|    293|  ProxyStream proxy(block.bs);
  215|    293|  BitStreamerLSB bs(proxy.getStream().peekRemainingBuffer().getAsArray1DRef());
  216|       |
  217|   282k|  for (int row = block.beginCoord.y; row <= block.endCoord.y; row++) {
  ------------------
  |  Branch (217:38): [True: 282k, False: 313]
  ------------------
  218|   282k|    int col = 0;
  219|       |    // First row may not begin at the first column.
  220|   282k|    if (block.beginCoord.y == row)
  ------------------
  |  Branch (220:9): [True: 279, False: 282k]
  ------------------
  221|    279|      col = block.beginCoord.x;
  222|       |
  223|   282k|    int endx = mRaw->dim.x;
  224|       |    // Last row may end before the last column.
  225|   282k|    if (block.endCoord.y == row)
  ------------------
  |  Branch (225:9): [True: 307, False: 282k]
  ------------------
  226|    307|      endx = block.endCoord.x;
  227|       |
  228|   282k|    invariant(col % dsc.pixelsPerPacket == 0);
  ------------------
  |  |   27|   282k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (228:5): [True: 282k, False: 18.4E]
  ------------------
  229|   282k|    invariant(endx % dsc.pixelsPerPacket == 0);
  ------------------
  |  |   27|   282k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (229:5): [True: 282k, False: 23]
  ------------------
  230|       |
  231|   570k|    for (; col < endx; col += dsc.pixelsPerPacket)
  ------------------
  |  Branch (231:12): [True: 287k, False: 282k]
  ------------------
  232|   287k|      processPixelPacket<dsc>(bs, row, col);
  233|   282k|  }
  234|    293|}
_ZNK8rawspeed23PanasonicV5Decompressor18processPixelPacketIL_ZNS0_17FourteenBitPacketEEEEvRNS_14BitStreamerLSBEii:
  193|   287k|                                                        int col) const {
  194|   287k|  static_assert(dsc.pixelsPerPacket > 0, "dsc should be compile-time const");
  195|   287k|  static_assert(dsc.bps > 0 && dsc.bps <= 16);
  196|       |
  197|   287k|  const Array2DRef<uint16_t> out(mRaw->getU16DataAsUncroppedArray2DRef());
  198|       |
  199|   287k|  invariant(bs.getFillLevel() == 0);
  ------------------
  |  |   27|   287k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (199:3): [True: 286k, False: 487]
  ------------------
  200|       |
  201|  1.37M|  for (int p = 0; p < dsc.pixelsPerPacket;) {
  ------------------
  |  Branch (201:19): [True: 1.08M, False: 286k]
  ------------------
  202|  1.08M|    bs.fill();
  203|  3.37M|    for (; bs.getFillLevel() >= implicit_cast<int>(dsc.bps); ++p, ++col)
  ------------------
  |  Branch (203:12): [True: 2.28M, False: 1.08M]
  ------------------
  204|  2.28M|      out(row, col) = implicit_cast<uint16_t>(bs.getBitsNoFill(dsc.bps));
  205|  1.08M|  }
  206|   286k|  bs.skipBitsNoFill(bs.getFillLevel()); // get rid of padding.
  207|   286k|}

_ZN8rawspeed23PanasonicV5Decompressor5BlockC2ENS_10ByteStreamENS_8iPoint2DES3_:
   82|    674|        : bs(bs_), beginCoord(beginCoord_), endCoord(endCoord_) {}

_ZN8rawspeed23PanasonicV6DecompressorC2ENS_8RawImageENS_10ByteStreamEj:
  140|    121|    : mRaw(std::move(img)), bps(bps_) {
  141|    121|  if (mRaw->getCpp() != 1 || mRaw->getDataType() != RawImageType::UINT16 ||
  ------------------
  |  Branch (141:7): [True: 0, False: 121]
  |  Branch (141:30): [True: 0, False: 121]
  ------------------
  142|    121|      mRaw->getBpp() != sizeof(uint16_t))
  ------------------
  |  Branch (142:7): [True: 0, False: 121]
  ------------------
  143|    121|    ThrowRDE("Unexpected component count / data type");
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  144|       |
  145|    121|  const BlockDsc* dsc = nullptr;
  146|    121|  switch (bps) {
  147|     74|  case 12:
  ------------------
  |  Branch (147:3): [True: 74, False: 47]
  ------------------
  148|     74|    dsc = &TwelveBitBlock;
  149|     74|    break;
  150|     47|  case 14:
  ------------------
  |  Branch (150:3): [True: 47, False: 74]
  ------------------
  151|     47|    dsc = &FourteenBitBlock;
  152|     47|    break;
  153|      0|  default:
  ------------------
  |  Branch (153:3): [True: 0, False: 121]
  ------------------
  154|      0|    ThrowRDE("Unsupported bps: %u", bps);
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  155|    121|  }
  156|       |
  157|    121|  if (!mRaw->dim.hasPositiveArea() || mRaw->dim.x % dsc->PixelsPerBlock != 0) {
  ------------------
  |  Branch (157:7): [True: 2, False: 119]
  |  Branch (157:39): [True: 4, False: 115]
  ------------------
  158|      6|    ThrowRDE("Unexpected image dimensions found: (%i; %i)", mRaw->dim.x,
  ------------------
  |  |   38|      6|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      6|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      6|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      6|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  159|      6|             mRaw->dim.y);
  160|      6|  }
  161|       |
  162|       |  // How many blocks are needed for the given image size?
  163|    115|  const auto numBlocks = mRaw->dim.area() / dsc->PixelsPerBlock;
  164|       |
  165|       |  // Does the input contain enough blocks?
  166|       |  // How many full blocks does the input contain? This is truncating division.
  167|    115|  if (const auto haveBlocks = input_.getRemainSize() / dsc->BytesPerBlock;
  168|    115|      haveBlocks < numBlocks)
  ------------------
  |  Branch (168:7): [True: 16, False: 99]
  ------------------
  169|    115|    ThrowRDE("Insufficient count of input blocks for a given image");
  ------------------
  |  |   38|     16|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     16|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     16|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     16|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  170|       |
  171|       |  // We only want those blocks we need, no extras.
  172|     99|  input = input_.peekStream(implicit_cast<Buffer::size_type>(numBlocks),
  173|     99|                            dsc->BytesPerBlock);
  174|     99|}
_ZNK8rawspeed23PanasonicV6Decompressor10decompressEv:
  250|     99|void PanasonicV6Decompressor::decompress() const noexcept {
  251|     99|  switch (bps) {
  252|     54|  case 12:
  ------------------
  |  Branch (252:3): [True: 54, False: 45]
  ------------------
  253|     54|    decompressInternal<TwelveBitBlock>();
  254|     54|    break;
  255|     45|  case 14:
  ------------------
  |  Branch (255:3): [True: 45, False: 54]
  ------------------
  256|     45|    decompressInternal<FourteenBitBlock>();
  257|     45|    break;
  258|      0|  default:
  ------------------
  |  Branch (258:3): [True: 0, False: 99]
  ------------------
  259|      0|    __builtin_unreachable();
  260|     99|  }
  261|     99|}
_ZNK8rawspeed23PanasonicV6Decompressor18decompressInternalIL_ZNS0_14TwelveBitBlockEEEEvv:
  235|     54|void PanasonicV6Decompressor::decompressInternal() const noexcept {
  236|     54|#ifdef HAVE_OPENMP
  237|     54|#pragma omp parallel for num_threads(rawspeed_get_number_of_processor_cores()) \
  238|     54|    schedule(static) default(none)
  239|     54|#endif
  240|     54|  for (int row = 0; row < mRaw->dim.y; ++row) {
  241|     54|    try {
  242|     54|      decompressRow<dsc>(row);
  243|     54|    } catch (...) {
  244|       |      // We should not get any exceptions here.
  245|     54|      __builtin_unreachable();
  246|     54|    }
  247|     54|  }
  248|     54|}
PanasonicV6Decompressor.cpp:_ZNK8rawspeed23PanasonicV6Decompressor18decompressInternalIL_ZNS0_14TwelveBitBlockEEEEvv.omp_outlined_debug__:
  240|  1.70k|  for (int row = 0; row < mRaw->dim.y; ++row) {
  ------------------
  |  Branch (240:21): [True: 1.70k, False: 0]
  ------------------
  241|  1.70k|    try {
  242|  1.70k|      decompressRow<dsc>(row);
  243|  1.70k|    } catch (...) {
  244|       |      // We should not get any exceptions here.
  245|      0|      __builtin_unreachable();
  246|      0|    }
  247|  1.70k|  }
_ZNK8rawspeed23PanasonicV6Decompressor13decompressRowIL_ZNS0_14TwelveBitBlockEEEEvi:
  223|  3.07k|void PanasonicV6Decompressor::decompressRow(int row) const noexcept {
  224|  3.07k|  invariant(mRaw->dim.x % dsc.PixelsPerBlock == 0);
  ------------------
  |  |   27|  3.07k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (224:3): [True: 3.07k, False: 2]
  ------------------
  225|  3.07k|  const int blocksperrow = mRaw->dim.x / dsc.PixelsPerBlock;
  226|  3.07k|  const int bytesPerRow = dsc.BytesPerBlock * blocksperrow;
  227|       |
  228|  3.07k|  ByteStream rowInput = input.getSubStream(bytesPerRow * row, bytesPerRow);
  229|  59.8k|  for (int rblock = 0, col = 0; rblock < blocksperrow;
  ------------------
  |  Branch (229:33): [True: 56.7k, False: 3.07k]
  ------------------
  230|  56.7k|       rblock++, col += dsc.PixelsPerBlock)
  231|  56.7k|    decompressBlock<dsc>(rowInput, row, col);
  232|  3.07k|}
_ZNK8rawspeed23PanasonicV6Decompressor15decompressBlockIL_ZNS0_14TwelveBitBlockEEEEvRNS_10ByteStreamEii:
  179|  56.7k|                                         int col) const noexcept {
  180|  56.7k|  const Array2DRef<uint16_t> out(mRaw->getU16DataAsUncroppedArray2DRef());
  181|       |
  182|  56.7k|  pana_cs6_page_decoder<dsc.BitsPerSample> page(
  183|  56.7k|      rowInput.getStream(dsc.BytesPerBlock));
  184|       |
  185|  56.7k|  std::array<unsigned, 2> oddeven = {0, 0};
  186|  56.7k|  std::array<unsigned, 2> nonzero = {0, 0};
  187|  56.7k|  unsigned pmul = 0;
  188|  56.7k|  unsigned pixel_base = 0;
  189|   838k|  for (int pix = 0; pix < dsc.PixelsPerBlock; pix++, col++) {
  ------------------
  |  Branch (189:21): [True: 782k, False: 56.7k]
  ------------------
  190|   782k|    if (pix % 3 == 2) {
  ------------------
  |  Branch (190:9): [True: 226k, False: 556k]
  ------------------
  191|   226k|      uint16_t base = page.nextpixel();
  192|   226k|      if (base == 3)
  ------------------
  |  Branch (192:11): [True: 35.8k, False: 190k]
  ------------------
  193|  35.8k|        base = 4;
  194|   226k|      pixel_base = dsc.PixelbaseZero << base;
  195|   226k|      pmul = 1 << base;
  196|   226k|    }
  197|   782k|    uint16_t epixel = page.nextpixel();
  198|   782k|    if (oddeven[pix % 2]) {
  ------------------
  |  Branch (198:9): [True: 488k, False: 293k]
  ------------------
  199|   488k|      epixel *= pmul;
  200|   488k|      if (pixel_base < dsc.PixelbaseCompare && nonzero[pix % 2] > pixel_base)
  ------------------
  |  Branch (200:11): [True: 382k, False: 105k]
  |  Branch (200:48): [True: 255k, False: 127k]
  ------------------
  201|   255k|        epixel += nonzero[pix % 2] - pixel_base;
  202|   488k|      nonzero[pix % 2] = epixel;
  203|   488k|    } else {
  204|   293k|      oddeven[pix % 2] = epixel;
  205|   293k|      if (epixel)
  ------------------
  |  Branch (205:11): [True: 86.8k, False: 207k]
  ------------------
  206|  86.8k|        nonzero[pix % 2] = epixel;
  207|   207k|      else
  208|   207k|        epixel = implicit_cast<uint16_t>(nonzero[pix % 2]);
  209|   293k|    }
  210|   782k|    auto spix = static_cast<unsigned>(static_cast<int>(epixel) - 0xf);
  211|   782k|    if (spix <= dsc.SpixCompare)
  ------------------
  |  Branch (211:9): [True: 502k, False: 279k]
  ------------------
  212|   502k|      out(row, col) = spix & dsc.SpixCompare;
  213|   279k|    else {
  214|       |      // FIXME: this is a convoluted way to compute zero.
  215|       |      // What was this code trying to do, actually?
  216|   279k|      epixel = static_cast<int>(epixel + 0x7ffffff1) >> 0x1f;
  217|   279k|      out(row, col) = epixel & dsc.PixelMask;
  218|   279k|    }
  219|   782k|  }
  220|  56.7k|}
PanasonicV6Decompressor.cpp:_ZN8rawspeed12_GLOBAL__N_121pana_cs6_page_decoderILi12EEC2ENS_10ByteStreamE:
   79|  56.7k|  explicit pana_cs6_page_decoder(ByteStream bs) { fillBuffer(bs); }
PanasonicV6Decompressor.cpp:_ZN8rawspeed12_GLOBAL__N_121pana_cs6_page_decoderILi12EE10fillBufferENS_10ByteStreamE:
   90|  56.7k|pana_cs6_page_decoder<12>::fillBuffer(ByteStream bs_) noexcept {
   91|  56.7k|  BitStreamerLSB bs(bs_.peekRemainingBuffer().getAsArray1DRef());
   92|  56.7k|  bs.fill(32);
   93|  56.7k|  pixelbuffer[17] = implicit_cast<uint16_t>(bs.getBits(8));
   94|  56.7k|  pixelbuffer[16] = implicit_cast<uint16_t>(bs.getBits(8));
   95|  56.7k|  pixelbuffer[15] = implicit_cast<uint16_t>(bs.getBits(8));
   96|  56.7k|  pixelbuffer[14] = implicit_cast<uint16_t>(bs.getBits(2));
   97|  56.7k|  pixelbuffer[13] = implicit_cast<uint16_t>(bs.getBits(8));
   98|  56.7k|  pixelbuffer[12] = implicit_cast<uint16_t>(bs.getBits(8));
   99|  56.7k|  pixelbuffer[11] = implicit_cast<uint16_t>(bs.getBits(8));
  100|  56.7k|  pixelbuffer[10] = implicit_cast<uint16_t>(bs.getBits(2));
  101|  56.7k|  pixelbuffer[9] = implicit_cast<uint16_t>(bs.getBits(8));
  102|  56.7k|  pixelbuffer[8] = implicit_cast<uint16_t>(bs.getBits(8));
  103|  56.7k|  pixelbuffer[7] = implicit_cast<uint16_t>(bs.getBits(8));
  104|  56.7k|  pixelbuffer[6] = implicit_cast<uint16_t>(bs.getBits(2));
  105|  56.7k|  pixelbuffer[5] = implicit_cast<uint16_t>(bs.getBits(8));
  106|  56.7k|  pixelbuffer[4] = implicit_cast<uint16_t>(bs.getBits(8));
  107|  56.7k|  pixelbuffer[3] = implicit_cast<uint16_t>(bs.getBits(8));
  108|  56.7k|  pixelbuffer[2] = implicit_cast<uint16_t>(bs.getBits(2));
  109|  56.7k|  pixelbuffer[1] = implicit_cast<uint16_t>(bs.getBits(12));
  110|  56.7k|  pixelbuffer[0] = implicit_cast<uint16_t>(bs.getBits(12));
  111|  56.7k|}
PanasonicV6Decompressor.cpp:_ZN8rawspeed12_GLOBAL__N_121pana_cs6_page_decoderILi12EE9nextpixelEv:
   81|  1.00M|  uint16_t nextpixel() {
   82|  1.00M|    uint16_t currPixel = pixelbuffer[current];
   83|  1.00M|    ++current;
   84|  1.00M|    return currPixel;
   85|  1.00M|  }
_ZNK8rawspeed23PanasonicV6Decompressor18decompressInternalIL_ZNS0_16FourteenBitBlockEEEEvv:
  235|     45|void PanasonicV6Decompressor::decompressInternal() const noexcept {
  236|     45|#ifdef HAVE_OPENMP
  237|     45|#pragma omp parallel for num_threads(rawspeed_get_number_of_processor_cores()) \
  238|     45|    schedule(static) default(none)
  239|     45|#endif
  240|     45|  for (int row = 0; row < mRaw->dim.y; ++row) {
  241|     45|    try {
  242|     45|      decompressRow<dsc>(row);
  243|     45|    } catch (...) {
  244|       |      // We should not get any exceptions here.
  245|     45|      __builtin_unreachable();
  246|     45|    }
  247|     45|  }
  248|     45|}
PanasonicV6Decompressor.cpp:_ZNK8rawspeed23PanasonicV6Decompressor18decompressInternalIL_ZNS0_16FourteenBitBlockEEEEvv.omp_outlined_debug__:
  240|  1.42k|  for (int row = 0; row < mRaw->dim.y; ++row) {
  ------------------
  |  Branch (240:21): [True: 1.42k, False: 0]
  ------------------
  241|  1.42k|    try {
  242|  1.42k|      decompressRow<dsc>(row);
  243|  1.42k|    } catch (...) {
  244|       |      // We should not get any exceptions here.
  245|      0|      __builtin_unreachable();
  246|      0|    }
  247|  1.42k|  }
_ZNK8rawspeed23PanasonicV6Decompressor13decompressRowIL_ZNS0_16FourteenBitBlockEEEEvi:
  223|  89.1k|void PanasonicV6Decompressor::decompressRow(int row) const noexcept {
  224|  89.1k|  invariant(mRaw->dim.x % dsc.PixelsPerBlock == 0);
  ------------------
  |  |   27|  89.1k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (224:3): [True: 89.1k, False: 20]
  ------------------
  225|  89.1k|  const int blocksperrow = mRaw->dim.x / dsc.PixelsPerBlock;
  226|  89.1k|  const int bytesPerRow = dsc.BytesPerBlock * blocksperrow;
  227|       |
  228|  89.1k|  ByteStream rowInput = input.getSubStream(bytesPerRow * row, bytesPerRow);
  229|   178k|  for (int rblock = 0, col = 0; rblock < blocksperrow;
  ------------------
  |  Branch (229:33): [True: 89.8k, False: 89.1k]
  ------------------
  230|  89.8k|       rblock++, col += dsc.PixelsPerBlock)
  231|  89.8k|    decompressBlock<dsc>(rowInput, row, col);
  232|  89.1k|}
_ZNK8rawspeed23PanasonicV6Decompressor15decompressBlockIL_ZNS0_16FourteenBitBlockEEEEvRNS_10ByteStreamEii:
  179|  89.8k|                                         int col) const noexcept {
  180|  89.8k|  const Array2DRef<uint16_t> out(mRaw->getU16DataAsUncroppedArray2DRef());
  181|       |
  182|  89.8k|  pana_cs6_page_decoder<dsc.BitsPerSample> page(
  183|  89.8k|      rowInput.getStream(dsc.BytesPerBlock));
  184|       |
  185|  89.8k|  std::array<unsigned, 2> oddeven = {0, 0};
  186|  89.8k|  std::array<unsigned, 2> nonzero = {0, 0};
  187|  89.8k|  unsigned pmul = 0;
  188|  89.8k|  unsigned pixel_base = 0;
  189|  1.02M|  for (int pix = 0; pix < dsc.PixelsPerBlock; pix++, col++) {
  ------------------
  |  Branch (189:21): [True: 933k, False: 89.8k]
  ------------------
  190|   933k|    if (pix % 3 == 2) {
  ------------------
  |  Branch (190:9): [True: 265k, False: 668k]
  ------------------
  191|   265k|      uint16_t base = page.nextpixel();
  192|   265k|      if (base == 3)
  ------------------
  |  Branch (192:11): [True: 51.9k, False: 213k]
  ------------------
  193|  51.9k|        base = 4;
  194|   265k|      pixel_base = dsc.PixelbaseZero << base;
  195|   265k|      pmul = 1 << base;
  196|   265k|    }
  197|   933k|    uint16_t epixel = page.nextpixel();
  198|   933k|    if (oddeven[pix % 2]) {
  ------------------
  |  Branch (198:9): [True: 674k, False: 258k]
  ------------------
  199|   674k|      epixel *= pmul;
  200|   674k|      if (pixel_base < dsc.PixelbaseCompare && nonzero[pix % 2] > pixel_base)
  ------------------
  |  Branch (200:11): [True: 531k, False: 142k]
  |  Branch (200:48): [True: 462k, False: 69.5k]
  ------------------
  201|   462k|        epixel += nonzero[pix % 2] - pixel_base;
  202|   674k|      nonzero[pix % 2] = epixel;
  203|   674k|    } else {
  204|   258k|      oddeven[pix % 2] = epixel;
  205|   258k|      if (epixel)
  ------------------
  |  Branch (205:11): [True: 156k, False: 102k]
  ------------------
  206|   156k|        nonzero[pix % 2] = epixel;
  207|   102k|      else
  208|   102k|        epixel = implicit_cast<uint16_t>(nonzero[pix % 2]);
  209|   258k|    }
  210|   933k|    auto spix = static_cast<unsigned>(static_cast<int>(epixel) - 0xf);
  211|   933k|    if (spix <= dsc.SpixCompare)
  ------------------
  |  Branch (211:9): [True: 800k, False: 133k]
  ------------------
  212|   800k|      out(row, col) = spix & dsc.SpixCompare;
  213|   133k|    else {
  214|       |      // FIXME: this is a convoluted way to compute zero.
  215|       |      // What was this code trying to do, actually?
  216|   133k|      epixel = static_cast<int>(epixel + 0x7ffffff1) >> 0x1f;
  217|   133k|      out(row, col) = epixel & dsc.PixelMask;
  218|   133k|    }
  219|   933k|  }
  220|  89.8k|}
PanasonicV6Decompressor.cpp:_ZN8rawspeed12_GLOBAL__N_121pana_cs6_page_decoderILi14EEC2ENS_10ByteStreamE:
   79|  89.9k|  explicit pana_cs6_page_decoder(ByteStream bs) { fillBuffer(bs); }
PanasonicV6Decompressor.cpp:_ZN8rawspeed12_GLOBAL__N_121pana_cs6_page_decoderILi14EE10fillBufferENS_10ByteStreamE:
  115|  89.9k|pana_cs6_page_decoder<14>::fillBuffer(ByteStream bs_) noexcept {
  116|  89.9k|  BitStreamerLSB bs(bs_.peekRemainingBuffer().getAsArray1DRef());
  117|  89.9k|  bs.fill(32);
  118|  89.9k|  bs.skipBitsNoFill(4);
  119|  89.9k|  pixelbuffer[13] = implicit_cast<uint16_t>(bs.getBits(10));
  120|  89.9k|  pixelbuffer[12] = implicit_cast<uint16_t>(bs.getBits(10));
  121|  89.9k|  pixelbuffer[11] = implicit_cast<uint16_t>(bs.getBits(10));
  122|  89.9k|  pixelbuffer[10] = implicit_cast<uint16_t>(bs.getBits(2));
  123|  89.9k|  pixelbuffer[9] = implicit_cast<uint16_t>(bs.getBits(10));
  124|  89.9k|  pixelbuffer[8] = implicit_cast<uint16_t>(bs.getBits(10));
  125|  89.9k|  pixelbuffer[7] = implicit_cast<uint16_t>(bs.getBits(10));
  126|  89.9k|  pixelbuffer[6] = implicit_cast<uint16_t>(bs.getBits(2));
  127|  89.9k|  pixelbuffer[5] = implicit_cast<uint16_t>(bs.getBits(10));
  128|  89.9k|  pixelbuffer[4] = implicit_cast<uint16_t>(bs.getBits(10));
  129|  89.9k|  pixelbuffer[3] = implicit_cast<uint16_t>(bs.getBits(10));
  130|  89.9k|  pixelbuffer[2] = implicit_cast<uint16_t>(bs.getBits(2));
  131|  89.9k|  pixelbuffer[1] = implicit_cast<uint16_t>(bs.getBits(14));
  132|  89.9k|  pixelbuffer[0] = implicit_cast<uint16_t>(bs.getBits(14));
  133|  89.9k|}
PanasonicV6Decompressor.cpp:_ZN8rawspeed12_GLOBAL__N_121pana_cs6_page_decoderILi14EE9nextpixelEv:
   81|  1.17M|  uint16_t nextpixel() {
   82|  1.17M|    uint16_t currPixel = pixelbuffer[current];
   83|  1.17M|    ++current;
   84|  1.17M|    return currPixel;
   85|  1.17M|  }

_ZN8rawspeed23PanasonicV7DecompressorC2ENS_8RawImageENS_10ByteStreamE:
   43|     64|    : mRaw(std::move(img)) {
   44|     64|  if (mRaw->getCpp() != 1 || mRaw->getDataType() != RawImageType::UINT16 ||
  ------------------
  |  Branch (44:7): [True: 0, False: 64]
  |  Branch (44:30): [True: 0, False: 64]
  ------------------
   45|     64|      mRaw->getBpp() != sizeof(uint16_t))
  ------------------
  |  Branch (45:7): [True: 0, False: 64]
  ------------------
   46|     64|    ThrowRDE("Unexpected component count / data type");
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   47|       |
   48|     64|  if (!mRaw->dim.hasPositiveArea() || mRaw->dim.x % PixelsPerBlock != 0) {
  ------------------
  |  Branch (48:7): [True: 2, False: 62]
  |  Branch (48:39): [True: 1, False: 61]
  ------------------
   49|      3|    ThrowRDE("Unexpected image dimensions found: (%i; %i)", mRaw->dim.x,
  ------------------
  |  |   38|      3|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      3|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      3|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      3|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   50|      3|             mRaw->dim.y);
   51|      3|  }
   52|       |
   53|       |  // How many blocks are needed for the given image size?
   54|     61|  const auto numBlocks = mRaw->dim.area() / PixelsPerBlock;
   55|       |
   56|       |  // Does the input contain enough blocks?
   57|       |  // How many full blocks does the input contain? This is truncating division.
   58|     61|  if (const auto haveBlocks = input_.getRemainSize() / BytesPerBlock;
   59|     61|      haveBlocks < numBlocks)
  ------------------
  |  Branch (59:7): [True: 27, False: 34]
  ------------------
   60|     61|    ThrowRDE("Insufficient count of input blocks for a given image");
  ------------------
  |  |   38|     27|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     27|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     27|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     27|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   61|       |
   62|       |  // We only want those blocks we need, no extras.
   63|     34|  input = input_.peekStream(implicit_cast<Buffer::size_type>(numBlocks),
   64|     34|                            BytesPerBlock);
   65|     34|}
_ZNK8rawspeed23PanasonicV7Decompressor13decompressRowEi:
   76|   229k|void PanasonicV7Decompressor::decompressRow(int row) const noexcept {
   77|   229k|  const Array2DRef<uint16_t> out(mRaw->getU16DataAsUncroppedArray2DRef());
   78|   229k|  Array1DRef<uint16_t> outRow = out[row];
   79|       |
   80|   229k|  invariant(outRow.size() % PixelsPerBlock == 0);
  ------------------
  |  |   27|   229k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (80:3): [True: 231k, False: 18.4E]
  ------------------
   81|   231k|  const int blocksperrow = outRow.size() / PixelsPerBlock;
   82|   231k|  const int bytesPerRow = BytesPerBlock * blocksperrow;
   83|       |
   84|   231k|  ByteStream rowInput = input.getSubStream(bytesPerRow * row, bytesPerRow);
   85|   465k|  for (int rblock = 0; rblock < blocksperrow; rblock++) {
  ------------------
  |  Branch (85:24): [True: 233k, False: 231k]
  ------------------
   86|   233k|    ByteStream block = rowInput.getStream(BytesPerBlock);
   87|   233k|    decompressBlock(block, outRow.getBlock(PixelsPerBlock, rblock));
   88|   233k|  }
   89|   231k|}
_ZN8rawspeed23PanasonicV7Decompressor15decompressBlockENS_10ByteStreamENS_17CroppedArray1DRefItEE:
   69|   230k|    ByteStream block, CroppedArray1DRef<uint16_t> out) noexcept {
   70|   230k|  invariant(out.size() == PixelsPerBlock);
  ------------------
  |  |   27|   230k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (70:3): [True: 230k, False: 672]
  ------------------
   71|   230k|  BitStreamerLSB pump(block.peekRemainingBuffer().getAsArray1DRef());
   72|  2.03M|  for (int pix = 0; pix < PixelsPerBlock; pix++)
  ------------------
  |  Branch (72:21): [True: 1.80M, False: 230k]
  ------------------
   73|  1.80M|    out(pix) = implicit_cast<uint16_t>(pump.getBits(BitsPerSample));
   74|   230k|}
_ZNK8rawspeed23PanasonicV7Decompressor10decompressEv:
   91|     34|void PanasonicV7Decompressor::decompress() const {
   92|     34|#ifdef HAVE_OPENMP
   93|     34|#pragma omp parallel for num_threads(rawspeed_get_number_of_processor_cores()) \
   94|     34|    schedule(static) default(none)
   95|     34|#endif
   96|     34|  for (int row = 0; row < mRaw->dim.y; ++row) {
   97|     34|    try {
   98|     34|      decompressRow(row);
   99|     34|    } catch (...) {
  100|       |      // We should not get any exceptions here.
  101|     34|      __builtin_unreachable();
  102|     34|    }
  103|     34|  }
  104|     34|}
PanasonicV7Decompressor.cpp:_ZNK8rawspeed23PanasonicV7Decompressor10decompressEv.omp_outlined_debug__:
   96|  1.07k|  for (int row = 0; row < mRaw->dim.y; ++row) {
  ------------------
  |  Branch (96:21): [True: 1.07k, False: 0]
  ------------------
   97|  1.07k|    try {
   98|  1.07k|      decompressRow(row);
   99|  1.07k|    } catch (...) {
  100|       |      // We should not get any exceptions here.
  101|      0|      __builtin_unreachable();
  102|      0|    }
  103|  1.07k|  }

_ZN8rawspeed18PentaxDecompressorC2ENS_8RawImageENS_8OptionalINS_10ByteStreamEEE:
   55|    174|    : mRaw(std::move(img)), ht(SetupPrefixCodeDecoder(metaData)) {
   56|    174|  if (mRaw->getCpp() != 1 || mRaw->getDataType() != RawImageType::UINT16 ||
  ------------------
  |  Branch (56:7): [True: 12, False: 162]
  |  Branch (56:30): [True: 0, False: 162]
  ------------------
   57|    162|      mRaw->getBpp() != sizeof(uint16_t))
  ------------------
  |  Branch (57:7): [True: 0, False: 162]
  ------------------
   58|    174|    ThrowRDE("Unexpected component count / data type");
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   59|       |
   60|    174|  if (!mRaw->dim.x || !mRaw->dim.y || mRaw->dim.x % 2 != 0 ||
  ------------------
  |  Branch (60:7): [True: 13, False: 161]
  |  Branch (60:23): [True: 1, False: 160]
  |  Branch (60:39): [True: 1, False: 159]
  ------------------
   61|    159|      mRaw->dim.x > 8384 || mRaw->dim.y > 6208) {
  ------------------
  |  Branch (61:7): [True: 8, False: 151]
  |  Branch (61:29): [True: 11, False: 140]
  ------------------
   62|     22|    ThrowRDE("Unexpected image dimensions found: (%d; %d)", mRaw->dim.x,
  ------------------
  |  |   38|     22|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     22|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     22|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     22|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   63|     22|             mRaw->dim.y);
   64|     22|  }
   65|    174|}
_ZN8rawspeed18PentaxDecompressor29SetupPrefixCodeDecoder_LegacyEv:
   68|    124|PentaxDecompressor::SetupPrefixCodeDecoder_Legacy() {
   69|       |  // Temporary table, used during parsing LJpeg.
   70|    124|  HuffmanCode<BaselineCodeTag> hc;
   71|       |
   72|       |  /* Initialize with legacy data */
   73|    124|  auto nCodes = hc.setNCodesPerLength(Buffer(pentax_tree[0][0].data(), 16));
   74|    124|  invariant(nCodes == 13); // see pentax_tree definition
  ------------------
  |  |   27|    124|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (74:3): [True: 124, False: 0]
  ------------------
   75|    124|  hc.setCodeValues(Array1DRef<const uint8_t>(pentax_tree[0][1].data(), nCodes));
   76|       |
   77|    124|  return hc;
   78|    124|}
_ZN8rawspeed18PentaxDecompressor29SetupPrefixCodeDecoder_ModernENS_10ByteStreamE:
   81|     50|PentaxDecompressor::SetupPrefixCodeDecoder_Modern(ByteStream stream) {
   82|       |  // Temporary table, used during parsing LJpeg.
   83|     50|  HuffmanCode<BaselineCodeTag> hc;
   84|       |
   85|     50|  const uint32_t depth = stream.getU16() + 12;
   86|     50|  if (depth > 15)
  ------------------
  |  Branch (86:7): [True: 1, False: 49]
  ------------------
   87|     50|    ThrowRDE("Depth of huffman table is too great (%u).", depth);
  ------------------
  |  |   38|      1|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      1|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      1|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      1|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   88|       |
   89|     49|  stream.skipBytes(12);
   90|       |
   91|     49|  std::array<uint32_t, 16> v0;
   92|     49|  std::array<uint32_t, 16> v1;
   93|    650|  for (uint32_t i = 0; i < depth; i++)
  ------------------
  |  Branch (93:24): [True: 601, False: 49]
  ------------------
   94|    601|    v0[i] = stream.getU16();
   95|    566|  for (uint32_t i = 0; i < depth; i++) {
  ------------------
  |  Branch (95:24): [True: 521, False: 45]
  ------------------
   96|    521|    v1[i] = stream.getByte();
   97|       |
   98|    521|    if (v1[i] == 0 || v1[i] > 12)
  ------------------
  |  Branch (98:9): [True: 3, False: 518]
  |  Branch (98:23): [True: 3, False: 515]
  ------------------
   99|    521|      ThrowRDE("Data corrupt: v1[%u]=%u, expected [1..12]", depth, v1[i]);
  ------------------
  |  |   38|      4|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      4|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      4|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      4|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  100|    521|  }
  101|       |
  102|     45|  std::vector<uint8_t> nCodesPerLength;
  103|     45|  nCodesPerLength.resize(17);
  104|       |
  105|     45|  std::array<uint32_t, 16> v2;
  106|       |  /* Calculate codes and store bitcounts */
  107|    550|  for (uint32_t c = 0; c < depth; c++) {
  ------------------
  |  Branch (107:24): [True: 505, False: 45]
  ------------------
  108|    505|    v2[c] = extractHighBits(v0[c], v1[c], /*effectiveBitwidth=*/12);
  109|    505|    nCodesPerLength.at(v1[c])++;
  110|    505|  }
  111|       |
  112|     45|  assert(nCodesPerLength.size() == 17);
  ------------------
  |  Branch (112:3): [True: 39, False: 6]
  ------------------
  113|     45|  assert(nCodesPerLength[0] == 0);
  ------------------
  |  Branch (113:3): [True: 39, False: 0]
  ------------------
  114|     39|  auto nCodes = hc.setNCodesPerLength(Buffer(&nCodesPerLength[1], 16));
  115|     39|  invariant(nCodes == depth);
  ------------------
  |  |   27|     39|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (115:3): [True: 38, False: 1]
  ------------------
  116|       |
  117|     38|  std::vector<uint8_t> codeValues;
  118|     38|  codeValues.reserve(nCodes);
  119|       |
  120|       |  /* Find smallest */
  121|    531|  for (uint32_t i = 0; i < depth; i++) {
  ------------------
  |  Branch (121:24): [True: 493, False: 38]
  ------------------
  122|    493|    uint32_t sm_val = 0xfffffff;
  123|    493|    uint32_t sm_num = 0xff;
  124|  6.92k|    for (uint32_t j = 0; j < depth; j++) {
  ------------------
  |  Branch (124:26): [True: 6.43k, False: 493]
  ------------------
  125|  6.43k|      if (v2[j] <= sm_val) {
  ------------------
  |  Branch (125:11): [True: 1.43k, False: 5.00k]
  ------------------
  126|  1.43k|        sm_num = j;
  127|  1.43k|        sm_val = v2[j];
  128|  1.43k|      }
  129|  6.43k|    }
  130|    493|    invariant(sm_num < 16);
  ------------------
  |  |   27|    493|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (130:5): [True: 493, False: 0]
  ------------------
  131|    493|    codeValues.push_back(implicit_cast<uint8_t>(sm_num));
  132|    493|    v2[sm_num] = 0xffffffff;
  133|    493|  }
  134|       |
  135|     38|  assert(codeValues.size() == nCodes);
  ------------------
  |  Branch (135:3): [True: 38, False: 0]
  ------------------
  136|     38|  hc.setCodeValues(Array1DRef<const uint8_t>(codeValues.data(), nCodes));
  137|       |
  138|     38|  return hc;
  139|     38|}
_ZN8rawspeed18PentaxDecompressor22SetupPrefixCodeDecoderENS_8OptionalINS_10ByteStreamEEE:
  142|    174|PentaxDecompressor::SetupPrefixCodeDecoder(Optional<ByteStream> metaData) {
  143|    174|  Optional<HuffmanCode<BaselineCodeTag>> hc;
  144|       |
  145|    174|  if (metaData)
  ------------------
  |  Branch (145:7): [True: 50, False: 124]
  ------------------
  146|     50|    hc = SetupPrefixCodeDecoder_Modern(*metaData);
  147|    124|  else
  148|    124|    hc = SetupPrefixCodeDecoder_Legacy();
  149|       |
  150|    174|  PrefixCodeDecoder<> ht(std::move(*hc));
  151|    174|  ht.setup(true, false);
  152|       |
  153|    174|  return ht;
  154|    174|}
_ZNK8rawspeed18PentaxDecompressor10decompressENS_10ByteStreamE:
  156|     86|void PentaxDecompressor::decompress(ByteStream data) const {
  157|     86|  const Array2DRef<uint16_t> out(mRaw->getU16DataAsUncroppedArray2DRef());
  158|       |
  159|     86|  invariant(out.height() > 0);
  ------------------
  |  |   27|     86|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (159:3): [True: 86, False: 0]
  ------------------
  160|     86|  invariant(out.width() > 0);
  ------------------
  |  |   27|     86|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (160:3): [True: 86, False: 0]
  ------------------
  161|     86|  invariant(out.width() % 2 == 0);
  ------------------
  |  |   27|     86|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (161:3): [True: 86, False: 0]
  ------------------
  162|       |
  163|     86|  BitStreamerMSB bs(data.peekRemainingBuffer().getAsArray1DRef());
  164|  1.12k|  for (int row = 0; row < out.height(); row++) {
  ------------------
  |  Branch (164:21): [True: 1.07k, False: 45]
  ------------------
  165|  1.07k|    std::array<int, 2> pred = {{}};
  166|  1.07k|    if (row >= 2)
  ------------------
  |  Branch (166:9): [True: 959, False: 117]
  ------------------
  167|    959|      pred = {out(row - 2, 0), out(row - 2, 1)};
  168|       |
  169|  9.54k|    for (int col = 0; col < out.width(); col++) {
  ------------------
  |  Branch (169:23): [True: 8.51k, False: 1.03k]
  ------------------
  170|  8.51k|      pred[col & 1] += ht.decodeDifference(bs);
  171|  8.51k|      int value = pred[col & 1];
  172|  8.51k|      if (!isIntN(value, 16))
  ------------------
  |  Branch (172:11): [True: 41, False: 8.47k]
  ------------------
  173|  8.51k|        ThrowRDE("decoded value out of bounds at %d:%d", col, row);
  ------------------
  |  |   38|     41|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     41|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     41|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     41|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  174|  8.47k|      out(row, col) = implicit_cast<uint16_t>(value);
  175|  8.47k|    }
  176|  1.07k|  }
  177|     86|}

_ZN8rawspeed20PhaseOneDecompressorC2ENS_8RawImageEONSt3__16vectorINS_13PhaseOneStripENS2_9allocatorIS4_EEEE:
   45|    488|    : mRaw(std::move(img)), strips(std::move(strips_)) {
   46|    488|  if (mRaw->getDataType() != RawImageType::UINT16)
  ------------------
  |  Branch (46:7): [True: 0, False: 488]
  ------------------
   47|    488|    ThrowRDE("Unexpected data type");
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   48|       |
   49|    488|  if (mRaw->getCpp() != 1 || mRaw->getBpp() != sizeof(uint16_t))
  ------------------
  |  Branch (49:7): [True: 0, False: 488]
  |  Branch (49:30): [True: 0, False: 488]
  ------------------
   50|    488|    ThrowRDE("Unexpected cpp: %u", mRaw->getCpp());
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   51|       |
   52|    488|  if (!mRaw->dim.hasPositiveArea() || mRaw->dim.x % 2 != 0 ||
  ------------------
  |  Branch (52:7): [True: 0, False: 488]
  |  Branch (52:39): [True: 2, False: 486]
  ------------------
   53|    486|      mRaw->dim.x > 11976 || mRaw->dim.y > 8854) {
  ------------------
  |  Branch (53:7): [True: 0, False: 486]
  |  Branch (53:30): [True: 0, False: 486]
  ------------------
   54|      2|    ThrowRDE("Unexpected image dimensions found: (%d; %d)", mRaw->dim.x,
  ------------------
  |  |   38|      2|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      2|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      2|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      2|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   55|      2|             mRaw->dim.y);
   56|      2|  }
   57|       |
   58|    486|  prepareStrips();
   59|    486|}
_ZN8rawspeed20PhaseOneDecompressor13prepareStripsEv:
   61|    486|void PhaseOneDecompressor::prepareStrips() {
   62|       |  // The 'strips' vector should contain exactly one element per row of image.
   63|       |
   64|       |  // If the length is different, then the 'strips' vector is clearly incorrect.
   65|    486|  if (strips.size() != static_cast<decltype(strips)::size_type>(mRaw->dim.y)) {
  ------------------
  |  Branch (65:7): [True: 0, False: 486]
  ------------------
   66|      0|    ThrowRDE("Height (%d) vs strip count %zu mismatch", mRaw->dim.y,
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   67|      0|             strips.size());
   68|      0|  }
   69|       |
   70|       |  // Now, the strips in 'strips' vector aren't in order.
   71|       |  // The 'decltype(strips)::value_type::n' is the row number of a strip.
   72|       |  // We need to make sure that we have every row (0..mRaw->dim.y-1), once.
   73|       |  // For that, first let's sort them to have monothonically increasting `n`.
   74|       |  // This will also serialize the per-line outputting.
   75|    486|  std::sort(
   76|    486|      strips.begin(), strips.end(),
   77|    486|      [](const PhaseOneStrip& a, const PhaseOneStrip& b) { return a.n < b.n; });
   78|       |  // And now ensure that slice number matches the slice's row.
   79|  3.78k|  for (decltype(strips)::size_type i = 0; i < strips.size(); ++i)
  ------------------
  |  Branch (79:43): [True: 3.29k, False: 486]
  ------------------
   80|  3.29k|    if (static_cast<decltype(strips)::size_type>(strips[i].n) != i)
  ------------------
  |  Branch (80:9): [True: 0, False: 3.29k]
  ------------------
   81|    486|      ThrowRDE("Strips validation issue.");
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|    486|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|    486|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|    486|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   82|       |  // All good.
   83|    486|}
PhaseOneDecompressor.cpp:_ZZN8rawspeed20PhaseOneDecompressor13prepareStripsEvENK3$_0clERKNS_13PhaseOneStripES4_:
   77|  9.79k|      [](const PhaseOneStrip& a, const PhaseOneStrip& b) { return a.n < b.n; });
_ZNK8rawspeed20PhaseOneDecompressor15decompressStripERKNS_13PhaseOneStripE:
   85|  3.26k|void PhaseOneDecompressor::decompressStrip(const PhaseOneStrip& strip) const {
   86|  3.26k|  const Array2DRef<uint16_t> out(mRaw->getU16DataAsUncroppedArray2DRef());
   87|       |
   88|  3.26k|  invariant(out.width() > 0);
  ------------------
  |  |   27|  3.26k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (88:3): [True: 3.19k, False: 62]
  ------------------
   89|  3.19k|  invariant(out.width() % 2 == 0);
  ------------------
  |  |   27|  3.19k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (89:3): [True: 3.18k, False: 14]
  ------------------
   90|       |
   91|  3.18k|  static constexpr std::array<const int, 10> length = {8,  7, 6,  9,  11,
   92|  3.18k|                                                       10, 5, 12, 14, 13};
   93|       |
   94|  3.18k|  BitStreamerMSB32 pump(strip.bs.peekRemainingBuffer().getAsArray1DRef());
   95|       |
   96|  3.18k|  std::array<int32_t, 2> pred;
   97|  3.18k|  pred.fill(0);
   98|  3.18k|  std::array<int, 2> len;
   99|  3.18k|  const int row = strip.n;
  100|   192k|  for (int col = 0; col < out.width(); col++) {
  ------------------
  |  Branch (100:21): [True: 189k, False: 2.79k]
  ------------------
  101|   189k|    pump.fill(32);
  102|   189k|    if (static_cast<unsigned>(col) >=
  ------------------
  |  Branch (102:9): [True: 8.09k, False: 181k]
  ------------------
  103|   189k|        (out.width() & ~7U)) // last 'width % 8' pixels.
  104|  8.09k|      len[0] = len[1] = 14;
  105|   181k|    else if ((col & 7) == 0) {
  ------------------
  |  Branch (105:14): [True: 23.1k, False: 158k]
  ------------------
  106|  45.9k|      for (int& i : len) {
  ------------------
  |  Branch (106:19): [True: 45.9k, False: 22.7k]
  ------------------
  107|  45.9k|        int j = 0;
  108|       |
  109|   151k|        for (; j < 5; j++) {
  ------------------
  |  Branch (109:16): [True: 137k, False: 14.8k]
  ------------------
  110|   137k|          if (pump.getBitsNoFill(1) != 0) {
  ------------------
  |  Branch (110:15): [True: 31.1k, False: 105k]
  ------------------
  111|  31.1k|            if (col == 0)
  ------------------
  |  Branch (111:17): [True: 393, False: 30.7k]
  ------------------
  112|  31.1k|              ThrowRDE("Can not initialize lengths. Data is corrupt.");
  ------------------
  |  |   38|    393|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|    393|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|    393|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|    393|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  113|       |
  114|       |            // else, we have previously initialized lengths, so we are fine
  115|  30.7k|            break;
  116|  31.1k|          }
  117|   137k|        }
  118|       |
  119|  45.5k|        invariant((col == 0 && j > 0) || col != 0);
  ------------------
  |  |   27|  45.5k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (119:9): [True: 829, False: 44.7k]
  |  Branch (119:9): [True: 829, False: 0]
  |  Branch (119:9): [True: 44.7k, False: 0]
  |  Branch (119:9): [True: 45.5k, False: 18.4E]
  ------------------
  120|  45.5k|        if (j > 0)
  ------------------
  |  Branch (120:13): [True: 31.3k, False: 14.2k]
  ------------------
  121|  31.3k|          i = length[(2 * (j - 1)) + pump.getBitsNoFill(1)];
  122|  45.5k|      }
  123|  23.1k|    }
  124|       |
  125|   189k|    int i = len[col & 1];
  126|   189k|    if (i == 14) {
  ------------------
  |  Branch (126:9): [True: 77.9k, False: 111k]
  ------------------
  127|  77.9k|      pred[col & 1] = pump.getBitsNoFill(16);
  128|  77.9k|      out(row, col) = implicit_cast<uint16_t>(pred[col & 1]);
  129|   111k|    } else {
  130|   111k|      pred[col & 1] +=
  131|   111k|          static_cast<signed>(pump.getBitsNoFill(i)) + 1 - (1 << (i - 1));
  132|       |      // FIXME: is the truncation the right solution here?
  133|   111k|      out(row, col) = uint16_t(pred[col & 1]);
  134|   111k|    }
  135|   189k|  }
  136|  3.18k|}
_ZNK8rawspeed20PhaseOneDecompressor16decompressThreadEv:
  138|  37.7k|void PhaseOneDecompressor::decompressThread() const noexcept {
  139|  37.7k|#ifdef HAVE_OPENMP
  140|  37.7k|#pragma omp for schedule(static)
  141|  37.7k|#endif
  142|  37.7k|  for (const auto& strip :
  143|  37.7k|       Array1DRef(strips.data(), implicit_cast<int>(strips.size()))) {
  144|  37.7k|    try {
  145|  37.7k|      decompressStrip(strip);
  146|  37.7k|    } catch (const RawspeedException& err) {
  147|       |      // Propagate the exception out of OpenMP magic.
  148|  37.7k|      mRaw->setError(err.what());
  149|  37.7k|    } catch (...) {
  150|       |      // We should not get any other exception type here.
  151|  37.7k|      __builtin_unreachable();
  152|  37.7k|    }
  153|  37.7k|  }
  154|  37.7k|}
_ZNK8rawspeed20PhaseOneDecompressor10decompressEv:
  156|    486|void PhaseOneDecompressor::decompress() const {
  157|    486|#ifdef HAVE_OPENMP
  158|    486|#pragma omp parallel default(none)                                             \
  159|    486|    num_threads(rawspeed_get_number_of_processor_cores())
  160|    486|#endif
  161|    486|  decompressThread();
  162|       |
  163|    486|  std::string firstErr;
  164|    486|  if (mRaw->isTooManyErrors(1, &firstErr)) {
  ------------------
  |  Branch (164:7): [True: 152, False: 334]
  ------------------
  165|    152|    ThrowRDE("Too many errors encountered. Giving up. First Error:\n%s",
  ------------------
  |  |   38|    152|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|    152|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|    152|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|    152|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  166|    152|             firstErr.c_str());
  167|    152|  }
  168|    486|}
PhaseOneDecompressor.cpp:_ZNK8rawspeed20PhaseOneDecompressor10decompressEv.omp_outlined_debug__:
  161|  15.2k|  decompressThread();

_ZN8rawspeed13PhaseOneStripC2EiNS_10ByteStreamE:
   37|  3.67k|  PhaseOneStrip(int block, ByteStream bs_) : n(block), bs(bs_) {}

_ZN8rawspeed21SamsungV0DecompressorC2ERKNS_8RawImageENS_10ByteStreamES4_:
   46|    146|    : AbstractSamsungDecompressor(image) {
   47|    146|  if (mRaw->getCpp() != 1 || mRaw->getDataType() != RawImageType::UINT16 ||
  ------------------
  |  Branch (47:7): [True: 0, False: 146]
  |  Branch (47:30): [True: 0, False: 146]
  ------------------
   48|    146|      mRaw->getBpp() != sizeof(uint16_t))
  ------------------
  |  Branch (48:7): [True: 0, False: 146]
  ------------------
   49|    146|    ThrowRDE("Unexpected component count / data type");
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   50|       |
   51|    146|  const uint32_t width = mRaw->dim.x;
   52|    146|  const uint32_t height = mRaw->dim.y;
   53|       |
   54|    146|  if (width == 0 || height == 0 || width < 16 || width > 5546 || height > 3714)
  ------------------
  |  Branch (54:7): [True: 1, False: 145]
  |  Branch (54:21): [True: 1, False: 144]
  |  Branch (54:36): [True: 1, False: 143]
  |  Branch (54:50): [True: 2, False: 141]
  |  Branch (54:66): [True: 1, False: 140]
  ------------------
   55|    146|    ThrowRDE("Unexpected image dimensions found: (%u; %u)", width, height);
  ------------------
  |  |   38|      6|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      6|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      6|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      6|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   56|       |
   57|    140|  computeStripes(bso.peekStream(height, 4), bsr);
   58|    140|}
_ZN8rawspeed21SamsungV0Decompressor14computeStripesENS_10ByteStreamES1_:
   61|    140|void SamsungV0Decompressor::computeStripes(ByteStream bso, ByteStream bsr) {
   62|    140|  const uint32_t height = mRaw->dim.y;
   63|       |
   64|    140|  std::vector<uint32_t> offsets;
   65|    140|  offsets.reserve(1 + height);
   66|  5.22k|  for (uint32_t y = 0; y < height; y++)
  ------------------
  |  Branch (66:24): [True: 5.08k, False: 140]
  ------------------
   67|  5.08k|    offsets.emplace_back(bso.getU32());
   68|    140|  offsets.emplace_back(bsr.getSize());
   69|       |
   70|    140|  stripes.reserve(height);
   71|       |
   72|    140|  auto offset_iterator = std::begin(offsets);
   73|    140|  bsr.skipBytes(*offset_iterator);
   74|       |
   75|    140|  auto next_offset_iterator = std::next(offset_iterator);
   76|    389|  while (next_offset_iterator < std::end(offsets)) {
  ------------------
  |  Branch (76:10): [True: 250, False: 139]
  ------------------
   77|    250|    if (*offset_iterator >= *next_offset_iterator)
  ------------------
  |  Branch (77:9): [True: 1, False: 249]
  ------------------
   78|    250|      ThrowRDE("Line offsets are out of sequence or slice is empty.");
  ------------------
  |  |   38|      1|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      1|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      1|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      1|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   79|       |
   80|    249|    const auto size = *next_offset_iterator - *offset_iterator;
   81|    249|    invariant(size > 0);
  ------------------
  |  |   27|    249|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (81:5): [True: 249, False: 0]
  ------------------
   82|       |
   83|    249|    stripes.emplace_back(bsr.getStream(size));
   84|       |
   85|    249|    std::advance(offset_iterator, 1);
   86|    249|    std::advance(next_offset_iterator, 1);
   87|    249|  }
   88|       |
   89|    140|  assert(stripes.size() == height);
  ------------------
  |  Branch (89:3): [True: 129, False: 10]
  ------------------
   90|    139|}
_ZNK8rawspeed21SamsungV0Decompressor10decompressEv:
   92|    129|void SamsungV0Decompressor::decompress() const {
   93|    349|  for (int row = 0; row < mRaw->dim.y; row++)
  ------------------
  |  Branch (93:21): [True: 220, False: 129]
  ------------------
   94|    220|    decompressStrip(row, stripes[row]);
   95|       |
   96|       |  // Swap red and blue pixels to get the final CFA pattern
   97|    129|  const Array2DRef<uint16_t> out(mRaw->getU16DataAsUncroppedArray2DRef());
   98|    155|  for (int row = 0; row < out.height() - 1; row += 2) {
  ------------------
  |  Branch (98:21): [True: 26, False: 129]
  ------------------
   99|  1.94k|    for (int col = 0; col < out.width() - 1; col += 2)
  ------------------
  |  Branch (99:23): [True: 1.91k, False: 26]
  ------------------
  100|  1.91k|      std::swap(out(row, col + 1), out(row + 1, col));
  101|     26|  }
  102|    129|}
_ZN8rawspeed21SamsungV0Decompressor7calcAdjERNS_16BitStreamerMSB32Ei:
  104|  54.7k|int32_t SamsungV0Decompressor::calcAdj(BitStreamerMSB32& bits, int nbits) {
  105|  54.7k|  if (!nbits)
  ------------------
  |  Branch (105:7): [True: 14.4k, False: 40.3k]
  ------------------
  106|  14.4k|    return 0;
  107|  40.3k|  return signExtend(bits.getBits(nbits), nbits);
  108|  54.7k|}
_ZNK8rawspeed21SamsungV0Decompressor15decompressStripEiNS_10ByteStreamE:
  110|    220|void SamsungV0Decompressor::decompressStrip(int row, ByteStream bs) const {
  111|    220|  const Array2DRef<uint16_t> out(mRaw->getU16DataAsUncroppedArray2DRef());
  112|    220|  invariant(out.width() > 0);
  ------------------
  |  |   27|    220|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (112:3): [True: 220, False: 0]
  ------------------
  113|       |
  114|    220|  BitStreamerMSB32 bits(bs.peekRemainingBuffer().getAsArray1DRef());
  115|       |
  116|    220|  std::array<int, 4> len;
  117|    220|  for (int& i : len)
  ------------------
  |  Branch (117:15): [True: 876, False: 220]
  ------------------
  118|    876|    i = row < 2 ? 7 : 4;
  ------------------
  |  Branch (118:9): [True: 652, False: 224]
  ------------------
  119|       |
  120|       |  // Image is arranged in groups of 16 pixels horizontally
  121|  3.65k|  for (int col = 0; col < out.width(); col += 16) {
  ------------------
  |  Branch (121:21): [True: 3.50k, False: 145]
  ------------------
  122|  3.50k|    bits.fill();
  123|  3.50k|    bool dir = !!bits.getBitsNoFill(1);
  124|       |
  125|  3.50k|    std::array<int, 4> op;
  126|  3.50k|    for (int& i : op)
  ------------------
  |  Branch (126:17): [True: 14.0k, False: 3.50k]
  ------------------
  127|  14.0k|      i = bits.getBitsNoFill(2);
  128|       |
  129|  17.5k|    for (int i = 0; i < 4; i++) {
  ------------------
  |  Branch (129:21): [True: 14.0k, False: 3.49k]
  ------------------
  130|  14.0k|      assert(op[i] >= 0 && op[i] <= 3);
  ------------------
  |  Branch (130:7): [True: 14.0k, False: 0]
  |  Branch (130:7): [True: 14.0k, False: 0]
  |  Branch (130:7): [True: 14.0k, False: 0]
  ------------------
  131|       |
  132|  14.0k|      switch (op[i]) {
  133|  1.20k|      case 3:
  ------------------
  |  Branch (133:7): [True: 1.20k, False: 12.7k]
  ------------------
  134|  1.20k|        len[i] = bits.getBits(4);
  135|  1.20k|        break;
  136|    934|      case 2:
  ------------------
  |  Branch (136:7): [True: 934, False: 13.0k]
  ------------------
  137|    934|        len[i]--;
  138|    934|        break;
  139|  1.14k|      case 1:
  ------------------
  |  Branch (139:7): [True: 1.14k, False: 12.8k]
  ------------------
  140|  1.14k|        len[i]++;
  141|  1.14k|        break;
  142|  10.7k|      default:
  ------------------
  |  Branch (142:7): [True: 10.7k, False: 3.29k]
  ------------------
  143|       |        // FIXME: it can be zero too.
  144|  10.7k|        break;
  145|  14.0k|      }
  146|       |
  147|  14.0k|      if (len[i] < 0)
  ------------------
  |  Branch (147:11): [True: 8, False: 13.9k]
  ------------------
  148|  14.0k|        ThrowRDE("Bit length less than 0.");
  ------------------
  |  |   38|      8|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      8|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      8|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      8|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  149|  13.9k|      if (len[i] > 16)
  ------------------
  |  Branch (149:11): [True: 1, False: 13.9k]
  ------------------
  150|  13.9k|        ThrowRDE("Bit Length more than 16.");
  ------------------
  |  |   38|      1|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      1|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      1|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      1|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  151|  13.9k|    }
  152|       |
  153|  3.49k|    if (dir) {
  ------------------
  |  Branch (153:9): [True: 152, False: 3.34k]
  ------------------
  154|       |      // Upward prediction
  155|       |
  156|    152|      if (row < 2)
  ------------------
  |  Branch (156:11): [True: 62, False: 90]
  ------------------
  157|    152|        ThrowRDE("Upward prediction for the first two rows. Raw corrupt");
  ------------------
  |  |   38|     62|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     62|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     62|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     62|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  158|       |
  159|     90|      if (col + 16 >= out.width())
  ------------------
  |  Branch (159:11): [True: 4, False: 86]
  ------------------
  160|     90|        ThrowRDE("Upward prediction for the last block of pixels. Raw corrupt");
  ------------------
  |  |   38|      4|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      4|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      4|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      4|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  161|       |
  162|       |      // First we decode even pixels
  163|    770|      for (int c = 0; c < 16; c += 2) {
  ------------------
  |  Branch (163:23): [True: 684, False: 86]
  ------------------
  164|    684|        int b = len[c >> 3];
  165|    684|        int32_t adj = calcAdj(bits, b);
  166|       |
  167|    684|        out(row, col + c) =
  168|    684|            implicit_cast<uint16_t>(adj + out(row - 1, col + c));
  169|    684|      }
  170|       |
  171|       |      // Now we decode odd pixels
  172|       |      // Why on earth upward prediction only looks up 1 line above
  173|       |      // is beyond me, it will hurt compression a deal.
  174|    751|      for (int c = 1; c < 16; c += 2) {
  ------------------
  |  Branch (174:23): [True: 665, False: 86]
  ------------------
  175|    665|        int b = len[2 | (c >> 3)];
  176|    665|        int32_t adj = calcAdj(bits, b);
  177|       |
  178|    665|        out(row, col + c) =
  179|    665|            implicit_cast<uint16_t>(adj + out(row - 2, col + c));
  180|    665|      }
  181|  3.34k|    } else {
  182|       |      // Left to right prediction
  183|       |      // First we decode even pixels
  184|  3.34k|      int pred_left = col != 0 ? out(row, col - 2) : 128;
  ------------------
  |  Branch (184:23): [True: 3.13k, False: 211]
  ------------------
  185|  30.0k|      for (int c = 0; c < 16; c += 2) {
  ------------------
  |  Branch (185:23): [True: 26.7k, False: 3.34k]
  ------------------
  186|  26.7k|        int b = len[c >> 3];
  187|  26.7k|        int32_t adj = calcAdj(bits, b);
  188|       |
  189|  26.7k|        if (col + c < out.width())
  ------------------
  |  Branch (189:13): [True: 26.4k, False: 298]
  ------------------
  190|  26.4k|          out(row, col + c) = implicit_cast<uint16_t>(adj + pred_left);
  191|  26.7k|      }
  192|       |
  193|       |      // Now we decode odd pixels
  194|  3.34k|      pred_left = col != 0 ? out(row, col - 1) : 128;
  ------------------
  |  Branch (194:19): [True: 3.12k, False: 218]
  ------------------
  195|  30.0k|      for (int c = 1; c < 16; c += 2) {
  ------------------
  |  Branch (195:23): [True: 26.6k, False: 3.34k]
  ------------------
  196|  26.6k|        int b = len[2 | (c >> 3)];
  197|  26.6k|        int32_t adj = calcAdj(bits, b);
  198|       |
  199|  26.6k|        if (col + c < out.width())
  ------------------
  |  Branch (199:13): [True: 26.2k, False: 369]
  ------------------
  200|  26.2k|          out(row, col + c) = implicit_cast<uint16_t>(adj + pred_left);
  201|  26.6k|      }
  202|  3.34k|    }
  203|  3.49k|  }
  204|    220|}

_ZN8rawspeed21SamsungV1DecompressorC2ERKNS_8RawImageENS_10ByteStreamEi:
   47|     98|    : AbstractSamsungDecompressor(image), bs(bs_) {
   48|     98|  if (mRaw->getCpp() != 1 || mRaw->getDataType() != RawImageType::UINT16 ||
  ------------------
  |  Branch (48:7): [True: 0, False: 98]
  |  Branch (48:30): [True: 0, False: 98]
  ------------------
   49|     98|      mRaw->getBpp() != sizeof(uint16_t))
  ------------------
  |  Branch (49:7): [True: 0, False: 98]
  ------------------
   50|     98|    ThrowRDE("Unexpected component count / data type");
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   51|       |
   52|     98|  if (bit != 12)
  ------------------
  |  Branch (52:7): [True: 1, False: 97]
  ------------------
   53|     98|    ThrowRDE("Unexpected bit per pixel (%d)", bit);
  ------------------
  |  |   38|      1|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      1|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      1|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      1|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   54|       |
   55|     97|  const uint32_t width = mRaw->dim.x;
   56|     97|  const uint32_t height = mRaw->dim.y;
   57|       |
   58|     97|  if (width == 0 || height == 0 || width % 32 != 0 || height % 2 != 0 ||
  ------------------
  |  Branch (58:7): [True: 1, False: 96]
  |  Branch (58:21): [True: 1, False: 95]
  |  Branch (58:36): [True: 5, False: 90]
  |  Branch (58:55): [True: 0, False: 90]
  ------------------
   59|     90|      width > 5664 || height > 3714)
  ------------------
  |  Branch (59:7): [True: 18, False: 72]
  |  Branch (59:23): [True: 23, False: 49]
  ------------------
   60|     97|    ThrowRDE("Unexpected image dimensions found: (%u; %u)", width, height);
  ------------------
  |  |   38|     48|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     48|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     48|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     48|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   61|     97|}
_ZNK8rawspeed21SamsungV1Decompressor10decompressEv:
   81|     49|void SamsungV1Decompressor::decompress() const {
   82|       |  // This format has a variable length encoding of how many bits are needed
   83|       |  // to encode the difference between pixels, we use a table to process it
   84|       |  // that has two values, the first the number of bits that were used to
   85|       |  // encode, the second the number of bits that come after with the difference
   86|       |  // The table has 14 entries because the difference can have between 0 (no
   87|       |  // difference) and 13 bits (differences between 12 bits numbers can need 13)
   88|     49|  static const std::array<std::array<uint8_t, 2>, 14> tab = {{{3, 4},
   89|     49|                                                              {3, 7},
   90|     49|                                                              {2, 6},
   91|     49|                                                              {2, 5},
   92|     49|                                                              {4, 3},
   93|     49|                                                              {6, 0},
   94|     49|                                                              {7, 9},
   95|     49|                                                              {8, 10},
   96|     49|                                                              {9, 11},
   97|     49|                                                              {10, 12},
   98|     49|                                                              {10, 13},
   99|     49|                                                              {5, 1},
  100|     49|                                                              {4, 8},
  101|     49|                                                              {4, 2}}};
  102|     49|  std::vector<encTableItem> tbl(1024);
  103|       |
  104|       |  // We generate a 1024 entry table (to be addressed by reading 10 bits) by
  105|       |  // consecutively filling in 2^(10-N) positions where N is the variable number
  106|       |  // of bits of the encoding. So for example 4 is encoded with 3 bits so the
  107|       |  // first 2^(10-3)=128 positions are set with 3,4 so that any time we read 000
  108|       |  // we know the next 4 bits are the difference. We read 10 bits because that is
  109|       |  // the maximum number of bits used in the variable encoding (for the 12 and
  110|       |  // 13 cases)
  111|     49|  uint32_t n = 0;
  112|    686|  for (auto i : tab) {
  ------------------
  |  Branch (112:15): [True: 686, False: 49]
  ------------------
  113|  50.8k|    for (int32_t c = 0; c < (1024 >> i[0]); c++) {
  ------------------
  |  Branch (113:25): [True: 50.1k, False: 686]
  ------------------
  114|  50.1k|      tbl[n].encLen = i[0];
  115|  50.1k|      tbl[n].diffLen = i[1];
  116|  50.1k|      n++;
  117|  50.1k|    }
  118|    686|  }
  119|       |
  120|     49|  const Array2DRef<uint16_t> out(mRaw->getU16DataAsUncroppedArray2DRef());
  121|     49|  invariant(out.width() % 32 == 0 &&
  ------------------
  |  |   27|     49|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (121:3): [True: 49, False: 0]
  |  Branch (121:3): [True: 49, Folded]
  |  Branch (121:3): [True: 49, False: 0]
  ------------------
  122|     49|            "Should have even count of pixels per row.");
  123|     49|  invariant(out.height() % 2 == 0 && "Should have even row count.");
  ------------------
  |  |   27|     49|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (123:3): [True: 49, False: 0]
  |  Branch (123:3): [True: 49, Folded]
  |  Branch (123:3): [True: 49, False: 0]
  ------------------
  124|     49|  BitStreamerMSB pump(bs.peekRemainingBuffer().getAsArray1DRef());
  125|    410|  for (int row = 0; row < out.height(); row++) {
  ------------------
  |  Branch (125:21): [True: 397, False: 13]
  ------------------
  126|    397|    std::array<int, 2> pred = {{}};
  127|    397|    if (row >= 2)
  ------------------
  |  Branch (127:9): [True: 333, False: 64]
  ------------------
  128|    333|      pred = {out(row - 2, 0), out(row - 2, 1)};
  129|       |
  130|  84.0k|    for (int col = 0; col < out.width(); col++) {
  ------------------
  |  Branch (130:23): [True: 83.7k, False: 361]
  ------------------
  131|  83.7k|      int32_t diff = samsungDiff(pump, tbl);
  132|  83.7k|      pred[col & 1] += diff;
  133|       |
  134|  83.7k|      int value = pred[col & 1];
  135|  83.7k|      if (!isIntN(value, bits))
  ------------------
  |  Branch (135:11): [True: 36, False: 83.6k]
  ------------------
  136|  83.7k|        ThrowRDE("decoded value out of bounds");
  ------------------
  |  |   38|     36|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     36|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     36|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     36|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  137|  83.6k|      out(row, col) = implicit_cast<uint16_t>(value);
  138|  83.6k|    }
  139|    397|  }
  140|     49|}
_ZN8rawspeed21SamsungV1Decompressor11samsungDiffERNS_14BitStreamerMSBERKNSt3__16vectorINS0_12encTableItemENS3_9allocatorIS5_EEEE:
   65|  83.7k|                                   const std::vector<encTableItem>& tbl) {
   66|  83.7k|  pump.fill(23); // That is the maximal number of bits we will need here.
   67|       |  // We read 10 bits to index into our table
   68|  83.7k|  uint32_t c = pump.peekBitsNoFill(10);
   69|       |  // Skip the bits that were used to encode this case
   70|  83.7k|  pump.skipBitsNoFill(tbl[c].encLen);
   71|       |  // Read the number of bits the table tells me
   72|  83.7k|  int32_t len = tbl[c].diffLen;
   73|  83.7k|  if (len == 0)
  ------------------
  |  Branch (73:7): [True: 412, False: 83.2k]
  ------------------
   74|    412|    return 0;
   75|  83.2k|  int32_t diff = pump.getBitsNoFill(len);
   76|       |  // If the first bit is 0 we need to turn this into a negative number
   77|  83.2k|  diff = PrefixCodeDecoder<>::extend(diff, len);
   78|  83.2k|  return diff;
   79|  83.7k|}

_ZN8rawspeed21SamsungV2DecompressorC2ERKNS_8RawImageENS_10ByteStreamEj:
   92|    216|    : AbstractSamsungDecompressor(image) {
   93|    216|  if (mRaw->getCpp() != 1 || mRaw->getDataType() != RawImageType::UINT16 ||
  ------------------
  |  Branch (93:7): [True: 0, False: 216]
  |  Branch (93:30): [True: 0, False: 216]
  ------------------
   94|    216|      mRaw->getBpp() != sizeof(uint16_t))
  ------------------
  |  Branch (94:7): [True: 0, False: 216]
  ------------------
   95|    216|    ThrowRDE("Unexpected component count / data type");
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   96|       |
   97|    216|  switch (bits) {
   98|    157|  case 12:
  ------------------
  |  Branch (98:3): [True: 157, False: 59]
  ------------------
   99|    216|  case 14:
  ------------------
  |  Branch (99:3): [True: 59, False: 157]
  ------------------
  100|    216|    break;
  101|      0|  default:
  ------------------
  |  Branch (101:3): [True: 0, False: 216]
  ------------------
  102|      0|    ThrowRDE("Unexpected bit per pixel (%u)", bits);
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  103|    216|  }
  104|       |
  105|    216|  static constexpr const auto headerSize = 16;
  106|    216|  (void)bs.check(headerSize);
  107|       |
  108|    216|  BitStreamerMSB32 startpump(bs.peekRemainingBuffer().getAsArray1DRef());
  109|       |
  110|       |  // Process the initial metadata bits, we only really use initVal, width and
  111|       |  // height (the last two match the TIFF values anyway)
  112|    216|  startpump.getBits(16); // NLCVersion
  113|    216|  startpump.getBits(4);  // ImgFormat
  114|    216|  bitDepth = startpump.getBits(4) + 1;
  115|    216|  if (bitDepth != bits)
  ------------------
  |  Branch (115:7): [True: 1, False: 215]
  ------------------
  116|    216|    ThrowRDE("Bit depth mismatch with container, %u vs %u", bitDepth, bits);
  ------------------
  |  |   38|      1|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      1|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      1|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      1|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  117|    215|  startpump.getBits(4); // NumBlkInRCUnit
  118|    215|  startpump.getBits(4); // CompressionRatio
  119|    215|  width = startpump.getBits(16);
  120|    215|  height = startpump.getBits(16);
  121|    215|  startpump.getBits(16); // TileWidth
  122|    215|  startpump.getBits(4);  // reserved
  123|       |
  124|       |  // The format includes an optimization code that sets 3 flags to change the
  125|       |  // decoding parameters
  126|    215|  const uint32_t _flags = startpump.getBits(4);
  127|    215|  if (_flags > static_cast<uint32_t>(OptFlags::ALL))
  ------------------
  |  Branch (127:7): [True: 1, False: 214]
  ------------------
  128|    215|    ThrowRDE("Invalid opt flags %x", _flags);
  ------------------
  |  |   38|      1|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      1|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      1|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      1|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  129|    214|  optflags = static_cast<OptFlags>(_flags);
  130|       |
  131|    214|  startpump.getBits(8); // OverlapWidth
  132|    214|  startpump.getBits(8); // reserved
  133|    214|  startpump.getBits(8); // Inc
  134|    214|  startpump.getBits(2); // reserved
  135|    214|  initVal = implicit_cast<uint16_t>(startpump.getBits(14));
  136|       |
  137|    214|  invariant(startpump.getInputPosition() == headerSize);
  ------------------
  |  |   27|    214|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (137:3): [True: 213, False: 1]
  ------------------
  138|       |
  139|    213|  if (width == 0 || height == 0 || width % 16 != 0 || width > 6496 ||
  ------------------
  |  Branch (139:7): [True: 1, False: 212]
  |  Branch (139:21): [True: 1, False: 211]
  |  Branch (139:36): [True: 4, False: 207]
  |  Branch (139:55): [True: 2, False: 205]
  ------------------
  140|    205|      height > 4336)
  ------------------
  |  Branch (140:7): [True: 2, False: 203]
  ------------------
  141|    213|    ThrowRDE("Unexpected image dimensions found: (%i; %i)", width, height);
  ------------------
  |  |   38|     10|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     10|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     10|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     10|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  142|       |
  143|    203|  if (width != mRaw->dim.x || height != mRaw->dim.y)
  ------------------
  |  Branch (143:7): [True: 6, False: 197]
  |  Branch (143:31): [True: 8, False: 189]
  ------------------
  144|    203|    ThrowRDE("EXIF image dimensions do not match dimensions from raw header");
  ------------------
  |  |   38|     14|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     14|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     14|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     14|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  145|       |
  146|    189|  data = bs.getSubStream(startpump.getInputPosition(),
  147|    189|                         startpump.getRemainingSize());
  148|    189|}
_ZN8rawspeed21SamsungV2Decompressor13decompressRowEi:
  335|  7.58k|void SamsungV2Decompressor::decompressRow(int row) {
  336|       |  // Align pump to 16byte boundary
  337|  7.58k|  if (const auto line_offset = data.getPosition(); (line_offset & 0xf) != 0)
  ------------------
  |  Branch (337:52): [True: 5.83k, False: 1.75k]
  ------------------
  338|  5.83k|    data.skipBytes(16 - (line_offset & 0xf));
  339|       |
  340|  7.58k|  BitStreamerMSB32 pump(data.peekRemainingBuffer().getAsArray1DRef());
  341|       |
  342|       |  // Initialize the motion and diff modes at the start of the line
  343|  7.58k|  motion = 7;
  344|       |  // By default we are not scaling values at all
  345|  7.58k|  scale = 0;
  346|       |
  347|  7.58k|  for (auto& i : diffBitsMode)
  ------------------
  |  Branch (347:16): [True: 22.7k, False: 7.58k]
  ------------------
  348|  22.7k|    i[0] = i[1] = (row == 0 || row == 1) ? 7 : 4;
  ------------------
  |  Branch (348:20): [True: 567, False: 22.1k]
  |  Branch (348:32): [True: 357, False: 21.7k]
  ------------------
  349|       |
  350|  7.58k|  invariant(width >= 16);
  ------------------
  |  |   27|  7.58k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (350:3): [True: 7.57k, False: 15]
  ------------------
  351|  7.57k|  invariant(width % 16 == 0);
  ------------------
  |  |   27|  7.57k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (351:3): [True: 7.57k, False: 0]
  ------------------
  352|  34.7k|  for (int col = 0; col < width; col += 16)
  ------------------
  |  Branch (352:21): [True: 27.1k, False: 7.57k]
  ------------------
  353|  27.1k|    processBlock(pump, row, col);
  354|       |
  355|  7.57k|  data.skipBytes(pump.getStreamPosition());
  356|  7.57k|}
_ZN8rawspeed21SamsungV2Decompressor12processBlockERNS_16BitStreamerMSB32Eii:
  321|  27.1k|SamsungV2Decompressor::processBlock(BitStreamerMSB32& pump, int row, int col) {
  322|  27.1k|  const Array2DRef<uint16_t> out(mRaw->getU16DataAsUncroppedArray2DRef());
  323|       |
  324|  27.1k|  const std::array<uint16_t, 16> baseline =
  325|  27.1k|      prepareBaselineValues(pump, row, col);
  326|       |
  327|       |  // Figure out how many difference bits we have to read for each pixel
  328|  27.1k|  const std::array<int, 16> diffs = decodeDifferences(pump, row);
  329|       |
  330|       |  // Actually apply the differences and write them to the pixels
  331|   459k|  for (int i = 0; i < 16; ++i, ++col)
  ------------------
  |  Branch (331:19): [True: 432k, False: 27.1k]
  ------------------
  332|   432k|    out(row, col) = clampBits(baseline[i] + diffs[i], bitDepth);
  333|  27.1k|}
_ZN8rawspeed21SamsungV2Decompressor21prepareBaselineValuesERNS_16BitStreamerMSB32Eii:
  159|  27.1k|                                             int col) {
  160|  27.1k|  const Array2DRef<uint16_t> img(mRaw->getU16DataAsUncroppedArray2DRef());
  161|       |
  162|  27.1k|  std::array<uint16_t, 16> baseline;
  163|       |
  164|  27.1k|  if (!(optflags & OptFlags::QP) && (col % 64) == 0) {
  ------------------
  |  Branch (164:7): [True: 23.4k, False: 3.76k]
  |  Branch (164:37): [True: 10.2k, False: 13.1k]
  ------------------
  165|       |    // Change scale every four 16-pixel blocks.
  166|  10.2k|    static constexpr std::array<int32_t, 3> scalevals = {{0, -2, 2}};
  167|  10.2k|    uint32_t i = pump.getBits(2);
  168|  10.2k|    scale = i < 3 ? scale + scalevals[i] : pump.getBits(12);
  ------------------
  |  Branch (168:13): [True: 5.89k, False: 4.35k]
  ------------------
  169|  10.2k|  }
  170|       |
  171|       |  // First we figure out which reference pixels mode we're in
  172|  27.1k|  if (optflags & OptFlags::MV)
  ------------------
  |  Branch (172:7): [True: 14.2k, False: 12.8k]
  ------------------
  173|  14.2k|    motion = pump.getBits(1) ? 3 : 7;
  ------------------
  |  Branch (173:14): [True: 5.09k, False: 9.19k]
  ------------------
  174|  12.8k|  else if (!pump.getBits(1))
  ------------------
  |  Branch (174:12): [True: 2.02k, False: 10.8k]
  ------------------
  175|  2.02k|    motion = pump.getBits(3);
  176|       |
  177|  27.1k|  if ((row == 0 || row == 1) && (motion != 7))
  ------------------
  |  Branch (177:8): [True: 6.17k, False: 21.0k]
  |  Branch (177:20): [True: 3.47k, False: 17.5k]
  |  Branch (177:33): [True: 47, False: 9.60k]
  ------------------
  178|  27.1k|    ThrowRDE("At start of image and motion isn't 7. File corrupted?");
  ------------------
  |  |   38|     47|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     47|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     47|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     47|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  179|       |
  180|  27.1k|  if (motion == 7) {
  ------------------
  |  Branch (180:7): [True: 18.0k, False: 9.09k]
  ------------------
  181|       |    // The base case.
  182|       |    // If we're at the left edge we just start at the initial value.
  183|  18.0k|    if (col == 0) {
  ------------------
  |  Branch (183:9): [True: 4.36k, False: 13.6k]
  ------------------
  184|  4.36k|      baseline.fill(initVal);
  185|  4.36k|      return baseline;
  186|  4.36k|    }
  187|       |    // Else just set all pixels to the previous ones on the same line.
  188|  13.6k|    std::array<uint16_t, 2> prev;
  189|  41.0k|    for (int i = 0; i < 2; i++)
  ------------------
  |  Branch (189:21): [True: 27.3k, False: 13.6k]
  ------------------
  190|  27.3k|      prev[i] = img(row, col + i - 2);
  191|   232k|    for (int i = 0; i < 16; i++)
  ------------------
  |  Branch (191:21): [True: 218k, False: 13.6k]
  ------------------
  192|   218k|      baseline[i] = prev[i & 1];
  193|  13.6k|    return baseline;
  194|  18.0k|  }
  195|       |
  196|       |  // The complex case, we now need to actually lookup one or two lines above
  197|  9.09k|  if (row < 2)
  ------------------
  |  Branch (197:7): [True: 0, False: 9.09k]
  ------------------
  198|  9.09k|    ThrowRDE("Got a previous line lookup on first two lines. File corrupted?");
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  199|       |
  200|  9.09k|  static constexpr std::array<int32_t, 7> motionOffset = {-4, -2, -2, 0,
  201|  9.09k|                                                          0,  2,  4};
  202|  9.09k|  static constexpr std::array<int32_t, 7> motionDoAverage = {0, 0, 1, 0,
  203|  9.09k|                                                             1, 0, 0};
  204|       |
  205|  9.09k|  int32_t slideOffset = motionOffset[motion];
  206|  9.09k|  int32_t doAverage = motionDoAverage[motion];
  207|       |
  208|   154k|  for (int i = 0; i < 16; i++) {
  ------------------
  |  Branch (208:19): [True: 145k, False: 9.07k]
  ------------------
  209|   145k|    int refRow = row;
  210|   145k|    int refCol = col + i + slideOffset;
  211|       |
  212|   145k|    if ((row + i) & 1) { // Red or blue pixels use same color two lines up
  ------------------
  |  Branch (212:9): [True: 72.6k, False: 72.6k]
  ------------------
  213|  72.6k|      refRow -= 2;
  214|  72.6k|    } else { // Green pixel N uses Green pixel N from row above
  215|  72.6k|      refRow -= 1;
  216|  72.6k|      refCol += (i & 1) ? -1 : 1; // (top left or top right)
  ------------------
  |  Branch (216:17): [True: 32.4k, False: 40.2k]
  ------------------
  217|  72.6k|    }
  218|       |
  219|   145k|    if (refCol < 0)
  ------------------
  |  Branch (219:9): [True: 6, False: 145k]
  ------------------
  220|   145k|      ThrowRDE("Bad motion %d at the beginning of the row", motion);
  ------------------
  |  |   38|      6|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      6|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      6|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      6|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  221|   145k|    if ((refCol >= width) || (doAverage && (refCol + 2 >= width)))
  ------------------
  |  Branch (221:9): [True: 5, False: 145k]
  |  Branch (221:31): [True: 3.42k, False: 141k]
  |  Branch (221:44): [True: 3, False: 3.41k]
  ------------------
  222|   145k|      ThrowRDE("Bad motion %d at the end of the row", motion);
  ------------------
  |  |   38|      8|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      8|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      8|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      8|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  223|       |
  224|       |    // In some cases we use as reference interpolation of this pixel and
  225|       |    // the next
  226|   145k|    if (doAverage) {
  ------------------
  |  Branch (226:9): [True: 3.41k, False: 141k]
  ------------------
  227|  3.41k|      baseline[i] = (img(refRow, refCol) + img(refRow, refCol + 2) + 1) >> 1;
  228|   141k|    } else {
  229|   141k|      baseline[i] = img(refRow, refCol);
  230|   141k|    }
  231|   145k|  }
  232|       |
  233|  9.07k|  return baseline;
  234|  9.09k|}
SamsungV2Decompressor.cpp:_ZN8rawspeed12_GLOBAL__N_1anENS_21SamsungV2Decompressor8OptFlagsES2_:
   71|  81.4k|                         SamsungV2Decompressor::OptFlags rhs) {
   72|  81.4k|  return SamsungV2Decompressor::OptFlags::NONE !=
   73|  81.4k|         static_cast<SamsungV2Decompressor::OptFlags>(
   74|  81.4k|             static_cast<
   75|  81.4k|                 std::underlying_type_t<SamsungV2Decompressor::OptFlags>>(lhs) &
   76|  81.4k|             static_cast<
   77|  81.4k|                 std::underlying_type_t<SamsungV2Decompressor::OptFlags>>(rhs));
   78|  81.4k|}
_ZN8rawspeed21SamsungV2Decompressor17decodeDifferencesERNS_16BitStreamerMSB32Ei:
  284|  27.1k|SamsungV2Decompressor::decodeDifferences(BitStreamerMSB32& pump, int row) {
  285|       |  // Figure out how many difference bits we have to read for each pixel
  286|  27.1k|  const std::array<uint32_t, 4> diffBits = decodeDiffLengths(pump, row);
  287|       |
  288|       |  // Actually read the differences. We know these fit into 15-bit ints.
  289|  27.1k|  std::array<int16_t, 16> diffs;
  290|   459k|  for (int i = 0; i < 16; i++) {
  ------------------
  |  Branch (290:19): [True: 432k, False: 27.1k]
  ------------------
  291|   432k|    uint32_t len = diffBits[i >> 2];
  292|   432k|    int16_t diff = getDiff(pump, len);
  293|   432k|    diffs[i] = diff;
  294|   432k|  }
  295|       |
  296|       |  // Reshuffle the differences, while they still are only 16-bit.
  297|  27.1k|  std::array<int16_t, 16> shuffled;
  298|   459k|  for (int i = 0; i < 16; i++) {
  ------------------
  |  Branch (298:19): [True: 432k, False: 27.1k]
  ------------------
  299|   432k|    int p;
  300|       |    // The differences are stored interlaced:
  301|       |    // 0 2 4 6 8 10 12 14 1 3 5 7 9 11 13 15
  302|   432k|    if (row % 2)
  ------------------
  |  Branch (302:9): [True: 182k, False: 249k]
  ------------------
  303|   182k|      p = ((i % 8) << 1) - (i >> 3) + 1;
  304|   249k|    else
  305|   249k|      p = ((i % 8) << 1) + (i >> 3);
  306|       |
  307|   432k|    shuffled[p] = diffs[i];
  308|   432k|  }
  309|       |
  310|       |  // And finally widen and scale the differences.
  311|  27.1k|  std::array<int, 16> scaled;
  312|   459k|  for (int i = 0; i < 16; i++) {
  ------------------
  |  Branch (312:19): [True: 432k, False: 27.1k]
  ------------------
  313|   432k|    int scaledDiff = (int(shuffled[i]) * (scale * 2 + 1)) + scale;
  314|   432k|    scaled[i] = scaledDiff;
  315|   432k|  }
  316|       |
  317|  27.1k|  return scaled;
  318|  27.1k|}
_ZN8rawspeed21SamsungV2Decompressor17decodeDiffLengthsERNS_16BitStreamerMSB32Ei:
  237|  27.1k|SamsungV2Decompressor::decodeDiffLengths(BitStreamerMSB32& pump, int row) {
  238|  27.1k|  if (!(optflags & OptFlags::SKIP) && pump.getBits(1))
  ------------------
  |  Branch (238:7): [True: 21.3k, False: 5.78k]
  |  Branch (238:39): [True: 17.4k, False: 3.86k]
  ------------------
  239|  17.4k|    return {};
  240|       |
  241|  9.64k|  std::array<uint32_t, 4> diffBits;
  242|       |
  243|       |  // Figure out how many difference bits we have to read for each pixel
  244|  9.64k|  std::array<uint32_t, 4> flags;
  245|  9.64k|  for (unsigned int& flag : flags)
  ------------------
  |  Branch (245:27): [True: 38.5k, False: 9.64k]
  ------------------
  246|  38.5k|    flag = pump.getBits(2);
  247|       |
  248|  48.1k|  for (int i = 0; i < 4; i++) {
  ------------------
  |  Branch (248:19): [True: 38.4k, False: 9.61k]
  ------------------
  249|       |    // The color is 0-Green 1-Blue 2-Red
  250|  38.4k|    uint32_t colornum = (row % 2 != 0) ? i >> 1 : ((i >> 1) + 2) % 3;
  ------------------
  |  Branch (250:25): [True: 16.7k, False: 21.7k]
  ------------------
  251|       |
  252|  38.4k|    assert(flags[i] <= 3);
  ------------------
  |  Branch (252:5): [True: 38.4k, False: 0]
  ------------------
  253|  38.4k|    switch (flags[i]) {
  254|  17.3k|    case 0:
  ------------------
  |  Branch (254:5): [True: 17.3k, False: 21.1k]
  ------------------
  255|  17.3k|      diffBits[i] = diffBitsMode[colornum][0];
  256|  17.3k|      break;
  257|  6.30k|    case 1:
  ------------------
  |  Branch (257:5): [True: 6.30k, False: 32.1k]
  ------------------
  258|  6.30k|      diffBits[i] = diffBitsMode[colornum][0] + 1;
  259|  6.30k|      break;
  260|  5.42k|    case 2:
  ------------------
  |  Branch (260:5): [True: 5.42k, False: 33.0k]
  ------------------
  261|  5.42k|      if (diffBitsMode[colornum][0] == 0)
  ------------------
  |  Branch (261:11): [True: 7, False: 5.42k]
  ------------------
  262|  5.42k|        ThrowRDE("Difference bits underflow. File corrupted?");
  ------------------
  |  |   38|      7|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      7|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      7|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      7|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  263|  5.42k|      diffBits[i] = diffBitsMode[colornum][0] - 1;
  264|  5.42k|      break;
  265|  9.37k|    case 3:
  ------------------
  |  Branch (265:5): [True: 9.37k, False: 29.1k]
  ------------------
  266|  9.37k|      diffBits[i] = pump.getBits(4);
  267|  9.37k|      break;
  268|      0|    default:
  ------------------
  |  Branch (268:5): [True: 0, False: 38.4k]
  ------------------
  269|      0|      __builtin_unreachable();
  270|  38.4k|    }
  271|       |
  272|  38.4k|    diffBitsMode[colornum][0] = diffBitsMode[colornum][1];
  273|  38.4k|    diffBitsMode[colornum][1] = diffBits[i];
  274|       |
  275|  38.4k|    if (diffBits[i] > bitDepth + 1)
  ------------------
  |  Branch (275:9): [True: 20, False: 38.4k]
  ------------------
  276|  38.4k|      ThrowRDE("Too many difference bits (%u). File corrupted?", diffBits[i]);
  ------------------
  |  |   38|     20|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     20|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     20|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     20|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  277|  38.4k|    assert(diffBits[i] <= 15 && "So any difference fits within uint16_t");
  ------------------
  |  Branch (277:5): [True: 38.4k, False: 0]
  |  Branch (277:5): [True: 38.4k, Folded]
  |  Branch (277:5): [True: 38.4k, False: 0]
  ------------------
  278|  38.4k|  }
  279|       |
  280|  9.61k|  return diffBits;
  281|  9.64k|}
_ZN8rawspeed21SamsungV2Decompressor7getDiffERNS_16BitStreamerMSB32Ej:
   83|   432k|SamsungV2Decompressor::getDiff(BitStreamerMSB32& pump, uint32_t len) {
   84|   432k|  if (len == 0)
  ------------------
  |  Branch (84:7): [True: 290k, False: 141k]
  ------------------
   85|   290k|    return 0;
   86|   141k|  invariant(len <= 15 && "Difference occupies at most 15 bits.");
  ------------------
  |  |   27|   141k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (86:3): [True: 141k, False: 0]
  |  Branch (86:3): [True: 141k, Folded]
  |  Branch (86:3): [True: 141k, False: 0]
  ------------------
   87|   141k|  return implicit_cast<int16_t>(signExtend(pump.getBits(len), len));
   88|   141k|}
_ZN8rawspeed21SamsungV2Decompressor10decompressEv:
  358|    189|void SamsungV2Decompressor::decompress() {
  359|  7.77k|  for (int row = 0; row < height; row++)
  ------------------
  |  Branch (359:21): [True: 7.58k, False: 189]
  ------------------
  360|  7.58k|    decompressRow(row);
  361|    189|}

_ZN8rawspeed20SonyArw1DecompressorC2ENS_8RawImageE:
   40|    826|    : mRaw(std::move(img)) {
   41|    826|  if (mRaw->getCpp() != 1 || mRaw->getDataType() != RawImageType::UINT16 ||
  ------------------
  |  Branch (41:7): [True: 0, False: 826]
  |  Branch (41:30): [True: 0, False: 826]
  ------------------
   42|    826|      mRaw->getBpp() != sizeof(uint16_t))
  ------------------
  |  Branch (42:7): [True: 0, False: 826]
  ------------------
   43|    826|    ThrowRDE("Unexpected component count / data type");
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   44|       |
   45|    826|  const uint32_t w = mRaw->dim.x;
   46|    826|  const uint32_t h = mRaw->dim.y;
   47|       |
   48|    826|  if (w == 0 || h == 0 || h % 2 != 0 || w > 4600 || h > 3072)
  ------------------
  |  Branch (48:7): [True: 0, False: 826]
  |  Branch (48:17): [True: 0, False: 826]
  |  Branch (48:27): [True: 0, False: 826]
  |  Branch (48:41): [True: 8, False: 818]
  |  Branch (48:53): [True: 2, False: 816]
  ------------------
   49|    826|    ThrowRDE("Unexpected image dimensions found: (%u; %u)", w, h);
  ------------------
  |  |   38|     10|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     10|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     10|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     10|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   50|    826|}
_ZNK8rawspeed20SonyArw1Decompressor10decompressENS_10ByteStreamE:
   59|    816|void SonyArw1Decompressor::decompress(ByteStream input) const {
   60|    816|  const Array2DRef<uint16_t> out(mRaw->getU16DataAsUncroppedArray2DRef());
   61|    816|  invariant(out.width() > 0);
  ------------------
  |  |   27|    816|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (61:3): [True: 816, False: 0]
  ------------------
   62|    816|  invariant(out.height() > 0);
  ------------------
  |  |   27|    816|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (62:3): [True: 816, False: 0]
  ------------------
   63|    816|  invariant(out.height() % 2 == 0);
  ------------------
  |  |   27|    816|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (63:3): [True: 816, False: 0]
  ------------------
   64|       |
   65|    816|  BitStreamerMSB bits(input.peekRemainingBuffer().getAsArray1DRef());
   66|    816|  int pred = 0;
   67|  1.18k|  for (int col = out.width() - 1; col >= 0; col--) {
  ------------------
  |  Branch (67:35): [True: 1.17k, False: 9]
  ------------------
   68|   438k|    for (int row = 0; row < out.height() + 1; row += 2) {
  ------------------
  |  Branch (68:23): [True: 438k, False: 366]
  ------------------
   69|   438k|      bits.fill(32);
   70|       |
   71|   438k|      if (row == out.height())
  ------------------
  |  Branch (71:11): [True: 377, False: 437k]
  ------------------
   72|    377|        row = 1;
   73|       |
   74|   438k|      uint32_t len = 4 - bits.getBitsNoFill(2);
   75|       |
   76|   438k|      if (len == 3 && bits.getBitsNoFill(1))
  ------------------
  |  Branch (76:11): [True: 42.2k, False: 396k]
  |  Branch (76:23): [True: 20.9k, False: 21.3k]
  ------------------
   77|  20.9k|        len = 0;
   78|       |
   79|   438k|      if (len == 4)
  ------------------
  |  Branch (79:11): [True: 47.7k, False: 390k]
  ------------------
   80|   116k|        while (len < 17 && !bits.getBitsNoFill(1))
  ------------------
  |  Branch (80:16): [True: 115k, False: 493]
  |  Branch (80:28): [True: 68.2k, False: 47.2k]
  ------------------
   81|  68.2k|          len++;
   82|       |
   83|   438k|      int diff = getDiff(bits, len);
   84|   438k|      pred += diff;
   85|       |
   86|   438k|      if (!isIntN(pred, 12))
  ------------------
  |  Branch (86:11): [True: 807, False: 437k]
  ------------------
   87|   438k|        ThrowRDE("Error decompressing");
  ------------------
  |  |   38|    807|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|    807|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|    807|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|    807|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   88|       |
   89|   437k|      out(row, col) = implicit_cast<uint16_t>(pred);
   90|   437k|    }
   91|  1.17k|  }
   92|    816|}
_ZN8rawspeed20SonyArw1Decompressor7getDiffERNS_14BitStreamerMSBEj:
   52|   438k|inline int SonyArw1Decompressor::getDiff(BitStreamerMSB& bs, uint32_t len) {
   53|   438k|  if (len == 0)
  ------------------
  |  Branch (53:7): [True: 20.9k, False: 417k]
  ------------------
   54|  20.9k|    return 0;
   55|   417k|  int diff = bs.getBitsNoFill(len);
   56|   417k|  return PrefixCodeDecoder<>::extend(diff, len);
   57|   438k|}

_ZN8rawspeed20SonyArw2DecompressorC2ENS_8RawImageENS_10ByteStreamE:
   43|     92|    : mRaw(std::move(img)) {
   44|     92|  if (mRaw->getCpp() != 1 || mRaw->getDataType() != RawImageType::UINT16 ||
  ------------------
  |  Branch (44:7): [True: 0, False: 92]
  |  Branch (44:30): [True: 0, False: 92]
  ------------------
   45|     92|      mRaw->getBpp() != sizeof(uint16_t))
  ------------------
  |  Branch (45:7): [True: 0, False: 92]
  ------------------
   46|     92|    ThrowRDE("Unexpected component count / data type");
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   47|       |
   48|     92|  if (!mRaw->dim.hasPositiveArea() || mRaw->dim.x % 32 != 0 ||
  ------------------
  |  Branch (48:7): [True: 0, False: 92]
  |  Branch (48:39): [True: 2, False: 90]
  ------------------
   49|     90|      mRaw->dim.x > 9600 || mRaw->dim.y > 6376)
  ------------------
  |  Branch (49:7): [True: 0, False: 90]
  |  Branch (49:29): [True: 0, False: 90]
  ------------------
   50|     92|    ThrowRDE("Unexpected image dimensions found: (%d; %d)", mRaw->dim.x,
  ------------------
  |  |   38|      2|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      2|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      2|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      2|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   51|     90|             mRaw->dim.y);
   52|       |
   53|       |  // 1 byte per pixel
   54|     90|  input = input_.peekStream(mRaw->dim.x * mRaw->dim.y);
   55|     90|}
_ZNK8rawspeed20SonyArw2Decompressor13decompressRowEi:
   57|  18.2k|void SonyArw2Decompressor::decompressRow(int row) const {
   58|  18.2k|  const Array2DRef<uint16_t> out(mRaw->getU16DataAsUncroppedArray2DRef());
   59|  18.2k|  invariant(out.width() > 0);
  ------------------
  |  |   27|  18.2k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (59:3): [True: 18.1k, False: 161]
  ------------------
   60|  18.1k|  invariant(out.width() % 32 == 0);
  ------------------
  |  |   27|  18.1k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (60:3): [True: 18.0k, False: 36]
  ------------------
   61|       |
   62|       |  // Allow compiler to devirtualize the calls below.
   63|  18.0k|  auto& rawdata = reinterpret_cast<RawImageDataU16&>(*mRaw);
   64|       |
   65|  18.0k|  ByteStream rowBs = input;
   66|  18.0k|  rowBs.skipBytes(row * out.width());
   67|  18.0k|  rowBs = rowBs.peekStream(out.width());
   68|       |
   69|  18.0k|  BitStreamerLSB bits(rowBs.peekRemainingBuffer().getAsArray1DRef());
   70|       |
   71|  18.0k|  uint32_t random = bits.peekBits(24);
   72|       |
   73|       |  // Each loop iteration processes 16 pixels, consuming 128 bits of input.
   74|  39.3k|  for (int col = 0; col < out.width(); col += ((col & 1) != 0) ? 31 : 1) {
  ------------------
  |  Branch (74:21): [True: 35.3k, False: 4.05k]
  |  Branch (74:47): [True: 9.03k, False: 12.2k]
  ------------------
   75|       |    // 30 bits.
   76|  35.3k|    int _max = bits.getBits(11);
   77|  35.3k|    int _min = bits.getBits(11);
   78|  35.3k|    int _imax = bits.getBits(4);
   79|  35.3k|    int _imin = bits.getBits(4);
   80|       |
   81|       |    // 128-30 = 98 bits remaining, still need to decode 16 pixels...
   82|       |    // Each full pixel consumes 7 bits, thus we can only have 14 full pixels.
   83|       |    // So we lack 2 pixels. That is where _imin and _imax come into play,
   84|       |    // values of those pixels were already specified in _min and _max.
   85|       |    // But what that means is, _imin and _imax must not be equal!
   86|  35.3k|    if (_imax == _imin)
  ------------------
  |  Branch (86:9): [True: 14.0k, False: 21.2k]
  ------------------
   87|  35.3k|      ThrowRDE("ARW2 invariant failed, same pixel is both min and max");
  ------------------
  |  |   38|  14.0k|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|  14.0k|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|  14.0k|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|  14.0k|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   88|       |
   89|  21.2k|    int sh = 0;
   90|  49.8k|    while ((sh < 4) && ((0x80 << sh) <= (_max - _min)))
  ------------------
  |  Branch (90:12): [True: 47.5k, False: 2.27k]
  |  Branch (90:24): [True: 28.5k, False: 19.0k]
  ------------------
   91|  28.5k|      sh++;
   92|       |
   93|   331k|    for (int i = 0; i < 16; i++) {
  ------------------
  |  Branch (93:21): [True: 310k, False: 21.2k]
  ------------------
   94|   310k|      int p;
   95|   310k|      if (i == _imax)
  ------------------
  |  Branch (95:11): [True: 21.4k, False: 288k]
  ------------------
   96|  21.4k|        p = _max;
   97|   288k|      else {
   98|   288k|        if (i == _imin)
  ------------------
  |  Branch (98:13): [True: 21.4k, False: 267k]
  ------------------
   99|  21.4k|          p = _min;
  100|   267k|        else {
  101|   267k|          p = (bits.getBits(7) << sh) + _min;
  102|   267k|          p = std::min(p, 0x7ff);
  103|   267k|        }
  104|   288k|      }
  105|   310k|      rawdata.setWithLookUp(
  106|   310k|          implicit_cast<uint16_t>(p << 1),
  107|   310k|          reinterpret_cast<std::byte*>(&out(row, col + (i * 2))), &random);
  108|   310k|    }
  109|  21.2k|  }
  110|  18.0k|}
_ZNK8rawspeed20SonyArw2Decompressor16decompressThreadEv:
  112|  55.6k|void SonyArw2Decompressor::decompressThread() const noexcept {
  113|  55.6k|  invariant(mRaw->dim.x > 0);
  ------------------
  |  |   27|  55.6k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (113:3): [True: 2.63k, False: 53.0k]
  ------------------
  114|  2.63k|  invariant(mRaw->dim.x % 32 == 0);
  ------------------
  |  |   27|  2.63k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (114:3): [True: 2.60k, False: 30]
  ------------------
  115|  2.60k|  invariant(mRaw->dim.y > 0);
  ------------------
  |  |   27|  2.60k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (115:3): [True: 2.59k, False: 9]
  ------------------
  116|       |
  117|  2.59k|#ifdef HAVE_OPENMP
  118|  2.59k|#pragma omp for schedule(static)
  119|  2.59k|#endif
  120|  2.59k|  for (int y = 0; y < mRaw->dim.y; y++) {
  121|  2.59k|    try {
  122|  2.59k|      decompressRow(y);
  123|  2.59k|    } catch (const RawspeedException& err) {
  124|       |      // Propagate the exception out of OpenMP magic.
  125|  2.59k|      mRaw->setError(err.what());
  126|  2.59k|#ifdef HAVE_OPENMP
  127|  2.59k|#pragma omp cancel for
  128|  2.59k|#endif
  129|  2.59k|    } catch (...) {
  130|       |      // We should not get any other exception type here.
  131|  2.59k|      __builtin_unreachable();
  132|  2.59k|    }
  133|  2.59k|  }
  134|  2.59k|}
_ZNK8rawspeed20SonyArw2Decompressor10decompressEv:
  136|     84|void SonyArw2Decompressor::decompress() const {
  137|     84|#ifdef HAVE_OPENMP
  138|     84|#pragma omp parallel default(none)                                             \
  139|     84|    num_threads(rawspeed_get_number_of_processor_cores())
  140|     84|#endif
  141|     84|  decompressThread();
  142|       |
  143|     84|  std::string firstErr;
  144|     84|  if (mRaw->isTooManyErrors(1, &firstErr)) {
  ------------------
  |  Branch (144:7): [True: 83, False: 1]
  ------------------
  145|     83|    ThrowRDE("Too many errors encountered. Giving up. First Error:\n%s",
  ------------------
  |  |   38|     83|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     83|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     83|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     83|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  146|     83|             firstErr.c_str());
  147|     83|  }
  148|     84|}
SonyArw2Decompressor.cpp:_ZNK8rawspeed20SonyArw2Decompressor10decompressEv.omp_outlined_debug__:
  141|  2.65k|  decompressThread();

_ZN8rawspeed24UncompressedDecompressor13decode8BitRawILb0EEEvv:
  271|     17|void UncompressedDecompressor::decode8BitRaw() {
  272|     17|  uint32_t w = size.x;
  273|     17|  uint32_t h = size.y;
  274|     17|  sanityCheck(w, &h, 1);
  275|       |
  276|     17|  const Array2DRef<uint16_t> out(mRaw->getU16DataAsUncroppedArray2DRef());
  277|       |
  278|     17|  const auto in = Array2DRef(input.getData(w * h), w, h);
  279|     17|  uint32_t random = 0;
  280|    370|  for (uint32_t row = 0; row < h; row++) {
  ------------------
  |  Branch (280:26): [True: 353, False: 17]
  ------------------
  281|  2.06k|    for (uint32_t col = 0; col < w; col++) {
  ------------------
  |  Branch (281:28): [True: 1.71k, False: 353]
  ------------------
  282|       |      if constexpr (uncorrectedRawValues)
  283|       |        out(row, col) = in(row, col);
  284|  1.71k|      else {
  285|  1.71k|        mRaw->setWithLookUp(in(row, col),
  286|  1.71k|                            reinterpret_cast<std::byte*>(&out(row, col)),
  287|  1.71k|                            &random);
  288|  1.71k|      }
  289|  1.71k|    }
  290|    353|  }
  291|     17|}
_ZN8rawspeed24UncompressedDecompressor25decode12BitRawWithControlILNS_10EndiannessE57005EEEvv:
  297|     63|void UncompressedDecompressor::decode12BitRawWithControl() {
  298|     63|  uint32_t w = size.x;
  299|     63|  uint32_t h = size.y;
  300|     63|  static constexpr const auto bits = 12;
  301|       |
  302|     63|  static_assert(e == Endianness::little || e == Endianness::big,
  303|     63|                "unknown endianness");
  304|       |
  305|     63|  static constexpr const auto shift = 16 - bits;
  306|     63|  static constexpr const auto pack = 8 - shift;
  307|     63|  static constexpr const auto mask = (1 << pack) - 1;
  308|       |
  309|     63|  static_assert(bits == 12 && pack == 4, "wrong pack");
  310|       |
  311|     63|  static_assert(bits == 12 && mask == 0x0f, "wrong mask");
  312|       |
  313|     63|  uint32_t perline = bytesPerLine(w, /*skips=*/true);
  314|       |
  315|     63|  sanityCheck(&h, perline);
  316|       |
  317|     63|  const Array2DRef<uint16_t> out(mRaw->getU16DataAsUncroppedArray2DRef());
  318|       |
  319|     63|  const auto in = Array2DRef(input.getData(perline * h), perline, h);
  320|  1.66k|  for (uint32_t row = 0; row < h; row++) {
  ------------------
  |  Branch (320:26): [True: 1.60k, False: 63]
  ------------------
  321|  1.60k|    uint32_t col = 0;
  322|   407k|    for (uint32_t x = 0; x < w; x += 2) {
  ------------------
  |  Branch (322:26): [True: 405k, False: 1.60k]
  ------------------
  323|   405k|      uint32_t g1 = in(row, col + 0);
  324|   405k|      uint32_t g2 = in(row, col + 1);
  325|       |
  326|   405k|      auto process = [out, row](uint32_t i, bool invert, uint32_t p1,
  327|   405k|                                uint32_t p2) {
  328|   405k|        uint16_t pix;
  329|   405k|        if (!(invert ^ (e == Endianness::little)))
  330|   405k|          pix = implicit_cast<uint16_t>((p1 << pack) | (p2 >> pack));
  331|   405k|        else
  332|   405k|          pix = implicit_cast<uint16_t>(((p2 & mask) << 8) | p1);
  333|   405k|        out(row, i) = pix;
  334|   405k|      };
  335|       |
  336|   405k|      process(x, false, g1, g2);
  337|       |
  338|   405k|      g1 = in(row, col + 2);
  339|       |
  340|   405k|      process(x + 1, true, g1, g2);
  341|       |
  342|   405k|      col += 3;
  343|       |
  344|   405k|      if ((x % 10) == 8)
  ------------------
  |  Branch (344:11): [True: 80.4k, False: 325k]
  ------------------
  345|  80.4k|        col++;
  346|   405k|    }
  347|  1.60k|  }
  348|     63|  input.skipBytes(input.getRemainSize());
  349|     63|}
_ZZN8rawspeed24UncompressedDecompressor25decode12BitRawWithControlILNS_10EndiannessE57005EEEvvENKUljbjjE_clEjbjj:
  327|   811k|                                uint32_t p2) {
  328|   811k|        uint16_t pix;
  329|   811k|        if (!(invert ^ (e == Endianness::little)))
  ------------------
  |  Branch (329:13): [True: 405k, False: 405k]
  ------------------
  330|   405k|          pix = implicit_cast<uint16_t>((p1 << pack) | (p2 >> pack));
  331|   405k|        else
  332|   405k|          pix = implicit_cast<uint16_t>(((p2 & mask) << 8) | p1);
  333|   811k|        out(row, i) = pix;
  334|   811k|      };
_ZN8rawspeed24UncompressedDecompressor25decode12BitRawWithControlILNS_10EndiannessE48879EEEvv:
  297|     22|void UncompressedDecompressor::decode12BitRawWithControl() {
  298|     22|  uint32_t w = size.x;
  299|     22|  uint32_t h = size.y;
  300|     22|  static constexpr const auto bits = 12;
  301|       |
  302|     22|  static_assert(e == Endianness::little || e == Endianness::big,
  303|     22|                "unknown endianness");
  304|       |
  305|     22|  static constexpr const auto shift = 16 - bits;
  306|     22|  static constexpr const auto pack = 8 - shift;
  307|     22|  static constexpr const auto mask = (1 << pack) - 1;
  308|       |
  309|     22|  static_assert(bits == 12 && pack == 4, "wrong pack");
  310|       |
  311|     22|  static_assert(bits == 12 && mask == 0x0f, "wrong mask");
  312|       |
  313|     22|  uint32_t perline = bytesPerLine(w, /*skips=*/true);
  314|       |
  315|     22|  sanityCheck(&h, perline);
  316|       |
  317|     22|  const Array2DRef<uint16_t> out(mRaw->getU16DataAsUncroppedArray2DRef());
  318|       |
  319|     22|  const auto in = Array2DRef(input.getData(perline * h), perline, h);
  320|    331|  for (uint32_t row = 0; row < h; row++) {
  ------------------
  |  Branch (320:26): [True: 309, False: 22]
  ------------------
  321|    309|    uint32_t col = 0;
  322|  3.94k|    for (uint32_t x = 0; x < w; x += 2) {
  ------------------
  |  Branch (322:26): [True: 3.63k, False: 309]
  ------------------
  323|  3.63k|      uint32_t g1 = in(row, col + 0);
  324|  3.63k|      uint32_t g2 = in(row, col + 1);
  325|       |
  326|  3.63k|      auto process = [out, row](uint32_t i, bool invert, uint32_t p1,
  327|  3.63k|                                uint32_t p2) {
  328|  3.63k|        uint16_t pix;
  329|  3.63k|        if (!(invert ^ (e == Endianness::little)))
  330|  3.63k|          pix = implicit_cast<uint16_t>((p1 << pack) | (p2 >> pack));
  331|  3.63k|        else
  332|  3.63k|          pix = implicit_cast<uint16_t>(((p2 & mask) << 8) | p1);
  333|  3.63k|        out(row, i) = pix;
  334|  3.63k|      };
  335|       |
  336|  3.63k|      process(x, false, g1, g2);
  337|       |
  338|  3.63k|      g1 = in(row, col + 2);
  339|       |
  340|  3.63k|      process(x + 1, true, g1, g2);
  341|       |
  342|  3.63k|      col += 3;
  343|       |
  344|  3.63k|      if ((x % 10) == 8)
  ------------------
  |  Branch (344:11): [True: 653, False: 2.97k]
  ------------------
  345|    653|        col++;
  346|  3.63k|    }
  347|    309|  }
  348|     22|  input.skipBytes(input.getRemainSize());
  349|     22|}
_ZZN8rawspeed24UncompressedDecompressor25decode12BitRawWithControlILNS_10EndiannessE48879EEEvvENKUljbjjE_clEjbjj:
  327|  7.26k|                                uint32_t p2) {
  328|  7.26k|        uint16_t pix;
  329|  7.26k|        if (!(invert ^ (e == Endianness::little)))
  ------------------
  |  Branch (329:13): [True: 3.63k, False: 3.63k]
  ------------------
  330|  3.63k|          pix = implicit_cast<uint16_t>((p1 << pack) | (p2 >> pack));
  331|  3.63k|        else
  332|  3.63k|          pix = implicit_cast<uint16_t>(((p2 & mask) << 8) | p1);
  333|  7.26k|        out(row, i) = pix;
  334|  7.26k|      };
_ZN8rawspeed24UncompressedDecompressor33decode12BitRawUnpackedLeftAlignedILNS_10EndiannessE57005EEEvv:
  357|     73|void UncompressedDecompressor::decode12BitRawUnpackedLeftAligned() {
  358|     73|  uint32_t w = size.x;
  359|     73|  uint32_t h = size.y;
  360|     73|  sanityCheck(w, &h, 2);
  361|       |
  362|     73|  const Array2DRef<uint16_t> out(mRaw->getU16DataAsUncroppedArray2DRef());
  363|     73|  const auto in = Array2DRef(input.getData(w * h * 2), 2 * w, h);
  364|       |
  365|  11.8k|  for (int row = 0; row < static_cast<int>(h); row++) {
  ------------------
  |  Branch (365:21): [True: 11.8k, False: 73]
  ------------------
  366|   310k|    for (int col = 0; col < static_cast<int>(w); ++col) {
  ------------------
  |  Branch (366:23): [True: 298k, False: 11.8k]
  ------------------
  367|   298k|      uint32_t g1 = in(row, (2 * col) + 0);
  368|   298k|      uint32_t g2 = in(row, (2 * col) + 1);
  369|       |
  370|   298k|      uint16_t pix;
  371|       |      if constexpr (e == Endianness::little)
  372|   298k|        pix = implicit_cast<uint16_t>((g2 << 8) | g1);
  373|       |      else
  374|       |        pix = implicit_cast<uint16_t>((g1 << 8) | g2);
  375|   298k|      out(row, col) = pix >> 4;
  376|   298k|    }
  377|  11.8k|  }
  378|     73|}
_ZNK8rawspeed24UncompressedDecompressor11sanityCheckEPKji:
   53|  3.79k|                                           int bytesPerLine) const {
   54|  3.79k|  invariant(h != nullptr);
  ------------------
  |  |   27|  3.79k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (54:3): [True: 3.79k, False: 18.4E]
  ------------------
   55|  3.79k|  invariant(*h > 0);
  ------------------
  |  |   27|  3.79k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (55:3): [True: 3.79k, False: 0]
  ------------------
   56|  3.79k|  invariant(bytesPerLine > 0);
  ------------------
  |  |   27|  3.79k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (56:3): [True: 3.79k, False: 0]
  ------------------
   57|  3.79k|  invariant(input.getSize() > 0);
  ------------------
  |  |   27|  3.79k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (57:3): [True: 3.79k, False: 0]
  ------------------
   58|       |
   59|       |  // How many multiples of bpl are there in the input buffer?
   60|       |  // The remainder is ignored/discarded.
   61|  3.79k|  const auto fullRows = input.getRemainSize() / bytesPerLine;
   62|       |
   63|       |  // If more than the output height, we are all good.
   64|  3.79k|  if (fullRows >= *h)
  ------------------
  |  Branch (64:7): [True: 3.79k, False: 1]
  ------------------
   65|  3.79k|    return; // all good!
   66|       |
   67|      1|  if (fullRows == 0)
  ------------------
  |  Branch (67:7): [True: 0, False: 1]
  ------------------
   68|      1|    ThrowIOE("Not enough data to decode a single line. Image file truncated.");
  ------------------
  |  |   37|      0|#define ThrowIOE(...) ThrowExceptionHelper(rawspeed::IOException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   69|       |
   70|      1|  ThrowIOE("Image truncated, only %u of %u lines found", fullRows, *h);
  ------------------
  |  |   37|      1|#define ThrowIOE(...) ThrowExceptionHelper(rawspeed::IOException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      1|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      1|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      1|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   71|       |
   72|       |  // FIXME: need to come up with some common variable to allow proceeding here
   73|       |  // *h = min_h;
   74|      1|}
_ZNK8rawspeed24UncompressedDecompressor11sanityCheckEjPKji:
   77|     90|                                           int bpp) const {
   78|     90|  invariant(w > 0);
  ------------------
  |  |   27|     90|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (78:3): [True: 90, False: 0]
  ------------------
   79|     90|  invariant(bpp > 0);
  ------------------
  |  |   27|     90|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (79:3): [True: 90, False: 0]
  ------------------
   80|       |
   81|       |  // bytes per line
   82|     90|  const auto bpl = bpp * w;
   83|     90|  invariant(bpl > 0);
  ------------------
  |  |   27|     90|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (83:3): [True: 90, False: 0]
  ------------------
   84|       |
   85|     90|  sanityCheck(h, bpl);
   86|     90|}
_ZN8rawspeed24UncompressedDecompressor12bytesPerLineEib:
   88|     85|int UncompressedDecompressor::bytesPerLine(int w, bool skips) {
   89|     85|  invariant(w > 0);
  ------------------
  |  |   27|     85|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (89:3): [True: 85, False: 0]
  ------------------
   90|       |
   91|     85|  if ((12 * w) % 8 != 0)
  ------------------
  |  Branch (91:7): [True: 0, False: 85]
  ------------------
   92|     85|    ThrowIOE("Bad image width");
  ------------------
  |  |   37|      0|#define ThrowIOE(...) ThrowExceptionHelper(rawspeed::IOException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   93|       |
   94|       |  // Calculate expected bytes per line.
   95|     85|  auto perline = (12 * w) / 8;
   96|       |
   97|     85|  if (!skips)
  ------------------
  |  Branch (97:7): [True: 0, False: 85]
  ------------------
   98|      0|    return perline;
   99|       |
  100|       |  // Add skips every 10 pixels
  101|     85|  perline += ((w + 2) / 10);
  102|       |
  103|     85|  return perline;
  104|     85|}
_ZN8rawspeed24UncompressedDecompressorC2ENS_10ByteStreamENS_8RawImageERKNS_12iRectangle2DEiiNS_8BitOrderE:
  109|  3.76k|    : input(input_.getStream(crop.dim.y, inputPitchBytes_)),
  110|  3.76k|      mRaw(std::move(img_)), size(crop.dim), offset(crop.pos),
  111|  3.76k|      inputPitchBytes(inputPitchBytes_), bitPerPixel(bitPerPixel_),
  112|  3.76k|      order(order_) {
  113|  3.76k|  if (!size.hasPositiveArea())
  ------------------
  |  Branch (113:7): [True: 0, False: 3.76k]
  ------------------
  114|  3.76k|    ThrowRDE("Empty tile.");
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  115|       |
  116|  3.76k|  if (inputPitchBytes < 1)
  ------------------
  |  Branch (116:7): [True: 0, False: 3.76k]
  ------------------
  117|  3.76k|    ThrowRDE("Input pitch is non-positive");
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  118|       |
  119|  3.76k|  switch (order) {
  ------------------
  |  Branch (119:11): [True: 3.64k, False: 115]
  ------------------
  120|  1.29k|  case BitOrder::LSB:
  ------------------
  |  Branch (120:3): [True: 1.29k, False: 2.46k]
  ------------------
  121|  3.63k|  case BitOrder::MSB:
  ------------------
  |  Branch (121:3): [True: 2.33k, False: 1.42k]
  ------------------
  122|  3.63k|  case BitOrder::MSB16:
  ------------------
  |  Branch (122:3): [True: 0, False: 3.76k]
  ------------------
  123|  3.64k|  case BitOrder::MSB32:
  ------------------
  |  Branch (123:3): [True: 18, False: 3.74k]
  ------------------
  124|  3.64k|    break;
  125|      0|  case BitOrder::JPEG:
  ------------------
  |  Branch (125:3): [True: 0, False: 3.76k]
  ------------------
  126|      0|    ThrowRDE("JPEG bit order not supported.");
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  127|  3.76k|  }
  128|       |
  129|  3.64k|  uint32_t w = size.x;
  130|  3.64k|  uint32_t h = size.y;
  131|  3.64k|  uint32_t cpp = mRaw->getCpp();
  132|  3.64k|  uint64_t ox = offset.x;
  133|  3.64k|  uint64_t oy = offset.y;
  134|       |
  135|  3.64k|  if (cpp < 1 || cpp > 3)
  ------------------
  |  Branch (135:7): [True: 18.4E, False: 3.64k]
  |  Branch (135:18): [True: 10, False: 3.63k]
  ------------------
  136|  3.64k|    ThrowRDE("Unsupported number of components per pixel: %u", cpp);
  ------------------
  |  |   38|     10|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     10|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     10|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     10|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  137|       |
  138|  3.63k|  if (bitPerPixel < 1 || bitPerPixel > 32 ||
  ------------------
  |  Branch (138:7): [True: 18.4E, False: 3.63k]
  |  Branch (138:26): [True: 2, False: 3.63k]
  ------------------
  139|  3.63k|      (bitPerPixel > 16 && mRaw->getDataType() == RawImageType::UINT16))
  ------------------
  |  Branch (139:8): [True: 176, False: 3.46k]
  |  Branch (139:28): [True: 2, False: 174]
  ------------------
  140|  3.63k|    ThrowRDE("Unsupported bit depth");
  ------------------
  |  |   38|      4|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      4|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      4|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      4|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  141|       |
  142|  3.63k|  const auto outPixelBits = static_cast<uint64_t>(w) * cpp * bitPerPixel;
  143|  3.63k|  invariant(outPixelBits > 0);
  ------------------
  |  |   27|  3.63k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (143:3): [True: 3.63k, False: 0]
  ------------------
  144|       |
  145|  3.63k|  if (outPixelBits % 8 != 0) {
  ------------------
  |  Branch (145:7): [True: 5, False: 3.62k]
  ------------------
  146|      5|    ThrowRDE("Bad combination of cpp (%u), bps (%d) and width (%u), the "
  ------------------
  |  |   38|      5|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      5|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      5|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      5|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  147|      5|             "pitch is %" PRIu64 " bits, which is not a multiple of 8 (1 byte)",
  148|      5|             cpp, bitPerPixel, w, outPixelBits);
  149|      5|  }
  150|       |
  151|  3.62k|  const auto outPixelBytes = outPixelBits / 8;
  152|       |
  153|       |  // The input pitch might be larger than needed (i.e. have some padding),
  154|       |  // but it can *not* be smaller than needed.
  155|  3.62k|  if (static_cast<unsigned>(inputPitchBytes) < outPixelBytes)
  ------------------
  |  Branch (155:7): [True: 14, False: 3.61k]
  ------------------
  156|  3.62k|    ThrowRDE("Specified pitch is smaller than minimally-required pitch");
  ------------------
  |  |   38|     14|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     14|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     14|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     14|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  157|       |
  158|       |  // Check the specified pitch, not the minimally-required pitch.
  159|  3.61k|  sanityCheck(&h, inputPitchBytes);
  160|       |
  161|  3.61k|  invariant(static_cast<unsigned>(inputPitchBytes) >= outPixelBytes);
  ------------------
  |  |   27|  3.61k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (161:3): [True: 3.61k, False: 0]
  ------------------
  162|  3.61k|  skipBytes =
  163|  3.61k|      implicit_cast<uint32_t>(inputPitchBytes - outPixelBytes); // Skip per line
  164|       |
  165|  3.61k|  if (oy > static_cast<uint64_t>(mRaw->dim.y))
  ------------------
  |  Branch (165:7): [True: 0, False: 3.61k]
  ------------------
  166|  3.61k|    ThrowRDE("Invalid y offset");
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  167|  3.61k|  if (ox + size.x > static_cast<uint64_t>(mRaw->dim.x))
  ------------------
  |  Branch (167:7): [True: 0, False: 3.61k]
  ------------------
  168|  3.61k|    ThrowRDE("Invalid x offset");
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  169|  3.61k|}
_ZN8rawspeed24UncompressedDecompressor19readUncompressedRawEv:
  202|  3.44k|void UncompressedDecompressor::readUncompressedRaw() {
  203|  3.44k|  uint32_t outPitch = mRaw->pitch;
  204|  3.44k|  uint32_t w = size.x;
  205|  3.44k|  uint32_t h = size.y;
  206|  3.44k|  uint32_t cpp = mRaw->getCpp();
  207|  3.44k|  uint64_t oy = offset.y;
  208|       |
  209|  3.44k|  uint64_t y = oy;
  210|  3.44k|  h = implicit_cast<uint32_t>(min(h + oy, static_cast<uint64_t>(mRaw->dim.y)));
  211|       |
  212|  3.44k|  if (mRaw->getDataType() == RawImageType::F32) {
  ------------------
  |  Branch (212:7): [True: 340, False: 3.10k]
  ------------------
  213|    340|    if (bitPerPixel == 32) {
  ------------------
  |  Branch (213:9): [True: 28, False: 312]
  ------------------
  214|     28|      const Array2DRef<float> out(mRaw->getF32DataAsUncroppedArray2DRef());
  215|     28|      copyPixels(
  216|     28|          reinterpret_cast<std::byte*>(
  217|     28|              &out(implicit_cast<int>(y), offset.x * cpp)),
  218|     28|          outPitch,
  219|     28|          reinterpret_cast<const std::byte*>(input.getData(
  220|     28|              implicit_cast<Buffer::size_type>(inputPitchBytes * (h - y)))),
  221|     28|          inputPitchBytes, w * mRaw->getBpp(), implicit_cast<int>(h - y));
  222|     28|      return;
  223|     28|    }
  224|    312|    if (BitOrder::MSB == order && bitPerPixel == 16) {
  ------------------
  |  Branch (224:9): [True: 130, False: 182]
  |  Branch (224:35): [True: 68, False: 62]
  ------------------
  225|     68|      decodePackedFP<BitStreamerMSB, ieee_754_2008::Binary16>(
  226|     68|          h, implicit_cast<int>(y));
  227|     68|      return;
  228|     68|    }
  229|    244|    if (BitOrder::LSB == order && bitPerPixel == 16) {
  ------------------
  |  Branch (229:9): [True: 182, False: 62]
  |  Branch (229:35): [True: 99, False: 83]
  ------------------
  230|     99|      decodePackedFP<BitStreamerLSB, ieee_754_2008::Binary16>(
  231|     99|          h, implicit_cast<int>(y));
  232|     99|      return;
  233|     99|    }
  234|    145|    if (BitOrder::MSB == order && bitPerPixel == 24) {
  ------------------
  |  Branch (234:9): [True: 62, False: 83]
  |  Branch (234:35): [True: 62, False: 0]
  ------------------
  235|     62|      decodePackedFP<BitStreamerMSB, ieee_754_2008::Binary24>(
  236|     62|          h, implicit_cast<int>(y));
  237|     62|      return;
  238|     62|    }
  239|     83|    if (BitOrder::LSB == order && bitPerPixel == 24) {
  ------------------
  |  Branch (239:9): [True: 83, False: 0]
  |  Branch (239:35): [True: 83, False: 0]
  ------------------
  240|     83|      decodePackedFP<BitStreamerLSB, ieee_754_2008::Binary24>(
  241|     83|          h, implicit_cast<int>(y));
  242|     83|      return;
  243|     83|    }
  244|     83|    ThrowRDE("Unsupported floating-point input bitwidth/bit packing: %d / %u",
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  245|     83|             bitPerPixel, static_cast<unsigned>(order));
  246|     83|  }
  247|       |
  248|  3.10k|  if (BitOrder::MSB == order) {
  ------------------
  |  Branch (248:7): [True: 2.15k, False: 942]
  ------------------
  249|  2.15k|    decodePackedInt<BitStreamerMSB>(h, implicit_cast<int>(y));
  250|  2.15k|  } else if (BitOrder::MSB16 == order) {
  ------------------
  |  Branch (250:14): [True: 0, False: 942]
  ------------------
  251|      0|    decodePackedInt<BitStreamerMSB16>(h, implicit_cast<int>(y));
  252|    942|  } else if (BitOrder::MSB32 == order) {
  ------------------
  |  Branch (252:14): [True: 18, False: 924]
  ------------------
  253|     18|    decodePackedInt<BitStreamerMSB32>(h, implicit_cast<int>(y));
  254|    924|  } else {
  255|    924|    if (bitPerPixel == 16 && getHostEndianness() == Endianness::little) {
  ------------------
  |  Branch (255:9): [True: 679, False: 245]
  |  Branch (255:30): [True: 679, False: 0]
  ------------------
  256|    679|      const Array2DRef<uint16_t> out(mRaw->getU16DataAsUncroppedArray2DRef());
  257|    679|      copyPixels(
  258|    679|          reinterpret_cast<std::byte*>(
  259|    679|              &out(implicit_cast<int>(y), offset.x * cpp)),
  260|    679|          outPitch,
  261|    679|          reinterpret_cast<const std::byte*>(input.getData(
  262|    679|              implicit_cast<Buffer::size_type>(inputPitchBytes * (h - y)))),
  263|    679|          inputPitchBytes, w * mRaw->getBpp(), implicit_cast<int>(h - y));
  264|    679|      return;
  265|    679|    }
  266|    245|    decodePackedInt<BitStreamerLSB>(h, implicit_cast<int>(y));
  267|    245|  }
  268|  3.10k|}
_ZNK8rawspeed24UncompressedDecompressor14decodePackedFPINS_14BitStreamerMSBENS_13ieee_754_20088Binary16EEEvii:
  172|     68|void UncompressedDecompressor::decodePackedFP(int rows, int row) const {
  173|     68|  const Array2DRef<float> out(mRaw->getF32DataAsUncroppedArray2DRef());
  174|     68|  Pump bits(input.peekRemainingBuffer().getAsArray1DRef());
  175|       |
  176|     68|  int cols = size.x * mRaw->getCpp();
  177|  9.38k|  for (; row < rows; row++) {
  ------------------
  |  Branch (177:10): [True: 9.32k, False: 68]
  ------------------
  178|  32.8k|    for (int col = 0; col < cols; col++) {
  ------------------
  |  Branch (178:23): [True: 23.5k, False: 9.32k]
  ------------------
  179|  23.5k|      uint32_t b = bits.getBits(NarrowFpType::StorageWidth);
  180|  23.5k|      uint32_t f =
  181|  23.5k|          extendBinaryFloatingPoint<NarrowFpType, ieee_754_2008::Binary32>(b);
  182|  23.5k|      out(row, offset.x + col) = std::bit_cast<float>(f);
  183|  23.5k|    }
  184|  9.32k|    bits.skipBytes(skipBytes);
  185|  9.32k|  }
  186|     68|}
_ZNK8rawspeed24UncompressedDecompressor14decodePackedFPINS_14BitStreamerLSBENS_13ieee_754_20088Binary16EEEvii:
  172|     99|void UncompressedDecompressor::decodePackedFP(int rows, int row) const {
  173|     99|  const Array2DRef<float> out(mRaw->getF32DataAsUncroppedArray2DRef());
  174|     99|  Pump bits(input.peekRemainingBuffer().getAsArray1DRef());
  175|       |
  176|     99|  int cols = size.x * mRaw->getCpp();
  177|  11.2k|  for (; row < rows; row++) {
  ------------------
  |  Branch (177:10): [True: 11.1k, False: 99]
  ------------------
  178|   102k|    for (int col = 0; col < cols; col++) {
  ------------------
  |  Branch (178:23): [True: 91.3k, False: 11.1k]
  ------------------
  179|  91.3k|      uint32_t b = bits.getBits(NarrowFpType::StorageWidth);
  180|  91.3k|      uint32_t f =
  181|  91.3k|          extendBinaryFloatingPoint<NarrowFpType, ieee_754_2008::Binary32>(b);
  182|  91.3k|      out(row, offset.x + col) = std::bit_cast<float>(f);
  183|  91.3k|    }
  184|  11.1k|    bits.skipBytes(skipBytes);
  185|  11.1k|  }
  186|     99|}
_ZNK8rawspeed24UncompressedDecompressor14decodePackedFPINS_14BitStreamerMSBENS_13ieee_754_20088Binary24EEEvii:
  172|     62|void UncompressedDecompressor::decodePackedFP(int rows, int row) const {
  173|     62|  const Array2DRef<float> out(mRaw->getF32DataAsUncroppedArray2DRef());
  174|     62|  Pump bits(input.peekRemainingBuffer().getAsArray1DRef());
  175|       |
  176|     62|  int cols = size.x * mRaw->getCpp();
  177|  21.1k|  for (; row < rows; row++) {
  ------------------
  |  Branch (177:10): [True: 21.0k, False: 62]
  ------------------
  178|  77.9k|    for (int col = 0; col < cols; col++) {
  ------------------
  |  Branch (178:23): [True: 56.8k, False: 21.0k]
  ------------------
  179|  56.8k|      uint32_t b = bits.getBits(NarrowFpType::StorageWidth);
  180|  56.8k|      uint32_t f =
  181|  56.8k|          extendBinaryFloatingPoint<NarrowFpType, ieee_754_2008::Binary32>(b);
  182|  56.8k|      out(row, offset.x + col) = std::bit_cast<float>(f);
  183|  56.8k|    }
  184|  21.0k|    bits.skipBytes(skipBytes);
  185|  21.0k|  }
  186|     62|}
_ZNK8rawspeed24UncompressedDecompressor14decodePackedFPINS_14BitStreamerLSBENS_13ieee_754_20088Binary24EEEvii:
  172|     83|void UncompressedDecompressor::decodePackedFP(int rows, int row) const {
  173|     83|  const Array2DRef<float> out(mRaw->getF32DataAsUncroppedArray2DRef());
  174|     83|  Pump bits(input.peekRemainingBuffer().getAsArray1DRef());
  175|       |
  176|     83|  int cols = size.x * mRaw->getCpp();
  177|  6.36k|  for (; row < rows; row++) {
  ------------------
  |  Branch (177:10): [True: 6.28k, False: 83]
  ------------------
  178|  36.4k|    for (int col = 0; col < cols; col++) {
  ------------------
  |  Branch (178:23): [True: 30.1k, False: 6.28k]
  ------------------
  179|  30.1k|      uint32_t b = bits.getBits(NarrowFpType::StorageWidth);
  180|  30.1k|      uint32_t f =
  181|  30.1k|          extendBinaryFloatingPoint<NarrowFpType, ieee_754_2008::Binary32>(b);
  182|  30.1k|      out(row, offset.x + col) = std::bit_cast<float>(f);
  183|  30.1k|    }
  184|  6.28k|    bits.skipBytes(skipBytes);
  185|  6.28k|  }
  186|     83|}
_ZNK8rawspeed24UncompressedDecompressor15decodePackedIntINS_14BitStreamerMSBEEEvii:
  189|  2.15k|void UncompressedDecompressor::decodePackedInt(int rows, int row) const {
  190|  2.15k|  const Array2DRef<uint16_t> out(mRaw->getU16DataAsUncroppedArray2DRef());
  191|  2.15k|  Pump bits(input.peekRemainingBuffer().getAsArray1DRef());
  192|       |
  193|  2.15k|  int cols = size.x * mRaw->getCpp();
  194|  76.2k|  for (; row < rows; row++) {
  ------------------
  |  Branch (194:10): [True: 74.0k, False: 2.15k]
  ------------------
  195|  3.84M|    for (int x = 0; x < cols; x++) {
  ------------------
  |  Branch (195:21): [True: 3.77M, False: 74.0k]
  ------------------
  196|  3.77M|      out(row, x) = implicit_cast<uint16_t>(bits.getBits(bitPerPixel));
  197|  3.77M|    }
  198|  74.0k|    bits.skipBytes(skipBytes);
  199|  74.0k|  }
  200|  2.15k|}
_ZNK8rawspeed24UncompressedDecompressor15decodePackedIntINS_16BitStreamerMSB32EEEvii:
  189|     18|void UncompressedDecompressor::decodePackedInt(int rows, int row) const {
  190|     18|  const Array2DRef<uint16_t> out(mRaw->getU16DataAsUncroppedArray2DRef());
  191|     18|  Pump bits(input.peekRemainingBuffer().getAsArray1DRef());
  192|       |
  193|     18|  int cols = size.x * mRaw->getCpp();
  194|     56|  for (; row < rows; row++) {
  ------------------
  |  Branch (194:10): [True: 38, False: 18]
  ------------------
  195|  1.30k|    for (int x = 0; x < cols; x++) {
  ------------------
  |  Branch (195:21): [True: 1.26k, False: 38]
  ------------------
  196|  1.26k|      out(row, x) = implicit_cast<uint16_t>(bits.getBits(bitPerPixel));
  197|  1.26k|    }
  198|     38|    bits.skipBytes(skipBytes);
  199|     38|  }
  200|     18|}
_ZNK8rawspeed24UncompressedDecompressor15decodePackedIntINS_14BitStreamerLSBEEEvii:
  189|    245|void UncompressedDecompressor::decodePackedInt(int rows, int row) const {
  190|    245|  const Array2DRef<uint16_t> out(mRaw->getU16DataAsUncroppedArray2DRef());
  191|    245|  Pump bits(input.peekRemainingBuffer().getAsArray1DRef());
  192|       |
  193|    245|  int cols = size.x * mRaw->getCpp();
  194|  6.19k|  for (; row < rows; row++) {
  ------------------
  |  Branch (194:10): [True: 5.94k, False: 245]
  ------------------
  195|   547k|    for (int x = 0; x < cols; x++) {
  ------------------
  |  Branch (195:21): [True: 541k, False: 5.94k]
  ------------------
  196|   541k|      out(row, x) = implicit_cast<uint16_t>(bits.getBits(bitPerPixel));
  197|   541k|    }
  198|  5.94k|    bits.skipBytes(skipBytes);
  199|  5.94k|  }
  200|    245|}

_ZN8rawspeed15VC5Decompressor7Wavelet12setBandValidEi:
  126|     23|void VC5Decompressor::Wavelet::setBandValid(const int band) {
  127|     23|  mDecodedBandMask |= (1 << band);
  128|     23|}
_ZNK8rawspeed15VC5Decompressor7Wavelet11isBandValidEi:
  130|  10.4k|bool VC5Decompressor::Wavelet::isBandValid(const int band) const {
  131|  10.4k|  return mDecodedBandMask & (1 << band);
  132|  10.4k|}
_ZNK8rawspeed15VC5Decompressor7Wavelet13allBandsValidEv:
  134|     23|bool VC5Decompressor::Wavelet::allBandsValid() const {
  135|     23|  return mDecodedBandMask == static_cast<uint32_t>((1 << maxBands) - 1);
  136|     23|}
_ZN8rawspeed15VC5DecompressorC2ENS_10ByteStreamERKNS_8RawImageE:
  385|    577|    : mRaw(img), mBs(bs) {
  386|    577|  if (mRaw->getCpp() != 1 || mRaw->getDataType() != RawImageType::UINT16 ||
  ------------------
  |  Branch (386:7): [True: 14, False: 563]
  |  Branch (386:30): [True: 14, False: 549]
  ------------------
  387|    551|      mRaw->getBpp() != sizeof(uint16_t))
  ------------------
  |  Branch (387:7): [True: 5, False: 546]
  ------------------
  388|    577|    ThrowRDE("Unexpected component count / data type");
  ------------------
  |  |   38|     25|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     25|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     25|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     25|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  389|       |
  390|    552|  if (!mRaw->dim.hasPositiveArea())
  ------------------
  |  Branch (390:7): [True: 0, False: 552]
  ------------------
  391|    552|    ThrowRDE("Bad image dimensions.");
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  392|       |
  393|    552|  if (mRaw->dim.x % mVC5.patternWidth != 0)
  ------------------
  |  Branch (393:7): [True: 41, False: 511]
  ------------------
  394|    552|    ThrowRDE("Width %i is not a multiple of %i", mRaw->dim.x,
  ------------------
  |  |   38|     41|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     41|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     41|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     41|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  395|    511|             mVC5.patternWidth);
  396|       |
  397|    511|  if (mRaw->dim.y % mVC5.patternHeight != 0)
  ------------------
  |  Branch (397:7): [True: 28, False: 483]
  ------------------
  398|    511|    ThrowRDE("Height %i is not a multiple of %i", mRaw->dim.y,
  ------------------
  |  |   38|     28|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     28|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     28|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     28|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  399|    483|             mVC5.patternHeight);
  400|       |
  401|    483|  Optional<BayerPhase> p = getAsBayerPhase(mRaw->cfa);
  402|    483|  if (!p)
  ------------------
  |  Branch (402:7): [True: 102, False: 381]
  ------------------
  403|    483|    ThrowRDE("Image has invalid CFA.");
  ------------------
  |  |   38|    102|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|    102|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|    102|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|    102|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  404|    381|  phase = *p;
  405|    381|  if (phase != BayerPhase::RGGB && phase != BayerPhase::GBRG)
  ------------------
  |  Branch (405:7): [True: 227, False: 154]
  |  Branch (405:36): [True: 13, False: 214]
  ------------------
  406|    381|    ThrowRDE("Unexpected bayer phase, please file a bug.");
  ------------------
  |  |   38|     13|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     13|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     13|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     13|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  407|       |
  408|       |  // Initialize wavelet sizes.
  409|  1.46k|  for (Channel& channel : channels) {
  ------------------
  |  Branch (409:25): [True: 1.46k, False: 368]
  ------------------
  410|  1.46k|    auto waveletWidth = implicit_cast<uint16_t>(mRaw->dim.x);
  411|  1.46k|    auto waveletHeight = implicit_cast<uint16_t>(mRaw->dim.y);
  412|  5.82k|    for (Wavelet& wavelet : channel.wavelets) {
  ------------------
  |  Branch (412:27): [True: 5.82k, False: 1.46k]
  ------------------
  413|       |      // Pad dimensions as necessary and divide them by two for the next wavelet
  414|  5.82k|      for (auto* dimension : {&waveletWidth, &waveletHeight})
  ------------------
  |  Branch (414:28): [True: 11.5k, False: 5.82k]
  ------------------
  415|  11.5k|        *dimension =
  416|  11.5k|            implicit_cast<uint16_t>(roundUpDivisionSafe(*dimension, 2));
  417|  5.82k|      wavelet.width = waveletWidth;
  418|  5.82k|      wavelet.height = waveletHeight;
  419|       |
  420|  5.82k|      wavelet.bands.resize(
  421|  5.82k|          &wavelet == &*channel.wavelets.begin() ? 1 : Wavelet::maxBands);
  ------------------
  |  Branch (421:11): [True: 1.43k, False: 4.38k]
  ------------------
  422|  5.82k|    }
  423|  1.46k|  }
  424|       |
  425|    368|  if (*img->whitePoint <= 0 || *img->whitePoint > int(((1U << 16U) - 1U)))
  ------------------
  |  Branch (425:7): [True: 72, False: 296]
  |  Branch (425:32): [True: 21, False: 275]
  ------------------
  426|    368|    ThrowRDE("Bad white level %i", *img->whitePoint);
  ------------------
  |  |   38|     94|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     94|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     94|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     94|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  427|       |
  428|    274|  outputBits = 0;
  429|  2.17k|  for (int wp = *img->whitePoint; wp != 0; wp >>= 1)
  ------------------
  |  Branch (429:35): [True: 1.90k, False: 274]
  ------------------
  430|  1.90k|    ++outputBits;
  431|    274|  invariant(outputBits <= 16);
  ------------------
  |  |   27|    274|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (431:3): [True: 275, False: 18.4E]
  ------------------
  432|       |
  433|    275|  parseVC5();
  434|    275|}
_ZN8rawspeed15VC5Decompressor8parseVC5Ev:
  492|    275|void VC5Decompressor::parseVC5() {
  493|    275|  mBs.setByteOrder(Endianness::big);
  494|       |
  495|    275|  invariant(mRaw->dim.x > 0);
  ------------------
  |  |   27|    275|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (495:3): [True: 274, False: 1]
  ------------------
  496|    274|  invariant(mRaw->dim.y > 0);
  ------------------
  |  |   27|    274|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (496:3): [True: 275, False: 18.4E]
  ------------------
  497|       |
  498|       |  // All VC-5 data must start with "VC-%" (0x56432d35)
  499|    275|  if (mBs.getU32() != 0x56432d35)
  ------------------
  |  Branch (499:7): [True: 102, False: 173]
  ------------------
  500|    275|    ThrowRDE("not a valid VC-5 datablock");
  ------------------
  |  |   38|    102|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|    102|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|    102|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|    102|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  501|       |
  502|    173|  bool done = false;
  503|  10.6k|  while (!done) {
  ------------------
  |  Branch (503:10): [True: 10.5k, False: 54]
  ------------------
  504|  10.5k|    auto tag = static_cast<VC5Tag>(mBs.getU16());
  505|  10.5k|    uint16_t val = mBs.getU16();
  506|       |
  507|  10.5k|    bool optional = matches(tag, VC5Tag::Optional);
  508|  10.5k|    if (optional)
  ------------------
  |  Branch (508:9): [True: 6.46k, False: 4.10k]
  ------------------
  509|  6.46k|      tag = -tag;
  510|       |
  511|  10.5k|    switch (tag) {
  512|      0|      using enum VC5Tag;
  513|    141|    case ChannelCount:
  ------------------
  |  Branch (513:5): [True: 141, False: 10.4k]
  ------------------
  514|    141|      if (val != numChannels)
  ------------------
  |  Branch (514:11): [True: 3, False: 138]
  ------------------
  515|    141|        ThrowRDE("Bad channel count %u, expected %i", val, numChannels);
  ------------------
  |  |   38|      3|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      3|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      3|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      3|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  516|    138|      break;
  517|    138|    case ImageWidth:
  ------------------
  |  Branch (517:5): [True: 86, False: 10.4k]
  ------------------
  518|     86|      if (val != mRaw->dim.x)
  ------------------
  |  Branch (518:11): [True: 10, False: 76]
  ------------------
  519|     86|        ThrowRDE("Image width mismatch: %u vs %i", val, mRaw->dim.x);
  ------------------
  |  |   38|     10|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     10|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     10|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     10|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  520|     76|      break;
  521|     76|    case ImageHeight:
  ------------------
  |  Branch (521:5): [True: 21, False: 10.5k]
  ------------------
  522|     21|      if (val != mRaw->dim.y)
  ------------------
  |  Branch (522:11): [True: 5, False: 16]
  ------------------
  523|     21|        ThrowRDE("Image height mismatch: %u vs %i", val, mRaw->dim.y);
  ------------------
  |  |   38|      5|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      5|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      5|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      5|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  524|     16|      break;
  525|     24|    case LowpassPrecision:
  ------------------
  |  Branch (525:5): [True: 24, False: 10.5k]
  ------------------
  526|     24|      if (val < PRECISION_MIN || val > PRECISION_MAX)
  ------------------
  |  Branch (526:11): [True: 0, False: 24]
  |  Branch (526:34): [True: 1, False: 23]
  ------------------
  527|     24|        ThrowRDE("Invalid precision %i", val);
  ------------------
  |  |   38|      1|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      1|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      1|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      1|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  528|     23|      mVC5.lowpassPrecision = val;
  529|     23|      break;
  530|    117|    case ChannelNumber:
  ------------------
  |  Branch (530:5): [True: 117, False: 10.4k]
  ------------------
  531|    117|      if (val >= numChannels)
  ------------------
  |  Branch (531:11): [True: 5, False: 112]
  ------------------
  532|    117|        ThrowRDE("Bad channel number (%u)", val);
  ------------------
  |  |   38|      5|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      5|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      5|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      5|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  533|    112|      mVC5.iChannel = val;
  534|    112|      break;
  535|     11|    case ImageFormat:
  ------------------
  |  Branch (535:5): [True: 11, False: 10.5k]
  ------------------
  536|     11|      if (val != mVC5.imgFormat)
  ------------------
  |  Branch (536:11): [True: 2, False: 9]
  ------------------
  537|     11|        ThrowRDE("Image format %i is not 4(RAW)", val);
  ------------------
  |  |   38|      2|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      2|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      2|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      2|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  538|      9|      break;
  539|      9|    case SubbandCount:
  ------------------
  |  Branch (539:5): [True: 9, False: 10.5k]
  ------------------
  540|      9|      if (val != numSubbands)
  ------------------
  |  Branch (540:11): [True: 1, False: 8]
  ------------------
  541|      9|        ThrowRDE("Unexpected subband count %u, expected %i", val, numSubbands);
  ------------------
  |  |   38|      1|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      1|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      1|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      1|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  542|      8|      break;
  543|     34|    case MaxBitsPerComponent:
  ------------------
  |  Branch (543:5): [True: 34, False: 10.5k]
  ------------------
  544|     34|      if (val != VC5_LOG_TABLE_BITWIDTH) {
  ------------------
  |  Branch (544:11): [True: 1, False: 33]
  ------------------
  545|      1|        ThrowRDE("Bad bits per componend %u, not %i", val,
  ------------------
  |  |   38|      1|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      1|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      1|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      1|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  546|      1|                 VC5_LOG_TABLE_BITWIDTH);
  547|      1|      }
  548|     33|      break;
  549|     82|    case PatternWidth:
  ------------------
  |  Branch (549:5): [True: 82, False: 10.4k]
  ------------------
  550|     82|      if (val != mVC5.patternWidth)
  ------------------
  |  Branch (550:11): [True: 3, False: 79]
  ------------------
  551|     82|        ThrowRDE("Bad pattern width %u, not %u", val, mVC5.patternWidth);
  ------------------
  |  |   38|      3|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      3|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      3|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      3|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  552|     79|      break;
  553|     91|    case PatternHeight:
  ------------------
  |  Branch (553:5): [True: 91, False: 10.4k]
  ------------------
  554|     91|      if (val != mVC5.patternHeight)
  ------------------
  |  Branch (554:11): [True: 1, False: 90]
  ------------------
  555|     91|        ThrowRDE("Bad pattern height %u, not %u", val, mVC5.patternHeight);
  ------------------
  |  |   38|      1|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      1|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      1|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      1|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  556|     90|      break;
  557|     90|    case SubbandNumber:
  ------------------
  |  Branch (557:5): [True: 38, False: 10.5k]
  ------------------
  558|     38|      if (val >= numSubbands)
  ------------------
  |  Branch (558:11): [True: 1, False: 37]
  ------------------
  559|     38|        ThrowRDE("Bad subband number %u", val);
  ------------------
  |  |   38|      1|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      1|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      1|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      1|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  560|     37|      mVC5.iSubband = val;
  561|     37|      break;
  562|    300|    case Quantization:
  ------------------
  |  Branch (562:5): [True: 300, False: 10.2k]
  ------------------
  563|    300|      mVC5.quantization = static_cast<int16_t>(val);
  564|    300|      break;
  565|     14|    case ComponentsPerSample:
  ------------------
  |  Branch (565:5): [True: 14, False: 10.5k]
  ------------------
  566|     14|      if (val != mVC5.cps)
  ------------------
  |  Branch (566:11): [True: 4, False: 10]
  ------------------
  567|     14|        ThrowRDE("Bad component per sample count %u, not %u", val, mVC5.cps);
  ------------------
  |  |   38|      4|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      4|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      4|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      4|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  568|     10|      break;
  569|     83|    case PrescaleShift:
  ------------------
  |  Branch (569:5): [True: 83, False: 10.4k]
  ------------------
  570|       |      // FIXME: something is wrong. We get this before ChannelNumber.
  571|       |      // Defaulting to 'mVC5.iChannel=0' seems to work *for existing samples*.
  572|    332|      for (int iWavelet = 0; iWavelet < numWaveletLevels; ++iWavelet) {
  ------------------
  |  Branch (572:30): [True: 249, False: 83]
  ------------------
  573|    249|        auto& channel = channels[mVC5.iChannel];
  574|    249|        auto& wavelet = channel.wavelets[1 + iWavelet];
  575|    249|        wavelet.prescale =
  576|    249|            extractHighBits(val, 2 * iWavelet, /*effectiveBitwidth=*/14) & 0x03;
  577|    249|      }
  578|     83|      break;
  579|  9.50k|    default: { // A chunk.
  ------------------
  |  Branch (579:5): [True: 9.50k, False: 1.06k]
  ------------------
  580|  9.50k|      unsigned int chunkSize = 0;
  581|  9.50k|      if (matches(tag, LARGE_CHUNK)) {
  ------------------
  |  Branch (581:11): [True: 4.03k, False: 5.47k]
  ------------------
  582|  4.03k|        chunkSize = static_cast<unsigned int>(
  583|  4.03k|            ((static_cast<std::underlying_type_t<VC5Tag>>(tag) & 0xff) << 16) |
  584|  4.03k|            (val & 0xffff));
  585|  5.47k|      } else if (matches(tag, SMALL_CHUNK)) {
  ------------------
  |  Branch (585:18): [True: 203, False: 5.26k]
  ------------------
  586|    203|        chunkSize = (val & 0xffff);
  587|    203|      }
  588|       |
  589|  9.50k|      if (is(tag, LargeCodeblock)) {
  ------------------
  |  Branch (589:11): [True: 46, False: 9.45k]
  ------------------
  590|     46|        parseLargeCodeblock(mBs.getStream(chunkSize, 4));
  591|     46|        break;
  592|     46|      }
  593|       |
  594|       |      // And finally, we got here if we didn't handle this tag/maybe-chunk.
  595|       |
  596|       |      // Magic, all the other 'large' chunks are actually optional,
  597|       |      // and don't specify any chunk bytes-to-be-skipped.
  598|  9.45k|      if (matches(tag, LARGE_CHUNK)) {
  ------------------
  |  Branch (598:11): [True: 3.98k, False: 5.47k]
  ------------------
  599|  3.98k|        optional = true;
  600|  3.98k|        chunkSize = 0;
  601|  3.98k|      }
  602|       |
  603|  9.45k|      if (!optional) {
  ------------------
  |  Branch (603:11): [True: 36, False: 9.42k]
  ------------------
  604|     36|        ThrowRDE("Unknown (unhandled) non-optional Tag 0x%04hx",
  ------------------
  |  |   38|     36|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     36|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     36|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     36|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  605|     36|                 static_cast<std::underlying_type_t<VC5Tag>>(tag));
  606|     36|      }
  607|       |
  608|  9.42k|      if (chunkSize)
  ------------------
  |  Branch (608:11): [True: 115, False: 9.30k]
  ------------------
  609|    115|        mBs.skipBytes(chunkSize, 4);
  610|       |
  611|  9.42k|      break;
  612|  9.45k|    }
  613|  10.5k|    }
  614|       |
  615|  10.4k|    done = std::all_of(channels.begin(), channels.end(),
  616|  10.4k|                       [](const Channel& channel) {
  617|  10.4k|                         return channel.wavelets[0].isBandValid(0);
  618|  10.4k|                       });
  619|  10.4k|  }
  620|    173|}
VC5Decompressor.cpp:_ZZN8rawspeed15VC5Decompressor8parseVC5EvENK3$_0clERKNS0_7ChannelE:
  616|  10.4k|                       [](const Channel& channel) {
  617|  10.4k|                         return channel.wavelets[0].isBandValid(0);
  618|  10.4k|                       });
_ZN8rawspeed15VC5Decompressor7Wavelet11LowPassBandC2ERS1_NS_10ByteStreamEt:
  654|      2|    : AbstractDecodeableBand(wavelet_, bs.getAsArray1DRef()),
  655|      2|      lowpassPrecision(lowpassPrecision_) {
  656|       |  // Low-pass band is a uncompressed version of the image, hugely downscaled.
  657|       |  // It consists of width * height pixels, `lowpassPrecision` each.
  658|       |  // We can easily check that we have sufficient amount of bits to decode it.
  659|      2|  const auto waveletArea = iPoint2D(wavelet.width, wavelet.height).area();
  660|      2|  const auto bitsTotal = waveletArea * lowpassPrecision;
  661|      2|  constexpr int bytesPerChunk = 8; // FIXME: or is it 4?
  662|      2|  constexpr int bitsPerChunk = 8 * bytesPerChunk;
  663|      2|  const auto chunksTotal = roundUpDivisionSafe(bitsTotal, bitsPerChunk);
  664|      2|  const auto bytesTotal = bytesPerChunk * chunksTotal;
  665|       |  // And clamp the size / verify sufficient input while we are at it.
  666|       |  // NOTE: this might fail (and should throw, not assert).
  667|      2|  input = bs.getStream(implicit_cast<Buffer::size_type>(bytesTotal))
  668|      2|              .getAsArray1DRef();
  669|      2|}
_ZN8rawspeed15VC5Decompressor19parseLargeCodeblockENS_10ByteStreamE:
  746|     31|void VC5Decompressor::parseLargeCodeblock(ByteStream bs) {
  747|     31|  static const auto subband_wavelet_index = []() {
  748|     31|    std::array<int, numSubbands> wavelets;
  749|     31|    int wavelet = 0;
  750|     31|    for (auto i = wavelets.size() - 1; i > 0;) {
  751|     31|      for (auto t = 0; t < numWaveletLevels; t++) {
  752|     31|        wavelets[i] = wavelet;
  753|     31|        i--;
  754|     31|      }
  755|     31|      if (i > 0)
  756|     31|        wavelet++;
  757|     31|    }
  758|     31|    wavelets.front() = wavelet;
  759|     31|    return wavelets;
  760|     31|  }();
  761|     31|  static const auto subband_band_index = []() {
  762|     31|    std::array<int, numSubbands> bands;
  763|     31|    bands.front() = 0;
  764|     31|    for (auto i = 1U; i < bands.size();) {
  765|     31|      for (int t = 1; t <= numWaveletLevels;) {
  766|     31|        bands[i] = t;
  767|     31|        t++;
  768|     31|        i++;
  769|     31|      }
  770|     31|    }
  771|     31|    return bands;
  772|     31|  }();
  773|       |
  774|     31|  if (!mVC5.iSubband.has_value())
  ------------------
  |  Branch (774:7): [True: 3, False: 28]
  ------------------
  775|     31|    ThrowRDE("Did not see VC5Tag::SubbandNumber yet");
  ------------------
  |  |   38|      3|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      3|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      3|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      3|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  776|       |
  777|     28|  const int idx = subband_wavelet_index[*mVC5.iSubband];
  778|     28|  const int band = subband_band_index[*mVC5.iSubband];
  779|       |
  780|     28|  auto& wavelets = channels[mVC5.iChannel].wavelets;
  781|       |
  782|     28|  Wavelet& wavelet = wavelets[1 + idx];
  783|     28|  if (wavelet.isBandValid(band)) {
  ------------------
  |  Branch (783:7): [True: 1, False: 27]
  ------------------
  784|      1|    ThrowRDE("Band %i for wavelet %i on channel %u was already seen", band, idx,
  ------------------
  |  |   38|      1|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      1|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      1|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      1|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  785|      1|             mVC5.iChannel);
  786|      1|  }
  787|       |
  788|     27|  std::unique_ptr<Wavelet::AbstractBand>& dstBand = wavelet.bands[band];
  789|     27|  if (mVC5.iSubband == 0) {
  ------------------
  |  Branch (789:7): [True: 4, False: 23]
  ------------------
  790|      4|    assert(band == 0);
  ------------------
  |  Branch (790:5): [True: 4, False: 0]
  ------------------
  791|       |    // low-pass band, only one, for the smallest wavelet, per channel per image
  792|      4|    if (!mVC5.lowpassPrecision.has_value())
  ------------------
  |  Branch (792:9): [True: 2, False: 2]
  ------------------
  793|      4|      ThrowRDE("Did not see VC5Tag::LowpassPrecision yet");
  ------------------
  |  |   38|      2|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      2|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      2|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      2|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  794|      2|    dstBand = std::make_unique<Wavelet::LowPassBand>(wavelet, bs,
  795|      2|                                                     *mVC5.lowpassPrecision);
  796|      2|    mVC5.lowpassPrecision.reset();
  797|     23|  } else {
  798|     23|    if (!mVC5.quantization.has_value())
  ------------------
  |  Branch (798:9): [True: 1, False: 22]
  ------------------
  799|     23|      ThrowRDE("Did not see VC5Tag::Quantization yet");
  ------------------
  |  |   38|      1|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      1|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      1|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      1|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  800|     22|    dstBand = std::make_unique<Wavelet::HighPassBand>(
  801|     22|        wavelet, bs.getAsArray1DRef(), codeDecoder, *mVC5.quantization);
  802|     22|    mVC5.quantization.reset();
  803|     22|  }
  804|     24|  wavelet.setBandValid(band);
  805|       |
  806|       |  // If this wavelet is fully specified, mark the low-pass band of the
  807|       |  // next lower wavelet as specified.
  808|     24|  if (wavelet.allBandsValid()) {
  ------------------
  |  Branch (808:7): [True: 0, False: 24]
  ------------------
  809|      0|    Wavelet& nextWavelet = wavelets[idx];
  810|      0|    assert(!nextWavelet.isBandValid(0));
  ------------------
  |  Branch (810:5): [True: 0, False: 0]
  ------------------
  811|      0|    bool finalWavelet = idx == 0;
  812|      0|    nextWavelet.bands[0] = std::make_unique<Wavelet::ReconstructableBand>(
  813|      0|        wavelet, /*clampUint=*/finalWavelet, finalWavelet);
  814|      0|    nextWavelet.setBandValid(0);
  815|      0|  }
  816|       |
  817|     24|  mVC5.iSubband.reset();
  818|     24|}

_ZN8rawspeed15VC5Decompressor7Wavelet12AbstractBandC2ERS1_:
  150|     24|      explicit AbstractBand(Wavelet& wavelet_) : wavelet(wavelet_) {}
_ZN8rawspeed15VC5Decompressor7Wavelet22AbstractDecodeableBandC2ERS1_NS_10Array1DRefIKhEE:
  178|     24|          : AbstractBand(wavelet_), input(input_) {}
_ZN8rawspeed15VC5Decompressor7Wavelet12HighPassBandC2ERS1_NS_10Array1DRefIKhEERKNS_8OptionalINS_20PrefixCodeLUTDecoderINS_10VC5CodeTagENS_23PrefixCodeVectorDecoderIS9_EEEEEEs:
  193|     22|          : AbstractDecodeableBand(wavelet_, input_), decoder(decoder_),
  194|     22|            quant(quant_) {}
_ZN8rawspeedanENS_6VC5TagES0_:
   76|  44.4k|inline VC5Tag operator&(VC5Tag LHS, VC5Tag RHS) {
   77|  44.4k|  using value_type = std::underlying_type_t<VC5Tag>;
   78|  44.4k|  return static_cast<VC5Tag>(static_cast<value_type>(LHS) &
   79|  44.4k|                             static_cast<value_type>(RHS));
   80|  44.4k|}
_ZN8rawspeed7matchesENS_6VC5TagES0_:
   81|  34.9k|inline bool matches(VC5Tag LHS, VC5Tag RHS) {
   82|       |  // Are there any common bit set?
   83|  34.9k|  return (LHS & RHS) != VC5Tag::NoTag;
   84|  34.9k|}
_ZN8rawspeed2isENS_6VC5TagES0_:
   85|  9.50k|inline bool is(VC5Tag LHS, VC5Tag RHS) {
   86|       |  // Does LHS have all the RHS bits set?
   87|  9.50k|  return (LHS & RHS) == RHS;
   88|  9.50k|}
_ZN8rawspeedngENS_6VC5TagE:
   89|  6.46k|inline VC5Tag operator-(VC5Tag tag) {
   90|  6.46k|  using value_type = std::underlying_type_t<VC5Tag>;
   91|       |  // Negate
   92|  6.46k|  return static_cast<VC5Tag>(-static_cast<value_type>(tag));
   93|  6.46k|}
_ZN8rawspeed15VC5Decompressor7Wavelet12AbstractBandD2Ev:
  151|     24|      virtual ~AbstractBand() = default;

_ZN8rawspeed6BufferC2EPKhj:
   68|  14.8k|      : Buffer(Array1DRef(data_, implicit_cast<int>(size_))) {}
_ZN8rawspeed6BufferC2ENS_10Array1DRefIKhEE:
   62|  26.5M|      : data(data_.begin()), size(data_.size()) {
   63|  26.5M|    assert(data);
  ------------------
  |  Branch (63:5): [True: 26.5M, False: 2.74k]
  ------------------
   64|  26.5M|    assert(!ASan::RegionIsPoisoned(data, size));
  ------------------
  |  Branch (64:5): [True: 26.5M, False: 2.10k]
  ------------------
   65|  26.5M|  }
_ZNK8rawspeed6Buffer15getAsArray1DRefEv:
   70|  53.8M|  [[nodiscard]] Array1DRef<const uint8_t> getAsArray1DRef() const {
   71|  53.8M|    return {data, implicit_cast<int>(size)};
   72|  53.8M|  }
_ZNK8rawspeed6Buffer10getSubViewEjj:
   78|  26.6M|  [[nodiscard]] Buffer getSubView(size_type offset, size_type size_) const {
   79|  26.6M|    if (!isValid(offset, size_))
  ------------------
  |  Branch (79:9): [True: 103k, False: 26.5M]
  ------------------
   80|  26.6M|      ThrowIOE("Buffer overflow: image file may be truncated");
  ------------------
  |  |   37|   103k|#define ThrowIOE(...) ThrowExceptionHelper(rawspeed::IOException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|   103k|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|   103k|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|   103k|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   81|       |
   82|  26.5M|    return getAsArray1DRef().getCrop(offset, size_).getAsArray1DRef();
   83|  26.6M|  }
_ZNK8rawspeed6Buffer10getSubViewEj:
   85|  6.14k|  [[nodiscard]] Buffer getSubView(size_type offset) const {
   86|  6.14k|    if (!isValid(0, offset))
  ------------------
  |  Branch (86:9): [True: 209, False: 5.93k]
  ------------------
   87|  6.14k|      ThrowIOE("Buffer overflow: image file may be truncated");
  ------------------
  |  |   37|    209|#define ThrowIOE(...) ThrowExceptionHelper(rawspeed::IOException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|    209|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|    209|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|    209|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   88|       |
   89|  5.93k|    size_type newSize = getSize() - offset;
   90|  5.93k|    return getSubView(offset, newSize);
   91|  6.14k|  }
_ZNK8rawspeed6BufferixEj:
   94|  12.9k|  uint8_t operator[](size_type offset) const {
   95|  12.9k|    return getAsArray1DRef()(offset);
   96|  12.9k|  }
_ZNK8rawspeed6Buffer5beginEv:
   99|  25.5M|  [[nodiscard]] const uint8_t* begin() const {
  100|  25.5M|    return getAsArray1DRef().begin();
  101|  25.5M|  }
_ZNK8rawspeed6Buffer3endEv:
  102|  1.26M|  [[nodiscard]] const uint8_t* end() const { return getAsArray1DRef().end(); }
_ZNK8rawspeed6Buffer7getSizeEv:
  115|  77.3M|  [[nodiscard]] size_type RAWSPEED_READONLY getSize() const { return size; }
_ZNK8rawspeed6Buffer7isValidEjj:
  117|  39.9M|  [[nodiscard]] bool isValid(size_type offset, size_type count = 1) const {
  118|  39.9M|    return static_cast<uint64_t>(offset) + count <=
  119|  39.9M|           static_cast<uint64_t>(getSize());
  120|  39.9M|  }
_ZN8rawspeed10DataBufferC2ENS_6BufferENS_10EndiannessE:
  142|   921k|      : Buffer(data_), endianness(endianness_) {}
_ZNK8rawspeed10DataBuffer12getByteOrderEv:
  154|   893k|  [[nodiscard]] Endianness getByteOrder() const { return endianness; }
_ZN8rawspeed10DataBuffer12setByteOrderENS_10EndiannessE:
  156|  21.5k|  Endianness setByteOrder(Endianness endianness_) {
  157|  21.5k|    std::swap(endianness, endianness_);
  158|  21.5k|    return endianness_;
  159|  21.5k|  }
_ZN8rawspeedltENS_6BufferES0_:
  124|  43.3k|inline bool operator<(Buffer lhs, Buffer rhs) {
  125|  43.3k|  return std::pair(lhs.begin(), lhs.end()) < std::pair(rhs.begin(), rhs.end());
  126|  43.3k|}
_ZNK8rawspeed10DataBuffer3getIhEET_jj:
  147|  8.58M|  [[nodiscard]] T get(size_type offset, size_type index = 0) const {
  148|  8.58M|    assert(Endianness::unknown != endianness);
  ------------------
  |  Branch (148:5): [True: 8.58M, False: 18.4E]
  ------------------
  149|  8.58M|    assert(Endianness::little == endianness || Endianness::big == endianness);
  ------------------
  |  Branch (149:5): [True: 142k, False: 8.44M]
  |  Branch (149:5): [True: 8.44M, False: 0]
  |  Branch (149:5): [True: 8.58M, False: 18.4E]
  ------------------
  150|       |
  151|  8.58M|    return Buffer::get<T>(getHostEndianness() == endianness, offset, index);
  152|  8.58M|  }
_ZNK8rawspeed6Buffer3getIhEET_bjj:
  108|  8.58M|                      size_type index = 0) const {
  109|  8.58M|    const Buffer buf =
  110|  8.58M|        getSubView(offset + (index * static_cast<size_type>(sizeof(T))),
  111|  8.58M|                   static_cast<size_type>(sizeof(T)));
  112|  8.58M|    return getByteSwapped<T>(buf.begin(), !inNativeByteOrder);
  113|  8.58M|  }
_ZNK8rawspeed10DataBuffer3getItEET_jj:
  147|  1.85M|  [[nodiscard]] T get(size_type offset, size_type index = 0) const {
  148|  1.85M|    assert(Endianness::unknown != endianness);
  ------------------
  |  Branch (148:5): [True: 1.85M, False: 0]
  ------------------
  149|  1.85M|    assert(Endianness::little == endianness || Endianness::big == endianness);
  ------------------
  |  Branch (149:5): [True: 1.55M, False: 291k]
  |  Branch (149:5): [True: 291k, False: 0]
  |  Branch (149:5): [True: 1.85M, False: 18.4E]
  ------------------
  150|       |
  151|  1.85M|    return Buffer::get<T>(getHostEndianness() == endianness, offset, index);
  152|  1.85M|  }
_ZNK8rawspeed6Buffer3getItEET_bjj:
  108|  1.85M|                      size_type index = 0) const {
  109|  1.85M|    const Buffer buf =
  110|  1.85M|        getSubView(offset + (index * static_cast<size_type>(sizeof(T))),
  111|  1.85M|                   static_cast<size_type>(sizeof(T)));
  112|  1.85M|    return getByteSwapped<T>(buf.begin(), !inNativeByteOrder);
  113|  1.85M|  }
_ZNK8rawspeed10DataBuffer3getIjEET_jj:
  147|  1.24M|  [[nodiscard]] T get(size_type offset, size_type index = 0) const {
  148|  1.24M|    assert(Endianness::unknown != endianness);
  ------------------
  |  Branch (148:5): [True: 1.24M, False: 0]
  ------------------
  149|  1.24M|    assert(Endianness::little == endianness || Endianness::big == endianness);
  ------------------
  |  Branch (149:5): [True: 1.11M, False: 130k]
  |  Branch (149:5): [True: 130k, False: 0]
  |  Branch (149:5): [True: 1.24M, False: 1]
  ------------------
  150|       |
  151|  1.24M|    return Buffer::get<T>(getHostEndianness() == endianness, offset, index);
  152|  1.24M|  }
_ZNK8rawspeed6Buffer3getIjEET_bjj:
  108|  1.24M|                      size_type index = 0) const {
  109|  1.24M|    const Buffer buf =
  110|  1.24M|        getSubView(offset + (index * static_cast<size_type>(sizeof(T))),
  111|  1.24M|                   static_cast<size_type>(sizeof(T)));
  112|  1.24M|    return getByteSwapped<T>(buf.begin(), !inNativeByteOrder);
  113|  1.24M|  }
_ZNK8rawspeed10DataBuffer3getIiEET_jj:
  147|   145k|  [[nodiscard]] T get(size_type offset, size_type index = 0) const {
  148|   145k|    assert(Endianness::unknown != endianness);
  ------------------
  |  Branch (148:5): [True: 145k, False: 0]
  ------------------
  149|   145k|    assert(Endianness::little == endianness || Endianness::big == endianness);
  ------------------
  |  Branch (149:5): [True: 145k, False: 9]
  |  Branch (149:5): [True: 9, False: 0]
  |  Branch (149:5): [True: 145k, False: 0]
  ------------------
  150|       |
  151|   145k|    return Buffer::get<T>(getHostEndianness() == endianness, offset, index);
  152|   145k|  }
_ZNK8rawspeed6Buffer3getIiEET_bjj:
  108|   145k|                      size_type index = 0) const {
  109|   145k|    const Buffer buf =
  110|   145k|        getSubView(offset + (index * static_cast<size_type>(sizeof(T))),
  111|   145k|                   static_cast<size_type>(sizeof(T)));
  112|   145k|    return getByteSwapped<T>(buf.begin(), !inNativeByteOrder);
  113|   145k|  }
_ZNK8rawspeed10DataBuffer3getIfEET_jj:
  147|  49.6k|  [[nodiscard]] T get(size_type offset, size_type index = 0) const {
  148|  49.6k|    assert(Endianness::unknown != endianness);
  ------------------
  |  Branch (148:5): [True: 49.6k, False: 0]
  ------------------
  149|  49.6k|    assert(Endianness::little == endianness || Endianness::big == endianness);
  ------------------
  |  Branch (149:5): [True: 390, False: 49.2k]
  |  Branch (149:5): [True: 49.2k, False: 0]
  |  Branch (149:5): [True: 49.6k, False: 0]
  ------------------
  150|       |
  151|  49.6k|    return Buffer::get<T>(getHostEndianness() == endianness, offset, index);
  152|  49.6k|  }
_ZNK8rawspeed6Buffer3getIfEET_bjj:
  108|  49.6k|                      size_type index = 0) const {
  109|  49.6k|    const Buffer buf =
  110|  49.6k|        getSubView(offset + (index * static_cast<size_type>(sizeof(T))),
  111|  49.6k|                   static_cast<size_type>(sizeof(T)));
  112|  49.6k|    return getByteSwapped<T>(buf.begin(), !inNativeByteOrder);
  113|  49.6k|  }
_ZN8rawspeed10DataBufferC2Ev:
  139|   277k|  DataBuffer() = default;
_ZN8rawspeed6BufferC2Ev:
   58|   277k|  Buffer() = default;
_ZNK8rawspeed10DataBuffer3getIsEET_jj:
  147|  1.09k|  [[nodiscard]] T get(size_type offset, size_type index = 0) const {
  148|  1.09k|    assert(Endianness::unknown != endianness);
  ------------------
  |  Branch (148:5): [True: 1.09k, False: 0]
  ------------------
  149|  1.09k|    assert(Endianness::little == endianness || Endianness::big == endianness);
  ------------------
  |  Branch (149:5): [True: 1.09k, False: 3]
  |  Branch (149:5): [True: 3, False: 0]
  |  Branch (149:5): [True: 1.09k, False: 0]
  ------------------
  150|       |
  151|  1.09k|    return Buffer::get<T>(getHostEndianness() == endianness, offset, index);
  152|  1.09k|  }
_ZNK8rawspeed6Buffer3getIsEET_bjj:
  108|  1.09k|                      size_type index = 0) const {
  109|  1.09k|    const Buffer buf =
  110|  1.09k|        getSubView(offset + (index * static_cast<size_type>(sizeof(T))),
  111|  1.09k|                   static_cast<size_type>(sizeof(T)));
  112|  1.09k|    return getByteSwapped<T>(buf.begin(), !inNativeByteOrder);
  113|  1.09k|  }
_ZNK8rawspeed10DataBuffer3getIdEET_jj:
  147|    326|  [[nodiscard]] T get(size_type offset, size_type index = 0) const {
  148|    326|    assert(Endianness::unknown != endianness);
  ------------------
  |  Branch (148:5): [True: 326, False: 0]
  ------------------
  149|    326|    assert(Endianness::little == endianness || Endianness::big == endianness);
  ------------------
  |  Branch (149:5): [True: 244, False: 82]
  |  Branch (149:5): [True: 82, False: 0]
  |  Branch (149:5): [True: 326, False: 0]
  ------------------
  150|       |
  151|    326|    return Buffer::get<T>(getHostEndianness() == endianness, offset, index);
  152|    326|  }
_ZNK8rawspeed6Buffer3getIdEET_bjj:
  108|    326|                      size_type index = 0) const {
  109|    326|    const Buffer buf =
  110|    326|        getSubView(offset + (index * static_cast<size_type>(sizeof(T))),
  111|    326|                   static_cast<size_type>(sizeof(T)));
  112|    326|    return getByteSwapped<T>(buf.begin(), !inNativeByteOrder);
  113|    326|  }

_ZN8rawspeed10ByteStreamC2ENS_10DataBufferE:
   50|   942k|  explicit ByteStream(DataBuffer buffer) : DataBuffer(buffer) {}
_ZNK8rawspeed10ByteStream12getSubStreamEjj:
   55|   978k|                                        size_type size_) const {
   56|   978k|    return ByteStream(DataBuffer(getSubView(offset, size_), getByteOrder()));
   57|   978k|  }
_ZNK8rawspeed10ByteStream12getSubStreamEj:
   59|    647|  [[nodiscard]] ByteStream getSubStream(size_type offset) const {
   60|    647|    return ByteStream(DataBuffer(getSubView(offset), getByteOrder()));
   61|    647|  }
_ZNK8rawspeed10ByteStream5checkEj:
   63|  12.2M|  [[nodiscard]] size_type check(size_type bytes) const {
   64|  12.2M|    if (!isValid(pos, bytes))
  ------------------
  |  Branch (64:9): [True: 16.2k, False: 12.1M]
  ------------------
   65|  12.2M|      ThrowIOE("Out of bounds access in ByteStream");
  ------------------
  |  |   37|  16.2k|#define ThrowIOE(...) ThrowExceptionHelper(rawspeed::IOException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|  16.2k|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|  16.2k|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|  16.2k|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   66|  12.1M|    [[maybe_unused]] Buffer tmp = getSubView(pos, bytes);
   67|  12.1M|    assert(tmp.getSize() == bytes);
  ------------------
  |  Branch (67:5): [True: 12.1M, False: 18.4E]
  ------------------
   68|  12.1M|    assert(!ASan::RegionIsPoisoned(tmp.begin(), tmp.getSize()));
  ------------------
  |  Branch (68:5): [True: 12.1M, False: 18.4E]
  ------------------
   69|  12.1M|    return bytes;
   70|  12.1M|  }
_ZNK8rawspeed10ByteStream5checkEjj:
   72|  1.20k|  [[nodiscard]] size_type check(size_type nmemb, size_type size_) const {
   73|  1.20k|    if (size_ && nmemb > std::numeric_limits<size_type>::max() / size_)
  ------------------
  |  Branch (73:9): [True: 1.20k, False: 0]
  |  Branch (73:18): [True: 23, False: 1.17k]
  ------------------
   74|  1.20k|      ThrowIOE("Integer overflow when calculating stream length");
  ------------------
  |  |   37|     23|#define ThrowIOE(...) ThrowExceptionHelper(rawspeed::IOException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     23|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     23|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     23|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   75|  1.17k|    return check(nmemb * size_);
   76|  1.20k|  }
_ZNK8rawspeed10ByteStream11getPositionEv:
   78|   485k|  [[nodiscard]] size_type getPosition() const {
   79|   485k|    invariant(getSize() >= pos);
  ------------------
  |  |   27|   485k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (79:5): [True: 485k, False: 0]
  ------------------
   80|   485k|    (void)check(0);
   81|   485k|    return pos;
   82|   485k|  }
_ZN8rawspeed10ByteStream11setPositionEj:
   83|   183k|  void setPosition(size_type newPos) {
   84|   183k|    pos = newPos;
   85|   183k|    (void)check(0);
   86|   183k|  }
_ZNK8rawspeed10ByteStream13getRemainSizeEv:
   87|  5.74M|  [[nodiscard]] size_type RAWSPEED_READONLY getRemainSize() const {
   88|  5.74M|    invariant(getSize() >= pos);
  ------------------
  |  |   27|  5.74M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (88:5): [True: 5.74M, False: 18.4E]
  ------------------
   89|  5.74M|    (void)check(0);
   90|  5.74M|    return getSize() - pos;
   91|  5.74M|  }
_ZNK8rawspeed10ByteStream8peekDataEj:
   92|  1.36k|  [[nodiscard]] const uint8_t* peekData(size_type count) const {
   93|  1.36k|    return Buffer::getSubView(pos, count).begin();
   94|  1.36k|  }
_ZN8rawspeed10ByteStream7getDataEj:
   95|    929|  const uint8_t* getData(size_type count) {
   96|    929|    const uint8_t* ret = peekData(count);
   97|    929|    pos += count;
   98|    929|    return ret;
   99|    929|  }
_ZNK8rawspeed10ByteStream10peekBufferEj:
  100|   117k|  [[nodiscard]] Buffer peekBuffer(size_type size_) const {
  101|   117k|    return getSubView(pos, size_);
  102|   117k|  }
_ZN8rawspeed10ByteStream9getBufferEj:
  103|  11.1k|  Buffer getBuffer(size_type size_) {
  104|  11.1k|    Buffer ret = peekBuffer(size_);
  105|  11.1k|    pos += size_;
  106|  11.1k|    return ret;
  107|  11.1k|  }
_ZNK8rawspeed10ByteStream19peekRemainingBufferEv:
  108|   412k|  [[nodiscard]] Buffer peekRemainingBuffer() const {
  109|   412k|    return getSubView(pos, getRemainSize());
  110|   412k|  }
_ZNK8rawspeed10ByteStream10peekStreamEj:
  111|   417k|  [[nodiscard]] ByteStream peekStream(size_type size_) const {
  112|   417k|    return getSubStream(pos, size_);
  113|   417k|  }
_ZNK8rawspeed10ByteStream10peekStreamEjj:
  114|    351|  [[nodiscard]] ByteStream peekStream(size_type nmemb, size_type size_) const {
  115|    351|    if (size_ && nmemb > std::numeric_limits<size_type>::max() / size_)
  ------------------
  |  Branch (115:9): [True: 351, False: 0]
  |  Branch (115:18): [True: 0, False: 351]
  ------------------
  116|    351|      ThrowIOE("Integer overflow when calculating stream length");
  ------------------
  |  |   37|      0|#define ThrowIOE(...) ThrowExceptionHelper(rawspeed::IOException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  117|    351|    return peekStream(nmemb * size_);
  118|    351|  }
_ZN8rawspeed10ByteStream9getStreamEj:
  119|   398k|  ByteStream getStream(size_type size_) {
  120|   398k|    ByteStream ret = peekStream(size_);
  121|   398k|    pos += size_;
  122|   398k|    return ret;
  123|   398k|  }
_ZN8rawspeed10ByteStream9getStreamEjj:
  124|  6.40k|  ByteStream getStream(size_type nmemb, size_type size_) {
  125|  6.40k|    if (size_ && nmemb > std::numeric_limits<size_type>::max() / size_)
  ------------------
  |  Branch (125:9): [True: 6.40k, False: 0]
  |  Branch (125:18): [True: 14, False: 6.39k]
  ------------------
  126|  6.40k|      ThrowIOE("Integer overflow when calculating stream length");
  ------------------
  |  |   37|     14|#define ThrowIOE(...) ThrowExceptionHelper(rawspeed::IOException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     14|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     14|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     14|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  127|  6.39k|    return getStream(nmemb * size_);
  128|  6.40k|  }
_ZN8rawspeed10ByteStream9skipBytesEj:
  130|  5.76M|  void skipBytes(size_type nbytes) { pos += check(nbytes); }
_ZN8rawspeed10ByteStream9skipBytesEjj:
  131|    908|  void skipBytes(size_type nmemb, size_type size_) {
  132|    908|    pos += check(nmemb, size_);
  133|    908|  }
_ZNK8rawspeed10ByteStream12hasPatternAtENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEEj:
  136|  1.08M|                                  size_type relPos) const {
  137|  1.08M|    if (!isValid(pos + relPos, implicit_cast<size_type>(pattern.size())))
  ------------------
  |  Branch (137:9): [True: 27.5k, False: 1.05M]
  ------------------
  138|  27.5k|      return false;
  139|  1.05M|    auto tmp =
  140|  1.05M|        getSubView(pos + relPos, implicit_cast<size_type>(pattern.size()));
  141|  1.05M|    assert(tmp.getSize() == pattern.size());
  ------------------
  |  Branch (141:5): [True: 1.05M, False: 0]
  ------------------
  142|  1.05M|    return std::equal(tmp.begin(), tmp.end(), pattern.begin());
  143|  1.05M|  }
_ZNK8rawspeed10ByteStream9hasPrefixENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
  145|  1.04M|  [[nodiscard]] bool hasPrefix(std::string_view prefix) const {
  146|  1.04M|    return hasPatternAt(prefix, /*relPos=*/0);
  147|  1.04M|  }
_ZN8rawspeed10ByteStream10skipPrefixENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
  149|   877k|  bool skipPrefix(std::string_view prefix) {
  150|   877k|    bool has_prefix = hasPrefix(prefix);
  151|   877k|    if (has_prefix)
  ------------------
  |  Branch (151:9): [True: 2.30k, False: 874k]
  ------------------
  152|  2.30k|      pos += prefix.size();
  153|   877k|    return has_prefix;
  154|   877k|  }
_ZNK8rawspeed10ByteStream8peekByteEj:
  183|  8.49M|  [[nodiscard]] uint8_t peekByte(size_type i = 0) const {
  184|  8.49M|    return peek<uint8_t>(i);
  185|  8.49M|  }
_ZN8rawspeed10ByteStream7getByteEv:
  186|  98.3k|  uint8_t getByte() { return get<uint8_t>(); }
_ZNK8rawspeed10ByteStream7peekU16Ev:
  188|  5.25k|  [[nodiscard]] uint16_t peekU16() const { return peek<uint16_t>(); }
_ZN8rawspeed10ByteStream6getU16Ev:
  194|  1.34M|  uint16_t getU16() { return get<uint16_t>(); }
_ZN8rawspeed10ByteStream6getU32Ev:
  196|  1.18M|  uint32_t getU32() { return get<uint32_t>(); }
_ZN8rawspeed10ByteStream8getFloatEv:
  197|    127|  float getFloat() { return get<float>(); }
_ZNK8rawspeed10ByteStream10peekStringEv:
  199|    270|  [[nodiscard]] std::string_view peekString() const {
  200|    270|    Buffer tmp = peekBuffer(getRemainSize());
  201|    270|    const auto* termIter = std::find(tmp.begin(), tmp.end(), '\0');
  202|    270|    if (termIter == tmp.end())
  ------------------
  |  Branch (202:9): [True: 0, False: 270]
  ------------------
  203|    270|      ThrowIOE("String is not null-terminated");
  ------------------
  |  |   37|      0|#define ThrowIOE(...) ThrowExceptionHelper(rawspeed::IOException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  204|    270|    std::string_view::size_type strlen = std::distance(tmp.begin(), termIter);
  205|    270|    return {reinterpret_cast<const char*>(tmp.begin()), strlen};
  206|    270|  }
_ZNK8rawspeed10ByteStream4peekIhEET_j:
  156|  8.58M|  template <typename T> [[nodiscard]] T peek(size_type i = 0) const {
  157|  8.58M|    return DataBuffer::get<T>(pos, i);
  158|  8.58M|  }
_ZN8rawspeed10ByteStream3getIhEET_v:
  159|  98.3k|  template <typename T> T get() {
  160|  98.3k|    auto ret = peek<T>();
  161|  98.3k|    pos += sizeof(T);
  162|  98.3k|    return ret;
  163|  98.3k|  }
_ZNK8rawspeed10ByteStream4peekItEET_j:
  156|  1.85M|  template <typename T> [[nodiscard]] T peek(size_type i = 0) const {
  157|  1.85M|    return DataBuffer::get<T>(pos, i);
  158|  1.85M|  }
_ZNK8rawspeed10ByteStream4peekIjEET_j:
  156|  1.23M|  template <typename T> [[nodiscard]] T peek(size_type i = 0) const {
  157|  1.23M|    return DataBuffer::get<T>(pos, i);
  158|  1.23M|  }
_ZN8rawspeed10ByteStream3getItEET_v:
  159|  1.34M|  template <typename T> T get() {
  160|  1.34M|    auto ret = peek<T>();
  161|  1.34M|    pos += sizeof(T);
  162|  1.34M|    return ret;
  163|  1.34M|  }
_ZNK8rawspeed10ByteStream4peekIiEET_j:
  156|   145k|  template <typename T> [[nodiscard]] T peek(size_type i = 0) const {
  157|   145k|    return DataBuffer::get<T>(pos, i);
  158|   145k|  }
_ZN8rawspeed10ByteStream3getIjEET_v:
  159|  1.18M|  template <typename T> T get() {
  160|  1.18M|    auto ret = peek<T>();
  161|  1.18M|    pos += sizeof(T);
  162|  1.18M|    return ret;
  163|  1.18M|  }
_ZN8rawspeed10ByteStream3getIfEET_v:
  159|  49.3k|  template <typename T> T get() {
  160|  49.3k|    auto ret = peek<T>();
  161|  49.3k|    pos += sizeof(T);
  162|  49.3k|    return ret;
  163|  49.3k|  }
_ZNK8rawspeed10ByteStream4peekIfEET_j:
  156|  49.6k|  template <typename T> [[nodiscard]] T peek(size_type i = 0) const {
  157|  49.6k|    return DataBuffer::get<T>(pos, i);
  158|  49.6k|  }
_ZN8rawspeed10ByteStreamC2Ev:
   48|   277k|  ByteStream() = default;
_ZNK8rawspeed10ByteStream4peekIsEET_j:
  156|  1.09k|  template <typename T> [[nodiscard]] T peek(size_type i = 0) const {
  157|  1.09k|    return DataBuffer::get<T>(pos, i);
  158|  1.09k|  }
_ZNK8rawspeed10ByteStream4peekIdEET_j:
  156|    326|  template <typename T> [[nodiscard]] T peek(size_type i = 0) const {
  157|    326|    return DataBuffer::get<T>(pos, i);
  158|    326|  }
_ZN8rawspeed10ByteStream3getIdEET_v:
  159|     82|  template <typename T> T get() {
  160|     82|    auto ret = peek<T>();
  161|     82|    pos += sizeof(T);
  162|     82|    return ret;
  163|     82|  }

_ZN8rawspeed17getHostEndiannessEv:
   63|  18.8M|inline Endianness getHostEndianness() {
   64|  18.8M|#if defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
   65|  18.8M|  return Endianness::little;
   66|       |#elif defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
   67|       |  return Endianness::big;
   68|       |#elif defined(__BYTE_ORDER__)
   69|       |#error "uhm, __BYTE_ORDER__ has some strange value"
   70|       |#else
   71|       |  return getHostEndiannessRuntime();
   72|       |#endif
   73|  18.8M|}
_ZN8rawspeed14getByteSwappedEh:
   76|  8.44M|inline uint8_t getByteSwapped(uint8_t v) { return v; }
_ZN8rawspeed14getByteSwappedEs:
   77|      3|inline int16_t getByteSwapped(int16_t v) {
   78|      3|  return static_cast<int16_t>(BSWAP16(static_cast<uint16_t>(v)));
  ------------------
  |  |   36|      3|#define BSWAP16(A) __builtin_bswap16(A)
  ------------------
   79|      3|}
_ZN8rawspeed14getByteSwappedEt:
   80|   291k|inline uint16_t getByteSwapped(uint16_t v) { return BSWAP16(v); }
  ------------------
  |  |   36|   291k|#define BSWAP16(A) __builtin_bswap16(A)
  ------------------
_ZN8rawspeed14getByteSwappedEi:
   81|      9|inline int32_t getByteSwapped(int32_t v) {
   82|      9|  return static_cast<int32_t>(BSWAP32(static_cast<uint32_t>(v)));
  ------------------
  |  |   37|      9|#define BSWAP32(A) __builtin_bswap32(A)
  ------------------
   83|      9|}
_ZN8rawspeed14getByteSwappedEj:
   84|  2.89M|inline uint32_t getByteSwapped(uint32_t v) { return BSWAP32(v); }
  ------------------
  |  |   37|  2.89M|#define BSWAP32(A) __builtin_bswap32(A)
  ------------------
_ZN8rawspeed14getByteSwappedEm:
   85|     82|inline uint64_t getByteSwapped(uint64_t v) { return BSWAP64(v); }
  ------------------
  |  |   38|     82|#define BSWAP64(A) __builtin_bswap64(A)
  ------------------
_ZN8rawspeed14getByteSwappedEf:
   89|  49.2k|inline float getByteSwapped(float f) {
   90|  49.2k|  auto i = std::bit_cast<uint32_t>(f);
   91|  49.2k|  i = getByteSwapped(i);
   92|  49.2k|  return std::bit_cast<float>(i);
   93|  49.2k|}
_ZN8rawspeed14getByteSwappedEd:
   94|     82|inline double getByteSwapped(double d) {
   95|     82|  auto i = std::bit_cast<uint64_t>(d);
   96|     82|  i = getByteSwapped(i);
   97|     82|  return std::bit_cast<double>(i);
   98|     82|}
_ZN8rawspeed8getU16BEEPKv:
  124|     12|inline uint16_t getU16BE(const void* data) { return getBE<uint16_t>(data); }
_ZN8rawspeed8getU32BEEPKv:
  126|  2.41k|inline uint32_t getU32BE(const void* data) { return getBE<uint32_t>(data); }
_ZN8rawspeed8getU32LEEPKv:
  127|     47|inline uint32_t getU32LE(const void* data) { return getLE<uint32_t>(data); }
_ZN8rawspeed5getBEItEET_PKv:
  116|     12|template <typename T> inline T getBE(const void* data) {
  117|     12|  return getByteSwapped<T>(data, getHostEndianness() == Endianness::little);
  118|     12|}
_ZN8rawspeed14getByteSwappedItEET_PKvb:
  100|  1.84M|template <typename T> inline T getByteSwapped(const void* data, bool bswap) {
  101|  1.84M|  T ret;
  102|       |  // all interesting compilers optimize this memcpy into a single move
  103|       |  // this is the most effective way to load some bytes without running into
  104|       |  // alignment or aliasing issues
  105|  1.84M|  memcpy(&ret, data, sizeof(T));
  106|  1.84M|  return bswap ? getByteSwapped(ret) : ret;
  ------------------
  |  Branch (106:10): [True: 291k, False: 1.55M]
  ------------------
  107|  1.84M|}
_ZN8rawspeed5getBEIjEET_PKv:
  116|  2.41k|template <typename T> inline T getBE(const void* data) {
  117|  2.41k|  return getByteSwapped<T>(data, getHostEndianness() == Endianness::little);
  118|  2.41k|}
_ZN8rawspeed14getByteSwappedIjEET_PKvb:
  100|  8.21M|template <typename T> inline T getByteSwapped(const void* data, bool bswap) {
  101|  8.21M|  T ret;
  102|       |  // all interesting compilers optimize this memcpy into a single move
  103|       |  // this is the most effective way to load some bytes without running into
  104|       |  // alignment or aliasing issues
  105|  8.21M|  memcpy(&ret, data, sizeof(T));
  106|  8.21M|  return bswap ? getByteSwapped(ret) : ret;
  ------------------
  |  Branch (106:10): [True: 2.84M, False: 5.36M]
  ------------------
  107|  8.21M|}
_ZN8rawspeed5getLEIjEET_PKv:
  120|     47|template <typename T> inline T getLE(const void* data) {
  121|     47|  return getByteSwapped<T>(data, getHostEndianness() == Endianness::big);
  122|     47|}
_ZN8rawspeed14getByteSwappedIhEET_PKvb:
  100|  8.58M|template <typename T> inline T getByteSwapped(const void* data, bool bswap) {
  101|  8.58M|  T ret;
  102|       |  // all interesting compilers optimize this memcpy into a single move
  103|       |  // this is the most effective way to load some bytes without running into
  104|       |  // alignment or aliasing issues
  105|  8.58M|  memcpy(&ret, data, sizeof(T));
  106|  8.58M|  return bswap ? getByteSwapped(ret) : ret;
  ------------------
  |  Branch (106:10): [True: 8.44M, False: 142k]
  ------------------
  107|  8.58M|}
_ZN8rawspeed14getByteSwappedIiEET_PKvb:
  100|   145k|template <typename T> inline T getByteSwapped(const void* data, bool bswap) {
  101|   145k|  T ret;
  102|       |  // all interesting compilers optimize this memcpy into a single move
  103|       |  // this is the most effective way to load some bytes without running into
  104|       |  // alignment or aliasing issues
  105|   145k|  memcpy(&ret, data, sizeof(T));
  106|   145k|  return bswap ? getByteSwapped(ret) : ret;
  ------------------
  |  Branch (106:10): [True: 9, False: 145k]
  ------------------
  107|   145k|}
_ZN8rawspeed14getByteSwappedIfEET_PKvb:
  100|  49.5k|template <typename T> inline T getByteSwapped(const void* data, bool bswap) {
  101|  49.5k|  T ret;
  102|       |  // all interesting compilers optimize this memcpy into a single move
  103|       |  // this is the most effective way to load some bytes without running into
  104|       |  // alignment or aliasing issues
  105|  49.5k|  memcpy(&ret, data, sizeof(T));
  106|  49.5k|  return bswap ? getByteSwapped(ret) : ret;
  ------------------
  |  Branch (106:10): [True: 49.2k, False: 290]
  ------------------
  107|  49.5k|}
_ZN8rawspeed14getByteSwappedIsEET_PKvb:
  100|  1.09k|template <typename T> inline T getByteSwapped(const void* data, bool bswap) {
  101|  1.09k|  T ret;
  102|       |  // all interesting compilers optimize this memcpy into a single move
  103|       |  // this is the most effective way to load some bytes without running into
  104|       |  // alignment or aliasing issues
  105|  1.09k|  memcpy(&ret, data, sizeof(T));
  106|  1.09k|  return bswap ? getByteSwapped(ret) : ret;
  ------------------
  |  Branch (106:10): [True: 3, False: 1.09k]
  ------------------
  107|  1.09k|}
_ZN8rawspeed14getByteSwappedIdEET_PKvb:
  100|    326|template <typename T> inline T getByteSwapped(const void* data, bool bswap) {
  101|    326|  T ret;
  102|       |  // all interesting compilers optimize this memcpy into a single move
  103|       |  // this is the most effective way to load some bytes without running into
  104|       |  // alignment or aliasing issues
  105|    326|  memcpy(&ret, data, sizeof(T));
  106|    326|  return bswap ? getByteSwapped(ret) : ret;
  ------------------
  |  Branch (106:10): [True: 82, False: 244]
  ------------------
  107|    326|}

_ZN8rawspeed9BlackAreaC2Eiib:
   30|    313|      : offset(offset_), size(size_), isVertical(isVertical_) {}

_ZNK8rawspeed5Hints8containsERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
   55|  1.56k|  [[nodiscard]] bool contains(const std::string& key) const {
   56|  1.56k|    return data.contains(key);
   57|  1.56k|  }
_ZNK8rawspeed5Hints3getERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEb:
   69|      9|  [[nodiscard]] bool get(const std::string& key, bool defaultValue) const {
   70|      9|    auto hint = data.find(key);
   71|      9|    if (hint == data.end())
  ------------------
  |  Branch (71:9): [True: 9, False: 0]
  ------------------
   72|      9|      return defaultValue;
   73|      0|    return "true" == hint->second;
   74|      9|  }
_ZNK8rawspeed5Hints3getIjEET_RKNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEES2_:
   60|     81|  [[nodiscard]] T get(const std::string& key, T defaultValue) const {
   61|     81|    if (auto hint = data.find(key);
   62|     81|        hint != data.end() && !hint->second.empty()) {
  ------------------
  |  Branch (62:9): [True: 0, False: 81]
  |  Branch (62:9): [True: 0, False: 81]
  |  Branch (62:31): [True: 0, False: 0]
  ------------------
   63|      0|      std::istringstream iss(hint->second);
   64|      0|      iss >> defaultValue;
   65|      0|    }
   66|     81|    return defaultValue;
   67|     81|  }
_ZNK8rawspeed5Hints3getIdEET_RKNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEES2_:
   60|  3.07k|  [[nodiscard]] T get(const std::string& key, T defaultValue) const {
   61|  3.07k|    if (auto hint = data.find(key);
   62|  3.07k|        hint != data.end() && !hint->second.empty()) {
  ------------------
  |  Branch (62:9): [True: 0, False: 3.07k]
  |  Branch (62:9): [True: 0, False: 3.07k]
  |  Branch (62:31): [True: 0, False: 0]
  ------------------
   63|      0|      std::istringstream iss(hint->second);
   64|      0|      iss >> defaultValue;
   65|      0|    }
   66|  3.07k|    return defaultValue;
   67|  3.07k|  }

_ZNK8rawspeed14CameraMetaData9getCameraERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_S9_:
   94|  4.42k|                                        const std::string& mode) const {
   95|  4.42k|  auto camera = cameras.find(getId(make, model, mode));
   96|  4.42k|  return camera == cameras.end() ? nullptr : camera->second.get();
  ------------------
  |  Branch (96:10): [True: 4.42k, False: 0]
  ------------------
   97|  4.42k|}
_ZNK8rawspeed14CameraMetaData9getCameraERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_:
  100|  1.69k|                                        const std::string& model) const {
  101|  1.69k|  auto id = getId(make, model, "");
  102|       |
  103|  1.69k|  auto iter = find_if(
  104|  1.69k|      cameras.cbegin(), cameras.cend(), [&id](decltype(*cameras.cbegin())& i) {
  105|  1.69k|        const auto& cid = i.first;
  106|  1.69k|        return tie(id.make, id.model) == tie(cid.make, cid.model);
  107|  1.69k|      });
  108|       |
  109|  1.69k|  if (iter == cameras.end())
  ------------------
  |  Branch (109:7): [True: 1.69k, False: 0]
  ------------------
  110|  1.69k|    return nullptr;
  111|       |
  112|      0|  return iter->second.get();
  113|  1.69k|}
_ZNK8rawspeed14CameraMetaData9hasCameraERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_S9_:
  117|    247|                               const std::string& mode) const {
  118|    247|  return getCamera(make, model, mode);
  119|    247|}
CameraMetaData.cpp:_ZN8rawspeed12_GLOBAL__N_15getIdERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_S9_:
   81|  6.11k|                      const std::string& mode) {
   82|  6.11k|  CameraId id;
   83|  6.11k|  id.make = trimSpaces(make);
   84|  6.11k|  id.model = trimSpaces(model);
   85|  6.11k|  id.mode = trimSpaces(mode);
   86|       |
   87|  6.11k|  return id;
   88|  6.11k|}

_ZN8rawspeed14CameraMetaDataC2Ev:
   49|      2|  CameraMetaData() = default;

_ZN8rawspeed16ColorFilterArray7setSizeERKNS_8iPoint2DE:
   50|    710|void ColorFilterArray::setSize(const iPoint2D& _size) {
   51|    710|  if (_size == iPoint2D(0, 0))
  ------------------
  |  Branch (51:7): [True: 0, False: 710]
  ------------------
   52|      0|    return;
   53|       |
   54|    710|  assert(_size.hasPositiveArea() && "CFA must have positive size.");
  ------------------
  |  Branch (54:3): [True: 710, False: 0]
  |  Branch (54:3): [True: 710, Folded]
  |  Branch (54:3): [True: 710, False: 0]
  ------------------
   55|       |
   56|    710|  size = _size;
   57|       |
   58|    710|  if (size.area() > 36) {
  ------------------
  |  Branch (58:7): [True: 1, False: 709]
  ------------------
   59|       |    // Bayer, FC() supports 2x8 pattern
   60|       |    // X-Trans is 6x6 pattern
   61|       |    // is there anything bigger?
   62|      1|    ThrowRDE("if your CFA pattern is really %" PRIu64 " pixels "
  ------------------
  |  |   38|      1|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      1|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      1|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      1|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   63|      1|             "in area we may as well give up now",
   64|      1|             size.area());
   65|      1|  }
   66|    709|  if (size.area() <= 0)
  ------------------
  |  Branch (66:7): [True: 0, False: 709]
  ------------------
   67|      0|    return;
   68|    709|  cfa.resize(implicit_cast<size_t>(size.area()));
   69|    709|  fill(cfa.begin(), cfa.end(), CFAColor::UNKNOWN);
   70|    709|}
_ZNK8rawspeed16ColorFilterArray10getColorAtEii:
   72|  2.72k|CFAColor ColorFilterArray::getColorAt(int x, int y) const {
   73|  2.72k|  if (cfa.empty())
  ------------------
  |  Branch (73:7): [True: 3, False: 2.71k]
  ------------------
   74|  2.72k|    ThrowRDE("No CFA size set");
  ------------------
  |  |   38|      3|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      3|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      3|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      3|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   75|       |
   76|       |  // calculate the positive modulo [0 .. size-1]
   77|  2.71k|  invariant(size.hasPositiveArea());
  ------------------
  |  |   27|  2.71k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (77:3): [True: 2.71k, False: 4]
  ------------------
   78|  2.71k|  x = (x % size.x + size.x) % size.x;
   79|  2.71k|  y = (y % size.y + size.y) % size.y;
   80|       |
   81|  2.71k|  return cfa[x + (static_cast<size_t>(y) * size.x)];
   82|  2.71k|}
_ZN8rawspeed16ColorFilterArray6setCFAENS_8iPoint2DEz:
   84|    446|void ColorFilterArray::setCFA(iPoint2D in_size, ...) {
   85|    446|  if (in_size != size) {
  ------------------
  |  Branch (85:7): [True: 446, False: 0]
  ------------------
   86|    446|    setSize(in_size);
   87|    446|  }
   88|    446|  va_list arguments;
   89|    446|  va_start(arguments, in_size);
   90|  2.23k|  for (auto i = 0UL; i < size.area(); i++) {
  ------------------
  |  Branch (90:22): [True: 1.78k, False: 446]
  ------------------
   91|  1.78k|    cfa[i] = static_cast<CFAColor>(va_arg(arguments, int));
   92|  1.78k|  }
   93|       |  va_end(arguments);
   94|    446|}
_ZN8rawspeed16ColorFilterArray10shiftRightEi:
   96|     26|void ColorFilterArray::shiftRight(int n) {
   97|     26|  if (cfa.empty())
  ------------------
  |  Branch (97:7): [True: 0, False: 26]
  ------------------
   98|     26|    ThrowRDE("No CFA size set (or set to zero)");
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   99|       |
  100|     26|  writeLog(DEBUG_PRIO::EXTRA, "Shift right:%d", n);
  101|     26|  n %= size.x;
  102|     26|  if (n == 0)
  ------------------
  |  Branch (102:7): [True: 20, False: 6]
  ------------------
  103|     20|    return;
  104|       |
  105|      6|  vector<CFAColor> tmp(implicit_cast<size_t>(size.area()));
  106|     20|  for (int y = 0; y < size.y; ++y) {
  ------------------
  |  Branch (106:19): [True: 14, False: 6]
  ------------------
  107|     66|    for (int x = 0; x < size.x; ++x) {
  ------------------
  |  Branch (107:21): [True: 52, False: 14]
  ------------------
  108|     52|      tmp[x + (static_cast<size_t>(y) * size.x)] = getColorAt(x + n, y);
  109|     52|    }
  110|     14|  }
  111|      6|  cfa = tmp;
  112|      6|}
_ZN8rawspeed16ColorFilterArray9shiftDownEi:
  114|     26|void ColorFilterArray::shiftDown(int n) {
  115|     26|  if (cfa.empty())
  ------------------
  |  Branch (115:7): [True: 0, False: 26]
  ------------------
  116|     26|    ThrowRDE("No CFA size set (or set to zero)");
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  117|       |
  118|     26|  writeLog(DEBUG_PRIO::EXTRA, "Shift down:%d", n);
  119|     26|  n %= size.y;
  120|     26|  if (n == 0)
  ------------------
  |  Branch (120:7): [True: 17, False: 9]
  ------------------
  121|     17|    return;
  122|       |
  123|      9|  vector<CFAColor> tmp(implicit_cast<size_t>(size.area()));
  124|     66|  for (int y = 0; y < size.y; ++y) {
  ------------------
  |  Branch (124:19): [True: 57, False: 9]
  ------------------
  125|    147|    for (int x = 0; x < size.x; ++x) {
  ------------------
  |  Branch (125:21): [True: 90, False: 57]
  ------------------
  126|     90|      tmp[x + (static_cast<size_t>(y) * size.x)] = getColorAt(x, y + n);
  127|     90|    }
  128|     57|  }
  129|      9|  cfa = tmp;
  130|      9|}
_ZNK8rawspeed16ColorFilterArray8asStringEv:
  132|     36|std::string ColorFilterArray::asString() const {
  133|     36|  std::string dst;
  134|    154|  for (int y = 0; y < size.y; y++) {
  ------------------
  |  Branch (134:19): [True: 118, False: 36]
  ------------------
  135|    244|    for (int x = 0; x < size.x; x++) {
  ------------------
  |  Branch (135:21): [True: 126, False: 118]
  ------------------
  136|    126|      dst += colorToString(getColorAt(x, y));
  137|    126|      dst += (x == size.x - 1) ? "\n" : ",";
  ------------------
  |  Branch (137:14): [True: 118, False: 8]
  ------------------
  138|    126|    }
  139|    118|  }
  140|     36|  return dst;
  141|     36|}
_ZN8rawspeed16ColorFilterArray13colorToStringENS_8CFAColorE:
  202|    126|std::string ColorFilterArray::colorToString(CFAColor c) {
  203|    126|  auto s = getColorAsString(c);
  204|    126|  if (!s)
  ------------------
  |  Branch (204:7): [True: 0, False: 126]
  ------------------
  205|    126|    ThrowRDE("Unsupported CFA Color: %u", static_cast<unsigned>(c));
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  206|    126|  return std::string(*s);
  207|    126|}
_ZN8rawspeed16ColorFilterArray10setColorAtENS_8iPoint2DENS_8CFAColorE:
  209|  1.26k|void ColorFilterArray::setColorAt(iPoint2D pos, CFAColor c) {
  210|  1.26k|  if (pos.x >= size.x || pos.x < 0)
  ------------------
  |  Branch (210:7): [True: 0, False: 1.26k]
  |  Branch (210:26): [True: 0, False: 1.26k]
  ------------------
  211|  1.26k|    ThrowRDE("position out of CFA pattern");
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  212|  1.26k|  if (pos.y >= size.y || pos.y < 0)
  ------------------
  |  Branch (212:7): [True: 0, False: 1.26k]
  |  Branch (212:26): [True: 0, False: 1.26k]
  ------------------
  213|  1.26k|    ThrowRDE("position out of CFA pattern");
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  214|  1.26k|  cfa[pos.x + (static_cast<size_t>(pos.y) * size.x)] = c;
  215|  1.26k|}
_ZNK8rawspeed16ColorFilterArray14getDcrawFilterEv:
  242|     37|uint32_t ColorFilterArray::getDcrawFilter() const {
  243|       |  // dcraw magic
  244|     37|  if (size.x == 6 && size.y == 6)
  ------------------
  |  Branch (244:7): [True: 0, False: 37]
  |  Branch (244:22): [True: 0, False: 0]
  ------------------
  245|      0|    return 9;
  246|       |
  247|     37|  if (cfa.empty() || size.x > 2 || size.y > 8 || !isPowerOfTwo(size.y))
  ------------------
  |  Branch (247:7): [True: 0, False: 37]
  |  Branch (247:22): [True: 1, False: 36]
  |  Branch (247:36): [True: 0, False: 36]
  |  Branch (247:50): [True: 0, False: 36]
  ------------------
  248|      1|    return 1;
  249|       |
  250|       |  // FIXME: the idea here is that for a given CFA, there are at most 4 unique
  251|       |  // colors in CFA, *AND* `toDcrawColor()` returns an unique `0b??` pattern
  252|       |  // for each of these 4 *IN THE GIVEN CFA*.
  253|       |  // We don't validate that invariant presently.
  254|       |
  255|     36|  uint32_t ret = 0;
  256|    108|  for (int x = 0; x < 2; x++) {
  ------------------
  |  Branch (256:19): [True: 72, False: 36]
  ------------------
  257|    648|    for (int y = 0; y < 8; y++) {
  ------------------
  |  Branch (257:21): [True: 576, False: 72]
  ------------------
  258|    576|      uint32_t c = toDcrawColor(getColorAt(x, y));
  259|    576|      int g = (x >> 1) * 8;
  260|    576|      ret |= c << ((x & 1) * 2 + y * 4 + g);
  261|    576|    }
  262|     72|  }
  263|       |
  264|     36|  writeLog(DEBUG_PRIO::EXTRA, "%s", asString().c_str());
  265|     36|  writeLog(DEBUG_PRIO::EXTRA, "DCRAW filter:%x", ret);
  266|       |
  267|     36|  return ret;
  268|     37|}
ColorFilterArray.cpp:_ZN8rawspeed12_GLOBAL__N_116getColorAsStringENS_8CFAColorE:
  174|    126|Optional<std::string_view> getColorAsString(CFAColor c) {
  175|    126|  switch (c) {
  176|      0|    using enum CFAColor;
  177|     26|  case RED:
  ------------------
  |  Branch (177:3): [True: 26, False: 100]
  ------------------
  178|     26|    return "RED";
  179|     16|  case GREEN:
  ------------------
  |  Branch (179:3): [True: 16, False: 110]
  ------------------
  180|     16|    return "GREEN";
  181|     18|  case BLUE:
  ------------------
  |  Branch (181:3): [True: 18, False: 108]
  ------------------
  182|     18|    return "BLUE";
  183|     12|  case CYAN:
  ------------------
  |  Branch (183:3): [True: 12, False: 114]
  ------------------
  184|     12|    return "CYAN";
  185|     14|  case MAGENTA:
  ------------------
  |  Branch (185:3): [True: 14, False: 112]
  ------------------
  186|     14|    return "MAGENTA";
  187|     18|  case YELLOW:
  ------------------
  |  Branch (187:3): [True: 18, False: 108]
  ------------------
  188|     18|    return "YELLOW";
  189|     22|  case WHITE:
  ------------------
  |  Branch (189:3): [True: 22, False: 104]
  ------------------
  190|     22|    return "WHITE";
  191|      0|  case FUJI_GREEN:
  ------------------
  |  Branch (191:3): [True: 0, False: 126]
  ------------------
  192|      0|    return "FUJIGREEN";
  193|      0|  case UNKNOWN:
  ------------------
  |  Branch (193:3): [True: 0, False: 126]
  ------------------
  194|      0|    return "UNKNOWN";
  195|      0|  default:
  ------------------
  |  Branch (195:3): [True: 0, False: 126]
  ------------------
  196|      0|    return std::nullopt;
  197|    126|  }
  198|    126|}
ColorFilterArray.cpp:_ZN8rawspeed12_GLOBAL__N_112toDcrawColorENS_8CFAColorE:
  218|    576|uint32_t toDcrawColor(CFAColor c) {
  219|    576|  switch (c) {
  ------------------
  |  Branch (219:11): [True: 576, False: 0]
  ------------------
  220|      0|    using enum CFAColor;
  221|      0|  case FUJI_GREEN:
  ------------------
  |  Branch (221:3): [True: 0, False: 576]
  ------------------
  222|    128|  case RED:
  ------------------
  |  Branch (222:3): [True: 128, False: 448]
  ------------------
  223|    128|    return 0;
  224|     56|  case MAGENTA:
  ------------------
  |  Branch (224:3): [True: 56, False: 520]
  ------------------
  225|    128|  case GREEN:
  ------------------
  |  Branch (225:3): [True: 72, False: 504]
  ------------------
  226|    128|    return 1;
  227|     48|  case CYAN:
  ------------------
  |  Branch (227:3): [True: 48, False: 528]
  ------------------
  228|    160|  case BLUE:
  ------------------
  |  Branch (228:3): [True: 112, False: 464]
  ------------------
  229|    160|    return 2;
  230|     72|  case YELLOW:
  ------------------
  |  Branch (230:3): [True: 72, False: 504]
  ------------------
  231|    160|  case WHITE:
  ------------------
  |  Branch (231:3): [True: 88, False: 488]
  ------------------
  232|    160|    return 3;
  233|      0|  case UNKNOWN:
  ------------------
  |  Branch (233:3): [True: 0, False: 576]
  ------------------
  234|      0|  case END:
  ------------------
  |  Branch (234:3): [True: 0, False: 576]
  ------------------
  235|      0|    throw out_of_range(ColorFilterArray::colorToString(c));
  236|    576|  }
  237|      0|  __builtin_unreachable();
  238|    576|}

_ZNK8rawspeed16ColorFilterArray7getSizeEv:
   66|    485|  [[nodiscard]] iPoint2D getSize() const { return size; }
_ZN8rawspeed16ColorFilterArrayC2Ev:
   51|  15.4k|  ColorFilterArray() = default;

_ZN8rawspeed9RawParserC2ENS_6BufferE:
   33|  13.7k|  explicit RawParser(Buffer inputData) : mInput(inputData) {}

_ZN8rawspeed10TiffParserC2ENS_6BufferE:
   60|  13.7k|TiffParser::TiffParser(Buffer file) : RawParser(file) {}
_ZN8rawspeed10TiffParser10getDecoderEPKNS_14CameraMetaDataE:
   62|  13.7k|std::unique_ptr<RawDecoder> TiffParser::getDecoder(const CameraMetaData* meta) {
   63|  13.7k|  return TiffParser::makeDecoder(TiffParser::parse(nullptr, mInput), mInput);
   64|  13.7k|}
_ZN8rawspeed10TiffParser5parseEPNS_7TiffIFDENS_6BufferE:
   66|  13.7k|TiffRootIFDOwner TiffParser::parse(TiffIFD* parent, Buffer data) {
   67|  13.7k|  ByteStream bs(DataBuffer(data, Endianness::unknown));
   68|  13.7k|  bs.setByteOrder(getTiffByteOrder(bs, 0, "TIFF header"));
   69|  13.7k|  bs.skipBytes(2);
   70|       |
   71|  13.7k|  if (uint16_t magic = bs.getU16();
   72|  13.7k|      magic != 42 && magic != 0x4f52 && magic != 0x5352 &&
  ------------------
  |  Branch (72:7): [True: 751, False: 13.0k]
  |  Branch (72:22): [True: 499, False: 252]
  |  Branch (72:41): [True: 466, False: 33]
  ------------------
   73|    466|      magic != 0x55) // ORF has 0x4f52/0x5352, RW2 0x55 - Brilliant!
  ------------------
  |  Branch (73:7): [True: 44, False: 422]
  ------------------
   74|  13.7k|    ThrowTPE("Not a TIFF file (magic 42)");
  ------------------
  |  |   39|     44|  ThrowExceptionHelper(rawspeed::TiffParserException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     44|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     44|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     44|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   75|       |
   76|  13.7k|  auto root = std::make_unique<TiffRootIFD>(
   77|  13.7k|      parent, nullptr, bs,
   78|  13.7k|      UINT32_MAX); // tell TiffIFD constructor not to parse bs as IFD
   79|       |
   80|  13.7k|  NORangesSet<Buffer> ifds;
   81|       |
   82|  31.1k|  for (uint32_t IFDOffset = bs.getU32(); IFDOffset;
  ------------------
  |  Branch (82:42): [True: 19.3k, False: 11.8k]
  ------------------
   83|  19.3k|       IFDOffset = root->getSubIFDs().back()->getNextIFD()) {
   84|  19.3k|    std::unique_ptr<TiffIFD> subIFD;
   85|  19.3k|    try {
   86|  19.3k|      subIFD = std::make_unique<TiffIFD>(root.get(), &ifds, bs, IFDOffset);
   87|  19.3k|    } catch (const TiffParserException&) {
   88|       |      // This IFD may fail to parse, in which case exit the loop,
   89|       |      // because the offset to the next IFD is last 4 bytes of an IFD,
   90|       |      // and we didn't get them because the IFD failed to parse.
   91|       |      // BUT: don't discard the IFD's that did succeed to parse!
   92|    964|      break;
   93|    964|    }
   94|  19.3k|    assert(subIFD.get());
  ------------------
  |  Branch (94:5): [True: 17.4k, False: 0]
  ------------------
   95|  17.4k|    root->add(std::move(subIFD));
   96|  17.4k|  }
   97|       |
   98|  12.8k|  return root;
   99|  13.7k|}
_ZN8rawspeed10TiffParser11makeDecoderENSt3__110unique_ptrINS_11TiffRootIFDENS1_14default_deleteIS3_EEEENS_6BufferE:
  102|  12.8k|                                                    Buffer data) {
  103|  12.8k|  if (!root)
  ------------------
  |  Branch (103:7): [True: 0, False: 12.8k]
  ------------------
  104|  12.8k|    ThrowTPE("TiffIFD is null.");
  ------------------
  |  |   39|      0|  ThrowExceptionHelper(rawspeed::TiffParserException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  105|       |
  106|  63.8k|  for (const auto& decoder : Map) {
  ------------------
  |  Branch (106:28): [True: 63.8k, False: 433]
  ------------------
  107|  63.8k|    checker_t dChecker = nullptr;
  108|  63.8k|    constructor_t dConstructor = nullptr;
  109|       |
  110|  63.8k|    std::tie(dChecker, dConstructor) = decoder;
  111|       |
  112|  63.8k|    assert(dChecker);
  ------------------
  |  Branch (112:5): [True: 63.8k, False: 0]
  ------------------
  113|  63.8k|    assert(dConstructor);
  ------------------
  |  Branch (113:5): [True: 63.8k, False: 0]
  ------------------
  114|       |
  115|  63.8k|    if (!dChecker(root.get(), data))
  ------------------
  |  Branch (115:9): [True: 51.4k, False: 12.3k]
  ------------------
  116|  51.4k|      continue;
  117|       |
  118|  12.3k|    return dConstructor(std::move(root), data);
  119|  63.8k|  }
  120|       |
  121|    433|  ThrowTPE("No decoder found. Sorry.");
  ------------------
  |  |   39|    433|  ThrowExceptionHelper(rawspeed::TiffParserException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|    433|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|    433|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|    433|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  122|  12.8k|}
_ZN8rawspeed10TiffParser11constructorINS_10DngDecoderEEENSt3__110unique_ptrINS_10RawDecoderENS3_14default_deleteIS5_EEEEONS4_INS_11TiffRootIFDENS6_IS9_EEEENS_6BufferE:
  126|  3.94k|                                                    Buffer data) {
  127|  3.94k|  return std::make_unique<Decoder>(std::move(root), data);
  128|  3.94k|}
_ZN8rawspeed10TiffParser11constructorINS_10MosDecoderEEENSt3__110unique_ptrINS_10RawDecoderENS3_14default_deleteIS5_EEEEONS4_INS_11TiffRootIFDENS6_IS9_EEEENS_6BufferE:
  126|    581|                                                    Buffer data) {
  127|    581|  return std::make_unique<Decoder>(std::move(root), data);
  128|    581|}
_ZN8rawspeed10TiffParser11constructorINS_10IiqDecoderEEENSt3__110unique_ptrINS_10RawDecoderENS3_14default_deleteIS5_EEEEONS4_INS_11TiffRootIFDENS6_IS9_EEEENS_6BufferE:
  126|  1.15k|                                                    Buffer data) {
  127|  1.15k|  return std::make_unique<Decoder>(std::move(root), data);
  128|  1.15k|}
_ZN8rawspeed10TiffParser11constructorINS_10Cr2DecoderEEENSt3__110unique_ptrINS_10RawDecoderENS3_14default_deleteIS5_EEEEONS4_INS_11TiffRootIFDENS6_IS9_EEEENS_6BufferE:
  126|  1.07k|                                                    Buffer data) {
  127|  1.07k|  return std::make_unique<Decoder>(std::move(root), data);
  128|  1.07k|}
_ZN8rawspeed10TiffParser11constructorINS_10NefDecoderEEENSt3__110unique_ptrINS_10RawDecoderENS3_14default_deleteIS5_EEEEONS4_INS_11TiffRootIFDENS6_IS9_EEEENS_6BufferE:
  126|    863|                                                    Buffer data) {
  127|    863|  return std::make_unique<Decoder>(std::move(root), data);
  128|    863|}
_ZN8rawspeed10TiffParser11constructorINS_10OrfDecoderEEENSt3__110unique_ptrINS_10RawDecoderENS3_14default_deleteIS5_EEEEONS4_INS_11TiffRootIFDENS6_IS9_EEEENS_6BufferE:
  126|    329|                                                    Buffer data) {
  127|    329|  return std::make_unique<Decoder>(std::move(root), data);
  128|    329|}
_ZN8rawspeed10TiffParser11constructorINS_10ArwDecoderEEENSt3__110unique_ptrINS_10RawDecoderENS3_14default_deleteIS5_EEEEONS4_INS_11TiffRootIFDENS6_IS9_EEEENS_6BufferE:
  126|  1.32k|                                                    Buffer data) {
  127|  1.32k|  return std::make_unique<Decoder>(std::move(root), data);
  128|  1.32k|}
_ZN8rawspeed10TiffParser11constructorINS_10PefDecoderEEENSt3__110unique_ptrINS_10RawDecoderENS3_14default_deleteIS5_EEEEONS4_INS_11TiffRootIFDENS6_IS9_EEEENS_6BufferE:
  126|    306|                                                    Buffer data) {
  127|    306|  return std::make_unique<Decoder>(std::move(root), data);
  128|    306|}
_ZN8rawspeed10TiffParser11constructorINS_10Rw2DecoderEEENSt3__110unique_ptrINS_10RawDecoderENS3_14default_deleteIS5_EEEEONS4_INS_11TiffRootIFDENS6_IS9_EEEENS_6BufferE:
  126|    709|                                                    Buffer data) {
  127|    709|  return std::make_unique<Decoder>(std::move(root), data);
  128|    709|}
_ZN8rawspeed10TiffParser11constructorINS_10SrwDecoderEEENSt3__110unique_ptrINS_10RawDecoderENS3_14default_deleteIS5_EEEEONS4_INS_11TiffRootIFDENS6_IS9_EEEENS_6BufferE:
  126|    544|                                                    Buffer data) {
  127|    544|  return std::make_unique<Decoder>(std::move(root), data);
  128|    544|}
_ZN8rawspeed10TiffParser11constructorINS_10MefDecoderEEENSt3__110unique_ptrINS_10RawDecoderENS3_14default_deleteIS5_EEEEONS4_INS_11TiffRootIFDENS6_IS9_EEEENS_6BufferE:
  126|     61|                                                    Buffer data) {
  127|     61|  return std::make_unique<Decoder>(std::move(root), data);
  128|     61|}
_ZN8rawspeed10TiffParser11constructorINS_10DcrDecoderEEENSt3__110unique_ptrINS_10RawDecoderENS3_14default_deleteIS5_EEEEONS4_INS_11TiffRootIFDENS6_IS9_EEEENS_6BufferE:
  126|    278|                                                    Buffer data) {
  127|    278|  return std::make_unique<Decoder>(std::move(root), data);
  128|    278|}
_ZN8rawspeed10TiffParser11constructorINS_10DcsDecoderEEENSt3__110unique_ptrINS_10RawDecoderENS3_14default_deleteIS5_EEEEONS4_INS_11TiffRootIFDENS6_IS9_EEEENS_6BufferE:
  126|    100|                                                    Buffer data) {
  127|    100|  return std::make_unique<Decoder>(std::move(root), data);
  128|    100|}
_ZN8rawspeed10TiffParser11constructorINS_10KdcDecoderEEENSt3__110unique_ptrINS_10RawDecoderENS3_14default_deleteIS5_EEEEONS4_INS_11TiffRootIFDENS6_IS9_EEEENS_6BufferE:
  126|     87|                                                    Buffer data) {
  127|     87|  return std::make_unique<Decoder>(std::move(root), data);
  128|     87|}
_ZN8rawspeed10TiffParser11constructorINS_10ErfDecoderEEENSt3__110unique_ptrINS_10RawDecoderENS3_14default_deleteIS5_EEEEONS4_INS_11TiffRootIFDENS6_IS9_EEEENS_6BufferE:
  126|     53|                                                    Buffer data) {
  127|     53|  return std::make_unique<Decoder>(std::move(root), data);
  128|     53|}
_ZN8rawspeed10TiffParser11constructorINS_10StiDecoderEEENSt3__110unique_ptrINS_10RawDecoderENS3_14default_deleteIS5_EEEEONS4_INS_11TiffRootIFDENS6_IS9_EEEENS_6BufferE:
  126|     26|                                                    Buffer data) {
  127|     26|  return std::make_unique<Decoder>(std::move(root), data);
  128|     26|}
_ZN8rawspeed10TiffParser11constructorINS_14ThreefrDecoderEEENSt3__110unique_ptrINS_10RawDecoderENS3_14default_deleteIS5_EEEEONS4_INS_11TiffRootIFDENS6_IS9_EEEENS_6BufferE:
  126|    230|                                                    Buffer data) {
  127|    230|  return std::make_unique<Decoder>(std::move(root), data);
  128|    230|}

_ZN8rawspeed9TiffEntryC2EPNS_7TiffIFDERNS_10ByteStreamE:
   58|   272k|    : parent(parent_), tag(static_cast<TiffTag>(bs.getU16())) {
   59|   272k|  const uint16_t numType = bs.getU16();
   60|   272k|  if (numType > static_cast<uint16_t>(TiffDataType::OFFSET))
  ------------------
  |  Branch (60:7): [True: 1.04k, False: 271k]
  ------------------
   61|   272k|    ThrowTPE("Error reading TIFF structure. Unknown Type 0x%x encountered.",
  ------------------
  |  |   39|  1.04k|  ThrowExceptionHelper(rawspeed::TiffParserException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|  1.04k|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|  1.04k|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|  1.04k|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   62|   271k|             numType);
   63|   271k|  type = static_cast<TiffDataType>(numType);
   64|   271k|  count = bs.getU32();
   65|       |
   66|       |  // check for count << datashift overflow
   67|   271k|  if (count > UINT32_MAX >> datashifts[numType])
  ------------------
  |  Branch (67:7): [True: 83, False: 271k]
  ------------------
   68|   271k|    ThrowTPE("integer overflow in size calculation.");
  ------------------
  |  |   39|     83|  ThrowExceptionHelper(rawspeed::TiffParserException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     83|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     83|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     83|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   69|       |
   70|   271k|  uint32_t byte_size = count << datashifts[numType];
   71|   271k|  uint32_t data_offset = UINT32_MAX;
   72|       |
   73|   271k|  if (byte_size <= 4) {
  ------------------
  |  Branch (73:7): [True: 88.7k, False: 183k]
  ------------------
   74|  88.7k|    data_offset = bs.getPosition();
   75|  88.7k|    data = bs.getSubStream(bs.getPosition(), byte_size);
   76|  88.7k|    bs.skipBytes(4);
   77|   183k|  } else {
   78|   183k|    data_offset = bs.getU32();
   79|   183k|    if (type == TiffDataType::OFFSET ||
  ------------------
  |  Branch (79:9): [True: 4.28k, False: 178k]
  |  Branch (79:9): [True: 39.4k, False: 143k]
  ------------------
   80|   178k|        isIn(tag, {TiffTag::DNGPRIVATEDATA, TiffTag::MAKERNOTE,
  ------------------
  |  Branch (80:9): [True: 35.1k, False: 143k]
  ------------------
   81|   178k|                   TiffTag::MAKERNOTE_ALT, TiffTag::FUJI_RAW_IFD,
   82|   178k|                   TiffTag::SUBIFDS, TiffTag::EXIFIFDPOINTER})) {
   83|       |      // preserve offset for SUB_IFD/EXIF/MAKER_NOTE data
   84|       |      if constexpr ((false)) {
   85|       |        // limit access to range from 0 to data_offset+byte_size
   86|       |        data = bs.getSubStream(data_offset, byte_size);
   87|  39.4k|      } else {
   88|       |        // allow access to whole file, necessary if offsets inside the maker
   89|       |        // note point to outside data, which is forbidden due to the TIFF/DNG
   90|       |        // spec but may happen none the less (see e.g. "old" ORF files like
   91|       |        // EX-1, note: the tags outside of the maker note area are currently not
   92|       |        // used anyway)
   93|  39.4k|        data = bs;
   94|  39.4k|        data.setPosition(data_offset);
   95|  39.4k|        (void)data.check(byte_size);
   96|  39.4k|      }
   97|   143k|    } else {
   98|   143k|      data = bs.getSubStream(data_offset, byte_size);
   99|   143k|    }
  100|   183k|  }
  101|   271k|}
_ZNK8rawspeed9TiffEntry5isIntEv:
  129|    578|bool RAWSPEED_READONLY TiffEntry::isInt() const {
  130|    578|  using enum TiffDataType;
  131|    578|  return type == LONG || type == SHORT || type == BYTE;
  ------------------
  |  Branch (131:10): [True: 367, False: 211]
  |  Branch (131:26): [True: 159, False: 52]
  |  Branch (131:43): [True: 24, False: 28]
  ------------------
  132|    578|}
_ZNK8rawspeed9TiffEntry7isFloatEv:
  138|  6.05k|bool RAWSPEED_READONLY TiffEntry::isFloat() const {
  139|  6.05k|  switch (type) {
  140|      0|    using enum TiffDataType;
  141|    263|  case FLOAT:
  ------------------
  |  Branch (141:3): [True: 263, False: 5.79k]
  ------------------
  142|    507|  case DOUBLE:
  ------------------
  |  Branch (142:3): [True: 244, False: 5.81k]
  ------------------
  143|  3.00k|  case RATIONAL:
  ------------------
  |  Branch (143:3): [True: 2.49k, False: 3.56k]
  ------------------
  144|  4.88k|  case SRATIONAL:
  ------------------
  |  Branch (144:3): [True: 1.88k, False: 4.17k]
  ------------------
  145|  5.17k|  case LONG:
  ------------------
  |  Branch (145:3): [True: 284, False: 5.77k]
  ------------------
  146|  5.53k|  case SLONG:
  ------------------
  |  Branch (146:3): [True: 365, False: 5.69k]
  ------------------
  147|  5.79k|  case SHORT:
  ------------------
  |  Branch (147:3): [True: 255, False: 5.80k]
  ------------------
  148|  6.03k|  case SSHORT:
  ------------------
  |  Branch (148:3): [True: 247, False: 5.80k]
  ------------------
  149|  6.03k|    return true;
  150|     19|  default:
  ------------------
  |  Branch (150:3): [True: 19, False: 6.03k]
  ------------------
  151|     19|    return false;
  152|  6.05k|  }
  153|  6.05k|}
_ZNK8rawspeed9TiffEntry10isRationalEv:
  155|  3.56k|bool RAWSPEED_READONLY TiffEntry::isRational() const {
  156|  3.56k|  switch (type) {
  157|      0|    using enum TiffDataType;
  158|     86|  case SHORT:
  ------------------
  |  Branch (158:3): [True: 86, False: 3.47k]
  ------------------
  159|    775|  case LONG:
  ------------------
  |  Branch (159:3): [True: 689, False: 2.87k]
  ------------------
  160|  3.55k|  case RATIONAL:
  ------------------
  |  Branch (160:3): [True: 2.77k, False: 786]
  ------------------
  161|  3.55k|    return true;
  162|     11|  default:
  ------------------
  |  Branch (162:3): [True: 11, False: 3.55k]
  ------------------
  163|     11|    return false;
  164|  3.56k|  }
  165|  3.56k|}
_ZNK8rawspeed9TiffEntry11isSRationalEv:
  167|  74.0k|bool RAWSPEED_READONLY TiffEntry::isSRational() const {
  168|  74.0k|  switch (type) {
  169|      0|    using enum TiffDataType;
  170|    852|  case SSHORT:
  ------------------
  |  Branch (170:3): [True: 852, False: 73.1k]
  ------------------
  171|  1.72k|  case SLONG:
  ------------------
  |  Branch (171:3): [True: 873, False: 73.1k]
  ------------------
  172|  74.0k|  case SRATIONAL:
  ------------------
  |  Branch (172:3): [True: 72.3k, False: 1.72k]
  ------------------
  173|  74.0k|    return true;
  174|      2|  default:
  ------------------
  |  Branch (174:3): [True: 2, False: 74.0k]
  ------------------
  175|      2|    return false;
  176|  74.0k|  }
  177|  74.0k|}
_ZNK8rawspeed9TiffEntry7getByteEj:
  179|  1.43k|uint8_t TiffEntry::getByte(uint32_t index) const {
  180|  1.43k|  if (type != TiffDataType::BYTE && type != TiffDataType::UNDEFINED)
  ------------------
  |  Branch (180:7): [True: 1.01k, False: 413]
  |  Branch (180:37): [True: 5, False: 1.01k]
  ------------------
  181|  1.43k|    ThrowTPE("Wrong type %u encountered. Expected Byte on 0x%x",
  ------------------
  |  |   39|      5|  ThrowExceptionHelper(rawspeed::TiffParserException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      5|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      5|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      5|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  182|  1.42k|             static_cast<unsigned>(type), static_cast<unsigned>(tag));
  183|       |
  184|  1.42k|  return data.peekByte(index);
  185|  1.43k|}
_ZNK8rawspeed9TiffEntry6getU16Ej:
  187|   499k|uint16_t TiffEntry::getU16(uint32_t index) const {
  188|   499k|  if (type != TiffDataType::SHORT && type != TiffDataType::UNDEFINED)
  ------------------
  |  Branch (188:7): [True: 5.64k, False: 493k]
  |  Branch (188:38): [True: 16, False: 5.62k]
  ------------------
  189|   499k|    ThrowTPE("Wrong type %u encountered. Expected Short or Undefined on 0x%x",
  ------------------
  |  |   39|     16|  ThrowExceptionHelper(rawspeed::TiffParserException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     16|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     16|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     16|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  190|   499k|             static_cast<unsigned>(type), static_cast<unsigned>(tag));
  191|       |
  192|   499k|  return data.peek<uint16_t>(index);
  193|   499k|}
_ZNK8rawspeed9TiffEntry6getI16Ej:
  195|  1.09k|int16_t TiffEntry::getI16(uint32_t index) const {
  196|  1.09k|  if (type != TiffDataType::SSHORT && type != TiffDataType::UNDEFINED)
  ------------------
  |  Branch (196:7): [True: 0, False: 1.09k]
  |  Branch (196:39): [True: 0, False: 0]
  ------------------
  197|  1.09k|    ThrowTPE("Wrong type %u encountered. Expected Short or Undefined on 0x%x",
  ------------------
  |  |   39|      0|  ThrowExceptionHelper(rawspeed::TiffParserException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  198|  1.09k|             static_cast<unsigned>(type), static_cast<unsigned>(tag));
  199|       |
  200|  1.09k|  return data.peek<int16_t>(index);
  201|  1.09k|}
_ZNK8rawspeed9TiffEntry6getU32Ej:
  203|   187k|uint32_t TiffEntry::getU32(uint32_t index) const {
  204|   187k|  using enum TiffDataType;
  205|   187k|  if (type == SHORT)
  ------------------
  |  Branch (205:7): [True: 139k, False: 47.4k]
  ------------------
  206|   139k|    return getU16(index);
  207|       |
  208|  47.4k|  switch (type) {
  209|  21.1k|  case LONG:
  ------------------
  |  Branch (209:3): [True: 21.1k, False: 26.3k]
  ------------------
  210|  24.3k|  case OFFSET:
  ------------------
  |  Branch (210:3): [True: 3.17k, False: 44.2k]
  ------------------
  211|  32.4k|  case BYTE:
  ------------------
  |  Branch (211:3): [True: 8.09k, False: 39.3k]
  ------------------
  212|  38.9k|  case UNDEFINED:
  ------------------
  |  Branch (212:3): [True: 6.50k, False: 40.9k]
  ------------------
  213|  46.5k|  case RATIONAL:
  ------------------
  |  Branch (213:3): [True: 7.66k, False: 39.7k]
  ------------------
  214|  46.5k|    break;
  215|    874|  default:
  ------------------
  |  Branch (215:3): [True: 874, False: 46.5k]
  ------------------
  216|    874|    ThrowTPE("Wrong type %u encountered. Expected Long, Offset, Rational or "
  ------------------
  |  |   39|    874|  ThrowExceptionHelper(rawspeed::TiffParserException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|    874|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|    874|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|    874|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  217|  47.4k|             "Undefined on 0x%x",
  218|  47.4k|             static_cast<unsigned>(type), static_cast<unsigned>(tag));
  219|  47.4k|  }
  220|       |
  221|  46.5k|  return data.peek<uint32_t>(index);
  222|  47.4k|}
_ZNK8rawspeed9TiffEntry6getI32Ej:
  224|   146k|int32_t TiffEntry::getI32(uint32_t index) const {
  225|   146k|  using enum TiffDataType;
  226|   146k|  if (type == SSHORT)
  ------------------
  |  Branch (226:7): [True: 1.09k, False: 145k]
  ------------------
  227|  1.09k|    return getI16(index);
  228|   145k|  if (type != SLONG && type != SRATIONAL && type != UNDEFINED)
  ------------------
  |  Branch (228:7): [True: 144k, False: 1.23k]
  |  Branch (228:24): [True: 0, False: 144k]
  |  Branch (228:45): [True: 0, False: 0]
  ------------------
  229|   145k|    ThrowTPE("Wrong type %u encountered. Expected SLong or Undefined on 0x%x",
  ------------------
  |  |   39|      0|  ThrowExceptionHelper(rawspeed::TiffParserException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  230|   145k|             static_cast<unsigned>(type), static_cast<unsigned>(tag));
  231|       |
  232|   145k|  return data.peek<int32_t>(index);
  233|   145k|}
_ZNK8rawspeed9TiffEntry11getRationalEj:
  235|  3.56k|NotARational<uint32_t> TiffEntry::getRational(uint32_t index) const {
  236|  3.56k|  if (!isRational()) {
  ------------------
  |  Branch (236:7): [True: 11, False: 3.55k]
  ------------------
  237|     11|    ThrowTPE("Wrong type 0x%x encountered. Expected Rational",
  ------------------
  |  |   39|     11|  ThrowExceptionHelper(rawspeed::TiffParserException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     11|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     11|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     11|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  238|     11|             static_cast<unsigned>(type));
  239|     11|  }
  240|       |
  241|  3.55k|  if (type != TiffDataType::RATIONAL)
  ------------------
  |  Branch (241:7): [True: 775, False: 2.77k]
  ------------------
  242|    775|    return {getU32(index), 1};
  243|       |
  244|  2.77k|  auto a = getU32(index * 2);
  245|  2.77k|  auto b = getU32((index * 2) + 1);
  246|  2.77k|  return {a, b};
  247|  3.55k|}
_ZNK8rawspeed9TiffEntry12getSRationalEj:
  249|  74.0k|NotARational<int32_t> TiffEntry::getSRational(uint32_t index) const {
  250|  74.0k|  if (!isSRational()) {
  ------------------
  |  Branch (250:7): [True: 2, False: 74.0k]
  ------------------
  251|      2|    ThrowTPE("Wrong type 0x%x encountered. Expected SRational",
  ------------------
  |  |   39|      2|  ThrowExceptionHelper(rawspeed::TiffParserException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      2|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      2|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      2|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  252|      2|             static_cast<unsigned>(type));
  253|      2|  }
  254|       |
  255|  74.0k|  if (type != TiffDataType::SRATIONAL)
  ------------------
  |  Branch (255:7): [True: 1.72k, False: 72.3k]
  ------------------
  256|  1.72k|    return {getI32(index), 1};
  257|       |
  258|  72.3k|  auto a = getI32(index * 2);
  259|  72.3k|  auto b = getI32((index * 2) + 1);
  260|  72.3k|  return {a, b};
  261|  74.0k|}
_ZNK8rawspeed9TiffEntry8getFloatEj:
  263|  6.05k|float TiffEntry::getFloat(uint32_t index) const {
  264|  6.05k|  if (!isFloat()) {
  ------------------
  |  Branch (264:7): [True: 19, False: 6.03k]
  ------------------
  265|     19|    ThrowTPE("Wrong type 0x%x encountered. Expected Float or something "
  ------------------
  |  |   39|     19|  ThrowExceptionHelper(rawspeed::TiffParserException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     19|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     19|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     19|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  266|     19|             "convertible on 0x%x",
  267|     19|             static_cast<unsigned>(type), static_cast<unsigned>(tag));
  268|     19|  }
  269|       |
  270|  6.03k|  switch (type) {
  271|      0|    using enum TiffDataType;
  272|    244|  case DOUBLE:
  ------------------
  |  Branch (272:3): [True: 244, False: 5.79k]
  ------------------
  273|    244|    return implicit_cast<float>(data.peek<double>(index));
  274|    263|  case FLOAT:
  ------------------
  |  Branch (274:3): [True: 263, False: 5.77k]
  ------------------
  275|    263|    return data.peek<float>(index);
  276|    284|  case LONG:
  ------------------
  |  Branch (276:3): [True: 284, False: 5.75k]
  ------------------
  277|    539|  case SHORT:
  ------------------
  |  Branch (277:3): [True: 255, False: 5.78k]
  ------------------
  278|    539|    return static_cast<float>(getU32(index));
  279|    365|  case SLONG:
  ------------------
  |  Branch (279:3): [True: 365, False: 5.67k]
  ------------------
  280|    612|  case SSHORT:
  ------------------
  |  Branch (280:3): [True: 247, False: 5.79k]
  ------------------
  281|    612|    return static_cast<float>(getI32(index));
  282|  2.49k|  case RATIONAL: {
  ------------------
  |  Branch (282:3): [True: 2.49k, False: 3.54k]
  ------------------
  283|  2.49k|    auto r = getRational(index);
  284|  2.49k|    return r.den ? static_cast<float>(r) : 0.0F;
  ------------------
  |  Branch (284:12): [True: 2.15k, False: 340]
  ------------------
  285|    365|  }
  286|  1.88k|  case SRATIONAL: {
  ------------------
  |  Branch (286:3): [True: 1.88k, False: 4.15k]
  ------------------
  287|  1.88k|    auto r = getSRational(index);
  288|  1.88k|    return r.den ? static_cast<float>(r) : 0.0F;
  ------------------
  |  Branch (288:12): [True: 1.42k, False: 457]
  ------------------
  289|    365|  }
  290|      0|  default:
  ------------------
  |  Branch (290:3): [True: 0, False: 6.03k]
  ------------------
  291|       |    // unreachable
  292|      0|    return 0.0F;
  293|  6.03k|  }
  294|  6.03k|}
_ZNK8rawspeed9TiffEntry9getStringEv:
  296|   106k|std::string TiffEntry::getString() const {
  297|   106k|  if (type != TiffDataType::ASCII && type != TiffDataType::BYTE)
  ------------------
  |  Branch (297:7): [True: 33.5k, False: 73.1k]
  |  Branch (297:38): [True: 284, False: 33.3k]
  ------------------
  298|   106k|    ThrowTPE("Wrong type 0x%x encountered. Expected Ascii or Byte",
  ------------------
  |  |   39|    284|  ThrowExceptionHelper(rawspeed::TiffParserException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|    284|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|    284|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|    284|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  299|   106k|             static_cast<unsigned>(type));
  300|       |
  301|       |  // *NOT* ByteStream::peekString() !
  302|   106k|  Buffer tmp = data.peekBuffer(data.getRemainSize());
  303|   106k|  const auto* termIter = std::find(tmp.begin(), tmp.end(), '\0');
  304|   106k|  return {reinterpret_cast<const char*>(tmp.begin()),
  305|   106k|          reinterpret_cast<const char*>(termIter)};
  306|   106k|}
_ZNK8rawspeed9TiffEntry14getRootIfdDataEv:
  308|    658|DataBuffer TiffEntry::getRootIfdData() const {
  309|    658|  const TiffIFD* p = parent;
  310|    658|  const TiffRootIFD* r = nullptr;
  311|  1.28k|  while (p) {
  ------------------
  |  Branch (311:10): [True: 1.28k, False: 0]
  ------------------
  312|  1.28k|    r = dynamic_cast<const TiffRootIFD*>(p);
  313|  1.28k|    if (r)
  ------------------
  |  Branch (313:9): [True: 658, False: 629]
  ------------------
  314|    658|      break;
  315|    629|    p = p->parent;
  316|    629|  }
  317|    658|  if (!r)
  ------------------
  |  Branch (317:7): [True: 0, False: 658]
  ------------------
  318|    658|    ThrowTPE("Internal error in TiffIFD data structure.");
  ------------------
  |  |   39|      0|  ThrowExceptionHelper(rawspeed::TiffParserException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  319|       |
  320|    658|  assert(r != nullptr);
  ------------------
  |  Branch (320:3): [True: 658, False: 0]
  ------------------
  321|    658|  return r->rootBuffer;
  322|    658|}

_ZNK8rawspeed9TiffEntry11getU16ArrayEj:
  107|    167|  [[nodiscard]] std::vector<uint16_t> getU16Array(uint32_t count_) const {
  108|    167|    return getArray<uint16_t, &TiffEntry::getU16>(count_);
  109|    167|  }
_ZNK8rawspeed9TiffEntry11getU32ArrayEj:
  111|    443|  [[nodiscard]] std::vector<uint32_t> getU32Array(uint32_t count_) const {
  112|    443|    return getArray<uint32_t, &TiffEntry::getU32>(count_);
  113|    443|  }
_ZNK8rawspeed9TiffEntry16getRationalArrayEj:
  120|    543|  getRationalArray(uint32_t count_) const {
  121|    543|    return getArray<NotARational<uint32_t>, &TiffEntry::getRational>(count_);
  122|    543|  }
_ZNK8rawspeed9TiffEntry17getSRationalArrayEj:
  125|     26|  getSRationalArray(uint32_t count_) const {
  126|     26|    return getArray<NotARational<int>, &TiffEntry::getSRational>(count_);
  127|     26|  }
_ZNK8rawspeed9TiffEntry7getDataEv:
  129|  27.3k|  [[nodiscard]] ByteStream getData() const { return data; }
_ZNK8rawspeed9TiffEntry8getArrayItTnMS0_KFT_jEXadL_ZNKS0_6getU16EjEEEENSt3__16vectorIS2_NS5_9allocatorIS2_EEEEj:
   71|    167|  [[nodiscard]] std::vector<T> getArray(uint32_t count_) const {
   72|    167|    std::vector<T> res(count_);
   73|   343k|    for (uint32_t i = 0; i < count_; ++i)
  ------------------
  |  Branch (73:26): [True: 343k, False: 167]
  ------------------
   74|   343k|      res[i] = (this->*getter)(i);
   75|    167|    return res;
   76|    167|  }
_ZNK8rawspeed9TiffEntry8getArrayIjTnMS0_KFT_jEXadL_ZNKS0_6getU32EjEEEENSt3__16vectorIS2_NS5_9allocatorIS2_EEEEj:
   71|    443|  [[nodiscard]] std::vector<T> getArray(uint32_t count_) const {
   72|    443|    std::vector<T> res(count_);
   73|   112k|    for (uint32_t i = 0; i < count_; ++i)
  ------------------
  |  Branch (73:26): [True: 111k, False: 443]
  ------------------
   74|   111k|      res[i] = (this->*getter)(i);
   75|    443|    return res;
   76|    443|  }
_ZNK8rawspeed9TiffEntry8getArrayINS_12NotARationalIjEETnMS0_KFT_jEXadL_ZNKS0_11getRationalEjEEEENSt3__16vectorIS4_NS7_9allocatorIS4_EEEEj:
   71|    543|  [[nodiscard]] std::vector<T> getArray(uint32_t count_) const {
   72|    543|    std::vector<T> res(count_);
   73|  1.61k|    for (uint32_t i = 0; i < count_; ++i)
  ------------------
  |  Branch (73:26): [True: 1.07k, False: 543]
  ------------------
   74|  1.07k|      res[i] = (this->*getter)(i);
   75|    543|    return res;
   76|    543|  }
_ZNK8rawspeed9TiffEntry8getArrayINS_12NotARationalIiEETnMS0_KFT_jEXadL_ZNKS0_12getSRationalEjEEEENSt3__16vectorIS4_NS7_9allocatorIS4_EEEEj:
   71|     26|  [[nodiscard]] std::vector<T> getArray(uint32_t count_) const {
   72|     26|    std::vector<T> res(count_);
   73|  72.1k|    for (uint32_t i = 0; i < count_; ++i)
  ------------------
  |  Branch (73:26): [True: 72.1k, False: 26]
  ------------------
   74|  72.1k|      res[i] = (this->*getter)(i);
   75|     26|    return res;
   76|     26|  }
_ZN8rawspeed9TiffEntryD2Ev:
   90|   161k|  virtual ~TiffEntry() = default;

_ZN8rawspeed7TiffIFD13parseIFDEntryEPNS_11NORangesSetINS_6BufferEEERNS_10ByteStreamE:
   53|   272k|void TiffIFD::parseIFDEntry(NORangesSet<Buffer>* ifds, ByteStream& bs) {
   54|   272k|  assert(ifds);
  ------------------
  |  Branch (54:3): [True: 272k, False: 0]
  ------------------
   55|       |
   56|   272k|  TiffEntryOwner t;
   57|       |
   58|   272k|  auto origPos = bs.getPosition();
   59|       |
   60|   272k|  try {
   61|   272k|    t = std::make_unique<TiffEntry>(this, bs);
   62|   272k|  } catch (const IOException&) { // Ignore unparsable entry
   63|       |    // fix probably broken position due to interruption by exception
   64|       |    // i.e. setting it to the next entry.
   65|   110k|    bs.setPosition(origPos + 12);
   66|   110k|    return;
   67|   110k|  }
   68|       |
   69|   161k|  try {
   70|   161k|    switch (t->tag) {
   71|      0|      using enum TiffTag;
   72|    420|    case DNGPRIVATEDATA:
  ------------------
  |  Branch (72:5): [True: 420, False: 161k]
  ------------------
   73|       |      // These are arbitrarily 'rebased', to preserve the offsets, but as it is
   74|       |      // implemented right now, that could trigger UB (pointer arithmetics,
   75|       |      // creating pointer to unowned memory, etc). And since this is not even
   76|       |      // used anywhere right now, let's not
   77|       |      //   add(parseDngPrivateData(ifds, t.get()));
   78|       |      // but just add them as entries. (e.g. ArwDecoder uses WB from them)
   79|    420|      add(std::move(t));
   80|    420|      break;
   81|       |
   82|  2.96k|    case MAKERNOTE:
  ------------------
  |  Branch (82:5): [True: 2.96k, False: 158k]
  ------------------
   83|  21.9k|    case MAKERNOTE_ALT:
  ------------------
  |  Branch (83:5): [True: 18.9k, False: 142k]
  ------------------
   84|  21.9k|      add(parseMakerNote(ifds, t.get()));
   85|  21.9k|      break;
   86|       |
   87|  1.76k|    case FUJI_RAW_IFD:
  ------------------
  |  Branch (87:5): [True: 1.76k, False: 160k]
  ------------------
   88|  8.21k|    case SUBIFDS:
  ------------------
  |  Branch (88:5): [True: 6.45k, False: 155k]
  ------------------
   89|  9.64k|    case EXIFIFDPOINTER:
  ------------------
  |  Branch (89:5): [True: 1.43k, False: 160k]
  ------------------
   90|  20.2k|      for (uint32_t j = 0; j < t->count; j++)
  ------------------
  |  Branch (90:28): [True: 10.5k, False: 9.64k]
  ------------------
   91|  10.5k|        add(std::make_unique<TiffIFD>(this, ifds, bs, t->getU32(j)));
   92|  9.64k|      break;
   93|       |
   94|   129k|    default:
  ------------------
  |  Branch (94:5): [True: 129k, False: 31.9k]
  ------------------
   95|   129k|      add(std::move(t));
   96|   161k|    }
   97|   161k|  } catch (const RawspeedException&) { // Unparsable private data are added as
   98|       |                                       // entries
   99|  27.6k|    add(std::move(t));
  100|  27.6k|  }
  101|   161k|}
_ZN8rawspeed7TiffIFDC2EPS0_:
  103|  62.1k|TiffIFD::TiffIFD(TiffIFD* parent_) : parent(parent_) {
  104|  62.1k|  recursivelyCheckSubIFDs(1);
  105|       |  // If we are good (can add this IFD without violating the limits),
  106|       |  // we are still here. However, due to the way we add parsed sub-IFD's (lazy),
  107|       |  // we need to count this IFD right *NOW*, not when adding it at the end.
  108|  62.1k|  recursivelyIncrementSubIFDCount();
  109|  62.1k|}
_ZN8rawspeed7TiffIFDC2EPS0_PNS_11NORangesSetINS_6BufferEEENS_10DataBufferEj:
  113|  62.1k|    : TiffIFD(parent_) {
  114|       |  // see TiffParser::parse: UINT32_MAX is used to mark the "virtual" top level
  115|       |  // TiffRootIFD in a tiff file
  116|  62.1k|  if (offset == UINT32_MAX)
  ------------------
  |  Branch (116:7): [True: 17.3k, False: 44.8k]
  ------------------
  117|  17.3k|    return;
  118|       |
  119|  62.1k|  assert(ifds);
  ------------------
  |  Branch (119:3): [True: 29.3k, False: 15.5k]
  ------------------
  120|       |
  121|  29.3k|  ByteStream bs(data);
  122|  29.3k|  bs.setPosition(offset);
  123|       |
  124|       |  // Directory entries in this IFD
  125|  29.3k|  auto numEntries = bs.getU16();
  126|       |
  127|       |  // 2 bytes for entry count
  128|       |  // each entry is 12 bytes
  129|       |  // 4-byte offset to the next IFD at the end
  130|  29.3k|  const auto IFDFullSize = 2 + 4 + (12 * numEntries);
  131|  29.3k|  if (const Buffer IFDBuf(data.getSubView(offset, IFDFullSize));
  132|  29.3k|      !ifds->insert(IFDBuf))
  ------------------
  |  Branch (132:7): [True: 2.33k, False: 26.9k]
  ------------------
  133|  29.3k|    ThrowTPE("Two IFD's overlap. Raw corrupt!");
  ------------------
  |  |   39|  2.33k|  ThrowExceptionHelper(rawspeed::TiffParserException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|  2.33k|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|  2.33k|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|  2.33k|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  134|       |
  135|   299k|  for (uint32_t i = 0; i < numEntries; i++)
  ------------------
  |  Branch (135:24): [True: 272k, False: 26.9k]
  ------------------
  136|   272k|    parseIFDEntry(ifds, bs);
  137|       |
  138|  26.9k|  nextIFD = bs.getU32();
  139|  26.9k|}
_ZN8rawspeed7TiffIFD14parseMakerNoteEPNS_11NORangesSetINS_6BufferEEEPKNS_9TiffEntryE:
  143|  21.9k|                                         const TiffEntry* t) {
  144|  21.9k|  assert(ifds);
  ------------------
  |  Branch (144:3): [True: 21.9k, False: 0]
  ------------------
  145|       |
  146|       |  // go up the IFD tree and try to find the MAKE entry on each level.
  147|       |  // we can not go all the way to the top first because this partial tree
  148|       |  // is not yet added to the TiffRootIFD.
  149|  21.9k|  const TiffIFD* p = this;
  150|  21.9k|  const TiffEntry* makeEntry = nullptr;
  151|  81.7k|  while (p && !makeEntry) {
  ------------------
  |  Branch (151:10): [True: 62.6k, False: 19.1k]
  |  Branch (151:15): [True: 59.8k, False: 2.77k]
  ------------------
  152|  59.8k|    makeEntry = p->getEntryRecursive(TiffTag::MAKE);
  153|  59.8k|    p = p->parent;
  154|  59.8k|  }
  155|  21.9k|  std::string make =
  156|  21.9k|      makeEntry != nullptr ? trimSpaces(makeEntry->getString()) : "";
  ------------------
  |  Branch (156:7): [True: 3.21k, False: 18.7k]
  ------------------
  157|       |
  158|  21.9k|  ByteStream bs = t->getData();
  159|       |
  160|       |  // helper function for easy setup of ByteStream buffer for the different maker
  161|       |  // note types 'rebase' means position 0 of new stream equals current position
  162|       |  // 'newPosition' is the position where the IFD starts
  163|       |  // 'byteOrderOffset' is the position where the 2 magic bytes (II/MM) may be
  164|       |  // found 'context' is a string providing error information in case the byte
  165|       |  // order parsing should fail
  166|  21.9k|  auto setup = [&bs](bool rebase, uint32_t newPosition,
  167|  21.9k|                     uint32_t byteOrderOffset = 0,
  168|  21.9k|                     const char* context = nullptr) {
  169|  21.9k|    if (rebase)
  170|  21.9k|      bs = bs.getSubStream(bs.getPosition(), bs.getRemainSize());
  171|  21.9k|    if (context)
  172|  21.9k|      bs.setByteOrder(getTiffByteOrder(bs, byteOrderOffset, context));
  173|  21.9k|    bs.skipBytes(newPosition);
  174|  21.9k|  };
  175|       |
  176|  21.9k|  if (bs.hasPrefix(std::string_view("AOC\0", 4))) {
  ------------------
  |  Branch (176:7): [True: 559, False: 21.3k]
  ------------------
  177|    559|    setup(false, 6, 4, "Pentax makernote");
  178|  21.3k|  } else if (bs.hasPrefix("PENTAX")) {
  ------------------
  |  Branch (178:14): [True: 447, False: 20.9k]
  ------------------
  179|    447|    setup(true, 10, 8, "Pentax makernote");
  180|  20.9k|  } else if (bs.hasPrefix(std::string_view("FUJIFILM\x0c\x00\x00\x00", 12))) {
  ------------------
  |  Branch (180:14): [True: 353, False: 20.5k]
  ------------------
  181|    353|    bs.setByteOrder(Endianness::little);
  182|    353|    setup(true, 12);
  183|  20.5k|  } else if (bs.hasPrefix(std::string_view("Nikon\x00\x02", 7))) {
  ------------------
  |  Branch (183:14): [True: 1.73k, False: 18.8k]
  ------------------
  184|       |    // this is Nikon type 3 maker note format
  185|       |    // TODO: implement Nikon type 1 maker note format
  186|       |    // see http://www.ozhiker.com/electronics/pjmt/jpeg_info/nikon_mn.html
  187|  1.73k|    bs.skipBytes(10);
  188|  1.73k|    setup(true, 8, 0, "Nikon makernote");
  189|  18.8k|  } else if (bs.hasPrefix("OLYMPUS")) { // new Olympus
  ------------------
  |  Branch (189:14): [True: 295, False: 18.5k]
  ------------------
  190|    295|    setup(true, 12);
  191|  18.5k|  } else if (bs.hasPrefix("OLYMP")) { // old Olympus
  ------------------
  |  Branch (191:14): [True: 918, False: 17.6k]
  ------------------
  192|    918|    setup(true, 8);
  193|  17.6k|  } else if (bs.hasPrefix("OM SYSTEM")) { // ex Olympus
  ------------------
  |  Branch (193:14): [True: 568, False: 17.0k]
  ------------------
  194|    568|    setup(true, 16);
  195|  17.0k|  } else if (bs.hasPrefix("EPSON")) {
  ------------------
  |  Branch (195:14): [True: 267, False: 16.7k]
  ------------------
  196|    267|    setup(false, 8);
  197|  16.7k|  } else if (bs.hasPrefix("Apple iOS")) {
  ------------------
  |  Branch (197:14): [True: 0, False: 16.7k]
  ------------------
  198|      0|    setup(true, 14, 12, "Apple makernote");
  199|  16.7k|  } else if (bs.hasPatternAt("Exif", 6)) {
  ------------------
  |  Branch (199:14): [True: 121, False: 16.6k]
  ------------------
  200|       |    // TODO: for none of the rawsamples.ch files from Panasonic is this true,
  201|       |    // instead their MakerNote start with "Panasonic" Panasonic has the word
  202|       |    // Exif at byte 6, a complete Tiff header starts at byte 12 This TIFF is 0
  203|       |    // offset based
  204|    121|    setup(false, 20, 12, "Panosonic makernote");
  205|  16.6k|  } else if (make == "SAMSUNG") {
  ------------------
  |  Branch (205:14): [True: 284, False: 16.3k]
  ------------------
  206|       |    // Samsung has no identification in its MakerNote but starts with the IFD
  207|       |    // right away
  208|    284|    setup(true, 0);
  209|  16.3k|  } else {
  210|       |    // cerr << "default MakerNote from " << make << endl; // Canon, Nikon (type
  211|       |    // 2), Sony, Minolta, Ricoh, Leica, Hasselblad, etc.
  212|       |
  213|       |    // At least one MAKE has not been handled explicitly and starts its
  214|       |    // MakerNote with an endian prefix: Kodak
  215|  16.3k|    if (bs.skipPrefix("II")) {
  ------------------
  |  Branch (215:9): [True: 615, False: 15.7k]
  ------------------
  216|    615|      bs.setByteOrder(Endianness::little);
  217|  15.7k|    } else if (bs.skipPrefix("MM")) {
  ------------------
  |  Branch (217:16): [True: 1.41k, False: 14.3k]
  ------------------
  218|  1.41k|      bs.setByteOrder(Endianness::big);
  219|  1.41k|    }
  220|  16.3k|  }
  221|       |
  222|       |  // Attempt to parse the rest as an IFD
  223|  21.9k|  return std::make_unique<TiffRootIFD>(this, ifds, bs, bs.getPosition());
  224|  21.9k|}
_ZNK8rawspeed7TiffIFD14getIFDsWithTagENS_7TiffTagE:
  226|  30.2k|std::vector<const TiffIFD*> TiffIFD::getIFDsWithTag(TiffTag tag) const {
  227|  30.2k|  vector<const TiffIFD*> matchingIFDs;
  228|  30.2k|  if (entries.contains(tag)) {
  ------------------
  |  Branch (228:7): [True: 12.4k, False: 17.8k]
  ------------------
  229|  12.4k|    matchingIFDs.push_back(this);
  230|  12.4k|  }
  231|  30.2k|  for (const auto& i : subIFDs) {
  ------------------
  |  Branch (231:22): [True: 18.5k, False: 30.2k]
  ------------------
  232|  18.5k|    vector<const TiffIFD*> t = i->getIFDsWithTag(tag);
  233|  18.5k|    matchingIFDs.insert(matchingIFDs.end(), t.begin(), t.end());
  234|  18.5k|  }
  235|  30.2k|  return matchingIFDs;
  236|  30.2k|}
_ZNK8rawspeed7TiffIFD13getIFDWithTagENS_7TiffTagEj:
  238|  4.85k|const TiffIFD* TiffIFD::getIFDWithTag(TiffTag tag, uint32_t index) const {
  239|  4.85k|  auto ifds = getIFDsWithTag(tag);
  240|  4.85k|  if (index >= ifds.size())
  ------------------
  |  Branch (240:7): [True: 116, False: 4.74k]
  ------------------
  241|  4.85k|    ThrowTPE("failed to find %u ifd with tag 0x%04x", index + 1,
  ------------------
  |  |   39|    116|  ThrowExceptionHelper(rawspeed::TiffParserException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|    116|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|    116|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|    116|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  242|  4.74k|             static_cast<unsigned>(tag));
  243|  4.74k|  return ifds[index];
  244|  4.85k|}
_ZNK8rawspeed7TiffIFD17getEntryRecursiveENS_7TiffTagE:
  246|   396k|TiffEntry* RAWSPEED_READONLY TiffIFD::getEntryRecursive(TiffTag tag) const {
  247|   396k|  if (auto i = entries.find(tag); i != entries.end()) {
  ------------------
  |  Branch (247:35): [True: 121k, False: 274k]
  ------------------
  248|   121k|    return i->second.get();
  249|   121k|  }
  250|   274k|  for (const auto& j : subIFDs) {
  ------------------
  |  Branch (250:22): [True: 185k, False: 149k]
  ------------------
  251|   185k|    TiffEntry* entry = j->getEntryRecursive(tag);
  252|   185k|    if (entry)
  ------------------
  |  Branch (252:9): [True: 125k, False: 60.0k]
  ------------------
  253|   125k|      return entry;
  254|   185k|  }
  255|   149k|  return nullptr;
  256|   274k|}
_ZN8rawspeed7TiffIFD31recursivelyIncrementSubIFDCountEv:
  258|  46.6k|void TiffIFD::recursivelyIncrementSubIFDCount() {
  259|  46.6k|  TiffIFD* p = this->parent;
  260|  46.6k|  if (!p)
  ------------------
  |  Branch (260:7): [True: 14.0k, False: 32.5k]
  ------------------
  261|  14.0k|    return;
  262|       |
  263|  32.5k|  p->subIFDCount++;
  264|       |
  265|  86.7k|  for (; p != nullptr; p = p->parent)
  ------------------
  |  Branch (265:10): [True: 54.1k, False: 32.5k]
  ------------------
  266|  54.1k|    p->subIFDCountRecursive++;
  267|  32.5k|}
_ZNK8rawspeed7TiffIFD12checkSubIFDsEi:
  269|   192k|void TiffIFD::checkSubIFDs(int headroom) const {
  270|   192k|  int count = headroom + subIFDCount;
  271|   192k|  if (!headroom)
  ------------------
  |  Branch (271:7): [True: 53.2k, False: 139k]
  ------------------
  272|   192k|    assert(count <= TiffIFD::Limits::SubIFDCount);
  ------------------
  |  Branch (272:5): [True: 53.2k, False: 0]
  ------------------
  273|   139k|  else if (count > TiffIFD::Limits::SubIFDCount)
  ------------------
  |  Branch (273:12): [True: 12.4k, False: 127k]
  ------------------
  274|  12.4k|    ThrowTPE("TIFF IFD has %d SubIFDs", count);
  ------------------
  |  |   39|  12.4k|  ThrowExceptionHelper(rawspeed::TiffParserException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|  12.4k|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|  12.4k|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|  12.4k|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  275|       |
  276|   180k|  count = headroom + subIFDCountRecursive;
  277|   180k|  if (!headroom)
  ------------------
  |  Branch (277:7): [True: 53.2k, False: 127k]
  ------------------
  278|   180k|    assert(count <= TiffIFD::Limits::RecursiveSubIFDCount);
  ------------------
  |  Branch (278:5): [True: 53.2k, False: 0]
  ------------------
  279|   127k|  else if (count > TiffIFD::Limits::RecursiveSubIFDCount)
  ------------------
  |  Branch (279:12): [True: 1.98k, False: 125k]
  ------------------
  280|  1.98k|    ThrowTPE("TIFF IFD file has %d SubIFDs (recursively)", count);
  ------------------
  |  |   39|  1.98k|  ThrowExceptionHelper(rawspeed::TiffParserException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|  1.98k|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|  1.98k|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|  1.98k|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  281|   180k|}
_ZNK8rawspeed7TiffIFD23recursivelyCheckSubIFDsEi:
  283|  84.5k|void TiffIFD::recursivelyCheckSubIFDs(int headroom) const {
  284|  84.5k|  int depth = 0;
  285|   277k|  for (const TiffIFD* p = this; p != nullptr;) {
  ------------------
  |  Branch (285:33): [True: 193k, False: 83.3k]
  ------------------
  286|   193k|    if (!headroom)
  ------------------
  |  Branch (286:9): [True: 53.2k, False: 140k]
  ------------------
  287|   193k|      assert(depth <= TiffIFD::Limits::Depth);
  ------------------
  |  Branch (287:7): [True: 53.2k, False: 0]
  ------------------
  288|   140k|    else if (depth > TiffIFD::Limits::Depth)
  ------------------
  |  Branch (288:14): [True: 1.12k, False: 139k]
  ------------------
  289|  1.12k|      ThrowTPE("TiffIFD cascading overflow, found %d level IFD", depth);
  ------------------
  |  |   39|  1.12k|  ThrowExceptionHelper(rawspeed::TiffParserException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|  1.12k|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|  1.12k|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|  1.12k|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  290|       |
  291|   192k|    p->checkSubIFDs(headroom);
  292|       |
  293|       |    // And step up
  294|   192k|    p = p->parent;
  295|   192k|    depth++;
  296|   192k|  }
  297|  84.5k|}
_ZN8rawspeed7TiffIFD3addENSt3__110unique_ptrIS0_NS1_14default_deleteIS0_EEEE:
  299|  22.3k|void TiffIFD::add(TiffIFDOwner subIFD) {
  300|  22.3k|  assert(subIFD->parent == this);
  ------------------
  |  Branch (300:3): [True: 22.3k, False: 0]
  ------------------
  301|       |
  302|       |  // We are good, and actually can add this sub-IFD, right?
  303|  22.3k|  subIFD->recursivelyCheckSubIFDs(0);
  304|       |
  305|  22.3k|  subIFDs.push_back(std::move(subIFD));
  306|  22.3k|}
_ZN8rawspeed7TiffIFD3addENSt3__110unique_ptrINS_9TiffEntryENS1_14default_deleteIS3_EEEE:
  308|   157k|void TiffIFD::add(TiffEntryOwner entry) {
  309|   157k|  entry->parent = this;
  310|   157k|  entries[entry->tag] = std::move(entry);
  311|   157k|}
_ZNK8rawspeed7TiffIFD8getEntryENS_7TiffTagE:
  313|  79.2k|TiffEntry* TiffIFD::getEntry(TiffTag tag) const {
  314|  79.2k|  auto i = entries.find(tag);
  315|  79.2k|  if (i == entries.end())
  ------------------
  |  Branch (315:7): [True: 235, False: 78.9k]
  ------------------
  316|  79.2k|    ThrowTPE("Entry 0x%x not found.", static_cast<unsigned>(tag));
  ------------------
  |  |   39|    235|  ThrowExceptionHelper(rawspeed::TiffParserException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|    235|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|    235|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|    235|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  317|  78.9k|  return i->second.get();
  318|  79.2k|}
_ZNK8rawspeed11TiffRootIFD5getIDEv:
  325|  53.7k|TiffID TiffRootIFD::getID() const {
  326|  53.7k|  TiffID id;
  327|  53.7k|  const auto* makeE = getEntryRecursive(TiffTag::MAKE);
  328|  53.7k|  const auto* modelE = getEntryRecursive(TiffTag::MODEL);
  329|       |
  330|  53.7k|  if (!makeE)
  ------------------
  |  Branch (330:7): [True: 2.93k, False: 50.8k]
  ------------------
  331|  53.7k|    ThrowTPE("Failed to find MAKE entry.");
  ------------------
  |  |   39|  2.93k|  ThrowExceptionHelper(rawspeed::TiffParserException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|  2.93k|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|  2.93k|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|  2.93k|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  332|  50.8k|  if (!modelE)
  ------------------
  |  Branch (332:7): [True: 86, False: 50.7k]
  ------------------
  333|  50.8k|    ThrowTPE("Failed to find MODEL entry.");
  ------------------
  |  |   39|     86|  ThrowExceptionHelper(rawspeed::TiffParserException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     86|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     86|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     86|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  334|       |
  335|  50.7k|  id.make = trimSpaces(makeE->getString());
  336|  50.7k|  id.model = trimSpaces(modelE->getString());
  337|       |
  338|  50.7k|  return id;
  339|  50.8k|}
TiffIFD.cpp:_ZZN8rawspeed7TiffIFD14parseMakerNoteEPNS_11NORangesSetINS_6BufferEEEPKNS_9TiffEntryEENK3$_0clEbjjPKc:
  168|  5.50k|                     const char* context = nullptr) {
  169|  5.50k|    if (rebase)
  ------------------
  |  Branch (169:9): [True: 4.55k, False: 947]
  ------------------
  170|  4.55k|      bs = bs.getSubStream(bs.getPosition(), bs.getRemainSize());
  171|  5.50k|    if (context)
  ------------------
  |  Branch (171:9): [True: 2.82k, False: 2.68k]
  ------------------
  172|  2.82k|      bs.setByteOrder(getTiffByteOrder(bs, byteOrderOffset, context));
  173|  5.50k|    bs.skipBytes(newPosition);
  174|  5.50k|  };

_ZNK8rawspeed7TiffIFD10getNextIFDEv:
  112|  17.4k|  [[nodiscard]] uint32_t getNextIFD() const { return nextIFD; }
_ZNK8rawspeed7TiffIFD8hasEntryENS_7TiffTagE:
  119|  43.3k|  [[nodiscard]] bool RAWSPEED_READONLY hasEntry(TiffTag tag) const {
  120|  43.3k|    return entries.contains(tag);
  121|  43.3k|  }
_ZNK8rawspeed7TiffIFD17hasEntryRecursiveENS_7TiffTagE:
  122|  29.2k|  [[nodiscard]] bool hasEntryRecursive(TiffTag tag) const {
  123|  29.2k|    return getEntryRecursive(tag) != nullptr;
  124|  29.2k|  }
_ZNK8rawspeed7TiffIFD10getSubIFDsEv:
  126|  19.0k|  [[nodiscard]] const std::vector<TiffIFDOwner>& getSubIFDs() const {
  127|  19.0k|    return subIFDs;
  128|  19.0k|  }
_ZN8rawspeed11TiffRootIFDC2EPNS_7TiffIFDEPNS_11NORangesSetINS_6BufferEEENS_10DataBufferEj:
  146|  34.5k|      : TiffIFD(parent_, ifds, data, offset), rootBuffer(data) {}
_ZN8rawspeed16getTiffByteOrderENS_10ByteStreamEjPKc:
  154|  16.9k|                                   const char* context = "") {
  155|  16.9k|  if (bs.hasPatternAt("II", pos))
  ------------------
  |  Branch (155:7): [True: 14.4k, False: 2.50k]
  ------------------
  156|  14.4k|    return Endianness::little;
  157|  2.50k|  if (bs.hasPatternAt("MM", pos))
  ------------------
  |  Branch (157:7): [True: 1.41k, False: 1.08k]
  ------------------
  158|  1.41k|    return Endianness::big;
  159|       |
  160|  1.08k|  ThrowTPE("Failed to parse TIFF endianness information in %s.", context);
  ------------------
  |  |   39|  1.08k|  ThrowExceptionHelper(rawspeed::TiffParserException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|  1.08k|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|  1.08k|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|  1.08k|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  161|  2.50k|}
_ZN8rawspeed7TiffIFDD2Ev:
  105|  46.6k|  virtual ~TiffIFD() = default;

_ZNKSt3__16__lessIvvEclB8ne180100ImmEEbRKT_RKT0_:
   40|    500|  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 bool operator()(const _Tp& __lhs, const _Up& __rhs) const {
   41|    500|    return __lhs < __rhs;
   42|    500|  }
_ZNKSt3__16__lessIvvEclB8ne180100IPKcS4_EEbRKT_RKT0_:
   40|    280|  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 bool operator()(const _Tp& __lhs, const _Up& __rhs) const {
   41|    280|    return __lhs < __rhs;
   42|    280|  }
_ZNKSt3__16__lessIvvEclB8ne180100IllEEbRKT_RKT0_:
   40|  1.25k|  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 bool operator()(const _Tp& __lhs, const _Up& __rhs) const {
   41|  1.25k|    return __lhs < __rhs;
   42|  1.25k|  }
_ZNKSt3__16__lessIvvEclB8ne180100IPcS3_EEbRKT_RKT0_:
   40|    438|  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 bool operator()(const _Tp& __lhs, const _Up& __rhs) const {
   41|    438|    return __lhs < __rhs;
   42|    438|  }

_ZNKSt3__114__copy_trivialclB8ne180100IKccTnNS_9enable_ifIXsr38__can_lower_copy_assignment_to_memmoveIT_T0_EE5valueEiE4typeELi0EEENS_4pairIPS4_PS5_EES9_S9_SA_:
  103|  21.3k|  operator()(_In* __first, _In* __last, _Out* __result) const {
  104|  21.3k|    return std::__copy_trivial_impl(__first, __last, __result);
  105|  21.3k|  }
_ZNSt3__16__copyB8ne180100INS_17_ClassicAlgPolicyEPKcS3_PcEENS_4pairIT0_T2_EES6_T1_S7_:
  110|  21.3k|__copy(_InIter __first, _Sent __last, _OutIter __result) {
  111|  21.3k|  return std::__dispatch_copy_or_move<_AlgPolicy, __copy_loop<_AlgPolicy>, __copy_trivial>(
  112|  21.3k|      std::move(__first), std::move(__last), std::move(__result));
  113|  21.3k|}
_ZNSt3__14copyB8ne180100IPKcPcEET0_T_S5_S4_:
  117|  21.3k|copy(_InputIterator __first, _InputIterator __last, _OutputIterator __result) {
  118|  21.3k|  return std::__copy<_ClassicAlgPolicy>(__first, __last, __result).second;
  119|  21.3k|}

_ZNSt3__119__copy_trivial_implB8ne180100IKccEENS_4pairIPT_PT0_EES4_S4_S6_:
   63|  21.3k|__copy_trivial_impl(_In* __first, _In* __last, _Out* __result) {
   64|  21.3k|  const size_t __n = static_cast<size_t>(__last - __first);
   65|       |
   66|  21.3k|  std::__constexpr_memmove(__result, __first, __element_count(__n));
   67|       |
   68|  21.3k|  return std::make_pair(__last, __result + __n);
   69|  21.3k|}
_ZNSt3__121__unwrap_and_dispatchB8ne180100INS_10__overloadINS_11__copy_loopINS_17_ClassicAlgPolicyEEENS_14__copy_trivialEEEPKcS8_PcTnNS_9enable_ifIXsr12__can_rewrapIT0_T1_T2_EE5valueEiE4typeELi0EEENS_4pairISB_SD_EESB_SC_SD_:
  107|  21.3k|__unwrap_and_dispatch(_InIter __first, _Sent __last, _OutIter __out_first) {
  108|  21.3k|  auto __range  = std::__unwrap_range(__first, std::move(__last));
  109|  21.3k|  auto __result = _Algorithm()(std::move(__range.first), std::move(__range.second), std::__unwrap_iter(__out_first));
  110|  21.3k|  return std::make_pair(std::__rewrap_range<_Sent>(std::move(__first), std::move(__result.first)),
  111|  21.3k|                        std::__rewrap_iter(std::move(__out_first), std::move(__result.second)));
  112|  21.3k|}
_ZNSt3__123__dispatch_copy_or_moveB8ne180100INS_17_ClassicAlgPolicyENS_11__copy_loopIS1_EENS_14__copy_trivialEPKcS6_PcEENS_4pairIT2_T4_EES9_T3_SA_:
  131|  21.3k|__dispatch_copy_or_move(_InIter __first, _Sent __last, _OutIter __out_first) {
  132|  21.3k|  using _Algorithm = __overload<_NaiveAlgorithm, _OptimizedAlgorithm>;
  133|  21.3k|  return std::__unwrap_and_dispatch<_Algorithm>(std::move(__first), std::move(__last), std::move(__out_first));
  134|  21.3k|}

_ZNSt3__16copy_nB8ne180100IPKcmPcTnNS_9enable_ifIXsr37__has_random_access_iterator_categoryIT_EE5valueEiE4typeELi0EEET1_S5_T0_S8_:
   51|  21.3k|copy_n(_InputIterator __first, _Size __orig_n, _OutputIterator __result) {
   52|  21.3k|  typedef typename iterator_traits<_InputIterator>::difference_type difference_type;
   53|  21.3k|  typedef decltype(std::__convert_to_integral(__orig_n)) _IntegralSize;
   54|  21.3k|  _IntegralSize __n = __orig_n;
   55|  21.3k|  return std::copy(__first, __first + difference_type(__n), __result);
   56|  21.3k|}

_ZNSt3__18__fill_nB8ne180100IPcmcEET_S2_T0_RKT1_:
   26|  1.84k|__fill_n(_OutputIterator __first, _Size __n, const _Tp& __value) {
   27|   453k|  for (; __n > 0; ++__first, (void)--__n)
  ------------------
  |  Branch (27:10): [True: 451k, False: 1.84k]
  ------------------
   28|   451k|    *__first = __value;
   29|  1.84k|  return __first;
   30|  1.84k|}
_ZNSt3__16fill_nB8ne180100IPcmcEET_S2_T0_RKT1_:
   34|  1.84k|fill_n(_OutputIterator __first, _Size __n, const _Tp& __value) {
   35|  1.84k|  return std::__fill_n(__first, std::__convert_to_integral(__n), __value);
   36|  1.84k|}

_ZNSt3__111__find_implB8ne180100IccNS_10__identityETnNS_9enable_ifIXaaaasr13__is_identityIT1_EE5valuesr41__libcpp_is_trivially_equality_comparableIT_T0_EE5valueeqstS4_Li1EEiE4typeELi0EEEPS4_S8_S8_RKS5_RS3_:
   61|   237k|__find_impl(_Tp* __first, _Tp* __last, const _Up& __value, _Proj&) {
   62|   237k|  if (auto __ret = std::__constexpr_memchr(__first, __value, __last - __first))
  ------------------
  |  Branch (62:12): [True: 237k, False: 215]
  ------------------
   63|   237k|    return __ret;
   64|    215|  return __last;
   65|   237k|}
_ZNSt3__14findB8ne180100IPccEET_S2_S2_RKT0_:
  173|   237k|find(_InputIterator __first, _InputIterator __last, const _Tp& __value) {
  174|   237k|  __identity __proj;
  175|   237k|  return std::__rewrap_iter(
  176|   237k|      __first, std::__find_impl(std::__unwrap_iter(__first), std::__unwrap_iter(__last), __value, __proj));
  177|   237k|}

_ZNSt3__13maxB8ne180100ImNS_6__lessIvvEEEERKT_S5_S5_T0_:
   29|    499|max(_LIBCPP_LIFETIMEBOUND const _Tp& __a, _LIBCPP_LIFETIMEBOUND const _Tp& __b, _Compare __comp) {
   30|    499|  return __comp(__a, __b) ? __b : __a;
  ------------------
  |  Branch (30:10): [True: 98, False: 401]
  ------------------
   31|    499|}
_ZNSt3__13maxB8ne180100ImEERKT_S3_S3_:
   35|    499|max(_LIBCPP_LIFETIMEBOUND const _Tp& __a, _LIBCPP_LIFETIMEBOUND const _Tp& __b) {
   36|    499|  return std::max(__a, __b, __less<>());
   37|    499|}
_ZNSt3__13maxB8ne180100IPcEERKT_S4_S4_:
   35|    438|max(_LIBCPP_LIFETIMEBOUND const _Tp& __a, _LIBCPP_LIFETIMEBOUND const _Tp& __b) {
   36|    438|  return std::max(__a, __b, __less<>());
   37|    438|}
_ZNSt3__13maxB8ne180100IPcNS_6__lessIvvEEEERKT_S6_S6_T0_:
   29|    438|max(_LIBCPP_LIFETIMEBOUND const _Tp& __a, _LIBCPP_LIFETIMEBOUND const _Tp& __b, _Compare __comp) {
   30|    438|  return __comp(__a, __b) ? __b : __a;
  ------------------
  |  Branch (30:10): [True: 0, False: 438]
  ------------------
   31|    438|}

_ZNSt3__13minB8ne180100ImEERKT_S3_S3_:
   35|      1|min(_LIBCPP_LIFETIMEBOUND const _Tp& __a, _LIBCPP_LIFETIMEBOUND const _Tp& __b) {
   36|      1|  return std::min(__a, __b, __less<>());
   37|      1|}
_ZNSt3__13minB8ne180100ImNS_6__lessIvvEEEERKT_S5_S5_T0_:
   29|      1|min(_LIBCPP_LIFETIMEBOUND const _Tp& __a, _LIBCPP_LIFETIMEBOUND const _Tp& __b, _Compare __comp) {
   30|      1|  return __comp(__b, __a) ? __b : __a;
  ------------------
  |  Branch (30:10): [True: 0, False: 1]
  ------------------
   31|      1|}
_ZNSt3__13minB8ne180100IlNS_6__lessIvvEEEERKT_S5_S5_T0_:
   29|  1.25k|min(_LIBCPP_LIFETIMEBOUND const _Tp& __a, _LIBCPP_LIFETIMEBOUND const _Tp& __b, _Compare __comp) {
   30|  1.25k|  return __comp(__b, __a) ? __b : __a;
  ------------------
  |  Branch (30:10): [True: 1.07k, False: 178]
  ------------------
   31|  1.25k|}
_ZNSt3__13minB8ne180100IlEERKT_S3_S3_:
   35|  1.25k|min(_LIBCPP_LIFETIMEBOUND const _Tp& __a, _LIBCPP_LIFETIMEBOUND const _Tp& __b) {
   36|  1.25k|  return std::min(__a, __b, __less<>());
   37|  1.25k|}

_ZNSt3__118__unwrap_iter_implIPKcLb1EE8__unwrapB8ne180100ES2_:
   55|  42.7k|  static _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR _ToAddressT __unwrap(_Iter __i) _NOEXCEPT {
   56|  42.7k|    return std::__to_address(__i);
   57|  42.7k|  }
_ZNSt3__113__unwrap_iterB8ne180100IPKcNS_18__unwrap_iter_implIS2_Lb1EEETnNS_9enable_ifIXsr21is_copy_constructibleIT_EE5valueEiE4typeELi0EEEDTclsrT0_8__unwrapclsr3stdE7declvalIS6_EEEES6_:
   64|  42.7k|__unwrap_iter(_Iter __i) _NOEXCEPT {
   65|  42.7k|  return _Impl::__unwrap(__i);
   66|  42.7k|}
_ZNSt3__118__unwrap_iter_implIPcLb1EE8__unwrapB8ne180100ES1_:
   55|   495k|  static _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR _ToAddressT __unwrap(_Iter __i) _NOEXCEPT {
   56|   495k|    return std::__to_address(__i);
   57|   495k|  }
_ZNSt3__113__unwrap_iterB8ne180100IPcNS_18__unwrap_iter_implIS1_Lb1EEETnNS_9enable_ifIXsr21is_copy_constructibleIT_EE5valueEiE4typeELi0EEEDTclsrT0_8__unwrapclsr3stdE7declvalIS5_EEEES5_:
   64|   495k|__unwrap_iter(_Iter __i) _NOEXCEPT {
   65|   495k|  return _Impl::__unwrap(__i);
   66|   495k|}
_ZNSt3__118__unwrap_iter_implIPKcLb1EE8__rewrapB8ne180100ES2_S2_:
   51|  21.3k|  static _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR _Iter __rewrap(_Iter __orig_iter, _ToAddressT __unwrapped_iter) {
   52|  21.3k|    return __orig_iter + (__unwrapped_iter - std::__to_address(__orig_iter));
   53|  21.3k|  }
_ZNSt3__113__rewrap_iterB8ne180100IPKcS2_NS_18__unwrap_iter_implIS2_Lb1EEEEET_S5_T0_:
   77|  21.3k|_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR _OrigIter __rewrap_iter(_OrigIter __orig_iter, _Iter __iter) _NOEXCEPT {
   78|  21.3k|  return _Impl::__rewrap(std::move(__orig_iter), std::move(__iter));
   79|  21.3k|}
_ZNSt3__118__unwrap_iter_implIPcLb1EE8__rewrapB8ne180100ES1_S1_:
   51|   258k|  static _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR _Iter __rewrap(_Iter __orig_iter, _ToAddressT __unwrapped_iter) {
   52|   258k|    return __orig_iter + (__unwrapped_iter - std::__to_address(__orig_iter));
   53|   258k|  }
_ZNSt3__113__rewrap_iterB8ne180100IPcS1_NS_18__unwrap_iter_implIS1_Lb1EEEEET_S4_T0_:
   77|   258k|_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR _OrigIter __rewrap_iter(_OrigIter __orig_iter, _Iter __iter) _NOEXCEPT {
   78|   258k|  return _Impl::__rewrap(std::move(__orig_iter), std::move(__iter));
   79|   258k|}

_ZNSt3__119__unwrap_range_implIPKcS2_E8__unwrapB8ne180100ES2_S2_:
   64|  21.3k|  _LIBCPP_HIDE_FROM_ABI static constexpr auto __unwrap(_Iter __first, _Iter __last) {
   65|  21.3k|    return pair{std::__unwrap_iter(std::move(__first)), std::__unwrap_iter(std::move(__last))};
   66|  21.3k|  }
_ZNSt3__114__unwrap_rangeB8ne180100IPKcS2_EEDaT_T0_:
   75|  21.3k|_LIBCPP_HIDE_FROM_ABI constexpr auto __unwrap_range(_Iter __first, _Sent __last) {
   76|  21.3k|  return __unwrap_range_impl<_Iter, _Sent>::__unwrap(std::move(__first), std::move(__last));
   77|  21.3k|}
_ZNSt3__119__unwrap_range_implIPKcS2_E8__rewrapB8ne180100ES2_S2_:
   69|  21.3k|  __rewrap(_Iter __orig_iter, decltype(std::__unwrap_iter(__orig_iter)) __iter) {
   70|  21.3k|    return std::__rewrap_iter(std::move(__orig_iter), std::move(__iter));
   71|  21.3k|  }
_ZNSt3__114__rewrap_rangeB8ne180100IPKcS2_S2_EET0_S3_T1_:
   80|  21.3k|_LIBCPP_HIDE_FROM_ABI constexpr _Iter __rewrap_range(_Iter __orig_iter, _Unwrapped __iter) {
   81|  21.3k|  return __unwrap_range_impl<_Iter, _Sent>::__rewrap(std::move(__orig_iter), std::move(__iter));
   82|  21.3k|}

_ZNSt9exceptionC2B8ne180100Ev:
   74|   172k|  _LIBCPP_HIDE_FROM_ABI exception() _NOEXCEPT {}

_ZNSt3__119istreambuf_iteratorIcNS_11char_traitsIcEEEC2B8ne180100Ev:
   67|  1.32k|  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR istreambuf_iterator() _NOEXCEPT : __sbuf_(nullptr) {}
_ZNSt3__119istreambuf_iteratorIcNS_11char_traitsIcEEEC2B8ne180100ERNS_13basic_istreamIcS2_EE:
   71|  1.32k|  _LIBCPP_HIDE_FROM_ABI istreambuf_iterator(istream_type& __s) _NOEXCEPT : __sbuf_(__s.rdbuf()) {}
_ZNSt3__1eqB8ne180100IcNS_11char_traitsIcEEEEbRKNS_19istreambuf_iteratorIT_T0_EES8_:
   95|   254k|operator==(const istreambuf_iterator<_CharT, _Traits>& __a, const istreambuf_iterator<_CharT, _Traits>& __b) {
   96|   254k|  return __a.equal(__b);
   97|   254k|}
_ZNKSt3__119istreambuf_iteratorIcNS_11char_traitsIcEEE5equalB8ne180100ERKS3_:
   82|   254k|  _LIBCPP_HIDE_FROM_ABI bool equal(const istreambuf_iterator& __b) const {
   83|   254k|    return __test_for_eof() == __b.__test_for_eof();
   84|   254k|  }
_ZNKSt3__119istreambuf_iteratorIcNS_11char_traitsIcEEE14__test_for_eofB8ne180100Ev:
   60|   508k|  _LIBCPP_HIDE_FROM_ABI bool __test_for_eof() const {
   61|   508k|    if (__sbuf_ && traits_type::eq_int_type(__sbuf_->sgetc(), traits_type::eof()))
  ------------------
  |  Branch (61:9): [True: 254k, False: 254k]
  |  Branch (61:20): [True: 122, False: 254k]
  ------------------
   62|    122|      __sbuf_ = nullptr;
   63|   508k|    return __sbuf_ == nullptr;
   64|   508k|  }
_ZNSt3__119istreambuf_iteratorIcNS_11char_traitsIcEEEppB8ne180100Ev:
   76|   251k|  _LIBCPP_HIDE_FROM_ABI istreambuf_iterator& operator++() {
   77|   251k|    __sbuf_->sbumpc();
   78|   251k|    return *this;
   79|   251k|  }
_ZNKSt3__119istreambuf_iteratorIcNS_11char_traitsIcEEEdeB8ne180100Ev:
   75|   252k|  _LIBCPP_HIDE_FROM_ABI char_type operator*() const { return static_cast<char_type>(__sbuf_->sgetc()); }

_ZNSt3__119ostreambuf_iteratorIcNS_11char_traitsIcEEEC2B8ne180100ERNS_13basic_ostreamIcS2_EE:
   53|    492|  _LIBCPP_HIDE_FROM_ABI ostreambuf_iterator(ostream_type& __s) _NOEXCEPT : __sbuf_(__s.rdbuf()) {}
_ZNKSt3__119ostreambuf_iteratorIcNS_11char_traitsIcEEE6failedB8ne180100Ev:
   63|    492|  _LIBCPP_HIDE_FROM_ABI bool failed() const _NOEXCEPT { return __sbuf_ == nullptr; }

_ZNSt3__16localeC2B8ne180100ENS0_13__private_tagEPNS0_5__impE:
  122|      1|  _LIBCPP_HIDE_FROM_ABI explicit locale(__private_tag, __imp* __loc) : __locale_(__loc) {}
_ZNSt3__16locale5facetC2B8ne180100Em:
  137|     31|  _LIBCPP_HIDE_FROM_ABI explicit facet(size_t __refs = 0) : __shared_count(static_cast<long>(__refs) - 1) {}
_ZNSt3__110ctype_baseC2B8ne180100Ev:
  460|      2|  _LIBCPP_HIDE_FROM_ABI ctype_base() {}
_ZNSt3__15ctypeIwEC2B8ne180100Em:
  476|      1|  _LIBCPP_HIDE_FROM_ABI explicit ctype(size_t __refs = 0) : locale::facet(__refs) {}
_ZNKSt3__15ctypeIcE2isB8ne180100Etc:
  547|  15.2k|  _LIBCPP_HIDE_FROM_ABI bool is(mask __m, char_type __c) const {
  548|  15.2k|    return isascii(__c) ? (__tab_[static_cast<int>(__c)] & __m) != 0 : false;
  ------------------
  |  Branch (548:12): [True: 15.2k, False: 34]
  ------------------
  549|  15.2k|  }
_ZNKSt3__15ctypeIcE5widenB8ne180100Ec:
  583|    302|  _LIBCPP_HIDE_FROM_ABI char_type widen(char __c) const { return do_widen(__c); }
_ZNKSt3__15ctypeIcE5widenB8ne180100EPKcS3_Pc:
  585|  1.15k|  _LIBCPP_HIDE_FROM_ABI const char* widen(const char* __low, const char* __high, char_type* __to) const {
  586|  1.15k|    return do_widen(__low, __high, __to);
  587|  1.15k|  }
_ZNSt3__112codecvt_baseC2B8ne180100Ev:
  752|      6|  _LIBCPP_HIDE_FROM_ABI codecvt_base() {}
_ZNSt3__17codecvtIcc11__mbstate_tEC2B8ne180100Em:
  770|      1|  _LIBCPP_HIDE_FROM_ABI explicit codecvt(size_t __refs = 0) : locale::facet(__refs) {}
_ZNSt3__17codecvtIDsc11__mbstate_tEC2B8ne180100Em:
  933|      1|  _LIBCPP_HIDE_FROM_ABI explicit codecvt(size_t __refs = 0) : locale::facet(__refs) {}
_ZNSt3__17codecvtIDsDu11__mbstate_tEC2B8ne180100Em:
 1014|      1|  _LIBCPP_HIDE_FROM_ABI explicit codecvt(size_t __refs = 0) : locale::facet(__refs) {}
_ZNSt3__17codecvtIDic11__mbstate_tEC2B8ne180100Em:
 1096|      1|  _LIBCPP_HIDE_FROM_ABI explicit codecvt(size_t __refs = 0) : locale::facet(__refs) {}
_ZNSt3__17codecvtIDiDu11__mbstate_tEC2B8ne180100Em:
 1177|      1|  _LIBCPP_HIDE_FROM_ABI explicit codecvt(size_t __refs = 0) : locale::facet(__refs) {}
_ZNKSt3__18numpunctIcE13thousands_sepB8ne180100Ev:
 1439|    661|  _LIBCPP_HIDE_FROM_ABI char_type thousands_sep() const { return do_thousands_sep(); }
_ZNKSt3__18numpunctIcE8groupingB8ne180100Ev:
 1440|  1.15k|  _LIBCPP_HIDE_FROM_ABI string grouping() const { return do_grouping(); }
_ZNSt3__19use_facetB8ne180100INS_5ctypeIcEEEERKT_RKNS_6localeE:
  185|  2.12k|inline _LIBCPP_HIDE_FROM_ABI const _Facet& use_facet(const locale& __l) {
  186|  2.12k|  return static_cast<const _Facet&>(*__l.use_facet(_Facet::id));
  187|  2.12k|}
_ZNSt3__19use_facetB8ne180100INS_7num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEEEERKT_RKNS_6localeE:
  185|    661|inline _LIBCPP_HIDE_FROM_ABI const _Facet& use_facet(const locale& __l) {
  186|    661|  return static_cast<const _Facet&>(*__l.use_facet(_Facet::id));
  187|    661|}
_ZNSt3__19use_facetB8ne180100INS_7num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEEEERKT_RKNS_6localeE:
  185|    492|inline _LIBCPP_HIDE_FROM_ABI const _Facet& use_facet(const locale& __l) {
  186|    492|  return static_cast<const _Facet&>(*__l.use_facet(_Facet::id));
  187|    492|}
_ZNSt3__17collateIcEC2B8ne180100Em:
  197|      1|  _LIBCPP_HIDE_FROM_ABI explicit collate(size_t __refs = 0) : locale::facet(__refs) {}
_ZNSt3__17collateIwEC2B8ne180100Em:
  197|      1|  _LIBCPP_HIDE_FROM_ABI explicit collate(size_t __refs = 0) : locale::facet(__refs) {}
_ZNSt3__19use_facetB8ne180100INS_8numpunctIcEEEERKT_RKNS_6localeE:
  185|  1.15k|inline _LIBCPP_HIDE_FROM_ABI const _Facet& use_facet(const locale& __l) {
  186|  1.15k|  return static_cast<const _Facet&>(*__l.use_facet(_Facet::id));
  187|  1.15k|}

_ZNSt3__119__libcpp_snprintf_lEPcmP15__locale_structPKcz:
   95|    492|    char* __s, size_t __n, locale_t __l, const char* __format, ...) {
   96|    492|  va_list __va;
   97|    492|  va_start(__va, __format);
   98|    492|  __libcpp_locale_guard __current(__l);
   99|    492|  int __res = vsnprintf(__s, __n, __format, __va);
  100|       |  va_end(__va);
  101|    492|  return __res;
  102|    492|}

_ZNSt3__121__libcpp_locale_guardC2B8ne180100ERP15__locale_struct:
   24|    492|  _LIBCPP_HIDE_FROM_ABI __libcpp_locale_guard(locale_t& __loc) : __old_loc_(uselocale(__loc)) {}
_ZNSt3__121__libcpp_locale_guardD2B8ne180100Ev:
   26|    492|  _LIBCPP_HIDE_FROM_ABI ~__libcpp_locale_guard() {
   27|    492|    if (__old_loc_)
  ------------------
  |  Branch (27:9): [True: 492, False: 0]
  ------------------
   28|    492|      uselocale(__old_loc_);
   29|    492|  }

_ZNSt3__122__libcpp_aligned_allocB8ne180100Emm:
   30|   180k|inline _LIBCPP_HIDE_FROM_ABI void* __libcpp_aligned_alloc(std::size_t __alignment, std::size_t __size) {
   31|       |#  if defined(_LIBCPP_MSVCRT_LIKE)
   32|       |  return ::_aligned_malloc(__size, __alignment);
   33|       |#  elif _LIBCPP_STD_VER >= 17 && !defined(_LIBCPP_HAS_NO_C11_ALIGNED_ALLOC)
   34|       |  // aligned_alloc() requires that __size is a multiple of __alignment,
   35|       |  // but for C++ [new.delete.general], only states "if the value of an
   36|       |  // alignment argument passed to any of these functions is not a valid
   37|       |  // alignment value, the behavior is undefined".
   38|       |  // To handle calls such as ::operator new(1, std::align_val_t(128)), we
   39|       |  // round __size up to the next multiple of __alignment.
   40|   180k|  size_t __rounded_size = (__size + __alignment - 1) & ~(__alignment - 1);
   41|       |  // Rounding up could have wrapped around to zero, so we have to add another
   42|       |  // max() ternary to the actual call site to avoid succeeded in that case.
   43|   180k|  return ::aligned_alloc(__alignment, __size > __rounded_size ? __size : __rounded_size);
  ------------------
  |  Branch (43:39): [True: 0, False: 180k]
  ------------------
   44|       |#  else
   45|       |  void* __result = nullptr;
   46|       |  (void)::posix_memalign(&__result, __alignment, __size);
   47|       |  // If posix_memalign fails, __result is unmodified so we still return `nullptr`.
   48|       |  return __result;
   49|       |#  endif
   50|   180k|}
_ZNSt3__121__libcpp_aligned_freeB8ne180100EPv:
   52|   180k|inline _LIBCPP_HIDE_FROM_ABI void __libcpp_aligned_free(void* __ptr) {
   53|       |#  if defined(_LIBCPP_MSVCRT_LIKE)
   54|       |  ::_aligned_free(__ptr);
   55|       |#  else
   56|   180k|  ::free(__ptr);
   57|   180k|#  endif
   58|   180k|}

_ZNSt3__117allocate_at_leastB8ne180100INS_9allocatorIcEEEENS_17allocation_resultINS_16allocator_traitsIT_E7pointerEEERS5_m:
   32|  19.7k|allocate_at_least(_Alloc& __alloc, size_t __n) {
   33|  19.7k|  if constexpr (requires { __alloc.allocate_at_least(__n); }) {
   34|  19.7k|    return __alloc.allocate_at_least(__n);
   35|       |  } else {
   36|       |    return {__alloc.allocate(__n), __n};
   37|       |  }
   38|  19.7k|}
_ZNSt3__119__allocate_at_leastB8ne180100INS_9allocatorIcEEEEDaRT_m:
   41|  19.7k|[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto __allocate_at_least(_Alloc& __alloc, size_t __n) {
   42|  19.7k|  return std::allocate_at_least(__alloc, __n);
   43|  19.7k|}
_ZNSt3__119__allocate_at_leastB8ne180100INS_15__sso_allocatorIPNS_6locale5facetELm30EEEEEDaRT_m:
   41|      1|[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto __allocate_at_least(_Alloc& __alloc, size_t __n) {
   42|      1|  return std::allocate_at_least(__alloc, __n);
   43|      1|}
_ZNSt3__117allocate_at_leastB8ne180100INS_15__sso_allocatorIPNS_6locale5facetELm30EEEEENS_17allocation_resultINS_16allocator_traitsIT_E7pointerEEERS8_m:
   32|      1|allocate_at_least(_Alloc& __alloc, size_t __n) {
   33|       |  if constexpr (requires { __alloc.allocate_at_least(__n); }) {
   34|       |    return __alloc.allocate_at_least(__n);
   35|      1|  } else {
   36|      1|    return {__alloc.allocate(__n), __n};
   37|      1|  }
   38|      1|}

_ZNSt3__19allocatorIcE8allocateB8ne180100Em:
  119|  19.7k|  _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _Tp* allocate(size_t __n) {
  120|  19.7k|    if (__n > allocator_traits<allocator>::max_size(*this))
  ------------------
  |  Branch (120:9): [True: 0, False: 19.7k]
  ------------------
  121|      0|      __throw_bad_array_new_length();
  122|  19.7k|    if (__libcpp_is_constant_evaluated()) {
  ------------------
  |  Branch (122:9): [Folded, False: 19.7k]
  ------------------
  123|      0|      return static_cast<_Tp*>(::operator new(__n * sizeof(_Tp)));
  124|  19.7k|    } else {
  125|  19.7k|      return static_cast<_Tp*>(std::__libcpp_allocate(__n * sizeof(_Tp), _LIBCPP_ALIGNOF(_Tp)));
  ------------------
  |  |  616|  19.7k|#    define _LIBCPP_ALIGNOF(_Tp) alignof(_Tp)
  ------------------
  126|  19.7k|    }
  127|  19.7k|  }
_ZNSt3__19allocatorIcE17allocate_at_leastB8ne180100Em:
  130|  19.7k|  [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr allocation_result<_Tp*> allocate_at_least(size_t __n) {
  131|  19.7k|    return {allocate(__n), __n};
  132|  19.7k|  }
_ZNSt3__19allocatorIcE10deallocateB8ne180100EPcm:
  135|    441|  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void deallocate(_Tp* __p, size_t __n) _NOEXCEPT {
  136|    441|    if (__libcpp_is_constant_evaluated()) {
  ------------------
  |  Branch (136:9): [Folded, False: 441]
  ------------------
  137|      0|      ::operator delete(__p);
  138|    441|    } else {
  139|    441|      std::__libcpp_deallocate((void*)__p, __n * sizeof(_Tp), _LIBCPP_ALIGNOF(_Tp));
  ------------------
  |  |  616|    441|#    define _LIBCPP_ALIGNOF(_Tp) alignof(_Tp)
  ------------------
  140|    441|    }
  141|    441|  }
_ZNSt3__19allocatorIcEC2B8ne180100Ev:
  114|  19.9k|  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 allocator() _NOEXCEPT = default;
_ZNSt3__116__non_trivial_ifILb1ENS_9allocatorIcEEEC2B8ne180100Ev:
   93|  19.9k|  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR __non_trivial_if() _NOEXCEPT {}

_ZNSt3__116allocator_traitsINS_9allocatorIcEEE8max_sizeB8ne180100IS2_vvEEmRKS2_:
  326|  39.4k|  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 static size_type max_size(const allocator_type&) _NOEXCEPT {
  327|  39.4k|    return numeric_limits<size_type>::max() / sizeof(value_type);
  328|  39.4k|  }
_ZNSt3__116allocator_traitsINS_9allocatorIcEEE10deallocateB8ne180100ERS2_Pcm:
  288|    441|  deallocate(allocator_type& __a, pointer __p, size_type __n) _NOEXCEPT {
  289|    441|    __a.deallocate(__p, __n);
  290|    441|  }
_ZNSt3__116allocator_traitsINS_9allocatorIcEEE37select_on_container_copy_constructionB8ne180100IS2_vvEES2_RKS2_:
  339|  1.15k|  select_on_container_copy_construction(const allocator_type& __a) {
  340|  1.15k|    return __a;
  341|  1.15k|  }
_ZNSt3__116allocator_traitsINS_15__sso_allocatorIPNS_6locale5facetELm30EEEE8max_sizeB8ne180100IS5_vEEmRKS5_:
  320|      1|  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 static size_type max_size(const allocator_type& __a) _NOEXCEPT {
  321|      1|    _LIBCPP_SUPPRESS_DEPRECATED_PUSH
  322|      1|    return __a.max_size();
  323|      1|    _LIBCPP_SUPPRESS_DEPRECATED_POP
  324|      1|  }
_ZNSt3__116allocator_traitsINS_15__sso_allocatorIPNS_6locale5facetELm30EEEE9constructB8ne180100IS4_JEvvEEvRS5_PT_DpOT0_:
  304|     60|  construct(allocator_type&, _Tp* __p, _Args&&... __args) {
  305|     60|    std::__construct_at(__p, std::forward<_Args>(__args)...);
  306|     60|  }
_ZNSt3__116allocator_traitsINS_15__sso_allocatorIPNS_6locale5facetELm30EEEE7destroyB8ne180100IS4_vvEEvRS5_PT_:
  315|     30|  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 static void destroy(allocator_type&, _Tp* __p) {
  316|     30|    std::__destroy_at(__p);
  317|     30|  }

_ZNSt3__122__compressed_pair_elemINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE5__repELi0ELb0EE5__getB8ne180100Ev:
   63|  90.3k|  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 reference __get() _NOEXCEPT { return __value_; }
_ZNSt3__117__compressed_pairINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE5__repES5_E5firstB8ne180100Ev:
  129|  90.3k|  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 typename _Base1::reference first() _NOEXCEPT {
  130|  90.3k|    return static_cast<_Base1&>(*this).__get();
  131|  90.3k|  }
_ZNKSt3__122__compressed_pair_elemINS_9allocatorIcEELi1ELb1EE5__getB8ne180100Ev:
   93|  20.9k|  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR const_reference __get() const _NOEXCEPT { return *this; }
_ZNKSt3__117__compressed_pairINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE5__repES5_E6secondB8ne180100Ev:
  141|  20.9k|  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR typename _Base2::const_reference second() const _NOEXCEPT {
  142|  20.9k|    return static_cast<_Base2 const&>(*this).__get();
  143|  20.9k|  }
_ZNSt3__122__compressed_pair_elemINS_9allocatorIcEELi1ELb1EE5__getB8ne180100Ev:
   92|  20.1k|  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 reference __get() _NOEXCEPT { return *this; }
_ZNSt3__117__compressed_pairINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE5__repES5_E6secondB8ne180100Ev:
  137|  20.1k|  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 typename _Base2::reference second() _NOEXCEPT {
  138|  20.1k|    return static_cast<_Base2&>(*this).__get();
  139|  20.1k|  }
_ZNKSt3__122__compressed_pair_elemINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE5__repELi0ELb0EE5__getB8ne180100Ev:
   64|   988k|  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR const_reference __get() const _NOEXCEPT { return __value_; }
_ZNKSt3__117__compressed_pairINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE5__repES5_E5firstB8ne180100Ev:
  133|   988k|  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR typename _Base1::const_reference first() const _NOEXCEPT {
  134|   988k|    return static_cast<_Base1 const&>(*this).__get();
  135|   988k|  }
_ZNSt3__117__compressed_pairINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE5__repES5_EC2B8ne180100INS_18__default_init_tagES5_EEOT_OT0_:
  119|  1.15k|      : _Base1(std::forward<_U1>(__t1)), _Base2(std::forward<_U2>(__t2)) {}
_ZNSt3__122__compressed_pair_elemINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE5__repELi0ELb0EEC2B8ne180100ENS_18__default_init_tagE:
   49|  20.4k|  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR explicit __compressed_pair_elem(__default_init_tag) {}
_ZNSt3__122__compressed_pair_elemINS_9allocatorIcEELi1ELb1EEC2B8ne180100IS2_vEEOT_:
   83|  1.15k|      : __value_type(std::forward<_Up>(__u)) {}
_ZNSt3__117__compressed_pairINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE5__repES5_EC2B8ne180100INS_18__default_init_tagESA_EEOT_OT0_:
  119|  19.2k|      : _Base1(std::forward<_U1>(__t1)), _Base2(std::forward<_U2>(__t2)) {}
_ZNSt3__122__compressed_pair_elemINS_9allocatorIcEELi1ELb1EEC2B8ne180100ENS_18__default_init_tagE:
   78|  19.9k|  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR explicit __compressed_pair_elem(__default_init_tag) {}
_ZNSt3__117__compressed_pairINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE5__repES5_EC2B8ne180100INS_16__value_init_tagENS_18__default_init_tagEEEOT_OT0_:
  119|    663|      : _Base1(std::forward<_U1>(__t1)), _Base2(std::forward<_U2>(__t2)) {}
_ZNSt3__122__compressed_pair_elemINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE5__repELi0ELb0EEC2B8ne180100ENS_16__value_init_tagE:
   50|    663|  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR explicit __compressed_pair_elem(__value_init_tag) : __value_() {}
_ZNSt3__117__compressed_pairIPPNS_6locale5facetENS_15__sso_allocatorIS3_Lm30EEEEC2B8ne180100IDnNS_18__default_init_tagEEEOT_OT0_:
  119|      1|      : _Base1(std::forward<_U1>(__t1)), _Base2(std::forward<_U2>(__t2)) {}
_ZNSt3__122__compressed_pair_elemIPPNS_6locale5facetELi0ELb0EEC2B8ne180100IDnvEEOT_:
   54|      1|      : __value_(std::forward<_Up>(__u)) {}
_ZNSt3__122__compressed_pair_elemINS_15__sso_allocatorIPNS_6locale5facetELm30EEELi1ELb0EEC2B8ne180100ENS_18__default_init_tagE:
   49|      1|  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR explicit __compressed_pair_elem(__default_init_tag) {}
_ZNKSt3__117__compressed_pairIPPNS_6locale5facetENS_15__sso_allocatorIS3_Lm30EEEE6secondB8ne180100Ev:
  141|      1|  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR typename _Base2::const_reference second() const _NOEXCEPT {
  142|      1|    return static_cast<_Base2 const&>(*this).__get();
  143|      1|  }
_ZNKSt3__122__compressed_pair_elemINS_15__sso_allocatorIPNS_6locale5facetELm30EEELi1ELb0EE5__getB8ne180100Ev:
   64|      1|  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR const_reference __get() const _NOEXCEPT { return __value_; }
_ZNSt3__117__compressed_pairIPPNS_6locale5facetENS_15__sso_allocatorIS3_Lm30EEEE6secondB8ne180100Ev:
  137|     91|  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 typename _Base2::reference second() _NOEXCEPT {
  138|     91|    return static_cast<_Base2&>(*this).__get();
  139|     91|  }
_ZNSt3__122__compressed_pair_elemINS_15__sso_allocatorIPNS_6locale5facetELm30EEELi1ELb0EE5__getB8ne180100Ev:
   63|     91|  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 reference __get() _NOEXCEPT { return __value_; }
_ZNSt3__117__compressed_pairIPPNS_6locale5facetENS_15__sso_allocatorIS3_Lm30EEEE5firstB8ne180100Ev:
  129|     31|  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 typename _Base1::reference first() _NOEXCEPT {
  130|     31|    return static_cast<_Base1&>(*this).__get();
  131|     31|  }
_ZNSt3__122__compressed_pair_elemIPPNS_6locale5facetELi0ELb0EE5__getB8ne180100Ev:
   63|     31|  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 reference __get() _NOEXCEPT { return __value_; }
locale.cpp:_ZNSt3__117__compressed_pairIPNS_6locale5facetENS_12_GLOBAL__N_18releaserEEC2B8ne180100IRS3_NS_16__value_init_tagEEEOT_OT0_:
  119|     30|      : _Base1(std::forward<_U1>(__t1)), _Base2(std::forward<_U2>(__t2)) {}
_ZNSt3__122__compressed_pair_elemIPNS_6locale5facetELi0ELb0EEC2B8ne180100IRS3_vEEOT_:
   54|     30|      : __value_(std::forward<_Up>(__u)) {}
locale.cpp:_ZNSt3__122__compressed_pair_elemINS_12_GLOBAL__N_18releaserELi1ELb1EEC2B8ne180100ENS_16__value_init_tagE:
   79|     30|  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR explicit __compressed_pair_elem(__value_init_tag) : __value_type() {}
locale.cpp:_ZNSt3__117__compressed_pairIPNS_6locale5facetENS_12_GLOBAL__N_18releaserEE5firstB8ne180100Ev:
  129|    120|  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 typename _Base1::reference first() _NOEXCEPT {
  130|    120|    return static_cast<_Base1&>(*this).__get();
  131|    120|  }
_ZNSt3__122__compressed_pair_elemIPNS_6locale5facetELi0ELb0EE5__getB8ne180100Ev:
   63|    120|  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 reference __get() _NOEXCEPT { return __value_; }

_ZNSt3__114__construct_atB8ne180100IPNS_6locale5facetEJEPS3_EEPT_S6_DpOT0_:
   47|     60|_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR _Tp* __construct_at(_Tp* __location, _Args&&... __args) {
   48|     60|#if _LIBCPP_STD_VER >= 20
   49|     60|  return std::construct_at(__location, std::forward<_Args>(__args)...);
   50|       |#else
   51|       |  return _LIBCPP_ASSERT_NON_NULL(__location != nullptr, "null pointer given to construct_at"),
   52|       |         ::new (std::__voidify(*__location)) _Tp(std::forward<_Args>(__args)...);
   53|       |#endif
   54|     60|}
_ZNSt3__112construct_atB8ne180100IPNS_6locale5facetEJEPS3_EEPT_S6_DpOT0_:
   39|     60|_LIBCPP_HIDE_FROM_ABI constexpr _Tp* construct_at(_Tp* __location, _Args&&... __args) {
   40|     60|  _LIBCPP_ASSERT_NON_NULL(__location != nullptr, "null pointer given to construct_at");
  ------------------
  |  |  409|     60|#    define _LIBCPP_ASSERT_NON_NULL(expression, message)                  _LIBCPP_ASSUME(expression)
  |  |  ------------------
  |  |  |  |   34|     60|#  define _LIBCPP_ASSUME(expression) ((void)0)
  |  |  ------------------
  ------------------
   41|     60|  return ::new (std::__voidify(*__location)) _Tp(std::forward<_Args>(__args)...);
   42|     60|}
_ZNSt3__112__destroy_atB8ne180100IPNS_6locale5facetETnNS_9enable_ifIXntsr8is_arrayIT_EE5valueEiE4typeELi0EEEvPS5_:
   65|     30|_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void __destroy_at(_Tp* __loc) {
   66|     30|  _LIBCPP_ASSERT_NON_NULL(__loc != nullptr, "null pointer given to destroy_at");
  ------------------
  |  |  409|     30|#    define _LIBCPP_ASSERT_NON_NULL(expression, message)                  _LIBCPP_ASSUME(expression)
  |  |  ------------------
  |  |  |  |   34|     30|#  define _LIBCPP_ASSUME(expression) ((void)0)
  |  |  ------------------
  ------------------
   67|     30|  __loc->~_Tp();
   68|     30|}

_ZNSt3__112__to_addressB8ne180100IKcEEPT_S3_:
  180|  63.9k|_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR _Tp* __to_address(_Tp* __p) _NOEXCEPT {
  181|  63.9k|  static_assert(!is_function<_Tp>::value, "_Tp is a function type");
  182|  63.9k|  return __p;
  183|  63.9k|}
_ZNSt3__112__to_addressB8ne180100IcEEPT_S2_:
  180|   777k|_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR _Tp* __to_address(_Tp* __p) _NOEXCEPT {
  181|   777k|  static_assert(!is_function<_Tp>::value, "_Tp is a function type");
  182|   777k|  return __p;
  183|   777k|}
_ZNSt3__114pointer_traitsIPcE10pointer_toB8ne180100ERc:
  161|  3.59k|  pointer_to(__conditional_t<is_void<element_type>::value, __nat, element_type>& __r) _NOEXCEPT {
  162|  3.59k|    return std::addressof(__r);
  163|  3.59k|  }
_ZNSt3__112__to_addressB8ne180100IPNS_6locale5facetEEEPT_S5_:
  180|     90|_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR _Tp* __to_address(_Tp* __p) _NOEXCEPT {
  181|     90|  static_assert(!is_function<_Tp>::value, "_Tp is a function type");
  182|     90|  return __p;
  183|     90|}

_ZNSt3__114__shared_countC2B8ne180100El:
  148|     31|  _LIBCPP_HIDE_FROM_ABI explicit __shared_count(long __refs = 0) _NOEXCEPT : __shared_owners_(__refs) {}
_ZNSt3__114__shared_count12__add_sharedB8ne180100Ev:
  154|     30|  _LIBCPP_HIDE_FROM_ABI void __add_shared() _NOEXCEPT { __libcpp_atomic_refcount_increment(__shared_owners_); }
_ZNSt3__134__libcpp_atomic_refcount_incrementB8ne180100IlEET_RS1_:
   99|     30|inline _LIBCPP_HIDE_FROM_ABI _Tp __libcpp_atomic_refcount_increment(_Tp& __t) _NOEXCEPT {
  100|     30|#if defined(_LIBCPP_HAS_BUILTIN_ATOMIC_SUPPORT) && !defined(_LIBCPP_HAS_NO_THREADS)
  101|     30|  return __atomic_add_fetch(&__t, 1, __ATOMIC_RELAXED);
  102|       |#else
  103|       |  return __t += 1;
  104|       |#endif
  105|     30|}
_ZNSt3__121__libcpp_acquire_loadB8ne180100ImEET_PKS1_:
   89|  4.53k|inline _LIBCPP_HIDE_FROM_ABI _ValueType __libcpp_acquire_load(_ValueType const* __value) {
   90|  4.53k|#if !defined(_LIBCPP_HAS_NO_THREADS) && defined(__ATOMIC_ACQUIRE) &&                                                   \
   91|  4.53k|    (__has_builtin(__atomic_load_n) || defined(_LIBCPP_COMPILER_GCC))
   92|  4.53k|  return __atomic_load_n(__value, __ATOMIC_ACQUIRE);
   93|       |#else
   94|       |  return *__value;
   95|       |#endif
   96|  4.53k|}

locale.cpp:_ZNSt3__110unique_ptrINS_6locale5facetENS_12_GLOBAL__N_18releaserEEC2B8ne180100ILb1EvEEPS2_:
  175|     30|      : __ptr_(__p, __value_init_tag()) {}
locale.cpp:_ZNSt3__110unique_ptrINS_6locale5facetENS_12_GLOBAL__N_18releaserEED2B8ne180100Ev:
  236|     30|  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 ~unique_ptr() { reset(); }
locale.cpp:_ZNSt3__110unique_ptrINS_6locale5facetENS_12_GLOBAL__N_18releaserEE5resetB8ne180100EPS2_:
  262|     30|  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 void reset(pointer __p = pointer()) _NOEXCEPT {
  263|     30|    pointer __tmp  = __ptr_.first();
  264|     30|    __ptr_.first() = __p;
  265|     30|    if (__tmp)
  ------------------
  |  Branch (265:9): [True: 0, False: 30]
  ------------------
  266|      0|      __ptr_.second()(__tmp);
  267|     30|  }
locale.cpp:_ZNSt3__110unique_ptrINS_6locale5facetENS_12_GLOBAL__N_18releaserEE7releaseB8ne180100Ev:
  256|     30|  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 pointer release() _NOEXCEPT {
  257|     30|    pointer __t    = __ptr_.first();
  258|     30|    __ptr_.first() = pointer();
  259|     30|    return __t;
  260|     30|  }

_ZNSt3__19__voidifyB8ne180100IPNS_6locale5facetEEEPvRT_:
   23|     60|_LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void* __voidify(_Tp& __from) {
   24|       |  // Cast away cv-qualifiers to allow modifying elements of a range through const iterators.
   25|     60|  return const_cast<void*>(static_cast<const volatile void*>(std::addressof(__from)));
   26|     60|}

locale.cpp:_ZNSt3__19call_onceB8ne180100IZNS_6locale2id5__getEvE3$_0JEEEvRNS_9once_flagEOT_DpOT0_:
  126|  4.53k|inline _LIBCPP_HIDE_FROM_ABI void call_once(once_flag& __flag, _Callable&& __func, _Args&&... __args) {
  127|  4.53k|  if (__libcpp_acquire_load(&__flag.__state_) != once_flag::_Complete) {
  ------------------
  |  Branch (127:7): [True: 30, False: 4.50k]
  ------------------
  128|     30|    typedef tuple<_Callable&&, _Args&&...> _Gp;
  129|     30|    _Gp __f(std::forward<_Callable>(__func), std::forward<_Args>(__args)...);
  130|     30|    __call_once_param<_Gp> __p(__f);
  131|     30|    std::__call_once(__flag.__state_, &__p, &__call_once_proxy<_Gp>);
  132|     30|  }
  133|  4.53k|}
locale.cpp:_ZNSt3__117__call_once_paramINS_5tupleIJOZNS_6locale2id5__getEvE3$_0EEEEC2B8ne180100ERS6_:
   87|     30|  _LIBCPP_HIDE_FROM_ABI explicit __call_once_param(_Fp& __f) : __f_(__f) {}
locale.cpp:_ZNSt3__117__call_once_proxyB8ne180100INS_5tupleIJOZNS_6locale2id5__getEvE3$_0EEEEEvPv:
  116|     30|void _LIBCPP_HIDE_FROM_ABI __call_once_proxy(void* __vp) {
  117|     30|  __call_once_param<_Fp>* __p = static_cast<__call_once_param<_Fp>*>(__vp);
  118|     30|  (*__p)();
  119|     30|}
locale.cpp:_ZNSt3__117__call_once_paramINS_5tupleIJOZNS_6locale2id5__getEvE3$_0EEEEclB8ne180100Ev:
   89|     30|  _LIBCPP_HIDE_FROM_ABI void operator()() {
   90|     30|    typedef typename __make_tuple_indices<tuple_size<_Fp>::value, 1>::type _Index;
   91|     30|    __execute(_Index());
   92|     30|  }
locale.cpp:_ZNSt3__117__call_once_paramINS_5tupleIJOZNS_6locale2id5__getEvE3$_0EEEE9__executeB8ne180100ITpTnmJEEEvNS_15__tuple_indicesIJXspT_EEEE:
   96|     30|  _LIBCPP_HIDE_FROM_ABI void __execute(__tuple_indices<_Indices...>) {
   97|     30|    std::__invoke(std::get<0>(std::move(__f_)), std::get<_Indices>(std::move(__f_))...);
   98|     30|  }

_ZNSt3__111char_traitsIcE6lengthB8ne180100EPKc:
  226|  19.2k|  static inline _LIBCPP_HIDE_FROM_ABI size_t _LIBCPP_CONSTEXPR_SINCE_CXX17 length(const char_type* __s) _NOEXCEPT {
  227|  19.2k|    return std::__constexpr_strlen(__s);
  228|  19.2k|  }
_ZNSt3__111char_traitsIcE6assignB8ne180100ERcRKc:
  189|  22.5k|  assign(char_type& __c1, const char_type& __c2) _NOEXCEPT {
  190|  22.5k|    __c1 = __c2;
  191|  22.5k|  }
_ZNSt3__111char_traitsIcE4moveB8ne180100EPcPKcm:
  238|    560|  move(char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT {
  239|    560|    return std::__constexpr_memmove(__s1, __s2, __element_count(__n));
  240|    560|  }
_ZNSt3__111char_traitsIcE4copyB8ne180100EPcPKcm:
  243|  21.3k|  copy(char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT {
  244|  21.3k|    _LIBCPP_ASSERT_NON_OVERLAPPING_RANGES(!std::__is_pointer_in_range(__s1, __s1 + __n, __s2),
  ------------------
  |  |  410|  21.3k|#    define _LIBCPP_ASSERT_NON_OVERLAPPING_RANGES(expression, message)    _LIBCPP_ASSUME(expression)
  |  |  ------------------
  |  |  |  |   34|  21.3k|#  define _LIBCPP_ASSUME(expression) ((void)0)
  |  |  ------------------
  ------------------
  245|  21.3k|                                          "char_traits::copy: source and destination ranges overlap");
  246|  21.3k|    std::copy_n(__s2, __n, __s1);
  247|  21.3k|    return __s1;
  248|  21.3k|  }
_ZNSt3__111char_traitsIcE6assignB8ne180100EPcmc:
  251|  1.84k|  assign(char_type* __s, size_t __n, char_type __a) _NOEXCEPT {
  252|  1.84k|    std::fill_n(__s, __n, __a);
  253|  1.84k|    return __s;
  254|  1.84k|  }
_ZNSt3__111char_traitsIcE12to_char_typeB8ne180100Ei:
  259|    438|  static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR char_type to_char_type(int_type __c) _NOEXCEPT {
  260|    438|    return char_type(__c);
  261|    438|  }
_ZNSt3__111char_traitsIcE11to_int_typeB8ne180100Ec:
  262|   759k|  static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR int_type to_int_type(char_type __c) _NOEXCEPT {
  263|   759k|    return int_type((unsigned char)__c);
  264|   759k|  }
_ZNSt3__111char_traitsIcE11eq_int_typeB8ne180100Eii:
  265|   255k|  static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool eq_int_type(int_type __c1, int_type __c2) _NOEXCEPT {
  266|   255k|    return __c1 == __c2;
  267|   255k|  }
_ZNSt3__111char_traitsIcE3eofB8ne180100Ev:
  268|   256k|  static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR int_type eof() _NOEXCEPT { return int_type(EOF); }

_ZNSt3__118__constexpr_strlenB8ne180100EPKc:
   38|  19.2k|inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 size_t __constexpr_strlen(const char* __str) {
   39|       |  // GCC currently doesn't support __builtin_strlen for heap-allocated memory during constant evaluation.
   40|       |  // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70816
   41|       |#ifdef _LIBCPP_COMPILER_GCC
   42|       |  if (__libcpp_is_constant_evaluated()) {
   43|       |    size_t __i = 0;
   44|       |    for (; __str[__i] != '\0'; ++__i)
   45|       |      ;
   46|       |    return __i;
   47|       |  }
   48|       |#endif
   49|  19.2k|  return __builtin_strlen(__str);
   50|  19.2k|}
_ZNSt3__119__constexpr_memmoveB8ne180100IcKcTnNS_9enable_ifIXsr23__is_always_bitcastableIT0_T_EE5valueEiE4typeELi0EEEPS4_S7_PS3_NS_15__element_countE:
  195|  21.9k|__constexpr_memmove(_Tp* __dest, _Up* __src, __element_count __n) {
  196|  21.9k|  size_t __count = static_cast<size_t>(__n);
  197|  21.9k|  if (__libcpp_is_constant_evaluated()) {
  ------------------
  |  Branch (197:7): [Folded, False: 21.9k]
  ------------------
  198|      0|#ifdef _LIBCPP_COMPILER_CLANG_BASED
  199|      0|    if (is_same<__remove_cv_t<_Tp>, __remove_cv_t<_Up> >::value) {
  ------------------
  |  Branch (199:9): [True: 0, Folded]
  ------------------
  200|      0|      ::__builtin_memmove(__dest, __src, __count * sizeof(_Tp));
  201|      0|      return __dest;
  202|      0|    }
  203|      0|#endif
  204|      0|    if (std::__is_pointer_in_range(__src, __src + __count, __dest)) {
  ------------------
  |  Branch (204:9): [True: 0, False: 0]
  ------------------
  205|      0|      for (; __count > 0; --__count)
  ------------------
  |  Branch (205:14): [True: 0, False: 0]
  ------------------
  206|      0|        std::__assign_trivially_copyable(__dest[__count - 1], __src[__count - 1]);
  207|      0|    } else {
  208|      0|      for (size_t __i = 0; __i != __count; ++__i)
  ------------------
  |  Branch (208:28): [True: 0, False: 0]
  ------------------
  209|      0|        std::__assign_trivially_copyable(__dest[__i], __src[__i]);
  210|      0|    }
  211|  21.9k|  } else if (__count > 0) {
  ------------------
  |  Branch (211:14): [True: 21.9k, False: 18.4E]
  ------------------
  212|  21.9k|    ::__builtin_memmove(__dest, __src, (__count - 1) * sizeof(_Tp) + __libcpp_datasizeof<_Tp>::value);
  213|  21.9k|  }
  214|  21.9k|  return __dest;
  215|  21.9k|}
_ZNSt3__118__constexpr_memchrB8ne180100IccEEPT_S2_T0_m:
  116|   237k|_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _Tp* __constexpr_memchr(_Tp* __str, _Up __value, size_t __count) {
  117|   237k|  static_assert(sizeof(_Tp) == 1 && __libcpp_is_trivially_equality_comparable<_Tp, _Up>::value,
  118|   237k|                "Calling memchr on non-trivially equality comparable types is unsafe.");
  119|       |
  120|   237k|  if (__libcpp_is_constant_evaluated()) {
  ------------------
  |  Branch (120:7): [Folded, False: 237k]
  ------------------
  121|       |// use __builtin_char_memchr to optimize constexpr evaluation if we can
  122|      0|#if _LIBCPP_STD_VER >= 17 && __has_builtin(__builtin_char_memchr)
  123|       |    if constexpr (is_same_v<remove_cv_t<_Tp>, char> && is_same_v<remove_cv_t<_Up>, char>)
  124|      0|      return __builtin_char_memchr(__str, __value, __count);
  125|      0|#endif
  126|       |
  127|      0|    for (; __count; --__count) {
  ------------------
  |  Branch (127:12): [True: 0, False: 0]
  ------------------
  128|      0|      if (*__str == __value)
  ------------------
  |  Branch (128:11): [True: 0, False: 0]
  ------------------
  129|      0|        return __str;
  130|      0|      ++__str;
  131|      0|    }
  132|      0|    return nullptr;
  133|   237k|  } else {
  134|   237k|    char __value_buffer = 0;
  135|   237k|    __builtin_memcpy(&__value_buffer, &__value, sizeof(char));
  136|   237k|    return static_cast<_Tp*>(__builtin_memchr(__str, __value_buffer, __count));
  137|   237k|  }
  138|   237k|}

_ZNSt3__116__libcpp_tls_setB8ne180100EjPv:
  352|     63|int __libcpp_tls_set(__libcpp_tls_key __key, void* __p) { return pthread_setspecific(__key, __p); }
_ZNSt3__121__libcpp_execute_onceB8ne180100EPiPFvvE:
  302|   521k|int __libcpp_execute_once(__libcpp_exec_once_flag* __flag, void (*__init_routine)()) {
  303|   521k|  return pthread_once(__flag, __init_routine);
  304|   521k|}
_ZNSt3__119__libcpp_tls_createB8ne180100EPjPFvPvE:
  346|      1|int __libcpp_tls_create(__libcpp_tls_key* __key, void (*__at_exit)(void*)) {
  347|      1|  return pthread_key_create(__key, __at_exit);
  348|      1|}
_ZNSt3__116__libcpp_tls_getB8ne180100Ej:
  350|   521k|void* __libcpp_tls_get(__libcpp_tls_key __key) { return pthread_getspecific(__key); }
_ZNSt3__119__libcpp_mutex_lockB8ne180100EP15pthread_mutex_t:
  280|     66|int __libcpp_mutex_lock(__libcpp_mutex_t* __m) { return pthread_mutex_lock(__m); }
_ZNSt3__121__libcpp_mutex_unlockB8ne180100EP15pthread_mutex_t:
  284|     66|int __libcpp_mutex_unlock(__libcpp_mutex_t* __m) { return pthread_mutex_unlock(__m); }
_ZNSt3__126__libcpp_condvar_broadcastB8ne180100EP14pthread_cond_t:
  291|     30|int __libcpp_condvar_broadcast(__libcpp_condvar_t* __cv) { return pthread_cond_broadcast(__cv); }

locale.cpp:_ZNSt3__18__invokeB8ne180100IZNS_6locale2id5__getEvE3$_0JEEEDTclclsr3stdE7declvalIT_EEspclsr3stdE7declvalIT0_EEEEOS4_DpOS5_:
  344|     30|               { return static_cast<_Fp&&>(__f)(static_cast<_Args&&>(__args)...); }

_ZNSt3__121__convert_to_integralB8ne180100Em:
   30|  1.84k|inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR unsigned long __convert_to_integral(unsigned long __val) {
   31|  1.84k|  return __val;
   32|  1.84k|}

_ZNSt3__122__make_exception_guardB8ne180100INS_6vectorIPNS_6locale5facetENS_15__sso_allocatorIS4_Lm30EEEE16__destroy_vectorEEENS_28__exception_guard_exceptionsIT_EESA_:
  136|      1|_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR __exception_guard<_Rollback> __make_exception_guard(_Rollback __rollback) {
  137|      1|  return __exception_guard<_Rollback>(std::move(__rollback));
  138|      1|}
_ZNSt3__128__exception_guard_exceptionsINS_6vectorIPNS_6locale5facetENS_15__sso_allocatorIS4_Lm30EEEE16__destroy_vectorEEC2B8ne180100ES8_:
   69|      1|      : __rollback_(std::move(__rollback)), __completed_(false) {}
_ZNSt3__128__exception_guard_exceptionsINS_6vectorIPNS_6locale5facetENS_15__sso_allocatorIS4_Lm30EEEE16__destroy_vectorEE10__completeB8ne180100Ev:
   82|      1|  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void __complete() _NOEXCEPT { __completed_ = true; }
_ZNSt3__128__exception_guard_exceptionsINS_6vectorIPNS_6locale5facetENS_15__sso_allocatorIS4_Lm30EEEE16__destroy_vectorEED2B8ne180100Ev:
   84|      1|  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 ~__exception_guard_exceptions() {
   85|      1|    if (!__completed_)
  ------------------
  |  Branch (85:9): [True: 0, False: 1]
  ------------------
   86|      0|      __rollback_();
   87|      1|  }
call_once.cpp:_ZNSt3__122__make_exception_guardB8ne180100IZNS_11__call_onceERVmPvPFvS3_EE3$_0EENS_28__exception_guard_exceptionsIT_EES8_:
  136|     30|_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR __exception_guard<_Rollback> __make_exception_guard(_Rollback __rollback) {
  137|     30|  return __exception_guard<_Rollback>(std::move(__rollback));
  138|     30|}
call_once.cpp:_ZNSt3__128__exception_guard_exceptionsIZNS_11__call_onceERVmPvPFvS3_EE3$_0EC2B8ne180100ES6_:
   69|     30|      : __rollback_(std::move(__rollback)), __completed_(false) {}
call_once.cpp:_ZNSt3__128__exception_guard_exceptionsIZNS_11__call_onceERVmPvPFvS3_EE3$_0E10__completeB8ne180100Ev:
   82|     30|  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void __complete() _NOEXCEPT { __completed_ = true; }
call_once.cpp:_ZNSt3__128__exception_guard_exceptionsIZNS_11__call_onceERVmPvPFvS3_EE3$_0ED2B8ne180100Ev:
   84|     30|  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 ~__exception_guard_exceptions() {
   85|     30|    if (!__completed_)
  ------------------
  |  Branch (85:9): [True: 0, False: 30]
  ------------------
   86|      0|      __rollback_();
   87|     30|  }

_ZNSt3__121__is_pointer_in_rangeB8ne180100IccTnNS_9enable_ifIXsr25__is_less_than_comparableIPKT_PKT0_EE5valueEiE4typeELi0EEEbS4_S4_S7_:
   36|    280|    const _Tp* __begin, const _Tp* __end, const _Up* __ptr) {
   37|    280|  if (__libcpp_is_constant_evaluated()) {
  ------------------
  |  Branch (37:7): [Folded, False: 280]
  ------------------
   38|      0|    _LIBCPP_ASSERT_VALID_INPUT_RANGE(__builtin_constant_p(__begin <= __end), "__begin and __end do not form a range");
  ------------------
  |  |  407|      0|#    define _LIBCPP_ASSERT_VALID_INPUT_RANGE(expression, message)         _LIBCPP_ASSUME(expression)
  |  |  ------------------
  |  |  |  |   34|      0|#  define _LIBCPP_ASSUME(expression) ((void)0)
  |  |  ------------------
  ------------------
   39|       |
   40|       |    // If this is not a constant during constant evaluation we know that __ptr is not part of the allocation where
   41|       |    // [__begin, __end) is.
   42|      0|    if (!__builtin_constant_p(__begin <= __ptr && __ptr < __end))
  ------------------
  |  Branch (42:9): [True: 0, False: 0]
  |  Branch (42:31): [True: 0, False: 0]
  |  Branch (42:51): [True: 0, False: 0]
  ------------------
   43|      0|      return false;
   44|      0|  }
   45|       |
   46|       |  // Checking this for unrelated pointers is technically UB, but no compiler optimizes based on it (currently).
   47|    280|  return !__less<>()(__ptr, __begin) && __less<>()(__ptr, __end);
  ------------------
  |  Branch (47:10): [True: 0, False: 280]
  |  Branch (47:41): [True: 0, False: 0]
  ------------------
   48|    280|}

_ZNSt3__112__no_destroyINS_6locale5__impEE9__emplaceB8ne180100IJjEEERS2_DpOT_:
   46|      1|  _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI _Tp& __emplace(_Args&&... __args) {
   47|      1|    new (&__obj_) _Tp(std::forward<_Args>(__args)...);
   48|      1|    return __obj_;
   49|      1|  }
_ZNSt3__112__no_destroyINS_6localeEEC2B8ne180100IJNS1_13__private_tagEPNS1_5__impEEEEDpOT_:
   43|      1|      : __obj_(std::forward<_Args>(__args)...) {}
_ZNKSt3__112__no_destroyINS_6localeEE5__getB8ne180100Ev:
   52|      1|  _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI _Tp const& __get() const { return __obj_; }
_ZNSt3__112__no_destroyINS_6localeEEC2B8ne180100IJRKS1_EEEDpOT_:
   43|      1|      : __obj_(std::forward<_Args>(__args)...) {}
_ZNSt3__112__no_destroyINS_6localeEE5__getB8ne180100Ev:
   51|  1.44k|  _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI _Tp& __get() { return __obj_; }
_ZNSt3__112__no_destroyINS_6locale5__impEE5__getB8ne180100Ev:
   51|  9.60k|  _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI _Tp& __get() { return __obj_; }
_ZNSt3__112__no_destroyINS_6localeEED2B8ne180100Ev:
   37|      2|  _LIBCPP_HIDE_FROM_ABI ~__no_destroy() {
   38|       |    // nothing
   39|      2|  }

_ZNSt3__19make_pairB8ne180100IRPKcPcEENS_4pairINS_18__unwrap_ref_decayIT_E4typeENS6_IT0_E4typeEEEOS7_OSA_:
  599|  21.3k|    make_pair(_T1&& __t1, _T2&& __t2) {
  600|  21.3k|  return pair<typename __unwrap_ref_decay<_T1>::type, typename __unwrap_ref_decay<_T2>::type>(
  601|  21.3k|      std::forward<_T1>(__t1), std::forward<_T2>(__t2));
  602|  21.3k|}
_ZNSt3__19make_pairB8ne180100IPKcPcEENS_4pairINS_18__unwrap_ref_decayIT_E4typeENS5_IT0_E4typeEEEOS6_OS9_:
  599|  21.3k|    make_pair(_T1&& __t1, _T2&& __t2) {
  600|  21.3k|  return pair<typename __unwrap_ref_decay<_T1>::type, typename __unwrap_ref_decay<_T2>::type>(
  601|  21.3k|      std::forward<_T1>(__t1), std::forward<_T2>(__t2));
  602|  21.3k|}
_ZNSt3__14pairIPKcS2_EC2B8ne180100IS2_S2_TnNS_9enable_ifIXclsr10_CheckArgsE17__enable_implicitIT_T0_EEEiE4typeELi0EEEOS6_OS7_:
  207|  21.3k|      : first(std::forward<_U1>(__u1)), second(std::forward<_U2>(__u2)) {
  208|  21.3k|  }
_ZNSt3__14pairIPKcPcEC2B8ne180100IRS2_S3_TnNS_9enable_ifIXclsr10_CheckArgsE17__enable_implicitIT_T0_EEEiE4typeELi0EEEOS8_OS9_:
  207|  21.3k|      : first(std::forward<_U1>(__u1)), second(std::forward<_U2>(__u2)) {
  208|  21.3k|  }
_ZNSt3__14pairIPKcPcEC2B8ne180100IS2_S3_TnNS_9enable_ifIXclsr10_CheckArgsE17__enable_implicitIT_T0_EEEiE4typeELi0EEEOS7_OS8_:
  207|  21.3k|      : first(std::forward<_U1>(__u1)), second(std::forward<_U2>(__u2)) {
  208|  21.3k|  }

_ZNKSt3__18ios_base5rdbufB8ne180100Ev:
  367|  3.07k|  _LIBCPP_HIDE_FROM_ABI void* rdbuf() const { return __rdbuf_; }
_ZNKSt3__18ios_base5flagsB8ne180100Ev:
  455|  3.56k|inline _LIBCPP_HIDE_FROM_ABI ios_base::fmtflags ios_base::flags() const { return __fmtflags_; }
_ZNKSt3__18ios_base5widthB8ne180100Ev:
  490|  1.25k|inline _LIBCPP_HIDE_FROM_ABI streamsize ios_base::width() const { return __width_; }
_ZNSt3__18ios_base5widthB8ne180100El:
  492|  1.25k|inline _LIBCPP_HIDE_FROM_ABI streamsize ios_base::width(streamsize __wide) {
  493|  1.25k|  streamsize __r = __width_;
  494|  1.25k|  __width_       = __wide;
  495|  1.25k|  return __r;
  496|  1.25k|}
_ZNSt3__18ios_base8setstateB8ne180100Ej:
  502|  1.08k|inline _LIBCPP_HIDE_FROM_ABI void ios_base::setstate(iostate __state) { clear(__rdstate_ | __state); }
_ZNKSt3__18ios_base4goodB8ne180100Ev:
  504|  4.25k|inline _LIBCPP_HIDE_FROM_ABI bool ios_base::good() const { return __rdstate_ == 0; }
_ZNSt3__19basic_iosIcNS_11char_traitsIcEEED2Ev:
  595|    723|basic_ios<_CharT, _Traits>::~basic_ios() {}
_ZNKSt3__19basic_iosIcNS_11char_traitsIcEEE4goodB8ne180100Ev:
  545|  4.25k|  _LIBCPP_HIDE_FROM_ABI bool good() const { return ios_base::good(); }
_ZNKSt3__19basic_iosIcNS_11char_traitsIcEEE3tieB8ne180100Ev:
  605|  1.92k|inline _LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>* basic_ios<_CharT, _Traits>::tie() const {
  606|  1.92k|  return __tie_;
  607|  1.92k|}
_ZNSt3__19basic_iosIcNS_11char_traitsIcEEE8setstateB8ne180100Ej:
  544|  1.08k|  _LIBCPP_HIDE_FROM_ABI void setstate(iostate __state) { ios_base::setstate(__state); }
_ZNKSt3__19basic_iosIcNS_11char_traitsIcEEE5rdbufB8ne180100Ev:
  618|  3.07k|inline _LIBCPP_HIDE_FROM_ABI basic_streambuf<_CharT, _Traits>* basic_ios<_CharT, _Traits>::rdbuf() const {
  619|  3.07k|  return static_cast<basic_streambuf<char_type, traits_type>*>(ios_base::rdbuf());
  620|  3.07k|}
_ZNKSt3__19basic_iosIcNS_11char_traitsIcEEE5widenB8ne180100Ec:
  645|    302|inline _LIBCPP_HIDE_FROM_ABI _CharT basic_ios<_CharT, _Traits>::widen(char __c) const {
  646|    302|  return std::use_facet<ctype<char_type> >(getloc()).widen(__c);
  647|    302|}
_ZNKSt3__19basic_iosIcNS_11char_traitsIcEEE4fillB8ne180100Ev:
  650|    492|inline _LIBCPP_HIDE_FROM_ABI _CharT basic_ios<_CharT, _Traits>::fill() const {
  651|    492|  if (traits_type::eq_int_type(traits_type::eof(), __fill_))
  ------------------
  |  Branch (651:7): [True: 302, False: 190]
  ------------------
  652|    302|    __fill_ = widen(' ');
  653|    492|  return __fill_;
  654|    492|}

_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEED2Ev:
  346|    270|basic_istream<_CharT, _Traits>::~basic_istream() {}
_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE6sentryC2ERS3_b:
  313|  1.08k|basic_istream<_CharT, _Traits>::sentry::sentry(basic_istream<_CharT, _Traits>& __is, bool __noskipws) : __ok_(false) {
  314|  1.08k|  if (__is.good()) {
  ------------------
  |  Branch (314:7): [True: 667, False: 413]
  ------------------
  315|    667|    if (__is.tie())
  ------------------
  |  Branch (315:9): [True: 0, False: 667]
  ------------------
  316|      0|      __is.tie()->flush();
  317|    667|    if (!__noskipws && (__is.flags() & ios_base::skipws)) {
  ------------------
  |  Branch (317:9): [True: 667, False: 0]
  |  Branch (317:24): [True: 667, False: 0]
  ------------------
  318|    667|      typedef istreambuf_iterator<_CharT, _Traits> _Ip;
  319|    667|      const ctype<_CharT>& __ct = std::use_facet<ctype<_CharT> >(__is.getloc());
  320|    667|      _Ip __i(__is);
  321|    667|      _Ip __eof;
  322|  15.3k|      for (; __i != __eof; ++__i)
  ------------------
  |  Branch (322:14): [True: 15.2k, False: 6]
  ------------------
  323|  15.2k|        if (!__ct.is(__ct.space, *__i))
  ------------------
  |  Branch (323:13): [True: 661, False: 14.6k]
  ------------------
  324|    661|          break;
  325|    667|      if (__i == __eof)
  ------------------
  |  Branch (325:11): [True: 6, False: 661]
  ------------------
  326|      6|        __is.setstate(ios_base::failbit | ios_base::eofbit);
  327|    667|    }
  328|    667|    __ok_ = __is.good();
  329|    667|  } else
  330|    413|    __is.setstate(ios_base::failbit);
  331|  1.08k|}
_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERj:
  380|  1.08k|basic_istream<_CharT, _Traits>& basic_istream<_CharT, _Traits>::operator>>(unsigned int& __n) {
  381|  1.08k|  return std::__input_arithmetic<unsigned int>(*this, __n);
  382|  1.08k|}
_ZNKSt3__113basic_istreamIcNS_11char_traitsIcEEE6sentrycvbB8ne180100Ev:
  306|  1.08k|  _LIBCPP_HIDE_FROM_ABI explicit operator bool() const { return __ok_; }
_ZNSt3__118__input_arithmeticB8ne180100IjcNS_11char_traitsIcEEEERNS_13basic_istreamIT0_T1_EES7_RT_:
  350|  1.08k|__input_arithmetic(basic_istream<_CharT, _Traits>& __is, _Tp& __n) {
  351|  1.08k|  ios_base::iostate __state = ios_base::goodbit;
  352|  1.08k|  typename basic_istream<_CharT, _Traits>::sentry __s(__is);
  353|  1.08k|  if (__s) {
  ------------------
  |  Branch (353:7): [True: 661, False: 419]
  ------------------
  354|    661|#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
  355|    661|    try {
  356|    661|#endif // _LIBCPP_HAS_NO_EXCEPTIONS
  357|    661|      typedef istreambuf_iterator<_CharT, _Traits> _Ip;
  358|    661|      typedef num_get<_CharT, _Ip> _Fp;
  359|    661|      std::use_facet<_Fp>(__is.getloc()).get(_Ip(__is), _Ip(), __is, __state, __n);
  360|    661|#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
  361|    661|    } catch (...) {
  362|      0|      __state |= ios_base::badbit;
  363|      0|      __is.__setstate_nothrow(__state);
  364|      0|      if (__is.exceptions() & ios_base::badbit) {
  ------------------
  |  Branch (364:11): [True: 0, False: 0]
  ------------------
  365|      0|        throw;
  366|      0|      }
  367|      0|    }
  368|      0|#endif
  369|    661|    __is.setstate(__state);
  370|    661|  }
  371|  1.08k|  return __is;
  372|  1.08k|}

_ZNSt3__123__libcpp_numeric_limitsIlLb1EE3maxB8ne180100Ev:
  203|      1|  _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type max() _NOEXCEPT { return __max; }
_ZNSt3__114numeric_limitsIlE3maxB8ne180100Ev:
  446|      1|  _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type max() _NOEXCEPT { return __base::max(); }
_ZNSt3__114numeric_limitsIjE3maxB8ne180100Ev:
  446|    627|  _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type max() _NOEXCEPT { return __base::max(); }
_ZNSt3__123__libcpp_numeric_limitsIjLb1EE3maxB8ne180100Ev:
  203|    627|  _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type max() _NOEXCEPT { return __max; }
_ZNSt3__123__libcpp_numeric_limitsImLb1EE3maxB8ne180100Ev:
  203|  59.1k|  _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type max() _NOEXCEPT { return __max; }
_ZNSt3__114numeric_limitsImE3maxB8ne180100Ev:
  446|  59.1k|  _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type max() _NOEXCEPT { return __base::max(); }

_ZNSt3__110__time_putC2B8ne180100Ev:
 2076|      2|  _LIBCPP_HIDE_FROM_ABI __time_put() : __loc_(_LIBCPP_GET_C_LOCALE) {}
  ------------------
  |  |  246|      2|#  define _LIBCPP_GET_C_LOCALE __cloc()
  ------------------
_ZNSt3__110money_baseC2B8ne180100Ev:
 2188|      4|  _LIBCPP_HIDE_FROM_ABI money_base() {}
_ZNSt3__113messages_baseC2B8ne180100Ev:
 3012|      2|  _LIBCPP_HIDE_FROM_ABI messages_base() {}
_ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE3getB8ne180100ES4_S4_RNS_8ios_baseERjS8_:
  611|    661|  get(iter_type __b, iter_type __e, ios_base& __iob, ios_base::iostate& __err, unsigned int& __v) const {
  612|    661|    return do_get(__b, __e, __iob, __err, __v);
  613|    661|  }
_ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE3putB8ne180100ES4_RNS_8ios_baseEcm:
 1174|    492|  _LIBCPP_HIDE_FROM_ABI iter_type put(iter_type __s, ios_base& __iob, char_type __fl, unsigned long __v) const {
 1175|    492|    return do_put(__s, __iob, __fl, __v);
 1176|    492|  }
_ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjS8_:
  679|    661|  do_get(iter_type __b, iter_type __e, ios_base& __iob, ios_base::iostate& __err, unsigned int& __v) const {
  680|    661|    return this->__do_get_unsigned(__b, __e, __iob, __err, __v);
  681|    661|  }
_ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE17__do_get_unsignedIjEES4_S4_S4_RNS_8ios_baseERjRT_:
  893|    661|    iter_type __b, iter_type __e, ios_base& __iob, ios_base::iostate& __err, _Unsigned& __v) const {
  894|       |  // Stage 1
  895|    661|  int __base = this->__get_base(__iob);
  896|       |  // Stage 2
  897|    661|  char_type __thousands_sep;
  898|    661|  const int __atoms_size = 26;
  899|       |#ifdef _LIBCPP_ABI_OPTIMIZED_LOCALE_NUM_GET
  900|       |  char_type __atoms1[__atoms_size];
  901|       |  const char_type* __atoms = this->__do_widen(__iob, __atoms1);
  902|       |  string __grouping        = this->__stage2_int_prep(__iob, __thousands_sep);
  903|       |#else
  904|    661|  char_type __atoms[__atoms_size];
  905|    661|  string __grouping = this->__stage2_int_prep(__iob, __atoms, __thousands_sep);
  906|    661|#endif
  907|    661|  string __buf;
  908|    661|  __buf.resize(__buf.capacity());
  909|    661|  char* __a     = &__buf[0];
  910|    661|  char* __a_end = __a;
  911|    661|  unsigned __g[__num_get_base::__num_get_buf_sz];
  912|    661|  unsigned* __g_end = __g;
  913|    661|  unsigned __dc     = 0;
  914|   237k|  for (; __b != __e; ++__b) {
  ------------------
  |  Branch (914:10): [True: 237k, False: 116]
  ------------------
  915|   237k|    if (__a_end == __a + __buf.size()) {
  ------------------
  |  Branch (915:9): [True: 375, False: 237k]
  ------------------
  916|    375|      size_t __tmp = __buf.size();
  917|    375|      __buf.resize(2 * __buf.size());
  918|    375|      __buf.resize(__buf.capacity());
  919|    375|      __a     = &__buf[0];
  920|    375|      __a_end = __a + __tmp;
  921|    375|    }
  922|   237k|    if (this->__stage2_int_loop(*__b, __base, __a, __a_end, __dc, __thousands_sep, __grouping, __g, __g_end, __atoms))
  ------------------
  |  Branch (922:9): [True: 545, False: 237k]
  ------------------
  923|    545|      break;
  924|   237k|  }
  925|    661|  if (__grouping.size() != 0 && __g_end - __g < __num_get_base::__num_get_buf_sz)
  ------------------
  |  Branch (925:7): [True: 0, False: 661]
  |  Branch (925:33): [True: 0, False: 0]
  ------------------
  926|      0|    *__g_end++ = __dc;
  927|       |  // Stage 3
  928|    661|  __v = std::__num_get_unsigned_integral<_Unsigned>(__a, __a_end, __err, __base);
  929|       |  // Digit grouping checked
  930|    661|  __check_grouping(__grouping, __g, __g_end, __err);
  931|       |  // EOF checked
  932|    661|  if (__b == __e)
  ------------------
  |  Branch (932:7): [True: 116, False: 545]
  ------------------
  933|    116|    __err |= ios_base::eofbit;
  934|    661|  return __b;
  935|    661|}
_ZNSt3__127__num_get_unsigned_integralB8ne180100IjEET_PKcS3_Rji:
  741|    661|__num_get_unsigned_integral(const char* __a, const char* __a_end, ios_base::iostate& __err, int __base) {
  742|    661|  if (__a != __a_end) {
  ------------------
  |  Branch (742:7): [True: 586, False: 75]
  ------------------
  743|    586|    const bool __negate = *__a == '-';
  744|    586|    if (__negate && ++__a == __a_end) {
  ------------------
  |  Branch (744:9): [True: 275, False: 311]
  |  Branch (744:21): [True: 4, False: 271]
  ------------------
  745|      4|      __err = ios_base::failbit;
  746|      4|      return 0;
  747|      4|    }
  748|    582|    __libcpp_remove_reference_t<decltype(errno)> __save_errno = errno;
  749|    582|    errno                                                     = 0;
  750|    582|    char* __p2;
  751|    582|    unsigned long long __ll                                      = strtoull_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
  ------------------
  |  |  246|    582|#  define _LIBCPP_GET_C_LOCALE __cloc()
  ------------------
  752|    582|    __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
  753|    582|    if (__current_errno == 0)
  ------------------
  |  Branch (753:9): [True: 558, False: 24]
  ------------------
  754|    582|      errno = __save_errno;
  755|    582|    if (__p2 != __a_end) {
  ------------------
  |  Branch (755:9): [True: 2, False: 580]
  ------------------
  756|      2|      __err = ios_base::failbit;
  757|      2|      return 0;
  758|    580|    } else if (__current_errno == ERANGE || numeric_limits<_Tp>::max() < __ll) {
  ------------------
  |  Branch (758:16): [True: 24, False: 556]
  |  Branch (758:45): [True: 47, False: 509]
  ------------------
  759|     71|      __err = ios_base::failbit;
  760|     71|      return numeric_limits<_Tp>::max();
  761|     71|    }
  762|    509|    _Tp __res = static_cast<_Tp>(__ll);
  763|    509|    if (__negate)
  ------------------
  |  Branch (763:9): [True: 269, False: 240]
  ------------------
  764|    269|      __res = -__res;
  765|    509|    return __res;
  766|    582|  }
  767|     75|  __err = ios_base::failbit;
  768|     75|  return 0;
  769|    661|}
_ZNSt3__19__num_getIcE17__stage2_int_prepERNS_8ios_baseEPcRc:
  448|    661|string __num_get<_CharT>::__stage2_int_prep(ios_base& __iob, _CharT* __atoms, _CharT& __thousands_sep) {
  449|    661|  locale __loc = __iob.getloc();
  450|    661|  std::use_facet<ctype<_CharT> >(__loc).widen(__src, __src + 26, __atoms);
  451|    661|  const numpunct<_CharT>& __np = std::use_facet<numpunct<_CharT> >(__loc);
  452|    661|  __thousands_sep              = __np.thousands_sep();
  453|    661|  return __np.grouping();
  454|    661|}
_ZNSt3__19__num_getIcE17__stage2_int_loopEciPcRS2_RjcRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjRSD_S2_:
  480|   237k|{
  481|   237k|  if (__a_end == __a && (__ct == __atoms[24] || __ct == __atoms[25])) {
  ------------------
  |  Branch (481:7): [True: 661, False: 236k]
  |  Branch (481:26): [True: 47, False: 614]
  |  Branch (481:49): [True: 275, False: 339]
  ------------------
  482|    322|    *__a_end++ = __ct == __atoms[24] ? '+' : '-';
  ------------------
  |  Branch (482:18): [True: 47, False: 275]
  ------------------
  483|    322|    __dc       = 0;
  484|    322|    return 0;
  485|    322|  }
  486|   237k|  if (__grouping.size() != 0 && __ct == __thousands_sep) {
  ------------------
  |  Branch (486:7): [True: 0, False: 237k]
  |  Branch (486:33): [True: 0, False: 0]
  ------------------
  487|      0|    if (__g_end - __g < __num_get_buf_sz) {
  ------------------
  |  Branch (487:9): [True: 0, False: 0]
  ------------------
  488|      0|      *__g_end++ = __dc;
  489|      0|      __dc       = 0;
  490|      0|    }
  491|      0|    return 0;
  492|      0|  }
  493|   237k|  ptrdiff_t __f = std::find(__atoms, __atoms + 26, __ct) - __atoms;
  494|   237k|  if (__f >= 24)
  ------------------
  |  Branch (494:7): [True: 533, False: 236k]
  ------------------
  495|    533|    return -1;
  496|   236k|  switch (__base) {
  ------------------
  |  Branch (496:11): [True: 236k, False: 0]
  ------------------
  497|      0|  case 8:
  ------------------
  |  Branch (497:3): [True: 0, False: 236k]
  ------------------
  498|   236k|  case 10:
  ------------------
  |  Branch (498:3): [True: 236k, False: 0]
  ------------------
  499|   236k|    if (__f >= __base)
  ------------------
  |  Branch (499:9): [True: 12, False: 236k]
  ------------------
  500|     12|      return -1;
  501|   236k|    break;
  502|   236k|  case 16:
  ------------------
  |  Branch (502:3): [True: 0, False: 236k]
  ------------------
  503|      0|    if (__f < 22)
  ------------------
  |  Branch (503:9): [True: 0, False: 0]
  ------------------
  504|      0|      break;
  505|      0|    if (__a_end != __a && __a_end - __a <= 2 && __a_end[-1] == '0') {
  ------------------
  |  Branch (505:9): [True: 0, False: 0]
  |  Branch (505:27): [True: 0, False: 0]
  |  Branch (505:49): [True: 0, False: 0]
  ------------------
  506|      0|      __dc       = 0;
  507|      0|      *__a_end++ = __src[__f];
  508|      0|      return 0;
  509|      0|    }
  510|      0|    return -1;
  511|   236k|  }
  512|   236k|  *__a_end++ = __src[__f];
  513|   236k|  ++__dc;
  514|   236k|  return 0;
  515|   236k|}
_ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcm:
 1339|    492|num_put<_CharT, _OutputIterator>::do_put(iter_type __s, ios_base& __iob, char_type __fl, unsigned long __v) const {
 1340|    492|  return this->__do_put_integral(__s, __iob, __fl, __v, "l");
 1341|    492|}
_ZNSt3__19__num_putIcE21__widen_and_group_intEPcS2_S2_S2_RS2_S3_RKNS_6localeE:
 1053|    492|    char* __nb, char* __np, char* __ne, _CharT* __ob, _CharT*& __op, _CharT*& __oe, const locale& __loc) {
 1054|    492|  const ctype<_CharT>& __ct     = std::use_facet<ctype<_CharT> >(__loc);
 1055|    492|  const numpunct<_CharT>& __npt = std::use_facet<numpunct<_CharT> >(__loc);
 1056|    492|  string __grouping             = __npt.grouping();
 1057|    492|  if (__grouping.empty()) {
  ------------------
  |  Branch (1057:7): [True: 492, False: 0]
  ------------------
 1058|    492|    __ct.widen(__nb, __ne, __ob);
 1059|    492|    __oe = __ob + (__ne - __nb);
 1060|    492|  } else {
 1061|      0|    __oe       = __ob;
 1062|      0|    char* __nf = __nb;
 1063|      0|    if (*__nf == '-' || *__nf == '+')
  ------------------
  |  Branch (1063:9): [True: 0, False: 0]
  |  Branch (1063:25): [True: 0, False: 0]
  ------------------
 1064|      0|      *__oe++ = __ct.widen(*__nf++);
 1065|      0|    if (__ne - __nf >= 2 && __nf[0] == '0' && (__nf[1] == 'x' || __nf[1] == 'X')) {
  ------------------
  |  Branch (1065:9): [True: 0, False: 0]
  |  Branch (1065:29): [True: 0, False: 0]
  |  Branch (1065:48): [True: 0, False: 0]
  |  Branch (1065:66): [True: 0, False: 0]
  ------------------
 1066|      0|      *__oe++ = __ct.widen(*__nf++);
 1067|      0|      *__oe++ = __ct.widen(*__nf++);
 1068|      0|    }
 1069|      0|    std::reverse(__nf, __ne);
 1070|      0|    _CharT __thousands_sep = __npt.thousands_sep();
 1071|      0|    unsigned __dc          = 0;
 1072|      0|    unsigned __dg          = 0;
 1073|      0|    for (char* __p = __nf; __p < __ne; ++__p) {
  ------------------
  |  Branch (1073:28): [True: 0, False: 0]
  ------------------
 1074|      0|      if (static_cast<unsigned>(__grouping[__dg]) > 0 && __dc == static_cast<unsigned>(__grouping[__dg])) {
  ------------------
  |  Branch (1074:11): [True: 0, False: 0]
  |  Branch (1074:58): [True: 0, False: 0]
  ------------------
 1075|      0|        *__oe++ = __thousands_sep;
 1076|      0|        __dc    = 0;
 1077|      0|        if (__dg < __grouping.size() - 1)
  ------------------
  |  Branch (1077:13): [True: 0, False: 0]
  ------------------
 1078|      0|          ++__dg;
 1079|      0|      }
 1080|      0|      *__oe++ = __ct.widen(*__p);
 1081|      0|      ++__dc;
 1082|      0|    }
 1083|      0|    std::reverse(__ob + (__nf - __nb), __oe);
 1084|      0|  }
 1085|    492|  if (__np == __ne)
  ------------------
  |  Branch (1085:7): [True: 0, False: 492]
  ------------------
 1086|      0|    __op = __oe;
 1087|    492|  else
 1088|    492|    __op = __ob + (__np - __nb);
 1089|    492|}
_ZNSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEC2B8ne180100Em:
  588|      1|  _LIBCPP_HIDE_FROM_ABI explicit num_get(size_t __refs = 0) : locale::facet(__refs) {}
_ZNSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEC2B8ne180100Em:
  588|      1|  _LIBCPP_HIDE_FROM_ABI explicit num_get(size_t __refs = 0) : locale::facet(__refs) {}
_ZNSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEC2B8ne180100Em:
 1160|      1|  _LIBCPP_HIDE_FROM_ABI explicit num_put(size_t __refs = 0) : locale::facet(__refs) {}
_ZNSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEC2B8ne180100Em:
 1160|      1|  _LIBCPP_HIDE_FROM_ABI explicit num_put(size_t __refs = 0) : locale::facet(__refs) {}
_ZNSt3__110moneypunctIcLb0EEC2B8ne180100Em:
 2199|      1|  _LIBCPP_HIDE_FROM_ABI explicit moneypunct(size_t __refs = 0) : locale::facet(__refs) {}
_ZNSt3__110moneypunctIcLb1EEC2B8ne180100Em:
 2199|      1|  _LIBCPP_HIDE_FROM_ABI explicit moneypunct(size_t __refs = 0) : locale::facet(__refs) {}
_ZNSt3__110moneypunctIwLb0EEC2B8ne180100Em:
 2199|      1|  _LIBCPP_HIDE_FROM_ABI explicit moneypunct(size_t __refs = 0) : locale::facet(__refs) {}
_ZNSt3__110moneypunctIwLb1EEC2B8ne180100Em:
 2199|      1|  _LIBCPP_HIDE_FROM_ABI explicit moneypunct(size_t __refs = 0) : locale::facet(__refs) {}
_ZNSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEC2B8ne180100Em:
 2379|      1|  _LIBCPP_HIDE_FROM_ABI explicit money_get(size_t __refs = 0) : locale::facet(__refs) {}
_ZNSt3__111__money_getIcEC2B8ne180100Ev:
 2317|      1|  _LIBCPP_HIDE_FROM_ABI __money_get() {}
_ZNSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEC2B8ne180100Em:
 2379|      1|  _LIBCPP_HIDE_FROM_ABI explicit money_get(size_t __refs = 0) : locale::facet(__refs) {}
_ZNSt3__111__money_getIwEC2B8ne180100Ev:
 2317|      1|  _LIBCPP_HIDE_FROM_ABI __money_get() {}
_ZNSt3__19money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEC2B8ne180100Em:
 2867|      1|  _LIBCPP_HIDE_FROM_ABI explicit money_put(size_t __refs = 0) : locale::facet(__refs) {}
_ZNSt3__111__money_putIcEC2B8ne180100Ev:
 2690|      1|  _LIBCPP_HIDE_FROM_ABI __money_put() {}
_ZNSt3__19money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEC2B8ne180100Em:
 2867|      1|  _LIBCPP_HIDE_FROM_ABI explicit money_put(size_t __refs = 0) : locale::facet(__refs) {}
_ZNSt3__111__money_putIwEC2B8ne180100Ev:
 2690|      1|  _LIBCPP_HIDE_FROM_ABI __money_put() {}
_ZNSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEC2B8ne180100Em:
 1529|      1|  _LIBCPP_HIDE_FROM_ABI explicit time_get(size_t __refs = 0) : locale::facet(__refs) {}
_ZNSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEC2B8ne180100Em:
 1529|      1|  _LIBCPP_HIDE_FROM_ABI explicit time_get(size_t __refs = 0) : locale::facet(__refs) {}
_ZNSt3__18time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEC2B8ne180100Em:
 2092|      1|  _LIBCPP_HIDE_FROM_ABI explicit time_put(size_t __refs = 0) : locale::facet(__refs) {}
_ZNSt3__18time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEC2B8ne180100Em:
 2092|      1|  _LIBCPP_HIDE_FROM_ABI explicit time_put(size_t __refs = 0) : locale::facet(__refs) {}
_ZNSt3__18messagesIcEC2B8ne180100Em:
 3021|      1|  _LIBCPP_HIDE_FROM_ABI explicit messages(size_t __refs = 0) : locale::facet(__refs) {}
_ZNSt3__18messagesIwEC2B8ne180100Em:
 3021|      1|  _LIBCPP_HIDE_FROM_ABI explicit messages(size_t __refs = 0) : locale::facet(__refs) {}
_ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE17__do_put_integralB8ne180100ImEES4_S4_RNS_8ios_baseEcT_PKc:
 1296|    492|    iter_type __s, ios_base& __iob, char_type __fl, _Integral __v, char const* __len) const {
 1297|       |  // Stage 1 - Get number in narrow char
 1298|    492|  char __fmt[8] = {'%', 0};
 1299|    492|  this->__format_int(__fmt + 1, __len, is_signed<_Integral>::value, __iob.flags());
 1300|       |  // Worst case is octal, with showbase enabled. Note that octal is always
 1301|       |  // printed as an unsigned value.
 1302|    492|  using _Unsigned = typename make_unsigned<_Integral>::type;
 1303|    492|  _LIBCPP_CONSTEXPR const unsigned __nbuf =
  ------------------
  |  |  622|    492|#    define _LIBCPP_CONSTEXPR constexpr
  ------------------
 1304|    492|      (numeric_limits<_Unsigned>::digits / 3)          // 1 char per 3 bits
 1305|    492|      + ((numeric_limits<_Unsigned>::digits % 3) != 0) // round up
 1306|    492|      + 2;                                             // base prefix + terminating null character
 1307|    492|  char __nar[__nbuf];
 1308|    492|  _LIBCPP_DIAGNOSTIC_PUSH
 1309|    492|  _LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wformat-nonliteral")
 1310|    492|  _LIBCPP_GCC_DIAGNOSTIC_IGNORED("-Wformat-nonliteral")
 1311|    492|  int __nc = __libcpp_snprintf_l(__nar, sizeof(__nar), _LIBCPP_GET_C_LOCALE, __fmt, __v);
  ------------------
  |  |  246|    492|#  define _LIBCPP_GET_C_LOCALE __cloc()
  ------------------
 1312|    492|  _LIBCPP_DIAGNOSTIC_POP
 1313|    492|  char* __ne = __nar + __nc;
 1314|    492|  char* __np = this->__identify_padding(__nar, __ne, __iob);
 1315|       |  // Stage 2 - Widen __nar while adding thousands separators
 1316|    492|  char_type __o[2 * (__nbuf - 1) - 1];
 1317|    492|  char_type* __op; // pad here
 1318|    492|  char_type* __oe; // end of output
 1319|    492|  this->__widen_and_group_int(__nar, __np, __ne, __o, __op, __oe, __iob.getloc());
 1320|       |  // [__o, __oe) contains thousands_sep'd wide number
 1321|       |  // Stage 3 & 4
 1322|    492|  return std::__pad_and_output(__s, __o, __op, __oe, __iob, __fl);
 1323|    492|}
_ZNSt3__116__pad_and_outputB8ne180100IcNS_11char_traitsIcEEEENS_19ostreambuf_iteratorIT_T0_EES6_PKS4_S8_S8_RNS_8ios_baseES4_:
 1246|  1.25k|    _CharT __fl) {
 1247|  1.25k|  if (__s.__sbuf_ == nullptr)
  ------------------
  |  Branch (1247:7): [True: 0, False: 1.25k]
  ------------------
 1248|      0|    return __s;
 1249|  1.25k|  streamsize __sz = __oe - __ob;
 1250|  1.25k|  streamsize __ns = __iob.width();
 1251|  1.25k|  if (__ns > __sz)
  ------------------
  |  Branch (1251:7): [True: 0, False: 1.25k]
  ------------------
 1252|      0|    __ns -= __sz;
 1253|  1.25k|  else
 1254|  1.25k|    __ns = 0;
 1255|  1.25k|  streamsize __np = __op - __ob;
 1256|  1.25k|  if (__np > 0) {
  ------------------
  |  Branch (1256:7): [True: 0, False: 1.25k]
  ------------------
 1257|      0|    if (__s.__sbuf_->sputn(__ob, __np) != __np) {
  ------------------
  |  Branch (1257:9): [True: 0, False: 0]
  ------------------
 1258|      0|      __s.__sbuf_ = nullptr;
 1259|      0|      return __s;
 1260|      0|    }
 1261|      0|  }
 1262|  1.25k|  if (__ns > 0) {
  ------------------
  |  Branch (1262:7): [True: 0, False: 1.25k]
  ------------------
 1263|      0|    basic_string<_CharT, _Traits> __sp(__ns, __fl);
 1264|      0|    if (__s.__sbuf_->sputn(__sp.data(), __ns) != __ns) {
  ------------------
  |  Branch (1264:9): [True: 0, False: 0]
  ------------------
 1265|      0|      __s.__sbuf_ = nullptr;
 1266|      0|      return __s;
 1267|      0|    }
 1268|      0|  }
 1269|  1.25k|  __np = __oe - __op;
 1270|  1.25k|  if (__np > 0) {
  ------------------
  |  Branch (1270:7): [True: 1.25k, False: 0]
  ------------------
 1271|  1.25k|    if (__s.__sbuf_->sputn(__op, __np) != __np) {
  ------------------
  |  Branch (1271:9): [True: 0, False: 1.25k]
  ------------------
 1272|      0|      __s.__sbuf_ = nullptr;
 1273|      0|      return __s;
 1274|      0|    }
 1275|  1.25k|  }
 1276|  1.25k|  __iob.width(0);
 1277|  1.25k|  return __s;
 1278|  1.25k|}

_ZNSt3__124__is_overaligned_for_newB8ne180100Em:
  260|  20.1k|_LIBCPP_CONSTEXPR inline _LIBCPP_HIDE_FROM_ABI bool __is_overaligned_for_new(size_t __align) _NOEXCEPT {
  261|  20.1k|#ifdef __STDCPP_DEFAULT_NEW_ALIGNMENT__
  262|  20.1k|  return __align > __STDCPP_DEFAULT_NEW_ALIGNMENT__;
  263|       |#else
  264|       |  return __align > _LIBCPP_ALIGNOF(max_align_t);
  265|       |#endif
  266|  20.1k|}
_ZNSt3__117__libcpp_allocateB8ne180100Emm:
  286|  19.7k|inline _LIBCPP_HIDE_FROM_ABI void* __libcpp_allocate(size_t __size, size_t __align) {
  287|  19.7k|#ifndef _LIBCPP_HAS_NO_ALIGNED_ALLOCATION
  288|  19.7k|  if (__is_overaligned_for_new(__align)) {
  ------------------
  |  Branch (288:7): [True: 0, False: 19.7k]
  ------------------
  289|      0|    const align_val_t __align_val = static_cast<align_val_t>(__align);
  290|      0|    return __libcpp_operator_new(__size, __align_val);
  291|      0|  }
  292|  19.7k|#endif
  293|       |
  294|  19.7k|  (void)__align;
  295|  19.7k|  return __libcpp_operator_new(__size);
  296|  19.7k|}
_ZNSt3__119__libcpp_deallocateB8ne180100EPvmm:
  308|    441|inline _LIBCPP_HIDE_FROM_ABI void __libcpp_deallocate(void* __ptr, size_t __size, size_t __align) {
  309|       |#if defined(_LIBCPP_HAS_NO_ALIGNED_ALLOCATION)
  310|       |  (void)__align;
  311|       |  return __do_deallocate_handle_size(__ptr, __size);
  312|       |#else
  313|    441|  if (__is_overaligned_for_new(__align)) {
  ------------------
  |  Branch (313:7): [True: 0, False: 441]
  ------------------
  314|      0|    const align_val_t __align_val = static_cast<align_val_t>(__align);
  315|      0|    return __do_deallocate_handle_size(__ptr, __size, __align_val);
  316|    441|  } else {
  317|    441|    return __do_deallocate_handle_size(__ptr, __size);
  318|    441|  }
  319|    441|#endif
  320|    441|}
_ZNSt3__121__libcpp_operator_newB8ne180100IJmEEEPvDpT_:
  269|  19.7k|_LIBCPP_HIDE_FROM_ABI void* __libcpp_operator_new(_Args... __args) {
  270|  19.7k|#if __has_builtin(__builtin_operator_new) && __has_builtin(__builtin_operator_delete)
  271|  19.7k|  return __builtin_operator_new(__args...);
  272|       |#else
  273|       |  return ::operator new(__args...);
  274|       |#endif
  275|  19.7k|}
_ZNSt3__127__do_deallocate_handle_sizeB8ne180100IJEEEvPvmDpT_:
  299|    441|_LIBCPP_HIDE_FROM_ABI void __do_deallocate_handle_size(void* __ptr, size_t __size, _Args... __args) {
  300|       |#ifdef _LIBCPP_HAS_NO_SIZED_DEALLOCATION
  301|       |  (void)__size;
  302|       |  return std::__libcpp_operator_delete(__ptr, __args...);
  303|       |#else
  304|    441|  return std::__libcpp_operator_delete(__ptr, __size, __args...);
  305|    441|#endif
  306|    441|}
_ZNSt3__124__libcpp_operator_deleteB8ne180100IJPvmEEEvDpT_:
  278|    441|_LIBCPP_HIDE_FROM_ABI void __libcpp_operator_delete(_Args... __args) {
  279|    441|#if __has_builtin(__builtin_operator_new) && __has_builtin(__builtin_operator_delete)
  280|    441|  __builtin_operator_delete(__args...);
  281|       |#else
  282|       |  ::operator delete(__args...);
  283|       |#endif
  284|    441|}

_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEED2Ev:
  348|    453|basic_ostream<_CharT, _Traits>::~basic_ostream() {}
_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE6sentryC2ERS3_:
  313|  1.25k|basic_ostream<_CharT, _Traits>::sentry::sentry(basic_ostream<_CharT, _Traits>& __os) : __ok_(false), __os_(__os) {
  314|  1.25k|  if (__os.good()) {
  ------------------
  |  Branch (314:7): [True: 1.25k, False: 0]
  ------------------
  315|  1.25k|    if (__os.tie())
  ------------------
  |  Branch (315:9): [True: 0, False: 1.25k]
  ------------------
  316|      0|      __os.tie()->flush();
  317|  1.25k|    __ok_ = true;
  318|  1.25k|  }
  319|  1.25k|}
_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE6sentryD2Ev:
  322|  1.25k|basic_ostream<_CharT, _Traits>::sentry::~sentry() {
  323|  1.25k|  if (__os_.rdbuf() && __os_.good() && (__os_.flags() & ios_base::unitbuf) && !uncaught_exception()) {
  ------------------
  |  Branch (323:7): [True: 1.25k, False: 0]
  |  Branch (323:24): [True: 1.25k, False: 0]
  |  Branch (323:40): [True: 0, False: 1.25k]
  |  Branch (323:79): [True: 0, False: 0]
  ------------------
  324|      0|#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
  325|      0|    try {
  326|      0|#endif // _LIBCPP_HAS_NO_EXCEPTIONS
  327|      0|      if (__os_.rdbuf()->pubsync() == -1)
  ------------------
  |  Branch (327:11): [True: 0, False: 0]
  ------------------
  328|      0|        __os_.setstate(ios_base::badbit);
  329|      0|#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
  330|      0|    } catch (...) {
  331|      0|    }
  332|      0|#endif // _LIBCPP_HAS_NO_EXCEPTIONS
  333|      0|  }
  334|  1.25k|}
_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEj:
  486|    492|basic_ostream<_CharT, _Traits>& basic_ostream<_CharT, _Traits>::operator<<(unsigned int __n) {
  487|    492|#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
  488|    492|  try {
  489|    492|#endif // _LIBCPP_HAS_NO_EXCEPTIONS
  490|    492|    sentry __s(*this);
  491|    492|    if (__s) {
  ------------------
  |  Branch (491:9): [True: 492, False: 0]
  ------------------
  492|    492|      typedef num_put<char_type, ostreambuf_iterator<char_type, traits_type> > _Fp;
  493|    492|      const _Fp& __f = std::use_facet<_Fp>(this->getloc());
  494|    492|      if (__f.put(*this, *this, this->fill(), static_cast<unsigned long>(__n)).failed())
  ------------------
  |  Branch (494:11): [True: 0, False: 492]
  ------------------
  495|      0|        this->setstate(ios_base::badbit | ios_base::failbit);
  496|    492|    }
  497|    492|#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
  498|    492|  } catch (...) {
  499|      0|    this->__set_badbit_and_consider_rethrow();
  500|      0|  }
  501|    492|#endif // _LIBCPP_HAS_NO_EXCEPTIONS
  502|    492|  return *this;
  503|    492|}
_ZNKSt3__113basic_ostreamIcNS_11char_traitsIcEEE6sentrycvbB8ne180100Ev:
  309|    492|  _LIBCPP_HIDE_FROM_ABI explicit operator bool() const { return __ok_; }

_ZNSt3__115basic_stringbufIcNS_11char_traitsIcEENS_9allocatorIcEEE9underflowEv:
  665|    122|basic_stringbuf<_CharT, _Traits, _Allocator>::underflow() {
  666|    122|  if (__hm_ < this->pptr())
  ------------------
  |  Branch (666:7): [True: 0, False: 122]
  ------------------
  667|      0|    __hm_ = this->pptr();
  668|    122|  if (__mode_ & ios_base::in) {
  ------------------
  |  Branch (668:7): [True: 122, False: 0]
  ------------------
  669|    122|    if (this->egptr() < __hm_)
  ------------------
  |  Branch (669:9): [True: 0, False: 122]
  ------------------
  670|      0|      this->setg(this->eback(), this->gptr(), __hm_);
  671|    122|    if (this->gptr() < this->egptr())
  ------------------
  |  Branch (671:9): [True: 0, False: 122]
  ------------------
  672|      0|      return traits_type::to_int_type(*this->gptr());
  673|    122|  }
  674|    122|  return traits_type::eof();
  675|    122|}
_ZNSt3__115basic_stringbufIcNS_11char_traitsIcEENS_9allocatorIcEEE8overflowEi:
  698|    438|basic_stringbuf<_CharT, _Traits, _Allocator>::overflow(int_type __c) {
  699|    438|  if (!traits_type::eq_int_type(__c, traits_type::eof())) {
  ------------------
  |  Branch (699:7): [True: 438, False: 0]
  ------------------
  700|    438|    ptrdiff_t __ninp = this->gptr() - this->eback();
  701|    438|    if (this->pptr() == this->epptr()) {
  ------------------
  |  Branch (701:9): [True: 438, False: 0]
  ------------------
  702|    438|      if (!(__mode_ & ios_base::out))
  ------------------
  |  Branch (702:11): [True: 0, False: 438]
  ------------------
  703|      0|        return traits_type::eof();
  704|    438|#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
  705|    438|      try {
  706|    438|#endif // _LIBCPP_HAS_NO_EXCEPTIONS
  707|    438|        ptrdiff_t __nout = this->pptr() - this->pbase();
  708|    438|        ptrdiff_t __hm   = __hm_ - this->pbase();
  709|    438|        __str_.push_back(char_type());
  710|    438|        __str_.resize(__str_.capacity());
  711|    438|        char_type* __p = const_cast<char_type*>(__str_.data());
  712|    438|        this->setp(__p, __p + __str_.size());
  713|    438|        this->__pbump(__nout);
  714|    438|        __hm_ = this->pbase() + __hm;
  715|    438|#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
  716|    438|      } catch (...) {
  717|      0|        return traits_type::eof();
  718|      0|      }
  719|    438|#endif // _LIBCPP_HAS_NO_EXCEPTIONS
  720|    438|    }
  721|    438|    __hm_ = std::max(this->pptr() + 1, __hm_);
  722|    438|    if (__mode_ & ios_base::in) {
  ------------------
  |  Branch (722:9): [True: 0, False: 438]
  ------------------
  723|      0|      char_type* __p = const_cast<char_type*>(__str_.data());
  724|      0|      this->setg(__p, __p + __ninp, __hm_);
  725|      0|    }
  726|    438|    return this->sputc(traits_type::to_char_type(__c));
  727|    438|  }
  728|      0|  return traits_type::not_eof(__c);
  729|    438|}

_ZNKSt3__118__libcpp_refstring5c_strB8ne180100Ev:
   68|  21.5k|  _LIBCPP_HIDE_FROM_ABI const char* c_str() const _NOEXCEPT { return __imp_; }

_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEED2Ev:
  290|    723|basic_streambuf<_CharT, _Traits>::~basic_streambuf() {}
_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE6sbumpcEv:
  183|   251k|  inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1 int_type sbumpc() {
  184|   251k|    if (__ninp_ == __einp_)
  ------------------
  |  Branch (184:9): [True: 0, False: 251k]
  ------------------
  185|      0|      return uflow();
  186|   251k|    return traits_type::to_int_type(*__ninp_++);
  187|   251k|  }
_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5sgetcEv:
  189|   507k|  inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1 int_type sgetc() {
  190|   507k|    if (__ninp_ == __einp_)
  ------------------
  |  Branch (190:9): [True: 122, False: 507k]
  ------------------
  191|    122|      return underflow();
  192|   507k|    return traits_type::to_int_type(*__ninp_);
  193|   507k|  }
_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5sputcEc:
  211|    438|  inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1 int_type sputc(char_type __c) {
  212|    438|    if (__nout_ == __eout_)
  ------------------
  |  Branch (212:9): [True: 0, False: 438]
  ------------------
  213|      0|      return overflow(traits_type::to_int_type(__c));
  214|    438|    *__nout_++ = __c;
  215|    438|    return traits_type::to_int_type(__c);
  216|    438|  }
_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5sputnEPKcl:
  218|  1.25k|  inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1 streamsize sputn(const char_type* __s, streamsize __n) {
  219|  1.25k|    return xsputn(__s, __n);
  220|  1.25k|  }
_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEEC2Ev:
  294|    723|    : __binp_(nullptr), __ninp_(nullptr), __einp_(nullptr), __bout_(nullptr), __nout_(nullptr), __eout_(nullptr) {}
_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE4setpEPcS4_:
  250|    438|  inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1 void setp(char_type* __pbeg, char_type* __pend) {
  251|    438|    __bout_ = __nout_ = __pbeg;
  252|    438|    __eout_           = __pend;
  253|    438|  }
_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE6xsputnEPKcl:
  399|  1.25k|streamsize basic_streambuf<_CharT, _Traits>::xsputn(const char_type* __s, streamsize __n) {
  400|  1.25k|  streamsize __i = 0;
  401|  1.25k|  int_type __eof = traits_type::eof();
  402|  2.94k|  while (__i < __n) {
  ------------------
  |  Branch (402:10): [True: 1.68k, False: 1.25k]
  ------------------
  403|  1.68k|    if (__nout_ >= __eout_) {
  ------------------
  |  Branch (403:9): [True: 438, False: 1.25k]
  ------------------
  404|    438|      if (overflow(traits_type::to_int_type(*__s)) == __eof)
  ------------------
  |  Branch (404:11): [True: 0, False: 438]
  ------------------
  405|      0|        break;
  406|    438|      ++__s;
  407|    438|      ++__i;
  408|  1.25k|    } else {
  409|  1.25k|      streamsize __chunk_size = std::min(__eout_ - __nout_, __n - __i);
  410|  1.25k|      traits_type::copy(__nout_, __s, __chunk_size);
  411|  1.25k|      __nout_ += __chunk_size;
  412|  1.25k|      __s += __chunk_size;
  413|  1.25k|      __i += __chunk_size;
  414|  1.25k|    }
  415|  1.68k|  }
  416|  1.25k|  return __i;
  417|  1.25k|}
_ZNKSt3__115basic_streambufIcNS_11char_traitsIcEEE5ebackB8ne180100Ev:
  229|    438|  _LIBCPP_HIDE_FROM_ABI char_type* eback() const { return __binp_; }
_ZNKSt3__115basic_streambufIcNS_11char_traitsIcEEE4gptrB8ne180100Ev:
  230|    560|  _LIBCPP_HIDE_FROM_ABI char_type* gptr() const { return __ninp_; }
_ZNKSt3__115basic_streambufIcNS_11char_traitsIcEEE5egptrB8ne180100Ev:
  231|    244|  _LIBCPP_HIDE_FROM_ABI char_type* egptr() const { return __einp_; }
_ZNKSt3__115basic_streambufIcNS_11char_traitsIcEEE5pbaseB8ne180100Ev:
  242|  1.31k|  _LIBCPP_HIDE_FROM_ABI char_type* pbase() const { return __bout_; }
_ZNKSt3__115basic_streambufIcNS_11char_traitsIcEEE4pptrB8ne180100Ev:
  243|  1.43k|  _LIBCPP_HIDE_FROM_ABI char_type* pptr() const { return __nout_; }
_ZNKSt3__115basic_streambufIcNS_11char_traitsIcEEE5epptrB8ne180100Ev:
  244|    438|  _LIBCPP_HIDE_FROM_ABI char_type* epptr() const { return __eout_; }
_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE7__pbumpB8ne180100El:
  248|    438|  _LIBCPP_HIDE_FROM_ABI void __pbump(streamsize __n) { __nout_ += __n; }

_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7__allocB8ne180100Ev:
 1827|  20.9k|  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR const allocator_type& __alloc() const _NOEXCEPT { return __r_.second(); }
_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE8max_sizeB8ne180100Ev:
 1181|  19.7k|  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type max_size() const _NOEXCEPT {
 1182|  19.7k|    size_type __m = __alloc_traits::max_size(__alloc());
 1183|  19.7k|    if (__m <= std::numeric_limits<size_type>::max() / 2) {
  ------------------
  |  Branch (1183:9): [True: 0, False: 19.7k]
  ------------------
 1184|      0|      return __m - __alignment;
 1185|  19.7k|    } else {
 1186|  19.7k|      bool __uses_lsb = __endian_factor == 2;
 1187|  19.7k|      return __uses_lsb ? __m - __alignment : (__m / 2) - __alignment;
  ------------------
  |  Branch (1187:14): [True: 19.7k, False: 10]
  ------------------
 1188|  19.7k|    }
 1189|  19.7k|  }
_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE13__fits_in_ssoB8ne180100Em:
 1788|  20.2k|  _LIBCPP_CONSTEXPR _LIBCPP_HIDE_FROM_ABI static bool __fits_in_sso(size_type __sz) { return __sz < __min_cap; }
_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE16__set_short_sizeB8ne180100Em:
 1830|  1.99k|  __set_short_size(size_type __s) _NOEXCEPT {
 1831|  1.99k|    _LIBCPP_ASSERT_INTERNAL(__s < __min_cap, "__s should never be greater than or equal to the short string capacity");
  ------------------
  |  |  417|  1.99k|#    define _LIBCPP_ASSERT_INTERNAL(expression, message)                  _LIBCPP_ASSUME(expression)
  |  |  ------------------
  |  |  |  |   34|  1.99k|#  define _LIBCPP_ASSUME(expression) ((void)0)
  |  |  ------------------
  ------------------
 1832|  1.99k|    __r_.first().__s.__size_    = __s;
 1833|  1.99k|    __r_.first().__s.__is_long_ = false;
 1834|  1.99k|  }
_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE19__get_short_pointerB8ne180100Ev:
 1873|  3.59k|  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 pointer __get_short_pointer() _NOEXCEPT {
 1874|  3.59k|    return pointer_traits<pointer>::pointer_to(__r_.first().__s.__data_[0]);
 1875|  3.59k|  }
_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7__allocB8ne180100Ev:
 1826|  20.1k|  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 allocator_type& __alloc() _NOEXCEPT { return __r_.second(); }
_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE10__align_itB8ne180100ILm8EEEmm:
 1936|  19.7k|  static _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type __align_it(size_type __s) _NOEXCEPT {
 1937|  19.7k|    return (__s + (__a - 1)) & ~(__a - 1);
 1938|  19.7k|  }
_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE11__recommendB8ne180100Em:
 1942|  19.7k|  static _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type __recommend(size_type __s) _NOEXCEPT {
 1943|  19.7k|    if (__s < __min_cap) {
  ------------------
  |  Branch (1943:9): [True: 0, False: 19.7k]
  ------------------
 1944|      0|      return static_cast<size_type>(__min_cap) - 1;
 1945|      0|    }
 1946|  19.7k|    const size_type __boundary = sizeof(value_type) < __alignment ? __alignment / sizeof(value_type) : __endian_factor;
  ------------------
  |  Branch (1946:34): [True: 0, Folded]
  ------------------
 1947|  19.7k|    size_type __guess          = __align_it<__boundary>(__s + 1) - 1;
 1948|  19.7k|    if (__guess == __min_cap)
  ------------------
  |  Branch (1948:9): [True: 0, False: 19.7k]
  ------------------
 1949|      0|      __guess += __endian_factor;
 1950|  19.7k|    return __guess;
 1951|  19.7k|  }
_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE16__begin_lifetimeB8ne180100EPcm:
 1776|  19.7k|  static _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void __begin_lifetime(pointer __begin, size_type __n) {
 1777|  19.7k|#if _LIBCPP_STD_VER >= 20
 1778|  19.7k|    if (__libcpp_is_constant_evaluated()) {
  ------------------
  |  Branch (1778:9): [Folded, False: 19.7k]
  ------------------
 1779|      0|      for (size_type __i = 0; __i != __n; ++__i)
  ------------------
  |  Branch (1779:31): [True: 0, False: 0]
  ------------------
 1780|      0|        std::construct_at(std::addressof(__begin[__i]));
 1781|      0|    }
 1782|       |#else
 1783|       |    (void)__begin;
 1784|       |    (void)__n;
 1785|       |#endif // _LIBCPP_STD_VER >= 20
 1786|  19.7k|  }
_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE18__set_long_pointerB8ne180100EPc:
 1864|  19.7k|  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void __set_long_pointer(pointer __p) _NOEXCEPT {
 1865|  19.7k|    __r_.first().__l.__data_ = __p;
 1866|  19.7k|  }
_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE14__set_long_capB8ne180100Em:
 1855|  19.7k|  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void __set_long_cap(size_type __s) _NOEXCEPT {
 1856|  19.7k|    __r_.first().__l.__cap_     = __s / __endian_factor;
 1857|  19.7k|    __r_.first().__l.__is_long_ = true;
 1858|  19.7k|  }
_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE15__set_long_sizeB8ne180100Em:
 1842|  20.6k|  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void __set_long_size(size_type __s) _NOEXCEPT {
 1843|  20.6k|    __r_.first().__l.__size_ = __s;
 1844|  20.6k|  }
_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE14__annotate_newB8ne180100Em:
 1904|  21.5k|  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void __annotate_new(size_type __current_size) const _NOEXCEPT {
 1905|  21.5k|    (void) __current_size;
 1906|       |#if !defined(_LIBCPP_HAS_NO_ASAN) && defined(_LIBCPP_INSTRUMENTED_WITH_ASAN)
 1907|       |    if (!__libcpp_is_constant_evaluated() && (__asan_short_string_is_annotated() || __is_long()))
 1908|       |      __annotate_contiguous_container(data() + capacity() + 1, data() + __current_size + 1);
 1909|       |#endif
 1910|  21.5k|  }
_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm:
 2202|  19.2k|basic_string<_CharT, _Traits, _Allocator>::__init(const value_type* __s, size_type __sz) {
 2203|  19.2k|  if (__libcpp_is_constant_evaluated())
  ------------------
  |  Branch (2203:7): [Folded, False: 19.2k]
  ------------------
 2204|      0|    __r_.first() = __rep();
 2205|  19.2k|  if (__sz > max_size())
  ------------------
  |  Branch (2205:7): [True: 0, False: 19.2k]
  ------------------
 2206|      0|    __throw_length_error();
 2207|  19.2k|  pointer __p;
 2208|  19.2k|  if (__fits_in_sso(__sz)) {
  ------------------
  |  Branch (2208:7): [True: 1, False: 19.2k]
  ------------------
 2209|      1|    __set_short_size(__sz);
 2210|      1|    __p = __get_short_pointer();
 2211|  19.2k|  } else {
 2212|  19.2k|    auto __allocation = std::__allocate_at_least(__alloc(), __recommend(__sz) + 1);
 2213|  19.2k|    __p               = __allocation.ptr;
 2214|  19.2k|    __begin_lifetime(__p, __allocation.count);
 2215|  19.2k|    __set_long_pointer(__p);
 2216|  19.2k|    __set_long_cap(__allocation.count);
 2217|  19.2k|    __set_long_size(__sz);
 2218|  19.2k|  }
 2219|  19.2k|  traits_type::copy(std::__to_address(__p), __s, __sz);
 2220|  19.2k|  traits_type::assign(__p[__sz], value_type());
 2221|  19.2k|  __annotate_new(__sz);
 2222|  19.2k|}
_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE17__annotate_deleteB8ne180100Ev:
 1912|  2.35k|  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void __annotate_delete() const _NOEXCEPT {
 1913|       |#if !defined(_LIBCPP_HAS_NO_ASAN) && defined(_LIBCPP_INSTRUMENTED_WITH_ASAN)
 1914|       |    if (!__libcpp_is_constant_evaluated() && (__asan_short_string_is_annotated() || __is_long()))
 1915|       |      __annotate_contiguous_container(data() + size() + 1, data() + capacity() + 1);
 1916|       |#endif
 1917|  2.35k|  }
_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9__is_longB8ne180100Ev:
 1769|   500k|  __is_long() const _NOEXCEPT {
 1770|   500k|    if (__libcpp_is_constant_evaluated() && __builtin_constant_p(__r_.first().__l.__is_long_)) {
  ------------------
  |  Branch (1770:9): [Folded, False: 500k]
  |  Branch (1770:45): [Folded, False: 0]
  ------------------
 1771|      0|      return __r_.first().__l.__is_long_;
 1772|      0|    }
 1773|   500k|    return __r_.first().__s.__is_long_;
 1774|   500k|  }
_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE18__get_long_pointerB8ne180100Ev:
 1867|  1.79k|  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 pointer __get_long_pointer() _NOEXCEPT {
 1868|  1.79k|    return __r_.first().__l.__data_;
 1869|  1.79k|  }
_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE14__get_long_capB8ne180100Ev:
 1860|  1.31k|  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type __get_long_cap() const _NOEXCEPT {
 1861|  1.31k|    return __r_.first().__l.__cap_ * __endian_factor;
 1862|  1.31k|  }
_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE8capacityB8ne180100Ev:
 1191|  5.56k|  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type capacity() const _NOEXCEPT {
 1192|  5.56k|    return (__is_long() ? __get_long_cap() : static_cast<size_type>(__min_cap)) - 1;
  ------------------
  |  Branch (1192:13): [True: 1.19k, False: 4.36k]
  ------------------
 1193|  5.56k|  }
_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE15__get_long_sizeB8ne180100Ev:
 1845|   233k|  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type __get_long_size() const _NOEXCEPT {
 1846|   233k|    return __r_.first().__l.__size_;
 1847|   233k|  }
_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE16__get_short_sizeB8ne180100Ev:
 1837|   251k|  __get_short_size() const _NOEXCEPT {
 1838|   251k|    _LIBCPP_ASSERT_INTERNAL(!__r_.first().__s.__is_long_, "String has to be short when trying to get the short size");
  ------------------
  |  |  417|   251k|#    define _LIBCPP_ASSERT_INTERNAL(expression, message)                  _LIBCPP_ASSUME(expression)
  |  |  ------------------
  |  |  |  |   34|   251k|#  define _LIBCPP_ASSUME(expression) ((void)0)
  |  |  ------------------
  ------------------
 1839|   251k|    return __r_.first().__s.__size_;
 1840|   251k|  }
_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4sizeB8ne180100Ev:
 1176|   483k|  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type size() const _NOEXCEPT {
 1177|   483k|    return __is_long() ? __get_long_size() : __get_short_size();
  ------------------
  |  Branch (1177:12): [True: 233k, False: 250k]
  ------------------
 1178|   483k|  }
_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE19__annotate_increaseB8ne180100Em:
 1919|  2.86k|  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void __annotate_increase(size_type __n) const _NOEXCEPT {
 1920|  2.86k|    (void) __n;
 1921|       |#if !defined(_LIBCPP_HAS_NO_ASAN) && defined(_LIBCPP_INSTRUMENTED_WITH_ASAN)
 1922|       |    if (!__libcpp_is_constant_evaluated() && (__asan_short_string_is_annotated() || __is_long()))
 1923|       |      __annotate_contiguous_container(data() + size() + 1, data() + size() + 1 + __n);
 1924|       |#endif
 1925|  2.86k|  }
_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE13__get_pointerB8ne180100Ev:
 1879|  4.83k|  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 pointer __get_pointer() _NOEXCEPT {
 1880|  4.83k|    return __is_long() ? __get_long_pointer() : __get_short_pointer();
  ------------------
  |  Branch (1880:12): [True: 1.62k, False: 3.21k]
  ------------------
 1881|  4.83k|  }
_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE10__set_sizeB8ne180100Em:
 1848|  2.42k|  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void __set_size(size_type __s) _NOEXCEPT {
 1849|  2.42k|    if (__is_long())
  ------------------
  |  Branch (1849:9): [True: 816, False: 1.60k]
  ------------------
 1850|    816|      __set_long_size(__s);
 1851|  1.60k|    else
 1852|  1.60k|      __set_short_size(__s);
 1853|  2.42k|  }
_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE21__grow_by_and_replaceEmmmmmmPKc:
 2357|     69|    const value_type* __p_new_stuff) {
 2358|     69|  size_type __ms = max_size();
 2359|     69|  if (__delta_cap > __ms - __old_cap - 1)
  ------------------
  |  Branch (2359:7): [True: 0, False: 69]
  ------------------
 2360|      0|    __throw_length_error();
 2361|     69|  pointer __old_p = __get_pointer();
 2362|     69|  size_type __cap =
 2363|     69|      __old_cap < __ms / 2 - __alignment ? __recommend(std::max(__old_cap + __delta_cap, 2 * __old_cap)) : __ms - 1;
  ------------------
  |  Branch (2363:7): [True: 69, False: 0]
  ------------------
 2364|     69|  __annotate_delete();
 2365|     69|  auto __allocation = std::__allocate_at_least(__alloc(), __cap + 1);
 2366|     69|  pointer __p       = __allocation.ptr;
 2367|     69|  __begin_lifetime(__p, __allocation.count);
 2368|     69|  if (__n_copy != 0)
  ------------------
  |  Branch (2368:7): [True: 69, False: 0]
  ------------------
 2369|     69|    traits_type::copy(std::__to_address(__p), std::__to_address(__old_p), __n_copy);
 2370|     69|  if (__n_add != 0)
  ------------------
  |  Branch (2370:7): [True: 69, False: 0]
  ------------------
 2371|     69|    traits_type::copy(std::__to_address(__p) + __n_copy, __p_new_stuff, __n_add);
 2372|     69|  size_type __sec_cp_sz = __old_sz - __n_del - __n_copy;
 2373|     69|  if (__sec_cp_sz != 0)
  ------------------
  |  Branch (2373:7): [True: 0, False: 69]
  ------------------
 2374|      0|    traits_type::copy(
 2375|      0|        std::__to_address(__p) + __n_copy + __n_add, std::__to_address(__old_p) + __n_copy + __n_del, __sec_cp_sz);
 2376|     69|  if (__old_cap + 1 != __min_cap)
  ------------------
  |  Branch (2376:7): [True: 66, False: 3]
  ------------------
 2377|     66|    __alloc_traits::deallocate(__alloc(), __old_p, __old_cap + 1);
 2378|     69|  __set_long_pointer(__p);
 2379|     69|  __set_long_cap(__allocation.count);
 2380|     69|  __old_sz = __n_copy + __n_add + __sec_cp_sz;
 2381|     69|  __set_long_size(__old_sz);
 2382|     69|  traits_type::assign(__p[__old_sz], value_type());
 2383|     69|  __annotate_new(__old_cap + __delta_cap);
 2384|     69|}
_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendEPKcm:
 2711|  1.95k|basic_string<_CharT, _Traits, _Allocator>::append(const value_type* __s, size_type __n) {
 2712|  1.95k|  _LIBCPP_ASSERT_NON_NULL(__n == 0 || __s != nullptr, "string::append received nullptr");
  ------------------
  |  |  409|  1.95k|#    define _LIBCPP_ASSERT_NON_NULL(expression, message)                  _LIBCPP_ASSUME(expression)
  |  |  ------------------
  |  |  |  |   34|  1.95k|#  define _LIBCPP_ASSUME(expression) ((void)0)
  |  |  ------------------
  ------------------
 2713|  1.95k|  size_type __cap = capacity();
 2714|  1.95k|  size_type __sz  = size();
 2715|  1.95k|  if (__cap - __sz >= __n) {
  ------------------
  |  Branch (2715:7): [True: 1.88k, False: 69]
  ------------------
 2716|  1.88k|    if (__n) {
  ------------------
  |  Branch (2716:9): [True: 294, False: 1.59k]
  ------------------
 2717|    294|      __annotate_increase(__n);
 2718|    294|      value_type* __p = std::__to_address(__get_pointer());
 2719|    294|      traits_type::copy(__p + __sz, __s, __n);
 2720|    294|      __sz += __n;
 2721|    294|      __set_size(__sz);
 2722|    294|      traits_type::assign(__p[__sz], value_type());
 2723|    294|    }
 2724|  1.88k|  } else
 2725|     69|    __grow_by_and_replace(__cap, __sz + __n - __cap, __sz, __sz, 0, __n, __s);
 2726|  1.95k|  return *this;
 2727|  1.95k|}
_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9__grow_byEmmmmmm:
 2400|    430|        size_type __n_add) {
 2401|    430|  size_type __ms = max_size();
 2402|    430|  if (__delta_cap > __ms - __old_cap)
  ------------------
  |  Branch (2402:7): [True: 0, False: 430]
  ------------------
 2403|      0|    __throw_length_error();
 2404|    430|  pointer __old_p = __get_pointer();
 2405|    430|  size_type __cap =
 2406|    430|      __old_cap < __ms / 2 - __alignment ? __recommend(std::max(__old_cap + __delta_cap, 2 * __old_cap)) : __ms - 1;
  ------------------
  |  Branch (2406:7): [True: 430, False: 0]
  ------------------
 2407|    430|  __annotate_delete();
 2408|    430|  auto __allocation = std::__allocate_at_least(__alloc(), __cap + 1);
 2409|    430|  pointer __p       = __allocation.ptr;
 2410|    430|  __begin_lifetime(__p, __allocation.count);
 2411|    430|  if (__n_copy != 0)
  ------------------
  |  Branch (2411:7): [True: 430, False: 0]
  ------------------
 2412|    430|    traits_type::copy(std::__to_address(__p), std::__to_address(__old_p), __n_copy);
 2413|    430|  size_type __sec_cp_sz = __old_sz - __n_del - __n_copy;
 2414|    430|  if (__sec_cp_sz != 0)
  ------------------
  |  Branch (2414:7): [True: 0, False: 430]
  ------------------
 2415|      0|    traits_type::copy(
 2416|      0|        std::__to_address(__p) + __n_copy + __n_add, std::__to_address(__old_p) + __n_copy + __n_del, __sec_cp_sz);
 2417|    430|  if (__old_cap + 1 != __min_cap)
  ------------------
  |  Branch (2417:7): [True: 253, False: 177]
  ------------------
 2418|    253|    __alloc_traits::deallocate(__alloc(), __old_p, __old_cap + 1);
 2419|    430|  __set_long_pointer(__p);
 2420|    430|  __set_long_cap(__allocation.count);
 2421|    430|}
_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE25__grow_by_without_replaceB8ne180100Emmmmmm:
 2431|    430|    size_type __n_add) {
 2432|    430|  _LIBCPP_SUPPRESS_DEPRECATED_PUSH
 2433|    430|  __grow_by(__old_cap, __delta_cap, __old_sz, __n_copy, __n_del, __n_add);
 2434|    430|  _LIBCPP_SUPPRESS_DEPRECATED_POP
 2435|    430|  __set_long_size(__old_sz - __n_del + __n_add);
 2436|    430|  __annotate_new(__old_sz - __n_del + __n_add);
 2437|    430|}
_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendEmc:
 2731|  1.84k|basic_string<_CharT, _Traits, _Allocator>::append(size_type __n, value_type __c) {
 2732|  1.84k|  if (__n) {
  ------------------
  |  Branch (2732:7): [True: 1.84k, False: 0]
  ------------------
 2733|  1.84k|    size_type __cap = capacity();
 2734|  1.84k|    size_type __sz  = size();
 2735|  1.84k|    if (__cap - __sz < __n)
  ------------------
  |  Branch (2735:9): [True: 375, False: 1.47k]
  ------------------
 2736|    375|      __grow_by_without_replace(__cap, __sz + __n - __cap, __sz, __sz, 0);
 2737|  1.84k|    __annotate_increase(__n);
 2738|  1.84k|    pointer __p = __get_pointer();
 2739|  1.84k|    traits_type::assign(std::__to_address(__p) + __sz, __n, __c);
 2740|  1.84k|    __sz += __n;
 2741|  1.84k|    __set_size(__sz);
 2742|  1.84k|    traits_type::assign(__p[__sz], value_type());
 2743|  1.84k|  }
 2744|  1.84k|  return *this;
 2745|  1.84k|}
_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6resizeEmc:
 3179|  1.84k|_LIBCPP_CONSTEXPR_SINCE_CXX20 void basic_string<_CharT, _Traits, _Allocator>::resize(size_type __n, value_type __c) {
 3180|  1.84k|  size_type __sz = size();
 3181|  1.84k|  if (__n > __sz)
  ------------------
  |  Branch (3181:7): [True: 1.84k, False: 0]
  ------------------
 3182|  1.84k|    append(__n - __sz, __c);
 3183|      0|  else
 3184|      0|    __erase_to_end(__n);
 3185|  1.84k|}
_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6resizeB8ne180100Em:
 1196|  1.84k|  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void resize(size_type __n) { resize(__n, value_type()); }
_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEixB8ne180100Em:
 1228|  1.03k|  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 reference operator[](size_type __pos) _NOEXCEPT {
 1229|  1.03k|    _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__pos <= size(), "string index out of bounds");
  ------------------
  |  |  408|  1.03k|#    define _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(expression, message)      _LIBCPP_ASSUME(expression)
  |  |  ------------------
  |  |  |  |   34|  1.03k|#  define _LIBCPP_ASSUME(expression) ((void)0)
  |  |  ------------------
  ------------------
 1230|  1.03k|    if (__builtin_constant_p(__pos) && !__fits_in_sso(__pos)) {
  ------------------
  |  Branch (1230:9): [True: 1.03k, False: 0]
  |  Branch (1230:40): [True: 0, False: 1.03k]
  ------------------
 1231|      0|      return *(__get_long_pointer() + __pos);
 1232|      0|    }
 1233|  1.03k|    return *(__get_pointer() + __pos);
 1234|  1.03k|  }
_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE5emptyB8ne180100Ev:
 1216|    492|  _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool empty() const _NOEXCEPT {
 1217|    492|    return size() == 0;
 1218|    492|  }
_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9push_backEc:
 2764|    438|_LIBCPP_CONSTEXPR_SINCE_CXX20 void basic_string<_CharT, _Traits, _Allocator>::push_back(value_type __c) {
 2765|    438|  bool __is_short = !__is_long();
 2766|    438|  size_type __cap;
 2767|    438|  size_type __sz;
 2768|    438|  if (__is_short) {
  ------------------
  |  Branch (2768:7): [True: 438, False: 0]
  ------------------
 2769|    438|    __cap = __min_cap - 1;
 2770|    438|    __sz  = __get_short_size();
 2771|    438|  } else {
 2772|      0|    __cap = __get_long_cap() - 1;
 2773|      0|    __sz  = __get_long_size();
 2774|      0|  }
 2775|    438|  if (__sz == __cap) {
  ------------------
  |  Branch (2775:7): [True: 55, False: 383]
  ------------------
 2776|     55|    __grow_by_without_replace(__cap, 1, __sz, __sz, 0);
 2777|     55|    __annotate_increase(1);
 2778|     55|    __is_short = false; // the string is always long after __grow_by
 2779|     55|  } else
 2780|    383|    __annotate_increase(1);
 2781|    438|  pointer __p = __get_pointer();
 2782|    438|  if (__is_short) {
  ------------------
  |  Branch (2782:7): [True: 383, False: 55]
  ------------------
 2783|    383|    __p = __get_short_pointer() + __sz;
 2784|    383|    __set_short_size(__sz + 1);
 2785|    383|  } else {
 2786|     55|    __p = __get_long_pointer() + __sz;
 2787|     55|    __set_long_size(__sz + 1);
 2788|     55|  }
 2789|    438|  traits_type::assign(*__p, __c);
 2790|    438|  traits_type::assign(*++__p, value_type());
 2791|    438|}
_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4dataB8ne180100Ev:
 1600|    438|  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 value_type* data() _NOEXCEPT {
 1601|    438|    return std::__to_address(__get_pointer());
 1602|    438|  }
_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2ERKS5_:
  897|  1.15k|      : __r_(__default_init_tag(), __alloc_traits::select_on_container_copy_construction(__str.__alloc())) {
  898|  1.15k|    if (!__str.__is_long()) {
  ------------------
  |  Branch (898:9): [True: 1.15k, False: 0]
  ------------------
  899|  1.15k|      __r_.first() = __str.__r_.first();
  900|  1.15k|      __annotate_new(__get_short_size());
  901|  1.15k|    } else
  902|      0|      __init_copy_ctor_external(std::__to_address(__str.__get_long_pointer()), __str.__get_long_size());
  903|  1.15k|  }
_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev:
 1102|  1.85k|  inline _LIBCPP_CONSTEXPR_SINCE_CXX20 ~basic_string() {
 1103|  1.85k|    __annotate_delete();
 1104|  1.85k|    if (__is_long())
  ------------------
  |  Branch (1104:9): [True: 122, False: 1.73k]
  ------------------
 1105|    122|      __alloc_traits::deallocate(__alloc(), __get_long_pointer(), __get_long_cap());
 1106|  1.85k|  }
_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6insertEmPKcm:
 2852|    280|basic_string<_CharT, _Traits, _Allocator>::insert(size_type __pos, const value_type* __s, size_type __n) {
 2853|    280|  _LIBCPP_ASSERT_NON_NULL(__n == 0 || __s != nullptr, "string::insert received nullptr");
  ------------------
  |  |  409|    280|#    define _LIBCPP_ASSERT_NON_NULL(expression, message)                  _LIBCPP_ASSUME(expression)
  |  |  ------------------
  |  |  |  |   34|    280|#  define _LIBCPP_ASSUME(expression) ((void)0)
  |  |  ------------------
  ------------------
 2854|    280|  size_type __sz = size();
 2855|    280|  if (__pos > __sz)
  ------------------
  |  Branch (2855:7): [True: 0, False: 280]
  ------------------
 2856|      0|    __throw_out_of_range();
 2857|    280|  size_type __cap = capacity();
 2858|    280|  if (__cap - __sz >= __n) {
  ------------------
  |  Branch (2858:7): [True: 280, False: 0]
  ------------------
 2859|    280|    if (__n) {
  ------------------
  |  Branch (2859:9): [True: 280, False: 0]
  ------------------
 2860|    280|      __annotate_increase(__n);
 2861|    280|      value_type* __p    = std::__to_address(__get_pointer());
 2862|    280|      size_type __n_move = __sz - __pos;
 2863|    280|      if (__n_move != 0) {
  ------------------
  |  Branch (2863:11): [True: 280, False: 0]
  ------------------
 2864|    280|        if (std::__is_pointer_in_range(__p + __pos, __p + __sz, __s))
  ------------------
  |  Branch (2864:13): [True: 0, False: 280]
  ------------------
 2865|      0|          __s += __n;
 2866|    280|        traits_type::move(__p + __pos + __n, __p + __pos, __n_move);
 2867|    280|      }
 2868|    280|      traits_type::move(__p + __pos, __s, __n);
 2869|    280|      __sz += __n;
 2870|    280|      __set_size(__sz);
 2871|    280|      traits_type::assign(__p[__sz], value_type());
 2872|    280|    }
 2873|    280|  } else
 2874|      0|    __grow_by_and_replace(__cap, __sz + __n - __cap, __sz, __pos, 0, __n, __s);
 2875|    280|  return *this;
 2876|    280|}
_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B8ne180100ILi0EEEPKc:
  952|  19.2k|      : __r_(__default_init_tag(), __default_init_tag()) {
  953|  19.2k|    _LIBCPP_ASSERT_NON_NULL(__s != nullptr, "basic_string(const char*) detected nullptr");
  ------------------
  |  |  409|  19.2k|#    define _LIBCPP_ASSERT_NON_NULL(expression, message)                  _LIBCPP_ASSUME(expression)
  |  |  ------------------
  |  |  |  |   34|  19.2k|#  define _LIBCPP_ASSUME(expression) ((void)0)
  |  |  ------------------
  ------------------
  954|  19.2k|    __init(__s, traits_type::length(__s));
  955|  19.2k|  }
_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B8ne180100Ev:
  882|    663|      : __r_(__value_init_tag(), __default_init_tag()) {
  883|    663|    __annotate_new(0);
  884|    663|  }

locale.cpp:_ZNSt3__15tupleIJOZNS_6locale2id5__getEvE3$_0EEC2B8ne180100IJS3_ETnNS_9enable_ifIXsr4_AndINS_17integral_constantIbXeqsZT_sZT_EEENS5_17_EnableUTypesCtorIJDpT_EEEEE5valueEiE4typeELi0EEEDpOSB_:
  620|     30|      : __base_(typename __make_tuple_indices<sizeof...(_Up)>::type(),
  621|     30|                typename __make_tuple_types<tuple, sizeof...(_Up)>::type(),
  622|     30|                typename __make_tuple_indices<sizeof...(_Tp), sizeof...(_Up)>::type(),
  623|     30|                typename __make_tuple_types<tuple, sizeof...(_Tp), sizeof...(_Up)>::type(),
  624|     30|                std::forward<_Up>(__u)...) {}
locale.cpp:_ZNSt3__112__tuple_implINS_15__tuple_indicesIJLm0EEEEJOZNS_6locale2id5__getEvE3$_0EEC2B8ne180100IJLm0EEJS6_ETpTnmJEJEJS5_EEENS1_IJXspT_EEEENS_13__tuple_typesIJDpT0_EEENS1_IJXspT1_EEEENSA_IJDpT2_EEEDpOT3_:
  473|     30|      : __tuple_leaf<_Uf, _Tf>(std::forward<_Up>(__u))..., __tuple_leaf<_Ul, _Tl>()... {}
locale.cpp:_ZNSt3__112__tuple_leafILm0EOZNS_6locale2id5__getEvE3$_0Lb0EEC2B8ne180100IS3_vEEOT_:
  345|     30|      : __value_(std::forward<_Tp>(__t)) {
  346|     30|    static_assert(__can_bind_reference<_Tp&&>(),
  347|     30|                  "Attempted construction of reference element binds to a temporary whose lifetime has ended");
  348|     30|  }
locale.cpp:_ZNSt3__13getB8ne180100ILm0EJOZNS_6locale2id5__getEvE3$_0EEEONS_13tuple_elementIXT_ENS_5tupleIJDpT0_EEEE4typeEOS9_:
 1084|     30|get(tuple<_Tp...>&& __t) _NOEXCEPT {
 1085|     30|  typedef _LIBCPP_NODEBUG typename tuple_element<_Ip, tuple<_Tp...> >::type type;
 1086|     30|  return static_cast<type&&>(static_cast<__tuple_leaf<_Ip, type>&&>(__t.__base_).get());
 1087|     30|}
locale.cpp:_ZNSt3__112__tuple_leafILm0EOZNS_6locale2id5__getEvE3$_0Lb0EE3getB8ne180100Ev:
  387|     30|  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _Hp& get() _NOEXCEPT { return __value_; }

_ZNSt27__type_info_implementations13__unique_impl4__eqB8ne180100EPKcS2_:
  203|   910k|    _LIBCPP_HIDE_FROM_ABI _LIBCPP_ALWAYS_INLINE static bool __eq(__type_name_t __lhs, __type_name_t __rhs) _NOEXCEPT {
  204|   910k|      return __lhs == __rhs;
  205|   910k|    }
_ZNKSt9type_infoeqB8ne180100ERKS_:
  302|   910k|  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 bool operator==(const type_info& __arg) const _NOEXCEPT {
  303|       |    // When evaluated in a constant expression, both type infos simply can't come
  304|       |    // from different translation units, so it is sufficient to compare their addresses.
  305|   910k|    if (__libcpp_is_constant_evaluated()) {
  ------------------
  |  Branch (305:9): [Folded, False: 910k]
  ------------------
  306|      0|      return this == &__arg;
  307|      0|    }
  308|   910k|    return __impl::__eq(__type_name, __arg.__type_name);
  309|   910k|  }

_ZNSt3__16vectorIPNS_6locale5facetENS_15__sso_allocatorIS3_Lm30EEEEC2Em:
 1118|      1|_LIBCPP_CONSTEXPR_SINCE_CXX20 vector<_Tp, _Allocator>::vector(size_type __n) {
 1119|      1|  auto __guard = std::__make_exception_guard(__destroy_vector(*this));
 1120|      1|  if (__n > 0) {
  ------------------
  |  Branch (1120:7): [True: 1, False: 0]
  ------------------
 1121|      1|    __vallocate(__n);
 1122|      1|    __construct_at_end(__n);
 1123|      1|  }
 1124|      1|  __guard.__complete();
 1125|      1|}
_ZNSt3__16vectorIPNS_6locale5facetENS_15__sso_allocatorIS3_Lm30EEEE16__destroy_vectorC2B8ne180100ERS6_:
  486|      1|    _LIBCPP_CONSTEXPR _LIBCPP_HIDE_FROM_ABI __destroy_vector(vector& __vec) : __vec_(__vec) {}
_ZNSt3__16vectorIPNS_6locale5facetENS_15__sso_allocatorIS3_Lm30EEEE11__vallocateB8ne180100Em:
  738|      1|  _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __vallocate(size_type __n) {
  739|      1|    if (__n > max_size())
  ------------------
  |  Branch (739:9): [True: 0, False: 1]
  ------------------
  740|      0|      __throw_length_error();
  741|      1|    auto __allocation = std::__allocate_at_least(__alloc(), __n);
  742|      1|    __begin_          = __allocation.ptr;
  743|      1|    __end_            = __allocation.ptr;
  744|      1|    __end_cap()       = __begin_ + __allocation.count;
  745|      1|    __annotate_new(0);
  746|      1|  }
_ZNKSt3__16vectorIPNS_6locale5facetENS_15__sso_allocatorIS3_Lm30EEEE8max_sizeEv:
 1030|      1|vector<_Tp, _Allocator>::max_size() const _NOEXCEPT {
 1031|      1|  return std::min<size_type>(__alloc_traits::max_size(this->__alloc()), numeric_limits<difference_type>::max());
 1032|      1|}
_ZNKSt3__16vectorIPNS_6locale5facetENS_15__sso_allocatorIS3_Lm30EEEE7__allocB8ne180100Ev:
  909|      1|  _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const allocator_type& __alloc() const _NOEXCEPT {
  910|      1|    return this->__end_cap_.second();
  911|      1|  }
_ZNSt3__16vectorIPNS_6locale5facetENS_15__sso_allocatorIS3_Lm30EEEE7__allocB8ne180100Ev:
  906|     91|  _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI allocator_type& __alloc() _NOEXCEPT {
  907|     91|    return this->__end_cap_.second();
  908|     91|  }
_ZNSt3__16vectorIPNS_6locale5facetENS_15__sso_allocatorIS3_Lm30EEEE9__end_capB8ne180100Ev:
  912|     31|  _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI pointer& __end_cap() _NOEXCEPT {
  913|     31|    return this->__end_cap_.first();
  914|     31|  }
_ZNKSt3__16vectorIPNS_6locale5facetENS_15__sso_allocatorIS3_Lm30EEEE14__annotate_newB8ne180100Em:
  847|      1|  _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __annotate_new(size_type __current_size) const _NOEXCEPT {
  848|      1|    (void)__current_size;
  849|       |#ifndef _LIBCPP_HAS_NO_ASAN
  850|       |    __annotate_contiguous_container(data() + capacity(), data() + __current_size);
  851|       |#endif
  852|      1|  }
_ZNSt3__16vectorIPNS_6locale5facetENS_15__sso_allocatorIS3_Lm30EEEE18__construct_at_endEm:
 1053|     31|_LIBCPP_CONSTEXPR_SINCE_CXX20 void vector<_Tp, _Allocator>::__construct_at_end(size_type __n) {
 1054|     31|  _ConstructTransaction __tx(*this, __n);
 1055|     31|  const_pointer __new_end = __tx.__new_end_;
 1056|     91|  for (pointer __pos = __tx.__pos_; __pos != __new_end; __tx.__pos_ = ++__pos) {
  ------------------
  |  Branch (1056:37): [True: 60, False: 31]
  ------------------
 1057|     60|    __alloc_traits::construct(this->__alloc(), std::__to_address(__pos));
 1058|     60|  }
 1059|     31|}
_ZNSt3__16vectorIPNS_6locale5facetENS_15__sso_allocatorIS3_Lm30EEEE21_ConstructTransactionC2B8ne180100ERS6_m:
  876|     31|        : __v_(__v), __pos_(__v.__end_), __new_end_(__v.__end_ + __n) {
  877|       |#ifndef _LIBCPP_HAS_NO_ASAN
  878|       |      __v_.__annotate_increase(__n);
  879|       |#endif
  880|     31|    }
_ZNSt3__16vectorIPNS_6locale5facetENS_15__sso_allocatorIS3_Lm30EEEE21_ConstructTransactionD2B8ne180100Ev:
  881|     31|    _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI ~_ConstructTransaction() {
  882|     31|      __v_.__end_ = __pos_;
  883|       |#ifndef _LIBCPP_HAS_NO_ASAN
  884|       |      if (__pos_ != __new_end_) {
  885|       |        __v_.__annotate_shrink(__new_end_ - __v_.__begin_);
  886|       |      }
  887|       |#endif
  888|     31|    }
_ZNSt3__16vectorIPNS_6locale5facetENS_15__sso_allocatorIS3_Lm30EEEE7__clearB8ne180100Ev:
  919|      1|  _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __clear() _NOEXCEPT {
  920|      1|    __base_destruct_at_end(this->__begin_);
  921|      1|  }
_ZNSt3__16vectorIPNS_6locale5facetENS_15__sso_allocatorIS3_Lm30EEEE22__base_destruct_at_endB8ne180100EPS3_:
  923|      1|  _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __base_destruct_at_end(pointer __new_last) _NOEXCEPT {
  924|      1|    pointer __soon_to_be_end = this->__end_;
  925|     31|    while (__new_last != __soon_to_be_end)
  ------------------
  |  Branch (925:12): [True: 30, False: 1]
  ------------------
  926|     30|      __alloc_traits::destroy(__alloc(), std::__to_address(--__soon_to_be_end));
  927|      1|    this->__end_ = __new_last;
  928|      1|  }
_ZNSt3__16vectorIPNS_6locale5facetENS_15__sso_allocatorIS3_Lm30EEEE5clearB8ne180100Ev:
  707|      1|  _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void clear() _NOEXCEPT {
  708|      1|    size_type __old_size = size();
  709|      1|    __clear();
  710|      1|    __annotate_shrink(__old_size);
  711|      1|  }
_ZNKSt3__16vectorIPNS_6locale5facetENS_15__sso_allocatorIS3_Lm30EEEE17__annotate_shrinkB8ne180100Em:
  867|      1|  _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __annotate_shrink(size_type __old_size) const _NOEXCEPT {
  868|      1|    (void)__old_size;
  869|       |#ifndef _LIBCPP_HAS_NO_ASAN
  870|       |    __annotate_contiguous_container(data() + __old_size, data() + size());
  871|       |#endif
  872|      1|  }
_ZNKSt3__16vectorIPNS_6locale5facetENS_15__sso_allocatorIS3_Lm30EEEE4sizeB8ne180100Ev:
  594|  4.57k|  _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI size_type size() const _NOEXCEPT {
  595|  4.57k|    return static_cast<size_type>(this->__end_ - this->__begin_);
  596|  4.57k|  }
_ZNSt3__16vectorIPNS_6locale5facetENS_15__sso_allocatorIS3_Lm30EEEEixB8ne180100Em:
 1392|     60|vector<_Tp, _Allocator>::operator[](size_type __n) _NOEXCEPT {
 1393|     60|  _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__n < size(), "vector[] index out of bounds");
  ------------------
  |  |  408|     60|#    define _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(expression, message)      _LIBCPP_ASSUME(expression)
  |  |  ------------------
  |  |  |  |   34|     60|#  define _LIBCPP_ASSUME(expression) ((void)0)
  |  |  ------------------
  ------------------
 1394|     60|  return this->__begin_[__n];
 1395|     60|}
_ZNSt3__16vectorIPNS_6locale5facetENS_15__sso_allocatorIS3_Lm30EEEE6resizeEm:
 1747|     30|_LIBCPP_CONSTEXPR_SINCE_CXX20 void vector<_Tp, _Allocator>::resize(size_type __sz) {
 1748|     30|  size_type __cs = size();
 1749|     30|  if (__cs < __sz)
  ------------------
  |  Branch (1749:7): [True: 30, False: 0]
  ------------------
 1750|     30|    this->__append(__sz - __cs);
 1751|      0|  else if (__cs > __sz)
  ------------------
  |  Branch (1751:12): [True: 0, False: 0]
  ------------------
 1752|      0|    this->__destruct_at_end(this->__begin_ + __sz);
 1753|     30|}
_ZNSt3__16vectorIPNS_6locale5facetENS_15__sso_allocatorIS3_Lm30EEEE8__appendEm:
 1090|     30|_LIBCPP_CONSTEXPR_SINCE_CXX20 void vector<_Tp, _Allocator>::__append(size_type __n) {
 1091|     30|  if (static_cast<size_type>(this->__end_cap() - this->__end_) >= __n)
  ------------------
  |  Branch (1091:7): [True: 30, False: 0]
  ------------------
 1092|     30|    this->__construct_at_end(__n);
 1093|      0|  else {
 1094|      0|    allocator_type& __a = this->__alloc();
 1095|      0|    __split_buffer<value_type, allocator_type&> __v(__recommend(size() + __n), size(), __a);
 1096|      0|    __v.__construct_at_end(__n);
 1097|      0|    __swap_out_circular_buffer(__v);
 1098|      0|  }
 1099|     30|}
_ZNKSt3__16vectorIPNS_6locale5facetENS_15__sso_allocatorIS3_Lm30EEEEixB8ne180100Em:
 1399|  9.01k|vector<_Tp, _Allocator>::operator[](size_type __n) const _NOEXCEPT {
 1400|  9.01k|  _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__n < size(), "vector[] index out of bounds");
  ------------------
  |  |  408|  9.01k|#    define _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(expression, message)      _LIBCPP_ASSUME(expression)
  |  |  ------------------
  |  |  |  |   34|  9.01k|#  define _LIBCPP_ASSUME(expression) ((void)0)
  |  |  ------------------
  ------------------
 1401|  9.01k|  return this->__begin_[__n];
 1402|  9.01k|}

_ZNSt3__111__call_onceERVmPvPFvS2_E:
   31|     30|void __call_once(volatile once_flag::_State_type& flag, void* arg, void (*func)(void*)) {
   32|       |#if defined(_LIBCPP_HAS_NO_THREADS)
   33|       |
   34|       |  if (flag == once_flag::_Unset) {
   35|       |    auto guard = std::__make_exception_guard([&flag] { flag = once_flag::_Unset; });
   36|       |    flag       = once_flag::_Pending;
   37|       |    func(arg);
   38|       |    flag = once_flag::_Complete;
   39|       |    guard.__complete();
   40|       |  }
   41|       |
   42|       |#else // !_LIBCPP_HAS_NO_THREADS
   43|       |
   44|     30|  __libcpp_mutex_lock(&mut);
   45|     30|  while (flag == once_flag::_Pending)
  ------------------
  |  Branch (45:10): [True: 0, False: 30]
  ------------------
   46|      0|    __libcpp_condvar_wait(&cv, &mut);
   47|     30|  if (flag == once_flag::_Unset) {
  ------------------
  |  Branch (47:7): [True: 30, False: 0]
  ------------------
   48|     30|    auto guard = std::__make_exception_guard([&flag] {
   49|     30|      __libcpp_mutex_lock(&mut);
   50|     30|      __libcpp_relaxed_store(&flag, once_flag::_Unset);
   51|     30|      __libcpp_mutex_unlock(&mut);
   52|     30|      __libcpp_condvar_broadcast(&cv);
   53|     30|    });
   54|       |
   55|     30|    __libcpp_relaxed_store(&flag, once_flag::_Pending);
   56|     30|    __libcpp_mutex_unlock(&mut);
   57|     30|    func(arg);
   58|     30|    __libcpp_mutex_lock(&mut);
   59|     30|    __libcpp_atomic_store(&flag, once_flag::_Complete, _AO_Release);
   60|     30|    __libcpp_mutex_unlock(&mut);
   61|     30|    __libcpp_condvar_broadcast(&cv);
   62|     30|    guard.__complete();
   63|     30|  } else {
   64|      0|    __libcpp_mutex_unlock(&mut);
   65|      0|  }
   66|       |
   67|     30|#endif // !_LIBCPP_HAS_NO_THREADS
   68|     30|}

cxa_handlers.cpp:_ZNSt3__112_GLOBAL__N_120__libcpp_atomic_loadB8ne180100IPFvvEEET_PKS4_i:
   58|   344k|inline _LIBCPP_HIDE_FROM_ABI _ValueType __libcpp_atomic_load(_ValueType const* __val, int __order = _AO_Seq) {
   59|   344k|  return __atomic_load_n(__val, __order);
   60|   344k|}
cxa_exception.cpp:_ZNSt3__112_GLOBAL__N_119__libcpp_atomic_addB8ne180100ImmEET_PS2_T0_i:
   63|   172k|inline _LIBCPP_HIDE_FROM_ABI _ValueType __libcpp_atomic_add(_ValueType* __val, _AddType __a, int __order = _AO_Seq) {
   64|   172k|  return __atomic_add_fetch(__val, __a, __order);
   65|   172k|}
memory.cpp:_ZNSt3__112_GLOBAL__N_120__libcpp_atomic_loadB8ne180100IlEET_PKS2_i:
   58|  15.4k|inline _LIBCPP_HIDE_FROM_ABI _ValueType __libcpp_atomic_load(_ValueType const* __val, int __order = _AO_Seq) {
   59|  15.4k|  return __atomic_load_n(__val, __order);
   60|  15.4k|}
stdlib_stdexcept.cpp:_ZNSt3__112_GLOBAL__N_119__libcpp_atomic_addB8ne180100IiiEET_PS2_T0_i:
   63|   172k|inline _LIBCPP_HIDE_FROM_ABI _ValueType __libcpp_atomic_add(_ValueType* __val, _AddType __a, int __order = _AO_Seq) {
   64|   172k|  return __atomic_add_fetch(__val, __a, __order);
   65|   172k|}
cxa_guard.cpp:_ZNSt3__112_GLOBAL__N_120__libcpp_atomic_loadB8ne180100IhEET_PKS2_i:
   58|      3|inline _LIBCPP_HIDE_FROM_ABI _ValueType __libcpp_atomic_load(_ValueType const* __val, int __order = _AO_Seq) {
   59|      3|  return __atomic_load_n(__val, __order);
   60|      3|}
cxa_guard.cpp:_ZNSt3__112_GLOBAL__N_121__libcpp_atomic_storeB8ne180100IhhEEvPT_T0_i:
   48|      3|inline _LIBCPP_HIDE_FROM_ABI void __libcpp_atomic_store(_ValueType* __dest, _FromType __val, int __order = _AO_Seq) {
   49|      3|  __atomic_store_n(__dest, __val, __order);
   50|      3|}
locale.cpp:_ZNSt3__112_GLOBAL__N_119__libcpp_atomic_addB8ne180100IiiEET_PS2_T0_i:
   63|     30|inline _LIBCPP_HIDE_FROM_ABI _ValueType __libcpp_atomic_add(_ValueType* __val, _AddType __a, int __order = _AO_Seq) {
   64|     30|  return __atomic_add_fetch(__val, __a, __order);
   65|     30|}
call_once.cpp:_ZNSt3__112_GLOBAL__N_122__libcpp_relaxed_storeB8ne180100IVmmEEvPT_T0_:
   53|     30|inline _LIBCPP_HIDE_FROM_ABI void __libcpp_relaxed_store(_ValueType* __dest, _FromType __val) {
   54|     30|  __atomic_store_n(__dest, __val, _AO_Relaxed);
   55|     30|}
call_once.cpp:_ZNSt3__112_GLOBAL__N_121__libcpp_atomic_storeB8ne180100IVmmEEvPT_T0_i:
   48|     30|inline _LIBCPP_HIDE_FROM_ABI void __libcpp_atomic_store(_ValueType* __dest, _FromType __val, int __order = _AO_Seq) {
   49|     30|  __atomic_store_n(__dest, __val, __order);
   50|     30|}

_ZNSt3__118__libcpp_refstringD2Ev:
  108|   172k|inline __libcpp_refstring::~__libcpp_refstring() {
  109|   172k|  if (__uses_refcount()) {
  ------------------
  |  Branch (109:7): [True: 172k, False: 0]
  ------------------
  110|   172k|    _Rep_base* rep = rep_from_data(__imp_);
  111|   172k|    if (__libcpp_atomic_add(&rep->count, count_t(-1)) < 0) {
  ------------------
  |  Branch (111:9): [True: 172k, False: 3]
  ------------------
  112|   172k|      ::operator delete(rep);
  113|   172k|    }
  114|   172k|  }
  115|   172k|}
_ZNKSt3__118__libcpp_refstring15__uses_refcountEv:
  117|   172k|inline bool __libcpp_refstring::__uses_refcount() const {
  118|       |#if defined(_LIBCPP_CHECK_FOR_GCC_EMPTY_STRING_STORAGE)
  119|       |  return __imp_ != get_gcc_empty_string_storage();
  120|       |#else
  121|   172k|  return true;
  122|   172k|#endif
  123|   172k|}
stdlib_stdexcept.cpp:_ZNSt3__115__refstring_imp12_GLOBAL__N_113rep_from_dataEPKc:
   46|   172k|inline _Rep_base* rep_from_data(const char* data_) noexcept {
   47|   172k|  char* data = const_cast<char*>(data_);
   48|   172k|  return reinterpret_cast<_Rep_base*>(data - sizeof(_Rep_base));
   49|   172k|}
_ZNSt3__118__libcpp_refstringC2EPKc:
   78|   172k|inline __libcpp_refstring::__libcpp_refstring(const char* msg) {
   79|   172k|  std::size_t len = strlen(msg);
   80|   172k|  _Rep_base* rep  = static_cast<_Rep_base*>(::operator new(sizeof(*rep) + len + 1));
   81|   172k|  rep->len        = len;
   82|   172k|  rep->cap        = len;
   83|   172k|  rep->count      = 0;
   84|   172k|  char* data      = data_from_rep(rep);
   85|   172k|  std::memcpy(data, msg, len + 1);
   86|   172k|  __imp_ = data;
   87|   172k|}
stdexcept.cpp:_ZNSt3__115__refstring_imp12_GLOBAL__N_113data_from_repEPNS1_9_Rep_baseE:
   51|   172k|inline char* data_from_rep(_Rep_base* rep) noexcept {
   52|   172k|  char* data = reinterpret_cast<char*>(rep);
   53|   172k|  return data + sizeof(*rep);
   54|   172k|}

_ZNSt3__115__sso_allocatorIPNS_6locale5facetELm30EEC2B8ne180100Ev:
   50|      1|  _LIBCPP_HIDE_FROM_ABI __sso_allocator() throw() : __allocated_(false) {}
_ZNKSt3__115__sso_allocatorIPNS_6locale5facetELm30EE8max_sizeB8ne180100Ev:
   72|      1|  _LIBCPP_HIDE_FROM_ABI size_type max_size() const throw() { return size_type(~0) / sizeof(_Tp); }
_ZNSt3__115__sso_allocatorIPNS_6locale5facetELm30EE8allocateB8ne180100EmPKv:
   59|      1|  _LIBCPP_HIDE_FROM_ABI pointer allocate(size_type __n, typename __sso_allocator<void, _Np>::const_pointer = nullptr) {
   60|      1|    if (!__allocated_ && __n <= _Np) {
  ------------------
  |  Branch (60:9): [True: 1, False: 0]
  |  Branch (60:26): [True: 1, False: 0]
  ------------------
   61|      1|      __allocated_ = true;
   62|      1|      return (pointer)&buf_;
   63|      1|    }
   64|      0|    return allocator<_Tp>().allocate(__n);
   65|      1|  }

_ZNSt3__18ios_base16__call_callbacksENS0_5eventE:
   95|    723|void ios_base::__call_callbacks(event ev) {
   96|    723|  for (size_t i = __event_size_; i;) {
  ------------------
  |  Branch (96:34): [True: 0, False: 723]
  ------------------
   97|      0|    --i;
   98|      0|    __fn_[i](ev, *this, __index_[i]);
   99|      0|  }
  100|    723|}
_ZNKSt3__18ios_base6getlocEv:
  113|  3.35k|locale ios_base::getloc() const {
  114|  3.35k|  const locale& loc_storage = *reinterpret_cast<const locale*>(&__loc_);
  115|  3.35k|  return loc_storage;
  116|  3.35k|}
_ZNSt3__18ios_baseD2Ev:
  197|    723|ios_base::~ios_base() {
  198|    723|  __call_callbacks(erase_event);
  199|    723|  locale& loc_storage = *reinterpret_cast<locale*>(&__loc_);
  200|    723|  loc_storage.~locale();
  201|    723|  free(__fn_);
  202|    723|  free(__index_);
  203|    723|  free(__iarray_);
  204|    723|  free(__parray_);
  205|    723|}
_ZNSt3__18ios_base5clearEj:
  209|  1.08k|void ios_base::clear(iostate state) {
  210|  1.08k|  if (__rdbuf_)
  ------------------
  |  Branch (210:7): [True: 1.08k, False: 0]
  ------------------
  211|  1.08k|    __rdstate_ = state;
  212|      0|  else
  213|      0|    __rdstate_ = state | badbit;
  214|       |
  215|  1.08k|  if (((state | (__rdbuf_ ? goodbit : badbit)) & __exceptions_) != 0)
  ------------------
  |  Branch (215:7): [True: 0, False: 1.08k]
  |  Branch (215:18): [True: 1.08k, False: 0]
  ------------------
  216|      0|    __throw_failure("ios_base::clear");
  217|  1.08k|}
_ZNSt3__18ios_base4initEPv:
  221|    723|void ios_base::init(void* sb) {
  222|    723|  __rdbuf_       = sb;
  223|    723|  __rdstate_     = __rdbuf_ ? goodbit : badbit;
  ------------------
  |  Branch (223:20): [True: 723, False: 0]
  ------------------
  224|    723|  __exceptions_  = goodbit;
  225|    723|  __fmtflags_    = skipws | dec;
  226|    723|  __width_       = 0;
  227|    723|  __precision_   = 6;
  228|    723|  __fn_          = 0;
  229|    723|  __index_       = 0;
  230|    723|  __event_size_  = 0;
  231|    723|  __event_cap_   = 0;
  232|    723|  __iarray_      = 0;
  233|    723|  __iarray_size_ = 0;
  234|    723|  __iarray_cap_  = 0;
  235|    723|  __parray_      = 0;
  236|    723|  __parray_size_ = 0;
  237|    723|  __parray_cap_  = 0;
  238|    723|  ::new (&__loc_) locale;
  239|    723|}

_ZNSt3__16__clocEv:
   75|  1.07k|locale_t __cloc() {
   76|       |  // In theory this could create a race condition. In practice
   77|       |  // the race condition is non-fatal since it will just create
   78|       |  // a little resource leak. Better approach would be appreciated.
   79|       |  static locale_t result = newlocale(LC_ALL_MASK, "C", 0);
   80|  1.07k|  return result;
   81|  1.07k|}
_ZNSt3__16locale5__impC2Em:
  161|      1|locale::__imp::__imp(size_t refs) : facet(refs), facets_(N), name_("C") {
  162|      1|  facets_.clear();
  163|      1|  install(&make<std::collate<char> >(1u));
  164|      1|#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
  165|      1|  install(&make<std::collate<wchar_t> >(1u));
  166|      1|#endif
  167|      1|  install(&make<std::ctype<char> >(nullptr, false, 1u));
  168|      1|#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
  169|      1|  install(&make<std::ctype<wchar_t> >(1u));
  170|      1|#endif
  171|      1|  install(&make<codecvt<char, char, mbstate_t> >(1u));
  172|      1|#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
  173|      1|  install(&make<codecvt<wchar_t, char, mbstate_t> >(1u));
  174|      1|#endif
  175|      1|  _LIBCPP_SUPPRESS_DEPRECATED_PUSH
  176|      1|  install(&make<codecvt<char16_t, char, mbstate_t> >(1u));
  177|      1|  install(&make<codecvt<char32_t, char, mbstate_t> >(1u));
  178|      1|  _LIBCPP_SUPPRESS_DEPRECATED_POP
  179|      1|#ifndef _LIBCPP_HAS_NO_CHAR8_T
  180|      1|  install(&make<codecvt<char16_t, char8_t, mbstate_t> >(1u));
  181|      1|  install(&make<codecvt<char32_t, char8_t, mbstate_t> >(1u));
  182|      1|#endif
  183|      1|  install(&make<numpunct<char> >(1u));
  184|      1|#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
  185|      1|  install(&make<numpunct<wchar_t> >(1u));
  186|      1|#endif
  187|      1|  install(&make<num_get<char> >(1u));
  188|      1|#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
  189|      1|  install(&make<num_get<wchar_t> >(1u));
  190|      1|#endif
  191|      1|  install(&make<num_put<char> >(1u));
  192|      1|#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
  193|      1|  install(&make<num_put<wchar_t> >(1u));
  194|      1|#endif
  195|      1|  install(&make<moneypunct<char, false> >(1u));
  196|      1|  install(&make<moneypunct<char, true> >(1u));
  197|      1|#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
  198|      1|  install(&make<moneypunct<wchar_t, false> >(1u));
  199|      1|  install(&make<moneypunct<wchar_t, true> >(1u));
  200|      1|#endif
  201|      1|  install(&make<money_get<char> >(1u));
  202|      1|#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
  203|      1|  install(&make<money_get<wchar_t> >(1u));
  204|      1|#endif
  205|      1|  install(&make<money_put<char> >(1u));
  206|      1|#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
  207|      1|  install(&make<money_put<wchar_t> >(1u));
  208|      1|#endif
  209|      1|  install(&make<time_get<char> >(1u));
  210|      1|#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
  211|      1|  install(&make<time_get<wchar_t> >(1u));
  212|      1|#endif
  213|      1|  install(&make<time_put<char> >(1u));
  214|      1|#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
  215|      1|  install(&make<time_put<wchar_t> >(1u));
  216|      1|#endif
  217|      1|  install(&make<std::messages<char> >(1u));
  218|      1|#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
  219|      1|  install(&make<std::messages<wchar_t> >(1u));
  220|      1|#endif
  221|      1|}
_ZNSt3__16locale5__imp7installEPNS0_5facetEl:
  475|     30|void locale::__imp::install(facet* f, long id) {
  476|     30|  f->__add_shared();
  477|     30|  unique_ptr<facet, releaser> hold(f);
  478|     30|  if (static_cast<size_t>(id) >= facets_.size())
  ------------------
  |  Branch (478:7): [True: 30, False: 0]
  ------------------
  479|     30|    facets_.resize(static_cast<size_t>(id + 1));
  480|     30|  if (facets_[static_cast<size_t>(id)])
  ------------------
  |  Branch (480:7): [True: 0, False: 30]
  ------------------
  481|      0|    facets_[static_cast<size_t>(id)]->__release_shared();
  482|     30|  facets_[static_cast<size_t>(id)] = hold.release();
  483|     30|}
_ZNKSt3__16locale5__imp9use_facetEl:
  485|  4.50k|const locale::facet* locale::__imp::use_facet(long id) const {
  486|  4.50k|  if (!has_facet(id))
  ------------------
  |  Branch (486:7): [True: 0, False: 4.50k]
  ------------------
  487|      0|    __throw_bad_cast();
  488|  4.50k|  return facets_[static_cast<size_t>(id)];
  489|  4.50k|}
_ZNSt3__16locale7classicEv:
  501|      1|const locale& locale::classic() {
  502|      1|  static const __no_destroy<locale> classic_locale(__private_tag{}, [] {
  503|       |    // executed exactly once on first initialization of `classic_locale`
  504|      1|    locale::__imp::classic_locale_imp_.__emplace(1u);
  505|      1|    return &locale::__imp::classic_locale_imp_.__get();
  506|      1|  }());
  507|      1|  return classic_locale.__get();
  508|      1|}
_ZNSt3__16locale8__globalEv:
  510|  1.44k|locale& locale::__global() {
  511|  1.44k|  static __no_destroy<locale> g(locale::classic());
  512|  1.44k|  return g.__get();
  513|  1.44k|}
_ZNSt3__16locale5__imp7acquireEv:
  515|  4.80k|void locale::__imp::acquire() {
  516|  4.80k|  if (this != &locale::__imp::classic_locale_imp_.__get())
  ------------------
  |  Branch (516:7): [True: 0, False: 4.80k]
  ------------------
  517|      0|    __add_shared();
  518|  4.80k|}
_ZNSt3__16locale5__imp7releaseEv:
  520|  4.80k|void locale::__imp::release() {
  521|  4.80k|  if (this != &locale::__imp::classic_locale_imp_.__get())
  ------------------
  |  Branch (521:7): [True: 0, False: 4.80k]
  ------------------
  522|      0|    __release_shared();
  523|  4.80k|}
_ZNSt3__16localeC2Ev:
  525|  1.44k|locale::locale() noexcept : __locale_(__global().__locale_) { __locale_->acquire(); }
_ZNSt3__16localeC2ERKS0_:
  527|  3.35k|locale::locale(const locale& l) noexcept : __locale_(l.__locale_) { __locale_->acquire(); }
_ZNSt3__16localeD2Ev:
  529|  4.80k|locale::~locale() { __locale_->release(); }
_ZNKSt3__16locale9use_facetERNS0_2idE:
  581|  4.50k|const locale::facet* locale::use_facet(id& x) const { return __locale_->use_facet(x.__get()); }
_ZNSt3__16locale2id5__getEv:
  597|  4.53k|long locale::id::__get() {
  598|  4.53k|  call_once(__flag_, [&] { __id_ = __libcpp_atomic_add(&__next_id, 1); });
  599|  4.53k|  return __id_ - 1;
  600|  4.53k|}
_ZNSt3__15ctypeIcEC2EPKtbm:
  809|      1|ctype<char>::ctype(const mask* tab, bool del, size_t refs) : locale::facet(refs), __tab_(tab), __del_(del) {
  810|      1|  if (__tab_ == 0)
  ------------------
  |  Branch (810:7): [True: 1, False: 0]
  ------------------
  811|      1|    __tab_ = classic_table();
  812|      1|}
_ZNKSt3__15ctypeIcE8do_widenEc:
  871|    383|char ctype<char>::do_widen(char c) const { return c; }
_ZNKSt3__15ctypeIcE8do_widenEPKcS3_Pc:
  873|  1.15k|const char* ctype<char>::do_widen(const char* low, const char* high, char_type* dest) const {
  874|  19.2k|  for (; low != high; ++low, ++dest)
  ------------------
  |  Branch (874:10): [True: 18.1k, False: 1.15k]
  ------------------
  875|  18.1k|    *dest = *low;
  876|  1.15k|  return low;
  877|  1.15k|}
_ZNSt3__15ctypeIcE13classic_tableEv:
  981|      1|const ctype<char>::mask* ctype<char>::classic_table() noexcept {
  982|       |#  if defined(__APPLE__) || defined(__FreeBSD__)
  983|       |  return _DefaultRuneLocale.__runetype;
  984|       |#  elif defined(__NetBSD__)
  985|       |  return _C_ctype_tab_ + 1;
  986|       |#  elif defined(__GLIBC__)
  987|      1|  return _LIBCPP_GET_C_LOCALE->__ctype_b;
  ------------------
  |  |  246|      1|#  define _LIBCPP_GET_C_LOCALE __cloc()
  ------------------
  988|       |#  elif defined(_LIBCPP_MSVCRT) || defined(__MINGW32__)
  989|       |  return __pctype_func();
  990|       |#  elif defined(__EMSCRIPTEN__)
  991|       |  return *__ctype_b_loc();
  992|       |#  elif defined(_NEWLIB_VERSION)
  993|       |  // Newlib has a 257-entry table in ctype_.c, where (char)0 starts at [1].
  994|       |  return _ctype_ + 1;
  995|       |#  elif defined(_AIX)
  996|       |  return (const unsigned int*)__lc_ctype_ptr->obj->mask;
  997|       |#  elif defined(__MVS__)
  998|       |#    if defined(__NATIVE_ASCII_F)
  999|       |  return const_cast<const ctype<char>::mask*>(__OBJ_DATA(__lc_ctype_a)->mask);
 1000|       |#    else
 1001|       |  return const_cast<const ctype<char>::mask*>(__ctypec);
 1002|       |#    endif
 1003|       |#  else
 1004|       |  // Platform not supported: abort so the person doing the port knows what to
 1005|       |  // fix
 1006|       |#    warning ctype<char>::classic_table() is not implemented
 1007|       |  printf("ctype<char>::classic_table() is not implemented\n");
 1008|       |  abort();
 1009|       |  return NULL;
 1010|       |#  endif
 1011|      1|}
_ZNSt3__17codecvtIwc11__mbstate_tEC2Em:
 1339|      1|codecvt<wchar_t, char, mbstate_t>::codecvt(size_t refs) : locale::facet(refs), __l_(_LIBCPP_GET_C_LOCALE) {}
  ------------------
  |  |  246|      1|#  define _LIBCPP_GET_C_LOCALE __cloc()
  ------------------
_ZNSt3__18numpunctIcEC2Em:
 4011|      1|numpunct<char>::numpunct(size_t refs) : locale::facet(refs), __decimal_point_('.'), __thousands_sep_(',') {}
_ZNSt3__18numpunctIwEC2Em:
 4014|      1|numpunct<wchar_t>::numpunct(size_t refs) : locale::facet(refs), __decimal_point_(L'.'), __thousands_sep_(L',') {}
_ZNKSt3__18numpunctIcE16do_thousands_sepEv:
 4028|    661|char numpunct< char >::do_thousands_sep() const { return __thousands_sep_; }
_ZNKSt3__18numpunctIcE11do_groupingEv:
 4033|  1.15k|string numpunct< char >::do_grouping() const { return __grouping_; }
_ZNSt3__114__num_get_base10__get_baseERNS_8ios_baseE:
 4109|    661|int __num_get_base::__get_base(ios_base& iob) {
 4110|    661|  ios_base::fmtflags __basefield = iob.flags() & ios_base::basefield;
 4111|    661|  if (__basefield == ios_base::oct)
  ------------------
  |  Branch (4111:7): [True: 0, False: 661]
  ------------------
 4112|      0|    return 8;
 4113|    661|  else if (__basefield == ios_base::hex)
  ------------------
  |  Branch (4113:12): [True: 0, False: 661]
  ------------------
 4114|      0|    return 16;
 4115|    661|  else if (__basefield == 0)
  ------------------
  |  Branch (4115:12): [True: 0, False: 661]
  ------------------
 4116|      0|    return 0;
 4117|    661|  return 10;
 4118|    661|}
_ZNSt3__116__check_groupingERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjS8_Rj:
 4122|    661|void __check_grouping(const string& __grouping, unsigned* __g, unsigned* __g_end, ios_base::iostate& __err) {
 4123|       |  //  if the grouping pattern is empty _or_ there are no grouping bits, then do nothing
 4124|       |  //  we always have at least a single entry in [__g, __g_end); the end of the input sequence
 4125|    661|  if (__grouping.size() != 0 && __g_end - __g > 1) {
  ------------------
  |  Branch (4125:7): [True: 0, False: 661]
  |  Branch (4125:33): [True: 0, False: 0]
  ------------------
 4126|      0|    reverse(__g, __g_end);
 4127|      0|    const char* __ig = __grouping.data();
 4128|      0|    const char* __eg = __ig + __grouping.size();
 4129|      0|    for (unsigned* __r = __g; __r < __g_end - 1; ++__r) {
  ------------------
  |  Branch (4129:31): [True: 0, False: 0]
  ------------------
 4130|      0|      if (0 < *__ig && *__ig < numeric_limits<char>::max()) {
  ------------------
  |  Branch (4130:11): [True: 0, False: 0]
  |  Branch (4130:24): [True: 0, False: 0]
  ------------------
 4131|      0|        if (static_cast<unsigned>(*__ig) != *__r) {
  ------------------
  |  Branch (4131:13): [True: 0, False: 0]
  ------------------
 4132|      0|          __err = ios_base::failbit;
 4133|      0|          return;
 4134|      0|        }
 4135|      0|      }
 4136|      0|      if (__eg - __ig > 1)
  ------------------
  |  Branch (4136:11): [True: 0, False: 0]
  ------------------
 4137|      0|        ++__ig;
 4138|      0|    }
 4139|      0|    if (0 < *__ig && *__ig < numeric_limits<char>::max()) {
  ------------------
  |  Branch (4139:9): [True: 0, False: 0]
  |  Branch (4139:22): [True: 0, False: 0]
  ------------------
 4140|      0|      if (static_cast<unsigned>(*__ig) < __g_end[-1] || __g_end[-1] == 0)
  ------------------
  |  Branch (4140:11): [True: 0, False: 0]
  |  Branch (4140:57): [True: 0, False: 0]
  ------------------
 4141|      0|        __err = ios_base::failbit;
 4142|      0|    }
 4143|      0|  }
 4144|    661|}
_ZNSt3__114__num_put_base12__format_intEPcPKcbj:
 4146|    492|void __num_put_base::__format_int(char* __fmtp, const char* __len, bool __signd, ios_base::fmtflags __flags) {
 4147|    492|  if ((__flags & ios_base::showpos) && (__flags & ios_base::basefield) != ios_base::oct &&
  ------------------
  |  Branch (4147:7): [True: 0, False: 492]
  |  Branch (4147:40): [True: 0, False: 0]
  ------------------
 4148|      0|      (__flags & ios_base::basefield) != ios_base::hex && __signd)
  ------------------
  |  Branch (4148:7): [True: 0, False: 0]
  |  Branch (4148:59): [True: 0, False: 0]
  ------------------
 4149|      0|    *__fmtp++ = '+';
 4150|    492|  if (__flags & ios_base::showbase)
  ------------------
  |  Branch (4150:7): [True: 0, False: 492]
  ------------------
 4151|      0|    *__fmtp++ = '#';
 4152|    984|  while (*__len)
  ------------------
  |  Branch (4152:10): [True: 492, False: 492]
  ------------------
 4153|    492|    *__fmtp++ = *__len++;
 4154|    492|  if ((__flags & ios_base::basefield) == ios_base::oct)
  ------------------
  |  Branch (4154:7): [True: 0, False: 492]
  ------------------
 4155|      0|    *__fmtp = 'o';
 4156|    492|  else if ((__flags & ios_base::basefield) == ios_base::hex) {
  ------------------
  |  Branch (4156:12): [True: 0, False: 492]
  ------------------
 4157|      0|    if (__flags & ios_base::uppercase)
  ------------------
  |  Branch (4157:9): [True: 0, False: 0]
  ------------------
 4158|      0|      *__fmtp = 'X';
 4159|      0|    else
 4160|      0|      *__fmtp = 'x';
 4161|    492|  } else if (__signd)
  ------------------
  |  Branch (4161:14): [True: 0, False: 492]
  ------------------
 4162|      0|    *__fmtp = 'd';
 4163|    492|  else
 4164|    492|    *__fmtp = 'u';
 4165|    492|}
_ZNSt3__114__num_put_base18__identify_paddingEPcS1_RKNS_8ios_baseE:
 4207|    492|char* __num_put_base::__identify_padding(char* __nb, char* __ne, const ios_base& __iob) {
 4208|    492|  switch (__iob.flags() & ios_base::adjustfield) {
 4209|      0|  case ios_base::internal:
  ------------------
  |  Branch (4209:3): [True: 0, False: 492]
  ------------------
 4210|      0|    if (__nb[0] == '-' || __nb[0] == '+')
  ------------------
  |  Branch (4210:9): [True: 0, False: 0]
  |  Branch (4210:27): [True: 0, False: 0]
  ------------------
 4211|      0|      return __nb + 1;
 4212|      0|    if (__ne - __nb >= 2 && __nb[0] == '0' && (__nb[1] == 'x' || __nb[1] == 'X'))
  ------------------
  |  Branch (4212:9): [True: 0, False: 0]
  |  Branch (4212:29): [True: 0, False: 0]
  |  Branch (4212:48): [True: 0, False: 0]
  |  Branch (4212:66): [True: 0, False: 0]
  ------------------
 4213|      0|      return __nb + 2;
 4214|      0|    break;
 4215|      0|  case ios_base::left:
  ------------------
  |  Branch (4215:3): [True: 0, False: 492]
  ------------------
 4216|      0|    return __ne;
 4217|      0|  case ios_base::right:
  ------------------
  |  Branch (4217:3): [True: 0, False: 492]
  ------------------
 4218|    492|  default:
  ------------------
  |  Branch (4218:3): [True: 492, False: 0]
  ------------------
 4219|    492|    break;
 4220|    492|  }
 4221|    492|  return __nb;
 4222|    492|}
_ZNKSt3__16locale5__imp9has_facetEl:
  144|  4.50k|  bool has_facet(long id) const { return static_cast<size_t>(id) < facets_.size() && facets_[static_cast<size_t>(id)]; }
  ------------------
  |  Branch (144:42): [True: 4.50k, False: 0]
  |  Branch (144:86): [True: 4.50k, False: 0]
  ------------------
locale.cpp:_ZZNSt3__16locale7classicEvENK3$_0clEv:
  502|      1|  static const __no_destroy<locale> classic_locale(__private_tag{}, [] {
  503|       |    // executed exactly once on first initialization of `classic_locale`
  504|      1|    locale::__imp::classic_locale_imp_.__emplace(1u);
  505|      1|    return &locale::__imp::classic_locale_imp_.__get();
  506|      1|  }());
locale.cpp:_ZNSt3__112_GLOBAL__N_14makeINS_7collateIcEEJjEEERT_DpT0_:
   91|      1|T& make(Args... args) {
   92|      1|  alignas(T) static std::byte buf[sizeof(T)];
   93|      1|  auto* obj = ::new (&buf) T(args...);
   94|      1|  return *obj;
   95|      1|}
_ZNSt3__16locale5__imp7installINS_7collateIcEEEEvPT_:
  154|      1|  void install(F* f) {
  155|      1|    install(f, f->id.__get());
  156|      1|  }
locale.cpp:_ZNSt3__112_GLOBAL__N_14makeINS_7collateIwEEJjEEERT_DpT0_:
   91|      1|T& make(Args... args) {
   92|      1|  alignas(T) static std::byte buf[sizeof(T)];
   93|      1|  auto* obj = ::new (&buf) T(args...);
   94|      1|  return *obj;
   95|      1|}
_ZNSt3__16locale5__imp7installINS_7collateIwEEEEvPT_:
  154|      1|  void install(F* f) {
  155|      1|    install(f, f->id.__get());
  156|      1|  }
locale.cpp:_ZNSt3__112_GLOBAL__N_14makeINS_5ctypeIcEEJDnbjEEERT_DpT0_:
   91|      1|T& make(Args... args) {
   92|      1|  alignas(T) static std::byte buf[sizeof(T)];
   93|      1|  auto* obj = ::new (&buf) T(args...);
   94|      1|  return *obj;
   95|      1|}
_ZNSt3__16locale5__imp7installINS_5ctypeIcEEEEvPT_:
  154|      1|  void install(F* f) {
  155|      1|    install(f, f->id.__get());
  156|      1|  }
locale.cpp:_ZNSt3__112_GLOBAL__N_14makeINS_5ctypeIwEEJjEEERT_DpT0_:
   91|      1|T& make(Args... args) {
   92|      1|  alignas(T) static std::byte buf[sizeof(T)];
   93|      1|  auto* obj = ::new (&buf) T(args...);
   94|      1|  return *obj;
   95|      1|}
_ZNSt3__16locale5__imp7installINS_5ctypeIwEEEEvPT_:
  154|      1|  void install(F* f) {
  155|      1|    install(f, f->id.__get());
  156|      1|  }
locale.cpp:_ZNSt3__112_GLOBAL__N_14makeINS_7codecvtIcc11__mbstate_tEEJjEEERT_DpT0_:
   91|      1|T& make(Args... args) {
   92|      1|  alignas(T) static std::byte buf[sizeof(T)];
   93|      1|  auto* obj = ::new (&buf) T(args...);
   94|      1|  return *obj;
   95|      1|}
_ZNSt3__16locale5__imp7installINS_7codecvtIcc11__mbstate_tEEEEvPT_:
  154|      1|  void install(F* f) {
  155|      1|    install(f, f->id.__get());
  156|      1|  }
locale.cpp:_ZNSt3__112_GLOBAL__N_14makeINS_7codecvtIwc11__mbstate_tEEJjEEERT_DpT0_:
   91|      1|T& make(Args... args) {
   92|      1|  alignas(T) static std::byte buf[sizeof(T)];
   93|      1|  auto* obj = ::new (&buf) T(args...);
   94|      1|  return *obj;
   95|      1|}
_ZNSt3__16locale5__imp7installINS_7codecvtIwc11__mbstate_tEEEEvPT_:
  154|      1|  void install(F* f) {
  155|      1|    install(f, f->id.__get());
  156|      1|  }
locale.cpp:_ZNSt3__112_GLOBAL__N_14makeINS_7codecvtIDsc11__mbstate_tEEJjEEERT_DpT0_:
   91|      1|T& make(Args... args) {
   92|      1|  alignas(T) static std::byte buf[sizeof(T)];
   93|      1|  auto* obj = ::new (&buf) T(args...);
   94|      1|  return *obj;
   95|      1|}
_ZNSt3__16locale5__imp7installINS_7codecvtIDsc11__mbstate_tEEEEvPT_:
  154|      1|  void install(F* f) {
  155|      1|    install(f, f->id.__get());
  156|      1|  }
locale.cpp:_ZNSt3__112_GLOBAL__N_14makeINS_7codecvtIDic11__mbstate_tEEJjEEERT_DpT0_:
   91|      1|T& make(Args... args) {
   92|      1|  alignas(T) static std::byte buf[sizeof(T)];
   93|      1|  auto* obj = ::new (&buf) T(args...);
   94|      1|  return *obj;
   95|      1|}
_ZNSt3__16locale5__imp7installINS_7codecvtIDic11__mbstate_tEEEEvPT_:
  154|      1|  void install(F* f) {
  155|      1|    install(f, f->id.__get());
  156|      1|  }
locale.cpp:_ZNSt3__112_GLOBAL__N_14makeINS_7codecvtIDsDu11__mbstate_tEEJjEEERT_DpT0_:
   91|      1|T& make(Args... args) {
   92|      1|  alignas(T) static std::byte buf[sizeof(T)];
   93|      1|  auto* obj = ::new (&buf) T(args...);
   94|      1|  return *obj;
   95|      1|}
_ZNSt3__16locale5__imp7installINS_7codecvtIDsDu11__mbstate_tEEEEvPT_:
  154|      1|  void install(F* f) {
  155|      1|    install(f, f->id.__get());
  156|      1|  }
locale.cpp:_ZNSt3__112_GLOBAL__N_14makeINS_7codecvtIDiDu11__mbstate_tEEJjEEERT_DpT0_:
   91|      1|T& make(Args... args) {
   92|      1|  alignas(T) static std::byte buf[sizeof(T)];
   93|      1|  auto* obj = ::new (&buf) T(args...);
   94|      1|  return *obj;
   95|      1|}
_ZNSt3__16locale5__imp7installINS_7codecvtIDiDu11__mbstate_tEEEEvPT_:
  154|      1|  void install(F* f) {
  155|      1|    install(f, f->id.__get());
  156|      1|  }
locale.cpp:_ZNSt3__112_GLOBAL__N_14makeINS_8numpunctIcEEJjEEERT_DpT0_:
   91|      1|T& make(Args... args) {
   92|      1|  alignas(T) static std::byte buf[sizeof(T)];
   93|      1|  auto* obj = ::new (&buf) T(args...);
   94|      1|  return *obj;
   95|      1|}
_ZNSt3__16locale5__imp7installINS_8numpunctIcEEEEvPT_:
  154|      1|  void install(F* f) {
  155|      1|    install(f, f->id.__get());
  156|      1|  }
locale.cpp:_ZNSt3__112_GLOBAL__N_14makeINS_8numpunctIwEEJjEEERT_DpT0_:
   91|      1|T& make(Args... args) {
   92|      1|  alignas(T) static std::byte buf[sizeof(T)];
   93|      1|  auto* obj = ::new (&buf) T(args...);
   94|      1|  return *obj;
   95|      1|}
_ZNSt3__16locale5__imp7installINS_8numpunctIwEEEEvPT_:
  154|      1|  void install(F* f) {
  155|      1|    install(f, f->id.__get());
  156|      1|  }
locale.cpp:_ZNSt3__112_GLOBAL__N_14makeINS_7num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEEJjEEERT_DpT0_:
   91|      1|T& make(Args... args) {
   92|      1|  alignas(T) static std::byte buf[sizeof(T)];
   93|      1|  auto* obj = ::new (&buf) T(args...);
   94|      1|  return *obj;
   95|      1|}
_ZNSt3__16locale5__imp7installINS_7num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEEEEvPT_:
  154|      1|  void install(F* f) {
  155|      1|    install(f, f->id.__get());
  156|      1|  }
locale.cpp:_ZNSt3__112_GLOBAL__N_14makeINS_7num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEEJjEEERT_DpT0_:
   91|      1|T& make(Args... args) {
   92|      1|  alignas(T) static std::byte buf[sizeof(T)];
   93|      1|  auto* obj = ::new (&buf) T(args...);
   94|      1|  return *obj;
   95|      1|}
_ZNSt3__16locale5__imp7installINS_7num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEEEEvPT_:
  154|      1|  void install(F* f) {
  155|      1|    install(f, f->id.__get());
  156|      1|  }
locale.cpp:_ZNSt3__112_GLOBAL__N_14makeINS_7num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEEJjEEERT_DpT0_:
   91|      1|T& make(Args... args) {
   92|      1|  alignas(T) static std::byte buf[sizeof(T)];
   93|      1|  auto* obj = ::new (&buf) T(args...);
   94|      1|  return *obj;
   95|      1|}
_ZNSt3__16locale5__imp7installINS_7num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEEEEvPT_:
  154|      1|  void install(F* f) {
  155|      1|    install(f, f->id.__get());
  156|      1|  }
locale.cpp:_ZNSt3__112_GLOBAL__N_14makeINS_7num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEEJjEEERT_DpT0_:
   91|      1|T& make(Args... args) {
   92|      1|  alignas(T) static std::byte buf[sizeof(T)];
   93|      1|  auto* obj = ::new (&buf) T(args...);
   94|      1|  return *obj;
   95|      1|}
_ZNSt3__16locale5__imp7installINS_7num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEEEEvPT_:
  154|      1|  void install(F* f) {
  155|      1|    install(f, f->id.__get());
  156|      1|  }
locale.cpp:_ZNSt3__112_GLOBAL__N_14makeINS_10moneypunctIcLb0EEEJjEEERT_DpT0_:
   91|      1|T& make(Args... args) {
   92|      1|  alignas(T) static std::byte buf[sizeof(T)];
   93|      1|  auto* obj = ::new (&buf) T(args...);
   94|      1|  return *obj;
   95|      1|}
_ZNSt3__16locale5__imp7installINS_10moneypunctIcLb0EEEEEvPT_:
  154|      1|  void install(F* f) {
  155|      1|    install(f, f->id.__get());
  156|      1|  }
locale.cpp:_ZNSt3__112_GLOBAL__N_14makeINS_10moneypunctIcLb1EEEJjEEERT_DpT0_:
   91|      1|T& make(Args... args) {
   92|      1|  alignas(T) static std::byte buf[sizeof(T)];
   93|      1|  auto* obj = ::new (&buf) T(args...);
   94|      1|  return *obj;
   95|      1|}
_ZNSt3__16locale5__imp7installINS_10moneypunctIcLb1EEEEEvPT_:
  154|      1|  void install(F* f) {
  155|      1|    install(f, f->id.__get());
  156|      1|  }
locale.cpp:_ZNSt3__112_GLOBAL__N_14makeINS_10moneypunctIwLb0EEEJjEEERT_DpT0_:
   91|      1|T& make(Args... args) {
   92|      1|  alignas(T) static std::byte buf[sizeof(T)];
   93|      1|  auto* obj = ::new (&buf) T(args...);
   94|      1|  return *obj;
   95|      1|}
_ZNSt3__16locale5__imp7installINS_10moneypunctIwLb0EEEEEvPT_:
  154|      1|  void install(F* f) {
  155|      1|    install(f, f->id.__get());
  156|      1|  }
locale.cpp:_ZNSt3__112_GLOBAL__N_14makeINS_10moneypunctIwLb1EEEJjEEERT_DpT0_:
   91|      1|T& make(Args... args) {
   92|      1|  alignas(T) static std::byte buf[sizeof(T)];
   93|      1|  auto* obj = ::new (&buf) T(args...);
   94|      1|  return *obj;
   95|      1|}
_ZNSt3__16locale5__imp7installINS_10moneypunctIwLb1EEEEEvPT_:
  154|      1|  void install(F* f) {
  155|      1|    install(f, f->id.__get());
  156|      1|  }
locale.cpp:_ZNSt3__112_GLOBAL__N_14makeINS_9money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEEJjEEERT_DpT0_:
   91|      1|T& make(Args... args) {
   92|      1|  alignas(T) static std::byte buf[sizeof(T)];
   93|      1|  auto* obj = ::new (&buf) T(args...);
   94|      1|  return *obj;
   95|      1|}
_ZNSt3__16locale5__imp7installINS_9money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEEEEvPT_:
  154|      1|  void install(F* f) {
  155|      1|    install(f, f->id.__get());
  156|      1|  }
locale.cpp:_ZNSt3__112_GLOBAL__N_14makeINS_9money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEEJjEEERT_DpT0_:
   91|      1|T& make(Args... args) {
   92|      1|  alignas(T) static std::byte buf[sizeof(T)];
   93|      1|  auto* obj = ::new (&buf) T(args...);
   94|      1|  return *obj;
   95|      1|}
_ZNSt3__16locale5__imp7installINS_9money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEEEEvPT_:
  154|      1|  void install(F* f) {
  155|      1|    install(f, f->id.__get());
  156|      1|  }
locale.cpp:_ZNSt3__112_GLOBAL__N_14makeINS_9money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEEJjEEERT_DpT0_:
   91|      1|T& make(Args... args) {
   92|      1|  alignas(T) static std::byte buf[sizeof(T)];
   93|      1|  auto* obj = ::new (&buf) T(args...);
   94|      1|  return *obj;
   95|      1|}
_ZNSt3__16locale5__imp7installINS_9money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEEEEvPT_:
  154|      1|  void install(F* f) {
  155|      1|    install(f, f->id.__get());
  156|      1|  }
locale.cpp:_ZNSt3__112_GLOBAL__N_14makeINS_9money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEEJjEEERT_DpT0_:
   91|      1|T& make(Args... args) {
   92|      1|  alignas(T) static std::byte buf[sizeof(T)];
   93|      1|  auto* obj = ::new (&buf) T(args...);
   94|      1|  return *obj;
   95|      1|}
_ZNSt3__16locale5__imp7installINS_9money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEEEEvPT_:
  154|      1|  void install(F* f) {
  155|      1|    install(f, f->id.__get());
  156|      1|  }
locale.cpp:_ZNSt3__112_GLOBAL__N_14makeINS_8time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEEJjEEERT_DpT0_:
   91|      1|T& make(Args... args) {
   92|      1|  alignas(T) static std::byte buf[sizeof(T)];
   93|      1|  auto* obj = ::new (&buf) T(args...);
   94|      1|  return *obj;
   95|      1|}
_ZNSt3__16locale5__imp7installINS_8time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEEEEvPT_:
  154|      1|  void install(F* f) {
  155|      1|    install(f, f->id.__get());
  156|      1|  }
locale.cpp:_ZNSt3__112_GLOBAL__N_14makeINS_8time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEEJjEEERT_DpT0_:
   91|      1|T& make(Args... args) {
   92|      1|  alignas(T) static std::byte buf[sizeof(T)];
   93|      1|  auto* obj = ::new (&buf) T(args...);
   94|      1|  return *obj;
   95|      1|}
_ZNSt3__16locale5__imp7installINS_8time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEEEEvPT_:
  154|      1|  void install(F* f) {
  155|      1|    install(f, f->id.__get());
  156|      1|  }
locale.cpp:_ZNSt3__112_GLOBAL__N_14makeINS_8time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEEJjEEERT_DpT0_:
   91|      1|T& make(Args... args) {
   92|      1|  alignas(T) static std::byte buf[sizeof(T)];
   93|      1|  auto* obj = ::new (&buf) T(args...);
   94|      1|  return *obj;
   95|      1|}
_ZNSt3__16locale5__imp7installINS_8time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEEEEvPT_:
  154|      1|  void install(F* f) {
  155|      1|    install(f, f->id.__get());
  156|      1|  }
locale.cpp:_ZNSt3__112_GLOBAL__N_14makeINS_8time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEEJjEEERT_DpT0_:
   91|      1|T& make(Args... args) {
   92|      1|  alignas(T) static std::byte buf[sizeof(T)];
   93|      1|  auto* obj = ::new (&buf) T(args...);
   94|      1|  return *obj;
   95|      1|}
_ZNSt3__16locale5__imp7installINS_8time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEEEEvPT_:
  154|      1|  void install(F* f) {
  155|      1|    install(f, f->id.__get());
  156|      1|  }
locale.cpp:_ZNSt3__112_GLOBAL__N_14makeINS_8messagesIcEEJjEEERT_DpT0_:
   91|      1|T& make(Args... args) {
   92|      1|  alignas(T) static std::byte buf[sizeof(T)];
   93|      1|  auto* obj = ::new (&buf) T(args...);
   94|      1|  return *obj;
   95|      1|}
_ZNSt3__16locale5__imp7installINS_8messagesIcEEEEvPT_:
  154|      1|  void install(F* f) {
  155|      1|    install(f, f->id.__get());
  156|      1|  }
locale.cpp:_ZNSt3__112_GLOBAL__N_14makeINS_8messagesIwEEJjEEERT_DpT0_:
   91|      1|T& make(Args... args) {
   92|      1|  alignas(T) static std::byte buf[sizeof(T)];
   93|      1|  auto* obj = ::new (&buf) T(args...);
   94|      1|  return *obj;
   95|      1|}
_ZNSt3__16locale5__imp7installINS_8messagesIwEEEEvPT_:
  154|      1|  void install(F* f) {
  155|      1|    install(f, f->id.__get());
  156|      1|  }
locale.cpp:_ZZNSt3__16locale2id5__getEvENK3$_0clEv:
  598|     30|  call_once(__flag_, [&] { __id_ = __libcpp_atomic_add(&__next_id, 1); });

_ZNSt3__119__shared_weak_count14__release_weakEv:
   57|  15.4k|void __shared_weak_count::__release_weak() noexcept {
   58|       |  // NOTE: The acquire load here is an optimization of the very
   59|       |  // common case where a shared pointer is being destructed while
   60|       |  // having no other contended references.
   61|       |  //
   62|       |  // BENEFIT: We avoid expensive atomic stores like XADD and STREX
   63|       |  // in a common case.  Those instructions are slow and do nasty
   64|       |  // things to caches.
   65|       |  //
   66|       |  // IS THIS SAFE?  Yes.  During weak destruction, if we see that we
   67|       |  // are the last reference, we know that no-one else is accessing
   68|       |  // us. If someone were accessing us, then they would be doing so
   69|       |  // while the last shared / weak_ptr was being destructed, and
   70|       |  // that's undefined anyway.
   71|       |  //
   72|       |  // If we see anything other than a 0, then we have possible
   73|       |  // contention, and need to use an atomicrmw primitive.
   74|       |  // The same arguments don't apply for increment, where it is legal
   75|       |  // (though inadvisable) to share shared_ptr references between
   76|       |  // threads, and have them all get copied at once.  The argument
   77|       |  // also doesn't apply for __release_shared, because an outstanding
   78|       |  // weak_ptr::lock() could read / modify the shared count.
   79|  15.4k|  if (__libcpp_atomic_load(&__shared_weak_owners_, _AO_Acquire) == 0) {
  ------------------
  |  Branch (79:7): [True: 15.4k, False: 0]
  ------------------
   80|       |    // no need to do this store, because we are about
   81|       |    // to destroy everything.
   82|       |    //__libcpp_atomic_store(&__shared_weak_owners_, -1, _AO_Release);
   83|  15.4k|    __on_zero_shared_weak();
   84|  15.4k|  } else if (__libcpp_atomic_refcount_decrement(__shared_weak_owners_) == -1)
  ------------------
  |  Branch (84:14): [True: 0, False: 0]
  ------------------
   85|      0|    __on_zero_shared_weak();
   86|  15.4k|}

_ZSt19uncaught_exceptionsv:
   18|  4.78k|int uncaught_exceptions() noexcept {
   19|  4.78k|#if _LIBCPPABI_VERSION > 1001
   20|  4.78k|  return __cxa_uncaught_exceptions();
   21|       |#else
   22|       |  return __cxa_uncaught_exception() ? 1 : 0;
   23|       |#endif
   24|  4.78k|}

_ZNSt13runtime_errorC2EPKc:
   34|   172k|runtime_error::runtime_error(const char* msg) : __imp_(msg) {}

_ZN10__cxxabiv119__setExceptionClassEP17_Unwind_Exceptionm:
   81|   172k|void __setExceptionClass(_Unwind_Exception* unwind_exception, uint64_t newValue) {
   82|   172k|    ::memcpy(&unwind_exception->exception_class, &newValue, sizeof(newValue));
   83|   172k|}
_ZN10__cxxabiv119__getExceptionClassEPK17_Unwind_Exception:
   95|   750k|uint64_t __getExceptionClass(const _Unwind_Exception* unwind_exception) {
   96|       |    // On x86 and some ARM unwinders, unwind_exception->exception_class is
   97|       |    // a uint64_t. On other ARM unwinders, it is a char[8].
   98|       |    // See: http://infocenter.arm.com/help/topic/com.arm.doc.ihi0038b/IHI0038B_ehabi.pdf
   99|       |    // So we just copy it into a uint64_t to be sure.
  100|   750k|    uint64_t exClass;
  101|   750k|    ::memcpy(&exClass, &unwind_exception->exception_class, sizeof(exClass));
  102|   750k|    return exClass;
  103|   750k|}
_ZN10__cxxabiv121__isOurExceptionClassEPK17_Unwind_Exception:
  105|   344k|bool __isOurExceptionClass(const _Unwind_Exception* unwind_exception) {
  106|   344k|    return (__getExceptionClass(unwind_exception) & get_vendor_and_language) ==
  107|   344k|           (kOurExceptionClass                    & get_vendor_and_language);
  108|   344k|}
__cxa_allocate_exception:
  183|   172k|void *__cxa_allocate_exception(size_t thrown_size) throw() {
  184|   172k|    size_t actual_size = cxa_exception_size_from_exception_thrown_size(thrown_size);
  185|       |
  186|       |    // Allocate extra space before the __cxa_exception header to ensure the
  187|       |    // start of the thrown object is sufficiently aligned.
  188|   172k|    size_t header_offset = get_cxa_exception_offset();
  189|   172k|    char *raw_buffer =
  190|   172k|        (char *)__aligned_malloc_with_fallback(header_offset + actual_size);
  191|   172k|    if (NULL == raw_buffer)
  ------------------
  |  Branch (191:9): [True: 0, False: 172k]
  ------------------
  192|      0|        std::terminate();
  193|   172k|    __cxa_exception *exception_header =
  194|   172k|        static_cast<__cxa_exception *>((void *)(raw_buffer + header_offset));
  195|   172k|    ::memset(exception_header, 0, actual_size);
  196|   172k|    return thrown_object_from_cxa_exception(exception_header);
  197|   172k|}
__cxa_free_exception:
  201|   172k|void __cxa_free_exception(void *thrown_object) throw() {
  202|       |    // Compute the size of the padding before the header.
  203|   172k|    size_t header_offset = get_cxa_exception_offset();
  204|   172k|    char *raw_buffer =
  205|   172k|        ((char *)cxa_exception_from_thrown_object(thrown_object)) - header_offset;
  206|   172k|    __aligned_free_with_fallback((void *)raw_buffer);
  207|   172k|}
__cxa_init_primary_exception:
  210|   172k|                                              void(_LIBCXXABI_DTOR_FUNC* dest)(void*)) throw() {
  211|   172k|  __cxa_exception* exception_header = cxa_exception_from_thrown_object(object);
  212|   172k|  exception_header->referenceCount = 0;
  213|   172k|  exception_header->unexpectedHandler = std::get_unexpected();
  214|   172k|  exception_header->terminateHandler = std::get_terminate();
  215|   172k|  exception_header->exceptionType = tinfo;
  216|   172k|  exception_header->exceptionDestructor = dest;
  217|   172k|  setOurExceptionClass(&exception_header->unwindHeader);
  218|   172k|  exception_header->unwindHeader.exception_cleanup = exception_cleanup_func;
  219|       |
  220|   172k|  return exception_header;
  221|   172k|}
__cxa_throw:
  274|   172k|__cxa_throw(void *thrown_object, std::type_info *tinfo, void (_LIBCXXABI_DTOR_FUNC *dest)(void *)) {
  275|   172k|#endif
  276|   172k|  __cxa_eh_globals* globals = __cxa_get_globals();
  277|   172k|  globals->uncaughtExceptions += 1; // Not atomically, since globals are thread-local
  278|       |
  279|   172k|  __cxa_exception* exception_header = __cxa_init_primary_exception(thrown_object, tinfo, dest);
  280|   172k|  exception_header->referenceCount = 1; // This is a newly allocated exception, no need for thread safety.
  281|       |
  282|       |#if __has_feature(address_sanitizer)
  283|       |  // Inform the ASan runtime that now might be a good time to clean stuff up.
  284|       |  __asan_handle_no_return();
  285|       |#endif
  286|       |
  287|       |#ifdef __USING_SJLJ_EXCEPTIONS__
  288|       |    _Unwind_SjLj_RaiseException(&exception_header->unwindHeader);
  289|       |#else
  290|   172k|    _Unwind_RaiseException(&exception_header->unwindHeader);
  291|   172k|#endif
  292|       |    //  This only happens when there is no handler, or some unexpected unwinding
  293|       |    //     error happens.
  294|   172k|    failed_throw(exception_header);
  295|   172k|}
__cxa_begin_catch:
  446|   172k|{
  447|   172k|    _Unwind_Exception* unwind_exception = static_cast<_Unwind_Exception*>(unwind_arg);
  448|   172k|    bool native_exception = __isOurExceptionClass(unwind_exception);
  449|   172k|    __cxa_eh_globals* globals = __cxa_get_globals();
  450|       |    // exception_header is a hackish offset from a foreign exception, but it
  451|       |    //   works as long as we're careful not to try to access any __cxa_exception
  452|       |    //   parts.
  453|   172k|    __cxa_exception* exception_header =
  454|   172k|            cxa_exception_from_exception_unwind_exception
  455|   172k|            (
  456|   172k|                static_cast<_Unwind_Exception*>(unwind_exception)
  457|   172k|            );
  458|       |
  459|       |#if defined(__MVS__)
  460|       |    // Remove the exception object from the linked list of exceptions that the z/OS unwinder
  461|       |    // maintains before adding it to the libc++abi list of caught exceptions.
  462|       |    // The libc++abi will manage the lifetime of the exception from this point forward.
  463|       |    _UnwindZOS_PopException();
  464|       |#endif
  465|       |
  466|   172k|    if (native_exception)
  ------------------
  |  Branch (466:9): [True: 172k, False: 1]
  ------------------
  467|   172k|    {
  468|       |        // Increment the handler count, removing the flag about being rethrown
  469|   172k|        exception_header->handlerCount = exception_header->handlerCount < 0 ?
  ------------------
  |  Branch (469:42): [True: 0, False: 172k]
  ------------------
  470|   172k|            -exception_header->handlerCount + 1 : exception_header->handlerCount + 1;
  471|       |        //  place the exception on the top of the stack if it's not already
  472|       |        //    there by a previous rethrow
  473|   172k|        if (exception_header != globals->caughtExceptions)
  ------------------
  |  Branch (473:13): [True: 172k, False: 0]
  ------------------
  474|   172k|        {
  475|   172k|            exception_header->nextException = globals->caughtExceptions;
  476|   172k|            globals->caughtExceptions = exception_header;
  477|   172k|        }
  478|   172k|        globals->uncaughtExceptions -= 1;   // Not atomically, since globals are thread-local
  479|       |#if defined(_LIBCXXABI_ARM_EHABI)
  480|       |        return reinterpret_cast<void*>(exception_header->unwindHeader.barrier_cache.bitpattern[0]);
  481|       |#else
  482|   172k|        return exception_header->adjustedPtr;
  483|   172k|#endif
  484|   172k|    }
  485|       |    // Else this is a foreign exception
  486|       |    // If the caughtExceptions stack is not empty, terminate
  487|      1|    if (globals->caughtExceptions != 0)
  ------------------
  |  Branch (487:9): [True: 0, False: 1]
  ------------------
  488|      0|        std::terminate();
  489|       |    // Push the foreign exception on to the stack
  490|      1|    globals->caughtExceptions = exception_header;
  491|      1|    return unwind_exception + 1;
  492|   172k|}
__cxa_end_catch:
  513|   172k|void __cxa_end_catch() {
  514|   172k|  static_assert(sizeof(__cxa_exception) == sizeof(__cxa_dependent_exception),
  515|   172k|                "sizeof(__cxa_exception) must be equal to "
  516|   172k|                "sizeof(__cxa_dependent_exception)");
  517|   172k|  static_assert(__builtin_offsetof(__cxa_exception, referenceCount) ==
  518|   172k|                    __builtin_offsetof(__cxa_dependent_exception,
  519|   172k|                                       primaryException),
  520|   172k|                "the layout of __cxa_exception must match the layout of "
  521|   172k|                "__cxa_dependent_exception");
  522|   172k|  static_assert(__builtin_offsetof(__cxa_exception, handlerCount) ==
  523|   172k|                    __builtin_offsetof(__cxa_dependent_exception, handlerCount),
  524|   172k|                "the layout of __cxa_exception must match the layout of "
  525|   172k|                "__cxa_dependent_exception");
  526|   172k|    __cxa_eh_globals* globals = __cxa_get_globals_fast(); // __cxa_get_globals called in __cxa_begin_catch
  527|   172k|    __cxa_exception* exception_header = globals->caughtExceptions;
  528|       |    // If we've rethrown a foreign exception, then globals->caughtExceptions
  529|       |    //    will have been made an empty stack by __cxa_rethrow() and there is
  530|       |    //    nothing more to be done.  Do nothing!
  531|   172k|    if (NULL != exception_header)
  ------------------
  |  Branch (531:9): [True: 172k, False: 0]
  ------------------
  532|   172k|    {
  533|   172k|        bool native_exception = __isOurExceptionClass(&exception_header->unwindHeader);
  534|   172k|        if (native_exception)
  ------------------
  |  Branch (534:13): [True: 172k, False: 0]
  ------------------
  535|   172k|        {
  536|       |            // This is a native exception
  537|   172k|            if (exception_header->handlerCount < 0)
  ------------------
  |  Branch (537:17): [True: 0, False: 172k]
  ------------------
  538|      0|            {
  539|       |                //  The exception has been rethrown by __cxa_rethrow, so don't delete it
  540|      0|                if (0 == incrementHandlerCount(exception_header))
  ------------------
  |  Branch (540:21): [True: 0, False: 0]
  ------------------
  541|      0|                {
  542|       |                    //  Remove from the chain of uncaught exceptions
  543|      0|                    globals->caughtExceptions = exception_header->nextException;
  544|       |                    // but don't destroy
  545|      0|                }
  546|       |                // Keep handlerCount negative in case there are nested catch's
  547|       |                //   that need to be told that this exception is rethrown.  Don't
  548|       |                //   erase this rethrow flag until the exception is recaught.
  549|      0|            }
  550|   172k|            else
  551|   172k|            {
  552|       |                // The native exception has not been rethrown
  553|   172k|                if (0 == decrementHandlerCount(exception_header))
  ------------------
  |  Branch (553:21): [True: 172k, False: 0]
  ------------------
  554|   172k|                {
  555|       |                    //  Remove from the chain of uncaught exceptions
  556|   172k|                    globals->caughtExceptions = exception_header->nextException;
  557|       |                    // Destroy this exception, being careful to distinguish
  558|       |                    //    between dependent and primary exceptions
  559|   172k|                    if (isDependentException(&exception_header->unwindHeader))
  ------------------
  |  Branch (559:25): [True: 0, False: 172k]
  ------------------
  560|      0|                    {
  561|       |                        // Reset exception_header to primaryException and deallocate the dependent exception
  562|      0|                        __cxa_dependent_exception* dep_exception_header =
  563|      0|                            reinterpret_cast<__cxa_dependent_exception*>(exception_header);
  564|      0|                        exception_header =
  565|      0|                            cxa_exception_from_thrown_object(dep_exception_header->primaryException);
  566|      0|                        __cxa_free_dependent_exception(dep_exception_header);
  567|      0|                    }
  568|       |                    // Destroy the primary exception only if its referenceCount goes to 0
  569|       |                    //    (this decrement must be atomic)
  570|   172k|                    __cxa_decrement_exception_refcount(thrown_object_from_cxa_exception(exception_header));
  571|   172k|                }
  572|   172k|            }
  573|   172k|        }
  574|      0|        else
  575|      0|        {
  576|       |            // The foreign exception has not been rethrown.  Pop the stack
  577|       |            //    and delete it.  If there are nested catch's and they try
  578|       |            //    to touch a foreign exception in any way, that is undefined
  579|       |            //     behavior.  They likely can't since the only way to catch
  580|       |            //     a foreign exception is with catch (...)!
  581|      0|            _Unwind_DeleteException(&globals->caughtExceptions->unwindHeader);
  582|      0|            globals->caughtExceptions = 0;
  583|      0|        }
  584|   172k|    }
  585|   172k|}
__cxa_decrement_exception_refcount:
  678|   172k|void __cxa_decrement_exception_refcount(void *thrown_object) throw() {
  679|   172k|    if (thrown_object != NULL )
  ------------------
  |  Branch (679:9): [True: 172k, False: 0]
  ------------------
  680|   172k|    {
  681|   172k|        __cxa_exception* exception_header = cxa_exception_from_thrown_object(thrown_object);
  682|   172k|        if (std::__libcpp_atomic_add(&exception_header->referenceCount, size_t(-1)) == 0)
  ------------------
  |  Branch (682:13): [True: 172k, False: 0]
  ------------------
  683|   172k|        {
  684|   172k|            if (NULL != exception_header->exceptionDestructor)
  ------------------
  |  Branch (684:17): [True: 172k, False: 0]
  ------------------
  685|   172k|                exception_header->exceptionDestructor(thrown_object);
  686|   172k|            __cxa_free_exception(thrown_object);
  687|   172k|        }
  688|   172k|    }
  689|   172k|}
__cxa_uncaught_exceptions:
  777|  4.78k|{
  778|       |    // This does not report foreign exceptions in flight
  779|  4.78k|    __cxa_eh_globals* globals = __cxa_get_globals_fast();
  780|  4.78k|    if (globals == 0)
  ------------------
  |  Branch (780:9): [True: 0, False: 4.78k]
  ------------------
  781|      0|        return 0;
  782|  4.78k|    return globals->uncaughtExceptions;
  783|  4.78k|}
cxa_exception.cpp:_ZN10__cxxabiv1L45cxa_exception_size_from_exception_thrown_sizeEm:
   76|   172k|size_t cxa_exception_size_from_exception_thrown_size(size_t size) {
   77|   172k|    return aligned_allocation_size(size + sizeof (__cxa_exception),
   78|   172k|                                   alignof(__cxa_exception));
   79|   172k|}
cxa_exception.cpp:_ZN10__cxxabiv1L23aligned_allocation_sizeEmm:
   71|   172k|size_t aligned_allocation_size(size_t s, size_t a) {
   72|   172k|    return (s + a - 1) & ~(a - 1);
   73|   172k|}
cxa_exception.cpp:_ZN10__cxxabiv1L24get_cxa_exception_offsetEv:
  161|   344k|static size_t get_cxa_exception_offset() {
  162|   344k|  struct S {
  163|   344k|  } __attribute__((aligned));
  164|       |
  165|       |  // Compute the maximum alignment for the target machine.
  166|   344k|  constexpr size_t alignment = alignof(S);
  167|   344k|  constexpr size_t excp_size = sizeof(__cxa_exception);
  168|   344k|  constexpr size_t aligned_size =
  169|   344k|      (excp_size + alignment - 1) / alignment * alignment;
  170|   344k|  constexpr size_t offset = aligned_size - excp_size;
  171|   344k|  static_assert((offset == 0 || alignof(_Unwind_Exception) < alignment),
  172|   344k|                "offset is non-zero only if _Unwind_Exception isn't aligned");
  173|   344k|  return offset;
  174|   344k|}
cxa_exception.cpp:_ZN10__cxxabiv1L32thrown_object_from_cxa_exceptionEPNS_15__cxa_exceptionE:
   54|   344k|{
   55|   344k|    return static_cast<void*>(exception_header + 1);
   56|   344k|}
cxa_exception.cpp:_ZN10__cxxabiv1L32cxa_exception_from_thrown_objectEPv:
   44|   689k|{
   45|   689k|    return static_cast<__cxa_exception*>(thrown_object) - 1;
   46|   689k|}
cxa_exception.cpp:_ZN10__cxxabiv1L20setOurExceptionClassEP17_Unwind_Exception:
   86|   172k|static void setOurExceptionClass(_Unwind_Exception* unwind_exception) {
   87|   172k|    __setExceptionClass(unwind_exception, kOurExceptionClass);
   88|   172k|}
cxa_exception.cpp:_ZN10__cxxabiv1L45cxa_exception_from_exception_unwind_exceptionEP17_Unwind_Exception:
   65|   172k|{
   66|   172k|    return cxa_exception_from_thrown_object(unwind_exception + 1 );
   67|   172k|}
cxa_exception.cpp:_ZN10__cxxabiv1L21decrementHandlerCountEPNS_15__cxa_exceptionE:
  120|   172k|static inline  int decrementHandlerCount(__cxa_exception *exception) {
  121|   172k|    return --exception->handlerCount;
  122|   172k|}
cxa_exception.cpp:_ZN10__cxxabiv1L20isDependentExceptionEP17_Unwind_Exception:
  110|   172k|static bool isDependentException(_Unwind_Exception* unwind_exception) {
  111|   172k|    return (__getExceptionClass(unwind_exception) & 0xFF) == 0x01;
  112|   172k|}

__cxa_get_globals:
   74|   344k|    __cxa_eh_globals *__cxa_get_globals() {
   75|       |        // Try to get the globals for this thread
   76|   344k|        __cxa_eh_globals *retVal = __cxa_get_globals_fast();
   77|       |
   78|       |        // If this is the first time we've been asked for these globals, create them
   79|   344k|        if (NULL == retVal) {
  ------------------
  |  Branch (79:13): [True: 32, False: 344k]
  ------------------
   80|     32|            retVal = static_cast<__cxa_eh_globals*>(
   81|     32|                __calloc_with_fallback(1, sizeof(__cxa_eh_globals)));
   82|     32|            if (NULL == retVal)
  ------------------
  |  Branch (82:17): [True: 0, False: 32]
  ------------------
   83|      0|                abort_message("cannot allocate __cxa_eh_globals");
   84|     32|            if (0 != std::__libcpp_tls_set(key_, retVal))
  ------------------
  |  Branch (84:17): [True: 0, False: 32]
  ------------------
   85|      0|               abort_message("std::__libcpp_tls_set failure in __cxa_get_globals()");
   86|     32|        }
   87|   344k|        return retVal;
   88|   344k|    }
__cxa_get_globals_fast:
   94|   521k|    __cxa_eh_globals *__cxa_get_globals_fast() {
   95|       |        // First time through, create the key.
   96|   521k|        if (0 != std::__libcpp_execute_once(&flag_, construct_))
  ------------------
  |  Branch (96:13): [True: 0, False: 521k]
  ------------------
   97|      0|            abort_message("execute once failure in __cxa_get_globals_fast()");
   98|   521k|        return static_cast<__cxa_eh_globals*>(std::__libcpp_tls_get(key_));
   99|   521k|    }
cxa_exception_storage.cpp:_ZN10__cxxabiv112_GLOBAL__N_110construct_Ev:
   67|      1|    void construct_() {
   68|      1|        if (0 != std::__libcpp_tls_create(&key_, destruct_))
  ------------------
  |  Branch (68:13): [True: 0, False: 1]
  ------------------
   69|      0|            abort_message("cannot create thread specific key for __cxa_get_globals()");
   70|      1|    }
cxa_exception_storage.cpp:_ZN10__cxxabiv112_GLOBAL__N_19destruct_EPv:
   61|     31|    void _LIBCPP_TLS_DESTRUCTOR_CC destruct_(void *p) {
   62|     31|        __free_with_fallback(p);
   63|     31|        if (0 != std::__libcpp_tls_set(key_, NULL))
  ------------------
  |  Branch (63:13): [True: 0, False: 31]
  ------------------
   64|      0|            abort_message("cannot zero out thread value for __cxa_get_globals()");
   65|     31|    }

__cxa_guard_acquire:
   37|      3|_LIBCXXABI_FUNC_VIS int __cxa_guard_acquire(guard_type* raw_guard_object) {
   38|      3|  SelectedImplementation imp(raw_guard_object);
   39|      3|  return static_cast<int>(imp.cxa_guard_acquire());
   40|      3|}
__cxa_guard_release:
   42|      3|_LIBCXXABI_FUNC_VIS void __cxa_guard_release(guard_type *raw_guard_object) {
   43|      3|  SelectedImplementation imp(raw_guard_object);
   44|      3|  imp.cxa_guard_release();
   45|      3|}

cxa_guard.cpp:_ZN10__cxxabiv112_GLOBAL__N_111GuardObjectINS0_19InitByteGlobalMutexINS0_11LibcppMutexENS0_13LibcppCondVarEL_ZNS0_12GlobalStaticIS3_E8instanceEEL_ZNS5_IS4_E8instanceEEXadL_ZNS0_16PlatformThreadIDEvEEEEEC2EPm:
  581|      6|      : guard_byte(reinterpret_cast<uint8_t*>(raw_guard_object)),
  582|      6|        init_byte(reinterpret_cast<uint8_t*>(raw_guard_object) + 1, reinterpret_cast<uint32_t*>(raw_guard_object) + 1) {
  583|      6|  }
cxa_guard.cpp:_ZN10__cxxabiv112_GLOBAL__N_19GuardByteC2EPh:
  188|      6|  explicit GuardByte(uint8_t* const guard_byte_address) : guard_byte(guard_byte_address) {}
cxa_guard.cpp:_ZN10__cxxabiv112_GLOBAL__N_19AtomicIntIhEC2EPh:
  140|      6|  explicit AtomicInt(IntType* b) : b_(b) {}
cxa_guard.cpp:_ZN10__cxxabiv112_GLOBAL__N_119InitByteGlobalMutexINS0_11LibcppMutexENS0_13LibcppCondVarEL_ZNS0_12GlobalStaticIS2_E8instanceEEL_ZNS4_IS3_E8instanceEEXadL_ZNS0_16PlatformThreadIDEvEEEC2EPhPj:
  320|      6|      : init_byte_address(_init_byte_address), thread_id_address(_thread_id_address),
  321|      6|        has_thread_id_support(_thread_id_address != nullptr && GetThreadID != nullptr) {}
  ------------------
  |  Branch (321:31): [True: 6, False: 0]
  |  Branch (321:64): [True: 6, Folded]
  ------------------
cxa_guard.cpp:_ZN10__cxxabiv112_GLOBAL__N_116PlatformThreadIDEv:
  165|      3|uint32_t PlatformThreadID() {
  166|      3|  static_assert(sizeof(pid_t) == sizeof(uint32_t), "");
  167|       |  return static_cast<uint32_t>(syscall(SYS_gettid));
  168|      3|}
cxa_guard.cpp:_ZN10__cxxabiv112_GLOBAL__N_19LazyValueIjXadL_ZNS0_16PlatformThreadIDEvEEEC2Ev:
  120|      6|  LazyValue() : is_init(false) {}
cxa_guard.cpp:_ZN10__cxxabiv112_GLOBAL__N_111GuardObjectINS0_19InitByteGlobalMutexINS0_11LibcppMutexENS0_13LibcppCondVarEL_ZNS0_12GlobalStaticIS3_E8instanceEEL_ZNS5_IS4_E8instanceEEXadL_ZNS0_16PlatformThreadIDEvEEEEE17cxa_guard_acquireEv:
  586|      3|  AcquireResult cxa_guard_acquire() {
  587|       |    // Use short-circuit evaluation to avoid calling init_byte.acquire when
  588|       |    // guard_byte.acquire returns true. (i.e. don't call it when we know from
  589|       |    // the guard byte that initialization has already been completed)
  590|      3|    if (guard_byte.acquire() || init_byte.acquire())
  ------------------
  |  Branch (590:9): [True: 0, False: 3]
  |  Branch (590:33): [True: 0, False: 3]
  ------------------
  591|      0|      return INIT_IS_DONE;
  592|      3|    return INIT_IS_PENDING;
  593|      3|  }
cxa_guard.cpp:_ZN10__cxxabiv112_GLOBAL__N_19GuardByte7acquireEv:
  193|      3|  bool acquire() {
  194|       |    // if guard_byte is non-zero, we have already completed initialization
  195|       |    // (i.e. release has been called)
  196|      3|    return guard_byte.load(std::_AO_Acquire) != UNSET;
  197|      3|  }
cxa_guard.cpp:_ZN10__cxxabiv112_GLOBAL__N_19AtomicIntIhE4loadENSt3__112_GLOBAL__N_121__libcpp_atomic_orderE:
  144|      3|  IntType load(MemoryOrder ord) { return std::__libcpp_atomic_load(b_, ord); }
cxa_guard.cpp:_ZN10__cxxabiv112_GLOBAL__N_119InitByteGlobalMutexINS0_11LibcppMutexENS0_13LibcppCondVarEL_ZNS0_12GlobalStaticIS2_E8instanceEEL_ZNS4_IS3_E8instanceEEXadL_ZNS0_16PlatformThreadIDEvEEE7acquireEv:
  326|      3|  bool acquire() {
  327|      3|    LockGuard g("__cxa_guard_acquire");
  328|       |    // Check for possible recursive initialization.
  329|      3|    if (has_thread_id_support && (*init_byte_address & PENDING_BIT)) {
  ------------------
  |  Branch (329:9): [True: 3, False: 0]
  |  Branch (329:34): [True: 0, False: 3]
  ------------------
  330|      0|      if (*thread_id_address == current_thread_id.get())
  ------------------
  |  Branch (330:11): [True: 0, False: 0]
  ------------------
  331|      0|        ABORT_WITH_MESSAGE("__cxa_guard_acquire detected recursive initialization: do you have a function-local static variable whose initialization depends on that function?");
  ------------------
  |  |   94|      0|#  define ABORT_WITH_MESSAGE(...) ::abort_message(__VA_ARGS__)
  ------------------
  332|      0|    }
  333|       |
  334|       |    // Wait until the pending bit is not set.
  335|      3|    while (*init_byte_address & PENDING_BIT) {
  ------------------
  |  Branch (335:12): [True: 0, False: 3]
  ------------------
  336|      0|      *init_byte_address |= WAITING_BIT;
  337|      0|      global_cond.wait(global_mutex);
  338|      0|    }
  339|       |
  340|      3|    if (*init_byte_address == COMPLETE_BIT)
  ------------------
  |  Branch (340:9): [True: 0, False: 3]
  ------------------
  341|      0|      return true;
  342|       |
  343|      3|    if (has_thread_id_support)
  ------------------
  |  Branch (343:9): [True: 3, False: 0]
  ------------------
  344|      3|      *thread_id_address = current_thread_id.get();
  345|       |
  346|      3|    *init_byte_address = PENDING_BIT;
  347|      3|    return false;
  348|      3|  }
cxa_guard.cpp:_ZN10__cxxabiv112_GLOBAL__N_119InitByteGlobalMutexINS0_11LibcppMutexENS0_13LibcppCondVarEL_ZNS0_12GlobalStaticIS2_E8instanceEEL_ZNS4_IS3_E8instanceEEXadL_ZNS0_16PlatformThreadIDEvEEE9LockGuardC2EPKc:
  398|      6|    explicit LockGuard(const char* calling_func) : calling_func_(calling_func) {
  399|      6|      if (global_mutex.lock())
  ------------------
  |  Branch (399:11): [True: 0, False: 6]
  ------------------
  400|      0|        ABORT_WITH_MESSAGE("%s failed to acquire mutex", calling_func_);
  ------------------
  |  |   94|      0|#  define ABORT_WITH_MESSAGE(...) ::abort_message(__VA_ARGS__)
  ------------------
  401|      6|    }
cxa_guard.cpp:_ZN10__cxxabiv112_GLOBAL__N_111LibcppMutex4lockEv:
  289|      6|  bool lock() { return std::__libcpp_mutex_lock(&mutex); }
cxa_guard.cpp:_ZN10__cxxabiv112_GLOBAL__N_19LazyValueIjXadL_ZNS0_16PlatformThreadIDEvEEE3getEv:
  122|      3|  T& get() {
  123|      3|    if (!is_init) {
  ------------------
  |  Branch (123:9): [True: 3, False: 0]
  ------------------
  124|      3|      value = Init();
  125|      3|      is_init = true;
  126|      3|    }
  127|      3|    return value;
  128|      3|  }
cxa_guard.cpp:_ZN10__cxxabiv112_GLOBAL__N_119InitByteGlobalMutexINS0_11LibcppMutexENS0_13LibcppCondVarEL_ZNS0_12GlobalStaticIS2_E8instanceEEL_ZNS4_IS3_E8instanceEEXadL_ZNS0_16PlatformThreadIDEvEEE9LockGuardD2Ev:
  403|      6|    ~LockGuard() {
  404|      6|      if (global_mutex.unlock())
  ------------------
  |  Branch (404:11): [True: 0, False: 6]
  ------------------
  405|      0|        ABORT_WITH_MESSAGE("%s failed to release mutex", calling_func_);
  ------------------
  |  |   94|      0|#  define ABORT_WITH_MESSAGE(...) ::abort_message(__VA_ARGS__)
  ------------------
  406|      6|    }
cxa_guard.cpp:_ZN10__cxxabiv112_GLOBAL__N_111LibcppMutex6unlockEv:
  290|      6|  bool unlock() { return std::__libcpp_mutex_unlock(&mutex); }
cxa_guard.cpp:_ZN10__cxxabiv112_GLOBAL__N_111GuardObjectINS0_19InitByteGlobalMutexINS0_11LibcppMutexENS0_13LibcppCondVarEL_ZNS0_12GlobalStaticIS3_E8instanceEEL_ZNS5_IS4_E8instanceEEXadL_ZNS0_16PlatformThreadIDEvEEEEE17cxa_guard_releaseEv:
  596|      3|  void cxa_guard_release() {
  597|       |    // Update guard byte first, so if somebody is woken up by init_byte.release
  598|       |    // and comes all the way back around to __cxa_guard_acquire again, they see
  599|       |    // it as having completed initialization.
  600|      3|    guard_byte.release();
  601|      3|    init_byte.release();
  602|      3|  }
cxa_guard.cpp:_ZN10__cxxabiv112_GLOBAL__N_19GuardByte7releaseEv:
  200|      3|  void release() { guard_byte.store(COMPLETE_BIT, std::_AO_Release); }
cxa_guard.cpp:_ZN10__cxxabiv112_GLOBAL__N_19AtomicIntIhE5storeEhNSt3__112_GLOBAL__N_121__libcpp_atomic_orderE:
  145|      3|  void store(IntType val, MemoryOrder ord) { std::__libcpp_atomic_store(b_, val, ord); }
cxa_guard.cpp:_ZN10__cxxabiv112_GLOBAL__N_119InitByteGlobalMutexINS0_11LibcppMutexENS0_13LibcppCondVarEL_ZNS0_12GlobalStaticIS2_E8instanceEEL_ZNS4_IS3_E8instanceEEXadL_ZNS0_16PlatformThreadIDEvEEE7releaseEv:
  351|      3|  void release() {
  352|      3|    bool has_waiting;
  353|      3|    {
  354|      3|      LockGuard g("__cxa_guard_release");
  355|      3|      has_waiting = *init_byte_address & WAITING_BIT;
  356|      3|      *init_byte_address = COMPLETE_BIT;
  357|      3|    }
  358|      3|    if (has_waiting) {
  ------------------
  |  Branch (358:9): [True: 0, False: 3]
  ------------------
  359|      0|      if (global_cond.broadcast()) {
  ------------------
  |  Branch (359:11): [True: 0, False: 0]
  ------------------
  360|      0|        ABORT_WITH_MESSAGE("%s failed to broadcast", "__cxa_guard_release");
  ------------------
  |  |   94|      0|#  define ABORT_WITH_MESSAGE(...) ::abort_message(__VA_ARGS__)
  ------------------
  361|      0|      }
  362|      0|    }
  363|      3|  }

_ZSt14get_unexpectedv:
   27|   172k|{
   28|   172k|    return __libcpp_atomic_load(&__cxa_unexpected_handler, _AO_Acquire);
   29|   172k|}
_ZSt13get_terminatev:
   48|   172k|{
   49|   172k|    return __libcpp_atomic_load(&__cxa_terminate_handler, _AO_Acquire);
   50|   172k|}

__gxx_personality_v0:
  924|   923k|{
  925|   923k|    if (version != 1 || unwind_exception == 0 || context == 0)
  ------------------
  |  Branch (925:9): [True: 0, False: 923k]
  |  Branch (925:25): [True: 0, False: 923k]
  |  Branch (925:50): [True: 0, False: 923k]
  ------------------
  926|      0|        return _URC_FATAL_PHASE1_ERROR;
  927|       |
  928|   923k|    bool native_exception = (exceptionClass     & get_vendor_and_language) ==
  929|   923k|                            (kOurExceptionClass & get_vendor_and_language);
  930|   923k|    scan_results results;
  931|       |    // Process a catch handler for a native exception first.
  932|   923k|    if (actions == (_UA_CLEANUP_PHASE | _UA_HANDLER_FRAME) &&
  ------------------
  |  Branch (932:9): [True: 172k, False: 751k]
  ------------------
  933|   172k|        native_exception) {
  ------------------
  |  Branch (933:9): [True: 172k, False: 0]
  ------------------
  934|       |        // Reload the results from the phase 1 cache.
  935|   172k|        __cxa_exception* exception_header =
  936|   172k|            (__cxa_exception*)(unwind_exception + 1) - 1;
  937|   172k|        results.ttypeIndex = exception_header->handlerSwitchValue;
  938|   172k|        results.actionRecord = exception_header->actionRecord;
  939|   172k|        results.languageSpecificData = exception_header->languageSpecificData;
  940|   172k|        results.landingPad =
  941|   172k|            reinterpret_cast<uintptr_t>(exception_header->catchTemp);
  942|   172k|        results.adjustedPtr = exception_header->adjustedPtr;
  943|       |
  944|       |        // Jump to the handler.
  945|   172k|        set_registers(unwind_exception, context, results);
  946|       |        // Cache base for calculating the address of ttype in
  947|       |        // __cxa_call_unexpected.
  948|   172k|        if (results.ttypeIndex < 0) {
  ------------------
  |  Branch (948:13): [True: 0, False: 172k]
  ------------------
  949|       |#if defined(_AIX)
  950|       |          exception_header->catchTemp = (void *)_Unwind_GetDataRelBase(context);
  951|       |#else
  952|      0|          exception_header->catchTemp = 0;
  953|      0|#endif
  954|      0|        }
  955|   172k|        return _URC_INSTALL_CONTEXT;
  956|   172k|    }
  957|       |
  958|       |    // In other cases we need to scan LSDA.
  959|   751k|    scan_eh_tab(results, actions, native_exception, unwind_exception, context);
  960|   751k|    if (results.reason == _URC_CONTINUE_UNWIND ||
  ------------------
  |  Branch (960:9): [True: 509k, False: 241k]
  ------------------
  961|   241k|        results.reason == _URC_FATAL_PHASE1_ERROR)
  ------------------
  |  Branch (961:9): [True: 18.4E, False: 241k]
  ------------------
  962|   509k|        return results.reason;
  963|       |
  964|   241k|    if (actions & _UA_SEARCH_PHASE)
  ------------------
  |  Branch (964:9): [True: 172k, False: 69.2k]
  ------------------
  965|   172k|    {
  966|       |        // Phase 1 search:  All we're looking for in phase 1 is a handler that
  967|       |        //   halts unwinding
  968|   172k|        assert(results.reason == _URC_HANDLER_FOUND);
  ------------------
  |  Branch (968:9): [True: 172k, False: 0]
  ------------------
  969|   172k|        if (native_exception) {
  ------------------
  |  Branch (969:13): [True: 172k, False: 0]
  ------------------
  970|       |            // For a native exception, cache the LSDA result.
  971|   172k|            __cxa_exception* exc = (__cxa_exception*)(unwind_exception + 1) - 1;
  972|   172k|            exc->handlerSwitchValue = static_cast<int>(results.ttypeIndex);
  973|   172k|            exc->actionRecord = results.actionRecord;
  974|   172k|            exc->languageSpecificData = results.languageSpecificData;
  975|   172k|            exc->catchTemp = reinterpret_cast<void*>(results.landingPad);
  976|   172k|            exc->adjustedPtr = results.adjustedPtr;
  977|       |#ifdef __USING_WASM_EXCEPTIONS__
  978|       |            // Wasm only uses a single phase (_UA_SEARCH_PHASE), so save the
  979|       |            // results here.
  980|       |            set_registers(unwind_exception, context, results);
  981|       |#endif
  982|   172k|        }
  983|   172k|        return _URC_HANDLER_FOUND;
  984|   172k|    }
  985|       |
  986|   241k|    assert(actions & _UA_CLEANUP_PHASE);
  ------------------
  |  Branch (986:5): [True: 69.1k, False: 13]
  ------------------
  987|  69.2k|    assert(results.reason == _URC_HANDLER_FOUND);
  ------------------
  |  Branch (987:5): [True: 69.1k, False: 0]
  ------------------
  988|  69.1k|    set_registers(unwind_exception, context, results);
  989|       |    // Cache base for calculating the address of ttype in __cxa_call_unexpected.
  990|  69.1k|    if (results.ttypeIndex < 0) {
  ------------------
  |  Branch (990:9): [True: 0, False: 69.1k]
  ------------------
  991|      0|      __cxa_exception* exception_header =
  992|      0|            (__cxa_exception*)(unwind_exception + 1) - 1;
  993|       |#if defined(_AIX)
  994|       |      exception_header->catchTemp = (void *)_Unwind_GetDataRelBase(context);
  995|       |#else
  996|      0|      exception_header->catchTemp = 0;
  997|      0|#endif
  998|      0|    }
  999|  69.1k|    return _URC_INSTALL_CONTEXT;
 1000|  69.1k|}
cxa_personality.cpp:_ZN10__cxxabiv1L13set_registersEP17_Unwind_ExceptionP15_Unwind_ContextRKNS_12_GLOBAL__N_112scan_resultsE:
  549|   241k|{
  550|       |#if defined(__USING_SJLJ_EXCEPTIONS__) || defined(__USING_WASM_EXCEPTIONS__)
  551|       |#define __builtin_eh_return_data_regno(regno) regno
  552|       |#elif defined(__ibmxl__)
  553|       |// IBM xlclang++ compiler does not support __builtin_eh_return_data_regno.
  554|       |#define __builtin_eh_return_data_regno(regno) regno + 3
  555|       |#endif
  556|   241k|  _Unwind_SetGR(context, __builtin_eh_return_data_regno(0),
  557|   241k|                reinterpret_cast<uintptr_t>(unwind_exception));
  558|   241k|  _Unwind_SetGR(context, __builtin_eh_return_data_regno(1),
  559|   241k|                static_cast<uintptr_t>(results.ttypeIndex));
  560|   241k|  _Unwind_SetIP(context, results.landingPad);
  561|   241k|}
cxa_personality.cpp:_ZN10__cxxabiv1L11scan_eh_tabERNS_12_GLOBAL__N_112scan_resultsE14_Unwind_ActionbP17_Unwind_ExceptionP15_Unwind_Context:
  587|   751k|                        _Unwind_Context *context) {
  588|       |    // Initialize results to found nothing but an error
  589|   751k|    results.ttypeIndex = 0;
  590|   751k|    results.actionRecord = 0;
  591|   751k|    results.languageSpecificData = 0;
  592|   751k|    results.landingPad = 0;
  593|   751k|    results.adjustedPtr = 0;
  594|   751k|    results.reason = _URC_FATAL_PHASE1_ERROR;
  595|       |    // Check for consistent actions
  596|   751k|    if (actions & _UA_SEARCH_PHASE)
  ------------------
  |  Branch (596:9): [True: 427k, False: 323k]
  ------------------
  597|   427k|    {
  598|       |        // Do Phase 1
  599|   427k|        if (actions & (_UA_CLEANUP_PHASE | _UA_HANDLER_FRAME | _UA_FORCE_UNWIND))
  ------------------
  |  Branch (599:13): [True: 0, False: 427k]
  ------------------
  600|      0|        {
  601|       |            // None of these flags should be set during Phase 1
  602|       |            //   Client error
  603|      0|            results.reason = _URC_FATAL_PHASE1_ERROR;
  604|      0|            return;
  605|      0|        }
  606|   427k|    }
  607|   323k|    else if (actions & _UA_CLEANUP_PHASE)
  ------------------
  |  Branch (607:14): [True: 323k, False: 18.4E]
  ------------------
  608|   323k|    {
  609|   323k|        if ((actions & _UA_HANDLER_FRAME) && (actions & _UA_FORCE_UNWIND))
  ------------------
  |  Branch (609:13): [True: 0, False: 323k]
  |  Branch (609:46): [True: 0, False: 0]
  ------------------
  610|      0|        {
  611|       |            // _UA_HANDLER_FRAME should only be set if phase 1 found a handler.
  612|       |            // If _UA_FORCE_UNWIND is set, phase 1 shouldn't have happened.
  613|       |            //    Client error
  614|      0|            results.reason = _URC_FATAL_PHASE2_ERROR;
  615|      0|            return;
  616|      0|        }
  617|   323k|    }
  618|  18.4E|    else // Neither _UA_SEARCH_PHASE nor _UA_CLEANUP_PHASE is set
  619|  18.4E|    {
  620|       |        // One of these should be set.
  621|       |        //   Client error
  622|  18.4E|        results.reason = _URC_FATAL_PHASE1_ERROR;
  623|  18.4E|        return;
  624|  18.4E|    }
  625|       |    // Start scan by getting exception table address.
  626|   751k|    const uint8_t *lsda = (const uint8_t *)_Unwind_GetLanguageSpecificData(context);
  627|   751k|    if (lsda == 0)
  ------------------
  |  Branch (627:9): [True: 0, False: 751k]
  ------------------
  628|      0|    {
  629|       |        // There is no exception table
  630|      0|        results.reason = _URC_CONTINUE_UNWIND;
  631|      0|        return;
  632|      0|    }
  633|   751k|    results.languageSpecificData = lsda;
  634|       |#if defined(_AIX)
  635|       |    uintptr_t base = _Unwind_GetDataRelBase(context);
  636|       |#else
  637|   751k|    uintptr_t base = 0;
  638|   751k|#endif
  639|       |    // Get the current instruction pointer and offset it before next
  640|       |    // instruction in the current frame which threw the exception.
  641|   751k|    uintptr_t ip = _Unwind_GetIP(context) - 1;
  642|       |    // Get beginning current frame's code (as defined by the
  643|       |    // emitted dwarf code)
  644|   751k|    uintptr_t funcStart = _Unwind_GetRegionStart(context);
  645|       |#if defined(__USING_SJLJ_EXCEPTIONS__) || defined(__USING_WASM_EXCEPTIONS__)
  646|       |    if (ip == uintptr_t(-1))
  647|       |    {
  648|       |        // no action
  649|       |        results.reason = _URC_CONTINUE_UNWIND;
  650|       |        return;
  651|       |    }
  652|       |    else if (ip == 0)
  653|       |        call_terminate(native_exception, unwind_exception);
  654|       |    // ip is 1-based index into call site table
  655|       |#else  // !__USING_SJLJ_EXCEPTIONS__ && !__USING_WASM_EXCEPTIONS__
  656|   751k|    uintptr_t ipOffset = ip - funcStart;
  657|   751k|#endif // !__USING_SJLJ_EXCEPTIONS__ && !__USING_WASM_EXCEPTIONS__
  658|   751k|    const uint8_t* classInfo = NULL;
  659|       |    // Note: See JITDwarfEmitter::EmitExceptionTable(...) for corresponding
  660|       |    //       dwarf emission
  661|       |    // Parse LSDA header.
  662|   751k|    uint8_t lpStartEncoding = *lsda++;
  663|   751k|    const uint8_t* lpStart = lpStartEncoding == DW_EH_PE_omit
  ------------------
  |  Branch (663:30): [True: 751k, False: 4]
  ------------------
  664|   751k|                                 ? (const uint8_t*)funcStart
  665|   751k|                                 : (const uint8_t*)readEncodedPointer(&lsda, lpStartEncoding, base);
  666|   751k|    uint8_t ttypeEncoding = *lsda++;
  667|   751k|    if (ttypeEncoding != DW_EH_PE_omit)
  ------------------
  |  Branch (667:9): [True: 201k, False: 549k]
  ------------------
  668|   201k|    {
  669|       |        // Calculate type info locations in emitted dwarf code which
  670|       |        // were flagged by type info arguments to llvm.eh.selector
  671|       |        // intrinsic
  672|   201k|        uintptr_t classInfoOffset = readULEB128(&lsda);
  673|   201k|        classInfo = lsda + classInfoOffset;
  674|   201k|    }
  675|       |    // Walk call-site table looking for range that
  676|       |    // includes current PC.
  677|   751k|    uint8_t callSiteEncoding = *lsda++;
  678|       |#if defined(__USING_SJLJ_EXCEPTIONS__) || defined(__USING_WASM_EXCEPTIONS__)
  679|       |    (void)callSiteEncoding;  // When using SjLj/Wasm exceptions, callSiteEncoding is never used
  680|       |#endif
  681|   751k|    uint32_t callSiteTableLength = static_cast<uint32_t>(readULEB128(&lsda));
  682|   751k|    const uint8_t* callSiteTableStart = lsda;
  683|   751k|    const uint8_t* callSiteTableEnd = callSiteTableStart + callSiteTableLength;
  684|   751k|    const uint8_t* actionTableStart = callSiteTableEnd;
  685|   751k|    const uint8_t* callSitePtr = callSiteTableStart;
  686|  3.01M|    while (callSitePtr < callSiteTableEnd)
  ------------------
  |  Branch (686:12): [True: 3.01M, False: 17]
  ------------------
  687|  3.01M|    {
  688|       |        // There is one entry per call site.
  689|  3.01M|#if !defined(__USING_SJLJ_EXCEPTIONS__) && !defined(__USING_WASM_EXCEPTIONS__)
  690|       |        // The call sites are non-overlapping in [start, start+length)
  691|       |        // The call sites are ordered in increasing value of start
  692|  3.01M|        uintptr_t start = readEncodedPointer(&callSitePtr, callSiteEncoding);
  693|  3.01M|        uintptr_t length = readEncodedPointer(&callSitePtr, callSiteEncoding);
  694|  3.01M|        uintptr_t landingPad = readEncodedPointer(&callSitePtr, callSiteEncoding);
  695|  3.01M|        uintptr_t actionEntry = readULEB128(&callSitePtr);
  696|  3.01M|        if ((start <= ipOffset) && (ipOffset < (start + length)))
  ------------------
  |  Branch (696:13): [True: 3.01M, False: 15]
  |  Branch (696:36): [True: 751k, False: 2.26M]
  ------------------
  697|       |#else  // __USING_SJLJ_EXCEPTIONS__ || __USING_WASM_EXCEPTIONS__
  698|       |        // ip is 1-based index into this table
  699|       |        uintptr_t landingPad = readULEB128(&callSitePtr);
  700|       |        uintptr_t actionEntry = readULEB128(&callSitePtr);
  701|       |        if (--ip == 0)
  702|       |#endif // __USING_SJLJ_EXCEPTIONS__ || __USING_WASM_EXCEPTIONS__
  703|   751k|        {
  704|       |            // Found the call site containing ip.
  705|   751k|#if !defined(__USING_SJLJ_EXCEPTIONS__) && !defined(__USING_WASM_EXCEPTIONS__)
  706|   751k|            if (landingPad == 0)
  ------------------
  |  Branch (706:17): [True: 426k, False: 324k]
  ------------------
  707|   426k|            {
  708|       |                // No handler here
  709|   426k|                results.reason = _URC_CONTINUE_UNWIND;
  710|   426k|                return;
  711|   426k|            }
  712|   324k|            landingPad = (uintptr_t)lpStart + landingPad;
  713|       |#else  // __USING_SJLJ_EXCEPTIONS__ || __USING_WASM_EXCEPTIONS__
  714|       |            ++landingPad;
  715|       |#endif // __USING_SJLJ_EXCEPTIONS__ || __USING_WASM_EXCEPTIONS__
  716|   324k|            results.landingPad = landingPad;
  717|   324k|            if (actionEntry == 0)
  ------------------
  |  Branch (717:17): [True: 134k, False: 190k]
  ------------------
  718|   134k|            {
  719|       |                // Found a cleanup
  720|   134k|                results.reason = actions & _UA_SEARCH_PHASE
  ------------------
  |  Branch (720:34): [True: 67.0k, False: 67.0k]
  ------------------
  721|   134k|                                     ? _URC_CONTINUE_UNWIND
  722|   134k|                                     : _URC_HANDLER_FOUND;
  723|   134k|                return;
  724|   134k|            }
  725|       |            // Convert 1-based byte offset into
  726|   190k|            const uint8_t* action = actionTableStart + (actionEntry - 1);
  727|   190k|            bool hasCleanup = false;
  728|       |            // Scan action entries until you find a matching handler, cleanup, or the end of action list
  729|   237k|            while (true)
  ------------------
  |  Branch (729:20): [True: 237k, Folded]
  ------------------
  730|   237k|            {
  731|   237k|                const uint8_t* actionRecord = action;
  732|   237k|                int64_t ttypeIndex = readSLEB128(&action);
  733|   237k|                if (ttypeIndex > 0)
  ------------------
  |  Branch (733:21): [True: 233k, False: 4.30k]
  ------------------
  734|   233k|                {
  735|       |                    // Found a catch, does it actually catch?
  736|       |                    // First check for catch (...)
  737|   233k|                    const __shim_type_info* catchType =
  738|   233k|                        get_shim_type_info(static_cast<uint64_t>(ttypeIndex),
  739|   233k|                                           classInfo, ttypeEncoding,
  740|   233k|                                           native_exception, unwind_exception,
  741|   233k|                                           base);
  742|   233k|                    if (catchType == 0)
  ------------------
  |  Branch (742:25): [True: 0, False: 233k]
  ------------------
  743|      0|                    {
  744|       |                        // Found catch (...) catches everything, including
  745|       |                        // foreign exceptions. This is search phase, cleanup
  746|       |                        // phase with foreign exception, or forced unwinding.
  747|      0|                        assert(actions & (_UA_SEARCH_PHASE | _UA_HANDLER_FRAME |
  ------------------
  |  Branch (747:25): [True: 0, False: 0]
  ------------------
  748|      0|                                          _UA_FORCE_UNWIND));
  749|      0|                        results.ttypeIndex = ttypeIndex;
  750|      0|                        results.actionRecord = actionRecord;
  751|      0|                        results.adjustedPtr =
  752|      0|                            get_thrown_object_ptr(unwind_exception);
  753|      0|                        results.reason = _URC_HANDLER_FOUND;
  754|      0|                        return;
  755|      0|                    }
  756|       |                    // Else this is a catch (T) clause and will never
  757|       |                    //    catch a foreign exception
  758|   233k|                    else if (native_exception)
  ------------------
  |  Branch (758:30): [True: 233k, False: 1]
  ------------------
  759|   233k|                    {
  760|   233k|                        __cxa_exception* exception_header = (__cxa_exception*)(unwind_exception+1) - 1;
  761|   233k|                        void* adjustedPtr = get_thrown_object_ptr(unwind_exception);
  762|   233k|                        const __shim_type_info* excpType =
  763|   233k|                            static_cast<const __shim_type_info*>(exception_header->exceptionType);
  764|   233k|                        if (adjustedPtr == 0 || excpType == 0)
  ------------------
  |  Branch (764:29): [True: 0, False: 233k]
  |  Branch (764:49): [True: 0, False: 233k]
  ------------------
  765|      0|                        {
  766|       |                            // Something very bad happened
  767|      0|                            call_terminate(native_exception, unwind_exception);
  768|      0|                        }
  769|   233k|                        if (catchType->can_catch(excpType, adjustedPtr))
  ------------------
  |  Branch (769:29): [True: 172k, False: 60.8k]
  ------------------
  770|   172k|                        {
  771|       |                            // Found a matching handler. This is either search
  772|       |                            // phase or forced unwinding.
  773|   172k|                            assert(actions &
  ------------------
  |  Branch (773:29): [True: 172k, False: 18.4E]
  ------------------
  774|   172k|                                   (_UA_SEARCH_PHASE | _UA_FORCE_UNWIND));
  775|   172k|                            results.ttypeIndex = ttypeIndex;
  776|   172k|                            results.actionRecord = actionRecord;
  777|   172k|                            results.adjustedPtr = adjustedPtr;
  778|   172k|                            results.reason = _URC_HANDLER_FOUND;
  779|   172k|                            return;
  780|   172k|                        }
  781|   233k|                    }
  782|       |                    // Scan next action ...
  783|   233k|                }
  784|  4.30k|                else if (ttypeIndex < 0)
  ------------------
  |  Branch (784:26): [True: 0, False: 4.30k]
  ------------------
  785|      0|                {
  786|       |                    // Found an exception specification.
  787|      0|                    if (actions & _UA_FORCE_UNWIND) {
  ------------------
  |  Branch (787:25): [True: 0, False: 0]
  ------------------
  788|       |                        // Skip if forced unwinding.
  789|      0|                    } else if (native_exception) {
  ------------------
  |  Branch (789:32): [True: 0, False: 0]
  ------------------
  790|       |                        // Does the exception spec catch this native exception?
  791|      0|                        __cxa_exception* exception_header = (__cxa_exception*)(unwind_exception+1) - 1;
  792|      0|                        void* adjustedPtr = get_thrown_object_ptr(unwind_exception);
  793|      0|                        const __shim_type_info* excpType =
  794|      0|                            static_cast<const __shim_type_info*>(exception_header->exceptionType);
  795|      0|                        if (adjustedPtr == 0 || excpType == 0)
  ------------------
  |  Branch (795:29): [True: 0, False: 0]
  |  Branch (795:49): [True: 0, False: 0]
  ------------------
  796|      0|                        {
  797|       |                            // Something very bad happened
  798|      0|                            call_terminate(native_exception, unwind_exception);
  799|      0|                        }
  800|      0|                        if (exception_spec_can_catch(ttypeIndex, classInfo,
  ------------------
  |  Branch (800:29): [True: 0, False: 0]
  ------------------
  801|      0|                                                     ttypeEncoding, excpType,
  802|      0|                                                     adjustedPtr,
  803|      0|                                                     unwind_exception, base))
  804|      0|                        {
  805|       |                            // Native exception caught by exception
  806|       |                            // specification.
  807|      0|                            assert(actions & _UA_SEARCH_PHASE);
  ------------------
  |  Branch (807:29): [True: 0, False: 0]
  ------------------
  808|      0|                            results.ttypeIndex = ttypeIndex;
  809|      0|                            results.actionRecord = actionRecord;
  810|      0|                            results.adjustedPtr = adjustedPtr;
  811|      0|                            results.reason = _URC_HANDLER_FOUND;
  812|      0|                            return;
  813|      0|                        }
  814|      0|                    } else {
  815|       |                        // foreign exception caught by exception spec
  816|      0|                        results.ttypeIndex = ttypeIndex;
  817|      0|                        results.actionRecord = actionRecord;
  818|      0|                        results.adjustedPtr =
  819|      0|                            get_thrown_object_ptr(unwind_exception);
  820|      0|                        results.reason = _URC_HANDLER_FOUND;
  821|      0|                        return;
  822|      0|                    }
  823|       |                    // Scan next action ...
  824|  4.30k|                } else {
  825|  4.30k|                    hasCleanup = true;
  826|  4.30k|                }
  827|  65.1k|                const uint8_t* temp = action;
  828|  65.1k|                int64_t actionOffset = readSLEB128(&temp);
  829|  65.1k|                if (actionOffset == 0)
  ------------------
  |  Branch (829:21): [True: 18.0k, False: 47.0k]
  ------------------
  830|  18.0k|                {
  831|       |                    // End of action list. If this is phase 2 and we have found
  832|       |                    // a cleanup (ttypeIndex=0), return _URC_HANDLER_FOUND;
  833|       |                    // otherwise return _URC_CONTINUE_UNWIND.
  834|  18.0k|                    results.reason = hasCleanup && actions & _UA_CLEANUP_PHASE
  ------------------
  |  Branch (834:38): [True: 4.30k, False: 13.7k]
  |  Branch (834:52): [True: 2.15k, False: 2.15k]
  ------------------
  835|  18.0k|                                         ? _URC_HANDLER_FOUND
  836|  18.0k|                                         : _URC_CONTINUE_UNWIND;
  837|  18.0k|                    return;
  838|  18.0k|                }
  839|       |                // Go to next action
  840|  47.0k|                action += actionOffset;
  841|  47.0k|            }  // there is no break out of this loop, only return
  842|   190k|        }
  843|  2.26M|#if !defined(__USING_SJLJ_EXCEPTIONS__) && !defined(__USING_WASM_EXCEPTIONS__)
  844|  2.26M|        else if (ipOffset < start)
  ------------------
  |  Branch (844:18): [True: 0, False: 2.26M]
  ------------------
  845|      0|        {
  846|       |            // There is no call site for this ip
  847|       |            // Something bad has happened.  We should never get here.
  848|       |            // Possible stack corruption.
  849|      0|            call_terminate(native_exception, unwind_exception);
  850|      0|        }
  851|  3.01M|#endif // !__USING_SJLJ_EXCEPTIONS__ && !__USING_WASM_EXCEPTIONS__
  852|  3.01M|    }  // there might be some tricky cases which break out of this loop
  853|       |
  854|       |    // It is possible that no eh table entry specify how to handle
  855|       |    // this exception. By spec, terminate it immediately.
  856|     17|    call_terminate(native_exception, unwind_exception);
  857|     17|}
cxa_personality.cpp:_ZN10__cxxabiv1L11readSLEB128EPPKh:
  231|   302k|{
  232|   302k|    uintptr_t result = 0;
  233|   302k|    uintptr_t shift = 0;
  234|   302k|    unsigned char byte;
  235|   302k|    const uint8_t *p = *data;
  236|   302k|    do
  237|   302k|    {
  238|   302k|        byte = *p++;
  239|   302k|        result |= static_cast<uintptr_t>(byte & 0x7F) << shift;
  240|   302k|        shift += 7;
  241|   302k|    } while (byte & 0x80);
  ------------------
  |  Branch (241:14): [True: 0, False: 302k]
  ------------------
  242|   302k|    *data = p;
  243|   302k|    if ((byte & 0x40) && (shift < (sizeof(result) << 3)))
  ------------------
  |  Branch (243:9): [True: 47.0k, False: 255k]
  |  Branch (243:26): [True: 47.0k, False: 0]
  ------------------
  244|  47.0k|        result |= static_cast<uintptr_t>(~0) << shift;
  245|   302k|    return static_cast<intptr_t>(result);
  246|   302k|}
cxa_personality.cpp:_ZN10__cxxabiv1L18get_shim_type_infoEmPKhhbP17_Unwind_Exceptionm:
  389|   233k|{
  390|   233k|    if (classInfo == 0)
  ------------------
  |  Branch (390:9): [True: 0, False: 233k]
  ------------------
  391|      0|    {
  392|       |        // this should not happen.  Indicates corrupted eh_table.
  393|      0|        call_terminate(native_exception, unwind_exception);
  394|      0|    }
  395|   233k|    switch (ttypeEncoding & 0x0F)
  396|   233k|    {
  397|      0|    case DW_EH_PE_absptr:
  ------------------
  |  Branch (397:5): [True: 0, False: 233k]
  ------------------
  398|      0|        ttypeIndex *= sizeof(void*);
  399|      0|        break;
  400|      0|    case DW_EH_PE_udata2:
  ------------------
  |  Branch (400:5): [True: 0, False: 233k]
  ------------------
  401|      0|    case DW_EH_PE_sdata2:
  ------------------
  |  Branch (401:5): [True: 0, False: 233k]
  ------------------
  402|      0|        ttypeIndex *= 2;
  403|      0|        break;
  404|      0|    case DW_EH_PE_udata4:
  ------------------
  |  Branch (404:5): [True: 0, False: 233k]
  ------------------
  405|   233k|    case DW_EH_PE_sdata4:
  ------------------
  |  Branch (405:5): [True: 233k, False: 18.4E]
  ------------------
  406|   233k|        ttypeIndex *= 4;
  407|   233k|        break;
  408|      0|    case DW_EH_PE_udata8:
  ------------------
  |  Branch (408:5): [True: 0, False: 233k]
  ------------------
  409|      0|    case DW_EH_PE_sdata8:
  ------------------
  |  Branch (409:5): [True: 0, False: 233k]
  ------------------
  410|      0|        ttypeIndex *= 8;
  411|      0|        break;
  412|      0|    default:
  ------------------
  |  Branch (412:5): [True: 0, False: 233k]
  ------------------
  413|       |        // this should not happen.   Indicates corrupted eh_table.
  414|      0|        call_terminate(native_exception, unwind_exception);
  415|   233k|    }
  416|   233k|    classInfo -= ttypeIndex;
  417|   233k|    return (const __shim_type_info*)readEncodedPointer(&classInfo,
  418|   233k|                                                       ttypeEncoding, base);
  419|   233k|}
cxa_personality.cpp:_ZN10__cxxabiv1L21get_thrown_object_ptrEP17_Unwind_Exception:
  518|   233k|{
  519|       |    // Even for foreign exceptions, the exception object is *probably* at unwind_exception + 1
  520|       |    //    Regardless, this library is prohibited from touching a foreign exception
  521|   233k|    void* adjustedPtr = unwind_exception + 1;
  522|   233k|    if (__getExceptionClass(unwind_exception) == kOurDependentExceptionClass)
  ------------------
  |  Branch (522:9): [True: 0, False: 233k]
  ------------------
  523|      0|        adjustedPtr = ((__cxa_dependent_exception*)adjustedPtr - 1)->primaryException;
  524|   233k|    return adjustedPtr;
  525|   233k|}
cxa_personality.cpp:_ZN10__cxxabiv1L18readEncodedPointerEPPKhhm:
  258|  9.28M|{
  259|  9.28M|    uintptr_t result = 0;
  260|  9.28M|    if (encoding == DW_EH_PE_omit)
  ------------------
  |  Branch (260:9): [True: 0, False: 9.28M]
  ------------------
  261|      0|        return result;
  262|  9.28M|    const uint8_t* p = *data;
  263|       |    // first get value
  264|  9.28M|    switch (encoding & 0x0F)
  265|  9.28M|    {
  266|      0|    case DW_EH_PE_absptr:
  ------------------
  |  Branch (266:5): [True: 0, False: 9.28M]
  ------------------
  267|      0|        result = readPointerHelper<uintptr_t>(p);
  268|      0|        break;
  269|  9.04M|    case DW_EH_PE_uleb128:
  ------------------
  |  Branch (269:5): [True: 9.04M, False: 233k]
  ------------------
  270|  9.04M|        result = readULEB128(&p);
  271|  9.04M|        break;
  272|      0|    case DW_EH_PE_sleb128:
  ------------------
  |  Branch (272:5): [True: 0, False: 9.28M]
  ------------------
  273|      0|        result = static_cast<uintptr_t>(readSLEB128(&p));
  274|      0|        break;
  275|      0|    case DW_EH_PE_udata2:
  ------------------
  |  Branch (275:5): [True: 0, False: 9.28M]
  ------------------
  276|      0|        result = readPointerHelper<uint16_t>(p);
  277|      0|        break;
  278|      0|    case DW_EH_PE_udata4:
  ------------------
  |  Branch (278:5): [True: 0, False: 9.28M]
  ------------------
  279|      0|        result = readPointerHelper<uint32_t>(p);
  280|      0|        break;
  281|      0|    case DW_EH_PE_udata8:
  ------------------
  |  Branch (281:5): [True: 0, False: 9.28M]
  ------------------
  282|      0|        result = readPointerHelper<uint64_t>(p);
  283|      0|        break;
  284|      0|    case DW_EH_PE_sdata2:
  ------------------
  |  Branch (284:5): [True: 0, False: 9.28M]
  ------------------
  285|      0|        result = readPointerHelper<int16_t>(p);
  286|      0|        break;
  287|   233k|    case DW_EH_PE_sdata4:
  ------------------
  |  Branch (287:5): [True: 233k, False: 9.04M]
  ------------------
  288|   233k|        result = readPointerHelper<int32_t>(p);
  289|   233k|        break;
  290|      0|    case DW_EH_PE_sdata8:
  ------------------
  |  Branch (290:5): [True: 0, False: 9.28M]
  ------------------
  291|      0|        result = readPointerHelper<int64_t>(p);
  292|      0|        break;
  293|      0|    default:
  ------------------
  |  Branch (293:5): [True: 0, False: 9.28M]
  ------------------
  294|       |        // not supported
  295|      0|        abort();
  296|      0|        break;
  297|  9.28M|    }
  298|       |    // then add relative offset
  299|  9.28M|    switch (encoding & 0x70)
  300|  9.28M|    {
  301|  9.04M|    case DW_EH_PE_absptr:
  ------------------
  |  Branch (301:5): [True: 9.04M, False: 233k]
  ------------------
  302|       |        // do nothing
  303|  9.04M|        break;
  304|   233k|    case DW_EH_PE_pcrel:
  ------------------
  |  Branch (304:5): [True: 233k, False: 9.04M]
  ------------------
  305|   233k|        if (result)
  ------------------
  |  Branch (305:13): [True: 233k, False: 1]
  ------------------
  306|   233k|            result += (uintptr_t)(*data);
  307|   233k|        break;
  308|      0|    case DW_EH_PE_datarel:
  ------------------
  |  Branch (308:5): [True: 0, False: 9.28M]
  ------------------
  309|      0|        assert((base != 0) && "DW_EH_PE_datarel is invalid with a base of 0");
  ------------------
  |  Branch (309:9): [True: 0, False: 0]
  |  Branch (309:9): [True: 0, Folded]
  |  Branch (309:9): [True: 0, False: 0]
  ------------------
  310|      0|        if (result)
  ------------------
  |  Branch (310:13): [True: 0, False: 0]
  ------------------
  311|      0|            result += base;
  312|      0|        break;
  313|      0|    case DW_EH_PE_textrel:
  ------------------
  |  Branch (313:5): [True: 0, False: 9.28M]
  ------------------
  314|      0|    case DW_EH_PE_funcrel:
  ------------------
  |  Branch (314:5): [True: 0, False: 9.28M]
  ------------------
  315|      0|    case DW_EH_PE_aligned:
  ------------------
  |  Branch (315:5): [True: 0, False: 9.28M]
  ------------------
  316|      0|    default:
  ------------------
  |  Branch (316:5): [True: 0, False: 9.28M]
  ------------------
  317|       |        // not supported
  318|      0|        abort();
  319|      0|        break;
  320|  9.28M|    }
  321|       |    // then apply indirection
  322|  9.28M|    if (result && (encoding & DW_EH_PE_indirect))
  ------------------
  |  Branch (322:9): [True: 7.49M, False: 1.79M]
  |  Branch (322:19): [True: 233k, False: 7.25M]
  ------------------
  323|   233k|        result = *((uintptr_t*)result);
  324|  9.28M|    *data = p;
  325|  9.28M|    return result;
  326|  9.28M|}
cxa_personality.cpp:_ZN10__cxxabiv112_GLOBAL__N_117readPointerHelperIiEEmRPKh:
  163|   233k|uintptr_t readPointerHelper(const uint8_t*& p) {
  164|   233k|    AsType value;
  165|   233k|    memcpy(&value, p, sizeof(AsType));
  166|   233k|    p += sizeof(AsType);
  167|   233k|    return static_cast<uintptr_t>(value);
  168|   233k|}
cxa_personality.cpp:_ZN10__cxxabiv1L11readULEB128EPPKh:
  208|  13.0M|{
  209|  13.0M|    uintptr_t result = 0;
  210|  13.0M|    uintptr_t shift = 0;
  211|  13.0M|    unsigned char byte;
  212|  13.0M|    const uint8_t *p = *data;
  213|  13.0M|    do
  214|  17.6M|    {
  215|  17.6M|        byte = *p++;
  216|  17.6M|        result |= static_cast<uintptr_t>(byte & 0x7F) << shift;
  217|  17.6M|        shift += 7;
  218|  17.6M|    } while (byte & 0x80);
  ------------------
  |  Branch (218:14): [True: 4.58M, False: 13.0M]
  ------------------
  219|  13.0M|    *data = p;
  220|  13.0M|    return result;
  221|  13.0M|}

_ZN10__cxxabiv130__aligned_malloc_with_fallbackEm:
  258|   172k|void* __aligned_malloc_with_fallback(size_t size) {
  259|       |#if defined(_WIN32)
  260|       |  if (void* dest = std::__libcpp_aligned_alloc(alignof(__aligned_type), size))
  261|       |    return dest;
  262|       |#elif defined(_LIBCPP_HAS_NO_LIBRARY_ALIGNED_ALLOCATION)
  263|       |  if (void* dest = ::malloc(size))
  264|       |    return dest;
  265|       |#else
  266|   172k|  if (size == 0)
  ------------------
  |  Branch (266:7): [True: 0, False: 172k]
  ------------------
  267|      0|    size = 1;
  268|   172k|  if (void* dest = std::__libcpp_aligned_alloc(__alignof(__aligned_type), size))
  ------------------
  |  Branch (268:13): [True: 172k, False: 2]
  ------------------
  269|   172k|    return dest;
  270|      2|#endif
  271|      2|  return fallback_malloc(size);
  272|   172k|}
_ZN10__cxxabiv122__calloc_with_fallbackEmm:
  274|     32|void* __calloc_with_fallback(size_t count, size_t size) {
  275|     32|  void* ptr = ::calloc(count, size);
  276|     32|  if (NULL != ptr)
  ------------------
  |  Branch (276:7): [True: 32, False: 0]
  ------------------
  277|     32|    return ptr;
  278|       |  // if calloc fails, fall back to emergency stash
  279|      0|  ptr = fallback_malloc(size * count);
  280|      0|  if (NULL != ptr)
  ------------------
  |  Branch (280:7): [True: 0, False: 0]
  ------------------
  281|      0|    ::memset(ptr, 0, size * count);
  282|      0|  return ptr;
  283|     32|}
_ZN10__cxxabiv128__aligned_free_with_fallbackEPv:
  285|   172k|void __aligned_free_with_fallback(void* ptr) {
  286|   172k|  if (is_fallback_ptr(ptr))
  ------------------
  |  Branch (286:7): [True: 0, False: 172k]
  ------------------
  287|      0|    fallback_free(ptr);
  288|   172k|  else {
  289|       |#if defined(_LIBCPP_HAS_NO_LIBRARY_ALIGNED_ALLOCATION)
  290|       |    ::free(ptr);
  291|       |#else
  292|   172k|    std::__libcpp_aligned_free(ptr);
  293|   172k|#endif
  294|   172k|  }
  295|   172k|}
_ZN10__cxxabiv120__free_with_fallbackEPv:
  297|     31|void __free_with_fallback(void* ptr) {
  298|     31|  if (is_fallback_ptr(ptr))
  ------------------
  |  Branch (298:7): [True: 0, False: 31]
  ------------------
  299|      0|    fallback_free(ptr);
  300|     31|  else
  301|     31|    ::free(ptr);
  302|     31|}
fallback_malloc.cpp:_ZN12_GLOBAL__N_115is_fallback_ptrEPv:
  128|   172k|bool is_fallback_ptr(void* ptr) {
  129|   172k|  return ptr >= heap && ptr < (heap + HEAP_SIZE);
  ------------------
  |  Branch (129:10): [True: 172k, False: 0]
  |  Branch (129:25): [True: 0, False: 172k]
  ------------------
  130|   172k|}

_ZNK10__cxxabiv117__class_type_info9can_catchEPKNS_16__shim_type_infoERPv:
  464|   233k|{
  465|       |    // bullet 1
  466|   233k|    if (is_equal(this, thrown_type, false))
  ------------------
  |  Branch (466:9): [True: 126k, False: 106k]
  ------------------
  467|   126k|        return true;
  468|   106k|    const __class_type_info* thrown_class_type =
  469|   106k|        dynamic_cast<const __class_type_info*>(thrown_type);
  470|   106k|    if (thrown_class_type == 0)
  ------------------
  |  Branch (470:9): [True: 0, False: 106k]
  ------------------
  471|      0|        return false;
  472|       |    // bullet 2
  473|   106k|    assert(adjustedPtr && "catching a class without an object?");
  ------------------
  |  Branch (473:5): [True: 106k, False: 8]
  |  Branch (473:5): [True: 106k, Folded]
  |  Branch (473:5): [True: 106k, False: 8]
  ------------------
  474|   106k|    __dynamic_cast_info info = {thrown_class_type, 0, this, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, true, nullptr};
  475|   106k|    info.number_of_dst_type = 1;
  476|   106k|    thrown_class_type->has_unambiguous_public_base(&info, adjustedPtr, public_path);
  477|   106k|    if (info.path_dst_ptr_to_static_ptr == public_path)
  ------------------
  |  Branch (477:9): [True: 45.5k, False: 60.8k]
  ------------------
  478|  45.5k|    {
  479|  45.5k|        adjustedPtr = const_cast<void*>(info.dst_ptr_leading_to_static_ptr);
  480|  45.5k|        return true;
  481|  45.5k|    }
  482|  60.8k|    return false;
  483|   106k|}
_ZNK10__cxxabiv117__class_type_info24process_found_base_classEPNS_19__dynamic_cast_infoEPvi:
  509|  45.5k|{
  510|  45.5k|  if (info->number_to_static_ptr == 0) {
  ------------------
  |  Branch (510:7): [True: 45.5k, False: 0]
  ------------------
  511|       |    // First time we found this base
  512|  45.5k|    info->dst_ptr_leading_to_static_ptr = adjustedPtr;
  513|  45.5k|    info->path_dst_ptr_to_static_ptr = path_below;
  514|       |    // stash the virtual base cookie.
  515|  45.5k|    info->dst_ptr_not_leading_to_static_ptr = info->vbase_cookie;
  516|  45.5k|    info->number_to_static_ptr = 1;
  517|  45.5k|  } else if (info->dst_ptr_not_leading_to_static_ptr == info->vbase_cookie &&
  ------------------
  |  Branch (517:14): [True: 0, False: 0]
  ------------------
  518|      0|             info->dst_ptr_leading_to_static_ptr == adjustedPtr) {
  ------------------
  |  Branch (518:14): [True: 0, False: 0]
  ------------------
  519|       |    // We've been here before.  Update path to "most public"
  520|      0|    if (info->path_dst_ptr_to_static_ptr == not_public_path)
  ------------------
  |  Branch (520:9): [True: 0, False: 0]
  ------------------
  521|      0|      info->path_dst_ptr_to_static_ptr = path_below;
  522|      0|  } else {
  523|       |    // We've detected an ambiguous cast from (thrown_class_type, adjustedPtr)
  524|       |    // to a static_type.
  525|      0|    info->number_to_static_ptr += 1;
  526|      0|    info->path_dst_ptr_to_static_ptr = not_public_path;
  527|      0|    info->search_done = true;
  528|      0|  }
  529|  45.5k|}
_ZNK10__cxxabiv117__class_type_info27has_unambiguous_public_baseEPNS_19__dynamic_cast_infoEPvi:
  535|  60.8k|{
  536|  60.8k|    if (is_equal(this, info->static_type, false))
  ------------------
  |  Branch (536:9): [True: 0, False: 60.8k]
  ------------------
  537|      0|        process_found_base_class(info, adjustedPtr, path_below);
  538|  60.8k|}
_ZNK10__cxxabiv120__si_class_type_info27has_unambiguous_public_baseEPNS_19__dynamic_cast_infoEPvi:
  544|   297k|{
  545|   297k|    if (is_equal(this, info->static_type, false))
  ------------------
  |  Branch (545:9): [True: 45.5k, False: 252k]
  ------------------
  546|  45.5k|        process_found_base_class(info, adjustedPtr, path_below);
  547|   252k|    else
  548|   252k|        __base_type->has_unambiguous_public_base(info, adjustedPtr, path_below);
  549|   297k|}
__dynamic_cast:
  899|   106k|               std::ptrdiff_t src2dst_offset) {
  900|       |    // Get (dynamic_ptr, dynamic_type) from static_ptr
  901|   106k|    derived_object_info derived_info;
  902|   106k|    dyn_cast_get_derived_info(&derived_info, static_ptr);
  903|       |
  904|       |    // Initialize answer to nullptr.  This will be changed from the search
  905|       |    //    results if a non-null answer is found.  Regardless, this is what will
  906|       |    //    be returned.
  907|   106k|    const void* dst_ptr = 0;
  908|       |
  909|       |    // Find out if we can use a giant short cut in the search
  910|   106k|    if (is_equal(derived_info.dynamic_type, dst_type, false))
  ------------------
  |  Branch (910:9): [True: 0, False: 106k]
  ------------------
  911|      0|    {
  912|      0|        dst_ptr = dyn_cast_to_derived(static_ptr,
  913|      0|                                      derived_info.dynamic_ptr,
  914|      0|                                      static_type,
  915|      0|                                      dst_type,
  916|      0|                                      derived_info.offset_to_derived,
  917|      0|                                      src2dst_offset);
  918|      0|    }
  919|   106k|    else
  920|   106k|    {
  921|       |        // Optimize toward downcasting: let's first try to do a downcast before
  922|       |        //   falling back to the slow path.
  923|   106k|        dst_ptr = dyn_cast_try_downcast(static_ptr,
  924|   106k|                                        derived_info.dynamic_ptr,
  925|   106k|                                        dst_type,
  926|   106k|                                        derived_info.dynamic_type,
  927|   106k|                                        src2dst_offset);
  928|       |
  929|   106k|        if (!dst_ptr)
  ------------------
  |  Branch (929:13): [True: 0, False: 106k]
  ------------------
  930|      0|        {
  931|      0|            dst_ptr = dyn_cast_slow(static_ptr,
  932|      0|                                    derived_info.dynamic_ptr,
  933|      0|                                    static_type,
  934|      0|                                    dst_type,
  935|      0|                                    derived_info.dynamic_type,
  936|      0|                                    src2dst_offset);
  937|      0|        }
  938|   106k|    }
  939|       |
  940|   106k|    return const_cast<void*>(dst_ptr);
  941|   106k|}
_ZNK10__cxxabiv117__class_type_info29process_static_type_above_dstEPNS_19__dynamic_cast_infoEPKvS4_i:
  961|   106k|{
  962|       |    // Record that we found a static_type
  963|   106k|    info->found_any_static_type = true;
  964|   106k|    if (current_ptr == info->static_ptr)
  ------------------
  |  Branch (964:9): [True: 106k, False: 2]
  ------------------
  965|   106k|    {
  966|       |        // Record that we found (static_ptr, static_type)
  967|   106k|        info->found_our_static_ptr = true;
  968|   106k|        if (info->dst_ptr_leading_to_static_ptr == 0)
  ------------------
  |  Branch (968:13): [True: 106k, False: 1]
  ------------------
  969|   106k|        {
  970|       |            // First time here
  971|   106k|            info->dst_ptr_leading_to_static_ptr = dst_ptr;
  972|   106k|            info->path_dst_ptr_to_static_ptr = path_below;
  973|   106k|            info->number_to_static_ptr = 1;
  974|       |            // If there is only one dst_type in the entire tree and the path from
  975|       |            //    there to here is public then we are done!
  976|   106k|            if (info->number_of_dst_type == 1 && info->path_dst_ptr_to_static_ptr == public_path)
  ------------------
  |  Branch (976:17): [True: 106k, False: 18.4E]
  |  Branch (976:50): [True: 106k, False: 0]
  ------------------
  977|   106k|                info->search_done = true;
  978|   106k|        }
  979|      1|        else if (info->dst_ptr_leading_to_static_ptr == dst_ptr)
  ------------------
  |  Branch (979:18): [True: 0, False: 1]
  ------------------
  980|      0|        {
  981|       |            // We've been here before.  Update path to "most public"
  982|      0|            if (info->path_dst_ptr_to_static_ptr == not_public_path)
  ------------------
  |  Branch (982:17): [True: 0, False: 0]
  ------------------
  983|      0|                info->path_dst_ptr_to_static_ptr = path_below;
  984|       |            // If there is only one dst_type in the entire tree and the path from
  985|       |            //    there to here is public then we are done!
  986|      0|            if (info->number_of_dst_type == 1 && info->path_dst_ptr_to_static_ptr == public_path)
  ------------------
  |  Branch (986:17): [True: 0, False: 0]
  |  Branch (986:50): [True: 0, False: 0]
  ------------------
  987|      0|                info->search_done = true;
  988|      0|        }
  989|      1|        else
  990|      1|        {
  991|       |            // We've detected an ambiguous cast from (static_ptr, static_type)
  992|       |            //   to a dst_type
  993|      1|            info->number_to_static_ptr += 1;
  994|      1|            info->search_done = true;
  995|      1|        }
  996|   106k|    }
  997|   106k|}
_ZNK10__cxxabiv120__si_class_type_info16search_above_dstEPNS_19__dynamic_cast_infoEPKvS4_ib:
 1469|   212k|{
 1470|   212k|    if (is_equal(this, info->static_type, use_strcmp))
  ------------------
  |  Branch (1470:9): [True: 106k, False: 106k]
  ------------------
 1471|   106k|        process_static_type_above_dst(info, dst_ptr, current_ptr, path_below);
 1472|   106k|    else
 1473|   106k|        __base_type->search_above_dst(info, dst_ptr, current_ptr, path_below, use_strcmp);
 1474|   212k|}
private_typeinfo.cpp:_ZL8is_equalPKSt9type_infoS1_b:
   57|   910k|{
   58|       |    // Use std::type_info's default comparison unless we've explicitly asked
   59|       |    // for strcmp.
   60|   910k|    if (!use_strcmp)
  ------------------
  |  Branch (60:9): [True: 910k, False: 18.4E]
  ------------------
   61|   910k|        return *x == *y;
   62|       |    // Still allow pointer equality to short circut.
   63|  18.4E|    return x == y || strcmp(x->name(), y->name()) == 0;
  ------------------
  |  Branch (63:12): [True: 18.4E, False: 0]
  |  Branch (63:22): [True: 0, False: 0]
  ------------------
   64|   910k|}
private_typeinfo.cpp:_ZN10__cxxabiv112_GLOBAL__N_125dyn_cast_get_derived_infoEPNS0_19derived_object_infoEPKv:
   89|   106k|{
   90|       |#if __has_feature(cxx_abi_relative_vtable)
   91|       |    // The vtable address will point to the first virtual function, which is 8
   92|       |    // bytes after the start of the vtable (4 for the offset from top + 4 for
   93|       |    // the typeinfo component).
   94|       |    const int32_t* vtable =
   95|       |        *reinterpret_cast<const int32_t* const*>(static_ptr);
   96|       |    info->offset_to_derived = static_cast<std::ptrdiff_t>(vtable[-2]);
   97|       |    info->dynamic_ptr = static_cast<const char*>(static_ptr) + info->offset_to_derived;
   98|       |
   99|       |    // The typeinfo component is now a relative offset to a proxy.
  100|       |    int32_t offset_to_ti_proxy = vtable[-1];
  101|       |    const uint8_t* ptr_to_ti_proxy =
  102|       |        reinterpret_cast<const uint8_t*>(vtable) + offset_to_ti_proxy;
  103|       |    info->dynamic_type = *(reinterpret_cast<const __class_type_info* const*>(ptr_to_ti_proxy));
  104|       |#else
  105|   106k|    void **vtable = *static_cast<void ** const *>(static_ptr);
  106|   106k|    info->offset_to_derived = reinterpret_cast<ptrdiff_t>(vtable[-2]);
  107|   106k|    info->dynamic_ptr = static_cast<const char*>(static_ptr) + info->offset_to_derived;
  108|   106k|    info->dynamic_type = static_cast<const __class_type_info*>(vtable[-1]);
  109|   106k|#endif
  110|   106k|}
private_typeinfo.cpp:_ZN10__cxxabiv112_GLOBAL__N_121dyn_cast_try_downcastEPKvS2_PKNS_17__class_type_infoES5_l:
  205|   106k|{
  206|   106k|    if (src2dst_offset < 0)
  ------------------
  |  Branch (206:9): [True: 0, False: 106k]
  ------------------
  207|      0|    {
  208|       |        // We can only optimize the case if the static type is a unique public
  209|       |        //   base of dst_type. Give up.
  210|      0|        return nullptr;
  211|      0|    }
  212|       |
  213|       |    // Pretend there is a dst_type object that leads to static_ptr. Later we
  214|       |    //   will check whether this imagined dst_type object exists. If it exists
  215|       |    //   then it will be the casting result.
  216|   106k|    const void* dst_ptr_to_static = reinterpret_cast<const char*>(static_ptr) - src2dst_offset;
  217|       |
  218|   106k|    if (reinterpret_cast<std::intptr_t>(dst_ptr_to_static) < reinterpret_cast<std::intptr_t>(dynamic_ptr))
  ------------------
  |  Branch (218:9): [True: 0, False: 106k]
  ------------------
  219|      0|    {
  220|       |        // The imagined dst_type object does not exist. Bail-out quickly.
  221|      0|        return nullptr;
  222|      0|    }
  223|       |
  224|       |    // Try to search a path from dynamic_type to dst_type.
  225|   106k|    __dynamic_cast_info dynamic_to_dst_info = {dynamic_type,
  226|   106k|                                               dst_ptr_to_static,
  227|   106k|                                               dst_type,
  228|   106k|                                               src2dst_offset,
  229|   106k|                                               0,
  230|   106k|                                               0,
  231|   106k|                                               0,
  232|   106k|                                               0,
  233|   106k|                                               0,
  234|   106k|                                               0,
  235|   106k|                                               0,
  236|   106k|                                               0,
  237|   106k|                                               1, // number_of_dst_type
  238|   106k|                                               false,
  239|   106k|                                               false,
  240|   106k|                                               false,
  241|   106k|                                               true,
  242|   106k|                                               nullptr};
  243|   106k|    dynamic_type->search_above_dst(&dynamic_to_dst_info, dynamic_ptr, dynamic_ptr, public_path, false);
  244|   106k|    if (dynamic_to_dst_info.path_dst_ptr_to_static_ptr != unknown) {
  ------------------
  |  Branch (244:9): [True: 106k, False: 18.4E]
  ------------------
  245|       |        // We have found at least one path from dynamic_ptr to dst_ptr. The
  246|       |        //   downcast can succeed.
  247|   106k|        return dst_ptr_to_static;
  248|   106k|    }
  249|       |
  250|  18.4E|    return nullptr;
  251|   106k|}

_ZNSt9exceptionD2Ev:
   18|   172k|{
   19|   172k|}

_Znwm:
   66|   863k|_LIBCPP_MAKE_OVERRIDABLE_FUNCTION_DETECTABLE _LIBCPP_WEAK void* operator new(std::size_t size) _THROW_BAD_ALLOC {
   67|   863k|  void* p = operator_new_impl(size);
   68|   863k|  if (p == nullptr)
  ------------------
  |  Branch (68:7): [True: 0, False: 863k]
  ------------------
   69|      0|    __throw_bad_alloc_shim();
   70|   863k|  return p;
   71|   863k|}
_ZdlPv:
  125|   863k|_LIBCPP_WEAK void operator delete(void* ptr) noexcept { std::free(ptr); }
_ZdlPvm:
  129|   691k|_LIBCPP_WEAK void operator delete(void* ptr, size_t) noexcept { ::operator delete(ptr); }
_ZnwmSt11align_val_t:
  160|  7.93k|operator new(std::size_t size, std::align_val_t alignment) _THROW_BAD_ALLOC {
  161|  7.93k|  void* p = operator_new_aligned_impl(size, alignment);
  162|  7.93k|  if (p == nullptr)
  ------------------
  |  Branch (162:7): [True: 0, False: 7.93k]
  ------------------
  163|      0|    __throw_bad_alloc_shim();
  164|  7.93k|  return p;
  165|  7.93k|}
_ZdlPvSt11align_val_t:
  221|  7.93k|_LIBCPP_WEAK void operator delete(void* ptr, std::align_val_t) noexcept { std::__libcpp_aligned_free(ptr); }
stdlib_new_delete.cpp:_ZL17operator_new_implm:
   50|   863k|static void* operator_new_impl(std::size_t size) {
   51|   863k|  if (size == 0)
  ------------------
  |  Branch (51:7): [True: 0, False: 863k]
  ------------------
   52|      0|    size = 1;
   53|   863k|  void* p;
   54|   863k|  while ((p = std::malloc(size)) == nullptr) {
  ------------------
  |  Branch (54:10): [True: 0, False: 863k]
  ------------------
   55|       |    // If malloc fails and there is a new_handler,
   56|       |    // call it to try free up memory.
   57|      0|    std::new_handler nh = std::get_new_handler();
   58|      0|    if (nh)
  ------------------
  |  Branch (58:9): [True: 0, False: 0]
  ------------------
   59|      0|      nh();
   60|      0|    else
   61|      0|      break;
   62|      0|  }
   63|   863k|  return p;
   64|   863k|}
stdlib_new_delete.cpp:_ZL25operator_new_aligned_implmSt11align_val_t:
  139|  7.93k|static void* operator_new_aligned_impl(std::size_t size, std::align_val_t alignment) {
  140|  7.93k|  if (size == 0)
  ------------------
  |  Branch (140:7): [True: 0, False: 7.93k]
  ------------------
  141|      0|    size = 1;
  142|  7.93k|  if (static_cast<size_t>(alignment) < sizeof(void*))
  ------------------
  |  Branch (142:7): [True: 0, False: 7.93k]
  ------------------
  143|      0|    alignment = std::align_val_t(sizeof(void*));
  144|       |
  145|       |  // Try allocating memory. If allocation fails and there is a new_handler,
  146|       |  // call it to try free up memory, and try again until it succeeds, or until
  147|       |  // the new_handler decides to terminate.
  148|  7.93k|  void* p;
  149|  7.93k|  while ((p = std::__libcpp_aligned_alloc(static_cast<std::size_t>(alignment), size)) == nullptr) {
  ------------------
  |  Branch (149:10): [True: 0, False: 7.93k]
  ------------------
  150|      0|    std::new_handler nh = std::get_new_handler();
  151|      0|    if (nh)
  ------------------
  |  Branch (151:9): [True: 0, False: 0]
  ------------------
  152|      0|      nh();
  153|      0|    else
  154|      0|      break;
  155|      0|  }
  156|  7.93k|  return p;
  157|  7.93k|}

_ZNSt13runtime_errorD2Ev:
   30|   172k|runtime_error::~runtime_error() noexcept {}
_ZNKSt13runtime_error4whatEv:
   34|  21.5k|{
   35|  21.5k|    return __imp_.c_str();
   36|  21.5k|}

kmp_csupport.cpp:_ZL23__kmp_assert_valid_gtidi:
 3510|  47.3k|static inline void __kmp_assert_valid_gtid(kmp_int32 gtid) {
 3511|  47.3k|  if (UNLIKELY(gtid < 0 || gtid >= __kmp_threads_capacity))
  ------------------
  |  |  119|  94.7k|#define UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (119:21): [True: 0, False: 47.3k]
  |  |  |  Branch (119:41): [True: 26, False: 47.3k]
  |  |  |  Branch (119:41): [True: 18.4E, False: 47.3k]
  |  |  ------------------
  ------------------
 3512|      0|    KMP_FATAL(ThreadIdentInvalid);
  ------------------
  |  |  146|      0|#define KMP_FATAL(...) __kmp_fatal(KMP_MSG(__VA_ARGS__), __kmp_msg_null)
  |  |  ------------------
  |  |  |  |  121|      0|#define KMP_MSG(...) __kmp_msg_format(kmp_i18n_msg_##__VA_ARGS__)
  |  |  ------------------
  ------------------
 3513|  47.3k|}
kmp_csupport.cpp:_ZL31__kmp_clear_x87_fpu_status_wordv:
 1365|  3.01k|static inline void __kmp_clear_x87_fpu_status_word() {
 1366|       |#if KMP_MIC
 1367|       |  // 32-bit protected mode x87 FPU state
 1368|       |  struct x87_fpu_state {
 1369|       |    unsigned cw;
 1370|       |    unsigned sw;
 1371|       |    unsigned tw;
 1372|       |    unsigned fip;
 1373|       |    unsigned fips;
 1374|       |    unsigned fdp;
 1375|       |    unsigned fds;
 1376|       |  };
 1377|       |  struct x87_fpu_state fpu_state = {0, 0, 0, 0, 0, 0, 0};
 1378|       |  __asm__ __volatile__("fstenv %0\n\t" // store FP env
 1379|       |                       "andw $0x7f00, %1\n\t" // clear 0-7,15 bits of FP SW
 1380|       |                       "fldenv %0\n\t" // load FP env back
 1381|       |                       : "+m"(fpu_state), "+m"(fpu_state.sw));
 1382|       |#else
 1383|  3.01k|  __asm__ __volatile__("fnclex");
 1384|  3.01k|#endif // KMP_MIC
 1385|  3.01k|}
kmp_csupport.cpp:_ZL31__kmp_load_x87_fpu_control_wordPKs:
 1358|  3.01k|static inline void __kmp_load_x87_fpu_control_word(const kmp_int16 *p) {
 1359|  3.01k|  __asm__ __volatile__("fldcw %0" : : "m"(*p));
 1360|  3.01k|}
kmp_csupport.cpp:_ZL16__kmp_load_mxcsrPKj:
 1387|  3.01k|static inline void __kmp_load_mxcsr(const kmp_uint32 *p) { _mm_setcsr(*p); }
_ZN11KMPAffinity4MaskD2Ev:
  724|     68|    virtual ~Mask() {}
_ZNK11KMPAffinity4Mask11get_max_cpuEv:
  756|      1|    int get_max_cpu() const {
  757|      1|      int cpu;
  758|      1|      int max_cpu = -1;
  759|     32|      KMP_CPU_SET_ITERATE(cpu, this) {
  ------------------
  |  |  688|     33|  for (i = (mask)->begin(); (int)i != (mask)->end(); i = (mask)->next(i))
  |  |  ------------------
  |  |  |  Branch (688:29): [True: 32, False: 1]
  |  |  ------------------
  ------------------
  760|     32|        if (cpu > max_cpu)
  ------------------
  |  Branch (760:13): [True: 32, False: 0]
  ------------------
  761|     32|          max_cpu = cpu;
  762|     32|      }
  763|      1|      return max_cpu;
  764|      1|    }
_ZN19kmp_affinity_raii_tC2EPKN11KMPAffinity4MaskE:
  807|      2|      : restored(false) {
  808|      2|    if (KMP_AFFINITY_CAPABLE()) {
  ------------------
  |  |  684|      2|#define KMP_AFFINITY_CAPABLE() (__kmp_affin_mask_size > 0)
  |  |  ------------------
  |  |  |  Branch (684:32): [True: 2, False: 0]
  |  |  ------------------
  ------------------
  809|      2|      KMP_CPU_ALLOC(mask);
  ------------------
  |  |  697|      2|#define KMP_CPU_ALLOC(ptr) (ptr = __kmp_affinity_dispatch->allocate_mask())
  ------------------
  810|      2|      KMP_ASSERT(mask != NULL);
  ------------------
  |  |   50|      2|  if (!(cond)) {                                                               \
  |  |  ------------------
  |  |  |  Branch (50:7): [True: 0, False: 2]
  |  |  ------------------
  |  |   51|      0|    __kmp_debug_assert("assertion failure", __FILE__, __LINE__);               \
  |  |   52|      0|  }
  ------------------
  811|      2|      __kmp_get_system_affinity(mask, /*abort_on_error=*/true);
  ------------------
  |  |  711|      2|  (mask)->get_system_affinity(abort_bool)
  ------------------
  812|      2|      if (new_mask)
  ------------------
  |  Branch (812:11): [True: 1, False: 1]
  ------------------
  813|      1|        __kmp_set_system_affinity(new_mask, /*abort_on_error=*/true);
  ------------------
  |  |  713|      1|  (mask)->set_system_affinity(abort_bool)
  ------------------
  814|      2|    }
  815|      2|  }
_ZN19kmp_affinity_raii_t7restoreEv:
  816|      3|  void restore() {
  817|      3|    if (!restored && KMP_AFFINITY_CAPABLE()) {
  ------------------
  |  |  684|      2|#define KMP_AFFINITY_CAPABLE() (__kmp_affin_mask_size > 0)
  |  |  ------------------
  |  |  |  Branch (684:32): [True: 2, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (817:9): [True: 2, False: 1]
  ------------------
  818|      2|      __kmp_set_system_affinity(mask, /*abort_on_error=*/true);
  ------------------
  |  |  713|      2|  (mask)->set_system_affinity(abort_bool)
  ------------------
  819|      2|      KMP_CPU_FREE(mask);
  ------------------
  |  |  698|      2|#define KMP_CPU_FREE(ptr) __kmp_affinity_dispatch->deallocate_mask(ptr)
  ------------------
  820|      2|    }
  821|      3|    restored = true;
  822|      3|  }
_ZN19kmp_affinity_raii_tD2Ev:
  823|      2|  ~kmp_affinity_raii_t() { restore(); }
_ZNK18kmp_affinity_ids_tixEm:
  875|    384|  int operator[](size_t idx) const { return ids[idx]; }
_ZN18kmp_affinity_ids_tixEm:
  876|    650|  int &operator[](size_t idx) { return ids[idx]; }
_ZN18kmp_affinity_ids_taSERKS_:
  877|     32|  kmp_affinity_ids_t &operator=(const kmp_affinity_ids_t &rhs) {
  878|    416|    for (int i = 0; i < KMP_HW_LAST; ++i)
  ------------------
  |  Branch (878:21): [True: 384, False: 32]
  ------------------
  879|    384|      ids[i] = rhs[i];
  880|     32|    return *this;
  881|     32|  }
_ZN11kmp_convertImiLb0ELb0ELb0ELb1EE2toEm:
 4667|    460|  static TargetType to(SourceType src) {
 4668|    460|    KMP_ASSERT(src <= static_cast<SourceType>(
  ------------------
  |  |   50|    460|  if (!(cond)) {                                                               \
  |  |  ------------------
  |  |  |  Branch (50:7): [True: 0, False: 460]
  |  |  ------------------
  |  |   51|      0|    __kmp_debug_assert("assertion failure", __FILE__, __LINE__);               \
  |  |   52|      0|  }
  ------------------
 4669|    460|                          (std::numeric_limits<TargetType>::max)()));
 4670|    460|    return (TargetType)src;
 4671|    460|  }
kmp_runtime.cpp:_ZL22__kmp_gtid_from_threadPK8kmp_info:
 3495|     32|static inline int __kmp_gtid_from_thread(const kmp_info_t *thr) {
 3496|     32|  KMP_DEBUG_ASSERT(thr);
 3497|     32|  return thr->th.th_info.ds.ds_gtid;
 3498|     32|}
kmp_runtime.cpp:_ZL13KMP_UBER_GTIDi:
 3478|      4|static inline bool KMP_UBER_GTID(int gtid) {
 3479|      4|  KMP_DEBUG_ASSERT(gtid >= KMP_GTID_MIN);
 3480|      4|  KMP_DEBUG_ASSERT(gtid < __kmp_threads_capacity);
 3481|      4|  return (gtid >= 0 && __kmp_root[gtid] && __kmp_threads[gtid] &&
  ------------------
  |  Branch (3481:11): [True: 4, False: 0]
  |  Branch (3481:24): [True: 4, False: 0]
  |  Branch (3481:44): [True: 4, False: 0]
  ------------------
 3482|      4|          __kmp_threads[gtid] == __kmp_root[gtid]->r.r_uber_thread);
  ------------------
  |  Branch (3482:11): [True: 4, False: 0]
  ------------------
 3483|      4|}
kmp_runtime.cpp:_ZL19__kmp_tid_from_gtidi:
 3485|  45.2k|static inline int __kmp_tid_from_gtid(int gtid) {
 3486|  45.2k|  KMP_DEBUG_ASSERT(gtid >= 0);
 3487|  45.2k|  return __kmp_threads[gtid]->th.th_info.ds.ds_tid;
 3488|  45.2k|}
kmp_runtime.cpp:_ZL9copy_icvsP20kmp_internal_controlS0_:
 2111|  4.42k|                             kmp_internal_control_t *src) {
 2112|  4.42k|  *dst = *src;
 2113|  4.42k|}
kmp_runtime.cpp:_ZL27__kmp_assign_root_init_maskv:
 3785|  1.35k|static inline void __kmp_assign_root_init_mask() {
 3786|  1.35k|  int gtid = __kmp_entry_gtid();
  ------------------
  |  | 3467|  1.35k|#define __kmp_entry_gtid() __kmp_get_global_thread_id_reg()
  ------------------
 3787|  1.35k|  kmp_root_t *r = __kmp_threads[gtid]->th.th_root;
 3788|  1.35k|  if (r->r.r_uber_thread == __kmp_threads[gtid] && !r->r.r_affinity_assigned) {
  ------------------
  |  Branch (3788:7): [True: 1.35k, False: 0]
  |  Branch (3788:52): [True: 0, False: 1.35k]
  ------------------
 3789|      0|    __kmp_affinity_set_init_mask(gtid, TRUE);
  ------------------
  |  | 1280|      0|#define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  | 1279|      0|#define FALSE 0
  |  |  ------------------
  ------------------
 3790|      0|    r->r.r_affinity_assigned = TRUE;
  ------------------
  |  | 1280|      0|#define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  | 1279|      0|#define FALSE 0
  |  |  ------------------
  ------------------
 3791|      0|  }
 3792|  1.35k|}
kmp_runtime.cpp:_ZL19__kmp_gtid_from_tidiPK8kmp_team:
 3490|     32|static inline int __kmp_gtid_from_tid(int tid, const kmp_team_t *team) {
 3491|     32|  KMP_DEBUG_ASSERT(tid >= 0 && team);
 3492|     32|  return team->t.t_threads[tid]->th.th_info.ds.ds_gtid;
 3493|     32|}
kmp_runtime.cpp:_ZL15__kmp_x86_cpuidiiP9kmp_cpuid:
 1352|      2|static inline void __kmp_x86_cpuid(int leaf, int subleaf, struct kmp_cpuid *p) {
 1353|      2|  __asm__ __volatile__("cpuid"
 1354|      2|                       : "=a"(p->eax), "=b"(p->ebx), "=c"(p->ecx), "=d"(p->edx)
 1355|      2|                       : "a"(leaf), "c"(subleaf));
 1356|      2|}
kmp_runtime.cpp:_ZL27__kmp_resume_if_hard_pausedv:
 4380|      1|static inline void __kmp_resume_if_hard_paused() {
 4381|      1|  if (__kmp_pause_status == kmp_hard_paused) {
  ------------------
  |  Branch (4381:7): [True: 0, False: 1]
  ------------------
 4382|      0|    __kmp_pause_status = kmp_not_paused;
 4383|      0|  }
 4384|      1|}
kmp_runtime.cpp:_ZL32__kmp_store_x87_fpu_control_wordPs:
 1362|  46.9k|static inline void __kmp_store_x87_fpu_control_word(kmp_int16 *p) {
 1363|  46.9k|  __asm__ __volatile__("fstcw %0" : "=m"(*p));
 1364|  46.9k|}
kmp_runtime.cpp:_ZL17__kmp_store_mxcsrPj:
 1388|  46.9k|static inline void __kmp_store_mxcsr(kmp_uint32 *p) { *p = _mm_getcsr(); }
kmp_runtime.cpp:_ZL19__kmp_is_hybrid_cpuv:
 3226|      1|static inline bool __kmp_is_hybrid_cpu() { return __kmp_cpuinfo.flags.hybrid; }
kmp_runtime.cpp:_ZL18__kmp_type_convertIliEvT_PT0_:
 4696|     31|static inline void __kmp_type_convert(T1 src, T2 *dest) {
 4697|     31|  *dest = kmp_convert<T1, T2>::to(src);
 4698|     31|}
_ZN11kmp_convertIliLb0ELb0ELb1ELb1EE2toEl:
 4612|     33|  static TargetType to(SourceType src) {
 4613|     33|    KMP_ASSERT(src <= static_cast<SourceType>(
  ------------------
  |  |   50|     33|  if (!(cond)) {                                                               \
  |  |  ------------------
  |  |  |  Branch (50:7): [True: 0, False: 33]
  |  |  ------------------
  |  |   51|      0|    __kmp_debug_assert("assertion failure", __FILE__, __LINE__);               \
  |  |   52|      0|  }
  ------------------
 4614|     33|                          (std::numeric_limits<TargetType>::max)()));
 4615|     33|    KMP_ASSERT(src >= static_cast<SourceType>(
  ------------------
  |  |   50|     33|  if (!(cond)) {                                                               \
  |  |  ------------------
  |  |  |  Branch (50:7): [True: 0, False: 33]
  |  |  ------------------
  |  |   51|      0|    __kmp_debug_assert("assertion failure", __FILE__, __LINE__);               \
  |  |   52|      0|  }
  ------------------
 4616|     33|                          (std::numeric_limits<TargetType>::min)()));
 4617|     33|    return (TargetType)src;
 4618|     33|  }
kmp_str.cpp:_ZL18__kmp_type_convertImiEvT_PT0_:
 4696|     68|static inline void __kmp_type_convert(T1 src, T2 *dest) {
 4697|     68|  *dest = kmp_convert<T1, T2>::to(src);
 4698|     68|}
kmp_utility.cpp:_ZL15__kmp_x86_cpuidiiP9kmp_cpuid:
 1352|      6|static inline void __kmp_x86_cpuid(int leaf, int subleaf, struct kmp_cpuid *p) {
 1353|      6|  __asm__ __volatile__("cpuid"
 1354|      6|                       : "=a"(p->eax), "=b"(p->ebx), "=c"(p->ecx), "=d"(p->edx)
 1355|      6|                       : "a"(leaf), "c"(subleaf));
 1356|      6|}
kmp_barrier.cpp:_ZL19__kmp_tid_from_gtidi:
 3485|   194k|static inline int __kmp_tid_from_gtid(int gtid) {
 3486|   194k|  KMP_DEBUG_ASSERT(gtid >= 0);
 3487|   194k|  return __kmp_threads[gtid]->th.th_info.ds.ds_tid;
 3488|   194k|}
kmp_barrier.cpp:_ZL15__kmp_x86_pausev:
 1496|   426M|static inline void __kmp_x86_pause(void) { _mm_pause(); }
kmp_barrier.cpp:_ZL9copy_icvsP20kmp_internal_controlS0_:
 2111|  81.9k|                             kmp_internal_control_t *src) {
 2112|  81.9k|  *dst = *src;
 2113|  81.9k|}
kmp_affinity.cpp:_ZL19__kmp_is_hybrid_cpuv:
 3226|     64|static inline bool __kmp_is_hybrid_cpu() { return __kmp_cpuinfo.flags.hybrid; }
_ZN11KMPAffinityD2Ev:
  769|      1|  virtual ~KMPAffinity() = default;
kmp_affinity.cpp:_ZL18__kmp_type_convertImiEvT_PT0_:
 4696|    392|static inline void __kmp_type_convert(T1 src, T2 *dest) {
 4697|    392|  *dest = kmp_convert<T1, T2>::to(src);
 4698|    392|}
kmp_affinity.cpp:_ZL15__kmp_x86_cpuidiiP9kmp_cpuid:
 1352|    134|static inline void __kmp_x86_cpuid(int leaf, int subleaf, struct kmp_cpuid *p) {
 1353|    134|  __asm__ __volatile__("cpuid"
 1354|    134|                       : "=a"(p->eax), "=b"(p->ebx), "=c"(p->ecx), "=d"(p->edx)
 1355|    134|                       : "a"(leaf), "c"(subleaf));
 1356|    134|}
kmp_dispatch.cpp:_ZL15__kmp_x86_pausev:
 1496|  11.9M|static inline void __kmp_x86_pause(void) { _mm_pause(); }
kmp_lock.cpp:_ZL15__kmp_x86_pausev:
 1496|  64.4k|static inline void __kmp_x86_pause(void) { _mm_pause(); }
kmp_lock.cpp:_ZL22__kmp_thread_from_gtidi:
 3500|  29.0k|static inline kmp_info_t *__kmp_thread_from_gtid(int gtid) {
 3501|  29.0k|  KMP_DEBUG_ASSERT(gtid >= 0);
 3502|  29.0k|  return __kmp_threads[gtid];
 3503|  29.0k|}
kmp_sched.cpp:_ZL23__kmp_assert_valid_gtidi:
 3510|  45.0k|static inline void __kmp_assert_valid_gtid(kmp_int32 gtid) {
 3511|  45.0k|  if (UNLIKELY(gtid < 0 || gtid >= __kmp_threads_capacity))
  ------------------
  |  |  119|  90.2k|#define UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (119:21): [True: 0, False: 45.0k]
  |  |  |  Branch (119:41): [True: 18.4E, False: 45.1k]
  |  |  |  Branch (119:41): [True: 18.4E, False: 45.1k]
  |  |  ------------------
  ------------------
 3512|      0|    KMP_FATAL(ThreadIdentInvalid);
  ------------------
  |  |  146|      0|#define KMP_FATAL(...) __kmp_fatal(KMP_MSG(__VA_ARGS__), __kmp_msg_null)
  |  |  ------------------
  |  |  |  |  121|      0|#define KMP_MSG(...) __kmp_msg_format(kmp_i18n_msg_##__VA_ARGS__)
  |  |  ------------------
  ------------------
 3513|  45.0k|}
kmp_sched.cpp:_ZL19__kmp_tid_from_gtidi:
 3485|  45.4k|static inline int __kmp_tid_from_gtid(int gtid) {
 3486|  45.4k|  KMP_DEBUG_ASSERT(gtid >= 0);
 3487|  45.4k|  return __kmp_threads[gtid]->th.th_info.ds.ds_tid;
 3488|  45.4k|}
z_Linux_util.cpp:_ZL13KMP_UBER_GTIDi:
 3478|     64|static inline bool KMP_UBER_GTID(int gtid) {
 3479|     64|  KMP_DEBUG_ASSERT(gtid >= KMP_GTID_MIN);
 3480|     64|  KMP_DEBUG_ASSERT(gtid < __kmp_threads_capacity);
 3481|     64|  return (gtid >= 0 && __kmp_root[gtid] && __kmp_threads[gtid] &&
  ------------------
  |  Branch (3481:11): [True: 64, False: 0]
  |  Branch (3481:24): [True: 2, False: 62]
  |  Branch (3481:44): [True: 2, False: 0]
  ------------------
 3482|      2|          __kmp_threads[gtid] == __kmp_root[gtid]->r.r_uber_thread);
  ------------------
  |  Branch (3482:11): [True: 2, False: 0]
  ------------------
 3483|     64|}
z_Linux_util.cpp:_ZL31__kmp_clear_x87_fpu_status_wordv:
 1365|     31|static inline void __kmp_clear_x87_fpu_status_word() {
 1366|       |#if KMP_MIC
 1367|       |  // 32-bit protected mode x87 FPU state
 1368|       |  struct x87_fpu_state {
 1369|       |    unsigned cw;
 1370|       |    unsigned sw;
 1371|       |    unsigned tw;
 1372|       |    unsigned fip;
 1373|       |    unsigned fips;
 1374|       |    unsigned fdp;
 1375|       |    unsigned fds;
 1376|       |  };
 1377|       |  struct x87_fpu_state fpu_state = {0, 0, 0, 0, 0, 0, 0};
 1378|       |  __asm__ __volatile__("fstenv %0\n\t" // store FP env
 1379|       |                       "andw $0x7f00, %1\n\t" // clear 0-7,15 bits of FP SW
 1380|       |                       "fldenv %0\n\t" // load FP env back
 1381|       |                       : "+m"(fpu_state), "+m"(fpu_state.sw));
 1382|       |#else
 1383|     31|  __asm__ __volatile__("fnclex");
 1384|     31|#endif // KMP_MIC
 1385|     31|}
z_Linux_util.cpp:_ZL31__kmp_load_x87_fpu_control_wordPKs:
 1358|     31|static inline void __kmp_load_x87_fpu_control_word(const kmp_int16 *p) {
 1359|     31|  __asm__ __volatile__("fldcw %0" : : "m"(*p));
 1360|     31|}
z_Linux_util.cpp:_ZL16__kmp_load_mxcsrPKj:
 1387|     31|static inline void __kmp_load_mxcsr(const kmp_uint32 *p) { _mm_setcsr(*p); }
z_Linux_util.cpp:_ZL18__kmp_type_convertIliEvT_PT0_:
 4696|      2|static inline void __kmp_type_convert(T1 src, T2 *dest) {
 4697|      2|  *dest = kmp_convert<T1, T2>::to(src);
 4698|      2|}
kmp_ftn_cdecl.cpp:_ZL27__kmp_assign_root_init_maskv:
 3785|  4.36k|static inline void __kmp_assign_root_init_mask() {
 3786|  4.36k|  int gtid = __kmp_entry_gtid();
  ------------------
  |  | 3467|  4.36k|#define __kmp_entry_gtid() __kmp_get_global_thread_id_reg()
  ------------------
 3787|  4.36k|  kmp_root_t *r = __kmp_threads[gtid]->th.th_root;
 3788|  4.36k|  if (r->r.r_uber_thread == __kmp_threads[gtid] && !r->r.r_affinity_assigned) {
  ------------------
  |  Branch (3788:7): [True: 4.36k, False: 0]
  |  Branch (3788:52): [True: 1, False: 4.36k]
  ------------------
 3789|      1|    __kmp_affinity_set_init_mask(gtid, TRUE);
  ------------------
  |  | 1280|      1|#define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  | 1279|      1|#define FALSE 0
  |  |  ------------------
  ------------------
 3790|      1|    r->r.r_affinity_assigned = TRUE;
  ------------------
  |  | 1280|      1|#define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  | 1279|      1|#define FALSE 0
  |  |  ------------------
  ------------------
 3791|      1|  }
 3792|  4.36k|}
ompt-general.cpp:_ZL22__kmp_thread_from_gtidi:
 3500|      1|static inline kmp_info_t *__kmp_thread_from_gtid(int gtid) {
 3501|      1|  KMP_DEBUG_ASSERT(gtid >= 0);
 3502|      1|  return __kmp_threads[gtid];
 3503|      1|}

__kmp_cleanup_hierarchy:
   39|      1|void __kmp_cleanup_hierarchy() { machine_hierarchy.fini(); }
_ZN15kmp_hw_thread_t11compare_idsEPKvS1_:
  154|     95|int kmp_hw_thread_t::compare_ids(const void *a, const void *b) {
  155|     95|  const kmp_hw_thread_t *ahwthread = (const kmp_hw_thread_t *)a;
  156|     95|  const kmp_hw_thread_t *bhwthread = (const kmp_hw_thread_t *)b;
  157|     95|  int depth = __kmp_topology->get_depth();
  158|    206|  for (int level = 0; level < depth; ++level) {
  ------------------
  |  Branch (158:23): [True: 206, False: 0]
  ------------------
  159|    206|    if (ahwthread->ids[level] < bhwthread->ids[level])
  ------------------
  |  Branch (159:9): [True: 80, False: 126]
  ------------------
  160|     80|      return -1;
  161|    126|    else if (ahwthread->ids[level] > bhwthread->ids[level])
  ------------------
  |  Branch (161:14): [True: 15, False: 111]
  ------------------
  162|     15|      return 1;
  163|    206|  }
  164|      0|  if (ahwthread->os_id < bhwthread->os_id)
  ------------------
  |  Branch (164:7): [True: 0, False: 0]
  ------------------
  165|      0|    return -1;
  166|      0|  else if (ahwthread->os_id > bhwthread->os_id)
  ------------------
  |  Branch (166:12): [True: 0, False: 0]
  ------------------
  167|      0|    return 1;
  168|      0|  return 0;
  169|      0|}
_ZN14kmp_topology_t21_remove_radix1_layersEv:
  286|      1|void kmp_topology_t::_remove_radix1_layers() {
  287|      1|  int preference[KMP_HW_LAST];
  288|      1|  int top_index1, top_index2;
  289|       |  // Set up preference associative array
  290|      1|  preference[KMP_HW_SOCKET] = 110;
  291|      1|  preference[KMP_HW_PROC_GROUP] = 100;
  292|      1|  preference[KMP_HW_CORE] = 95;
  293|      1|  preference[KMP_HW_THREAD] = 90;
  294|      1|  preference[KMP_HW_NUMA] = 85;
  295|      1|  preference[KMP_HW_DIE] = 80;
  296|      1|  preference[KMP_HW_TILE] = 75;
  297|      1|  preference[KMP_HW_MODULE] = 73;
  298|      1|  preference[KMP_HW_L3] = 70;
  299|      1|  preference[KMP_HW_L2] = 65;
  300|      1|  preference[KMP_HW_L1] = 60;
  301|      1|  preference[KMP_HW_LLC] = 5;
  302|      1|  top_index1 = 0;
  303|      1|  top_index2 = 1;
  304|      3|  while (top_index1 < depth - 1 && top_index2 < depth) {
  ------------------
  |  Branch (304:10): [True: 2, False: 1]
  |  Branch (304:36): [True: 2, False: 0]
  ------------------
  305|      2|    kmp_hw_t type1 = types[top_index1];
  306|      2|    kmp_hw_t type2 = types[top_index2];
  307|      2|    KMP_ASSERT_VALID_HW_TYPE(type1);
  ------------------
  |  |  637|      2|  KMP_ASSERT(type >= (kmp_hw_t)0 && type < KMP_HW_LAST)
  |  |  ------------------
  |  |  |  |   50|      4|  if (!(cond)) {                                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (50:9): [True: 2, False: 0]
  |  |  |  |  |  Branch (50:9): [True: 2, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   51|      0|    __kmp_debug_assert("assertion failure", __FILE__, __LINE__);               \
  |  |  |  |   52|      0|  }
  |  |  ------------------
  ------------------
  308|      2|    KMP_ASSERT_VALID_HW_TYPE(type2);
  ------------------
  |  |  637|      2|  KMP_ASSERT(type >= (kmp_hw_t)0 && type < KMP_HW_LAST)
  |  |  ------------------
  |  |  |  |   50|      4|  if (!(cond)) {                                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (50:9): [True: 2, False: 0]
  |  |  |  |  |  Branch (50:9): [True: 2, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   51|      0|    __kmp_debug_assert("assertion failure", __FILE__, __LINE__);               \
  |  |  |  |   52|      0|  }
  |  |  ------------------
  ------------------
  309|       |    // Do not allow the three main topology levels (sockets, cores, threads) to
  310|       |    // be compacted down
  311|      2|    if ((type1 == KMP_HW_THREAD || type1 == KMP_HW_CORE ||
  ------------------
  |  Branch (311:10): [True: 0, False: 2]
  |  Branch (311:36): [True: 1, False: 1]
  ------------------
  312|      1|         type1 == KMP_HW_SOCKET) &&
  ------------------
  |  Branch (312:10): [True: 1, False: 0]
  ------------------
  313|      2|        (type2 == KMP_HW_THREAD || type2 == KMP_HW_CORE ||
  ------------------
  |  Branch (313:10): [True: 1, False: 1]
  |  Branch (313:36): [True: 1, False: 0]
  ------------------
  314|      2|         type2 == KMP_HW_SOCKET)) {
  ------------------
  |  Branch (314:10): [True: 0, False: 0]
  ------------------
  315|      2|      top_index1 = top_index2++;
  316|      2|      continue;
  317|      2|    }
  318|      0|    bool radix1 = true;
  319|      0|    bool all_same = true;
  320|      0|    int id1 = hw_threads[0].ids[top_index1];
  321|      0|    int id2 = hw_threads[0].ids[top_index2];
  322|      0|    int pref1 = preference[type1];
  323|      0|    int pref2 = preference[type2];
  324|      0|    for (int hwidx = 1; hwidx < num_hw_threads; ++hwidx) {
  ------------------
  |  Branch (324:25): [True: 0, False: 0]
  ------------------
  325|      0|      if (hw_threads[hwidx].ids[top_index1] == id1 &&
  ------------------
  |  Branch (325:11): [True: 0, False: 0]
  ------------------
  326|      0|          hw_threads[hwidx].ids[top_index2] != id2) {
  ------------------
  |  Branch (326:11): [True: 0, False: 0]
  ------------------
  327|      0|        radix1 = false;
  328|      0|        break;
  329|      0|      }
  330|      0|      if (hw_threads[hwidx].ids[top_index2] != id2)
  ------------------
  |  Branch (330:11): [True: 0, False: 0]
  ------------------
  331|      0|        all_same = false;
  332|      0|      id1 = hw_threads[hwidx].ids[top_index1];
  333|      0|      id2 = hw_threads[hwidx].ids[top_index2];
  334|      0|    }
  335|      0|    if (radix1) {
  ------------------
  |  Branch (335:9): [True: 0, False: 0]
  ------------------
  336|       |      // Select the layer to remove based on preference
  337|      0|      kmp_hw_t remove_type, keep_type;
  338|      0|      int remove_layer, remove_layer_ids;
  339|      0|      if (pref1 > pref2) {
  ------------------
  |  Branch (339:11): [True: 0, False: 0]
  ------------------
  340|      0|        remove_type = type2;
  341|      0|        remove_layer = remove_layer_ids = top_index2;
  342|      0|        keep_type = type1;
  343|      0|      } else {
  344|      0|        remove_type = type1;
  345|      0|        remove_layer = remove_layer_ids = top_index1;
  346|      0|        keep_type = type2;
  347|      0|      }
  348|       |      // If all the indexes for the second (deeper) layer are the same.
  349|       |      // e.g., all are zero, then make sure to keep the first layer's ids
  350|      0|      if (all_same)
  ------------------
  |  Branch (350:11): [True: 0, False: 0]
  ------------------
  351|      0|        remove_layer_ids = top_index2;
  352|       |      // Remove radix one type by setting the equivalence, removing the id from
  353|       |      // the hw threads and removing the layer from types and depth
  354|      0|      set_equivalent_type(remove_type, keep_type);
  355|      0|      for (int idx = 0; idx < num_hw_threads; ++idx) {
  ------------------
  |  Branch (355:25): [True: 0, False: 0]
  ------------------
  356|      0|        kmp_hw_thread_t &hw_thread = hw_threads[idx];
  357|      0|        for (int d = remove_layer_ids; d < depth - 1; ++d)
  ------------------
  |  Branch (357:40): [True: 0, False: 0]
  ------------------
  358|      0|          hw_thread.ids[d] = hw_thread.ids[d + 1];
  359|      0|      }
  360|      0|      for (int idx = remove_layer; idx < depth - 1; ++idx)
  ------------------
  |  Branch (360:36): [True: 0, False: 0]
  ------------------
  361|      0|        types[idx] = types[idx + 1];
  362|      0|      depth--;
  363|      0|    } else {
  364|      0|      top_index1 = top_index2++;
  365|      0|    }
  366|      0|  }
  367|      1|  KMP_ASSERT(depth > 0);
  ------------------
  |  |   50|      1|  if (!(cond)) {                                                               \
  |  |  ------------------
  |  |  |  Branch (50:7): [True: 0, False: 1]
  |  |  ------------------
  |  |   51|      0|    __kmp_debug_assert("assertion failure", __FILE__, __LINE__);               \
  |  |   52|      0|  }
  ------------------
  368|      1|}
_ZN14kmp_topology_t21_set_last_level_cacheEv:
  370|      1|void kmp_topology_t::_set_last_level_cache() {
  371|      1|  if (get_equivalent_type(KMP_HW_L3) != KMP_HW_UNKNOWN)
  ------------------
  |  Branch (371:7): [True: 0, False: 1]
  ------------------
  372|      0|    set_equivalent_type(KMP_HW_LLC, KMP_HW_L3);
  373|      1|  else if (get_equivalent_type(KMP_HW_L2) != KMP_HW_UNKNOWN)
  ------------------
  |  Branch (373:12): [True: 0, False: 1]
  ------------------
  374|      0|    set_equivalent_type(KMP_HW_LLC, KMP_HW_L2);
  375|      1|#if KMP_MIC_SUPPORTED
  376|      1|  else if (__kmp_mic_type == mic3) {
  ------------------
  |  Branch (376:12): [True: 0, False: 1]
  ------------------
  377|      0|    if (get_equivalent_type(KMP_HW_L2) != KMP_HW_UNKNOWN)
  ------------------
  |  Branch (377:9): [True: 0, False: 0]
  ------------------
  378|      0|      set_equivalent_type(KMP_HW_LLC, KMP_HW_L2);
  379|      0|    else if (get_equivalent_type(KMP_HW_TILE) != KMP_HW_UNKNOWN)
  ------------------
  |  Branch (379:14): [True: 0, False: 0]
  ------------------
  380|      0|      set_equivalent_type(KMP_HW_LLC, KMP_HW_TILE);
  381|       |    // L2/Tile wasn't detected so just say L1
  382|      0|    else
  383|      0|      set_equivalent_type(KMP_HW_LLC, KMP_HW_L1);
  384|      0|  }
  385|      1|#endif
  386|      1|  else if (get_equivalent_type(KMP_HW_L1) != KMP_HW_UNKNOWN)
  ------------------
  |  Branch (386:12): [True: 0, False: 1]
  ------------------
  387|      0|    set_equivalent_type(KMP_HW_LLC, KMP_HW_L1);
  388|       |  // Fallback is to set last level cache to socket or core
  389|      1|  if (get_equivalent_type(KMP_HW_LLC) == KMP_HW_UNKNOWN) {
  ------------------
  |  Branch (389:7): [True: 1, False: 0]
  ------------------
  390|      1|    if (get_equivalent_type(KMP_HW_SOCKET) != KMP_HW_UNKNOWN)
  ------------------
  |  Branch (390:9): [True: 1, False: 0]
  ------------------
  391|      1|      set_equivalent_type(KMP_HW_LLC, KMP_HW_SOCKET);
  392|      0|    else if (get_equivalent_type(KMP_HW_CORE) != KMP_HW_UNKNOWN)
  ------------------
  |  Branch (392:14): [True: 0, False: 0]
  ------------------
  393|      0|      set_equivalent_type(KMP_HW_LLC, KMP_HW_CORE);
  394|      1|  }
  395|      1|  KMP_ASSERT(get_equivalent_type(KMP_HW_LLC) != KMP_HW_UNKNOWN);
  ------------------
  |  |   50|      1|  if (!(cond)) {                                                               \
  |  |  ------------------
  |  |  |  Branch (50:7): [True: 0, False: 1]
  |  |  ------------------
  |  |   51|      0|    __kmp_debug_assert("assertion failure", __FILE__, __LINE__);               \
  |  |   52|      0|  }
  ------------------
  396|      1|}
_ZN14kmp_topology_t31_gather_enumeration_informationEv:
  399|      1|void kmp_topology_t::_gather_enumeration_information() {
  400|      1|  int previous_id[KMP_HW_LAST];
  401|      1|  int max[KMP_HW_LAST];
  402|       |
  403|      4|  for (int i = 0; i < depth; ++i) {
  ------------------
  |  Branch (403:19): [True: 3, False: 1]
  ------------------
  404|      3|    previous_id[i] = kmp_hw_thread_t::UNKNOWN_ID;
  405|      3|    max[i] = 0;
  406|      3|    count[i] = 0;
  407|      3|    ratio[i] = 0;
  408|      3|  }
  409|      1|  int core_level = get_level(KMP_HW_CORE);
  410|     33|  for (int i = 0; i < num_hw_threads; ++i) {
  ------------------
  |  Branch (410:19): [True: 32, False: 1]
  ------------------
  411|     32|    kmp_hw_thread_t &hw_thread = hw_threads[i];
  412|     79|    for (int layer = 0; layer < depth; ++layer) {
  ------------------
  |  Branch (412:25): [True: 79, False: 0]
  ------------------
  413|     79|      int id = hw_thread.ids[layer];
  414|     79|      if (id != previous_id[layer]) {
  ------------------
  |  Branch (414:11): [True: 32, False: 47]
  ------------------
  415|       |        // Add an additional increment to each count
  416|     81|        for (int l = layer; l < depth; ++l)
  ------------------
  |  Branch (416:29): [True: 49, False: 32]
  ------------------
  417|     49|          count[l]++;
  418|       |        // Keep track of topology layer ratio statistics
  419|     32|        max[layer]++;
  420|     49|        for (int l = layer + 1; l < depth; ++l) {
  ------------------
  |  Branch (420:33): [True: 17, False: 32]
  ------------------
  421|     17|          if (max[l] > ratio[l])
  ------------------
  |  Branch (421:15): [True: 1, False: 16]
  ------------------
  422|      1|            ratio[l] = max[l];
  423|     17|          max[l] = 1;
  424|     17|        }
  425|       |        // Figure out the number of different core types
  426|       |        // and efficiencies for hybrid CPUs
  427|     32|        if (__kmp_is_hybrid_cpu() && core_level >= 0 && layer <= core_level) {
  ------------------
  |  Branch (427:13): [True: 0, False: 32]
  |  Branch (427:38): [True: 0, False: 0]
  |  Branch (427:57): [True: 0, False: 0]
  ------------------
  428|      0|          if (hw_thread.attrs.is_core_eff_valid() &&
  ------------------
  |  Branch (428:15): [True: 0, False: 0]
  ------------------
  429|      0|              hw_thread.attrs.core_eff >= num_core_efficiencies) {
  ------------------
  |  Branch (429:15): [True: 0, False: 0]
  ------------------
  430|       |            // Because efficiencies can range from 0 to max efficiency - 1,
  431|       |            // the number of efficiencies is max efficiency + 1
  432|      0|            num_core_efficiencies = hw_thread.attrs.core_eff + 1;
  433|      0|          }
  434|      0|          if (hw_thread.attrs.is_core_type_valid()) {
  ------------------
  |  Branch (434:15): [True: 0, False: 0]
  ------------------
  435|      0|            bool found = false;
  436|      0|            for (int j = 0; j < num_core_types; ++j) {
  ------------------
  |  Branch (436:29): [True: 0, False: 0]
  ------------------
  437|      0|              if (hw_thread.attrs.get_core_type() == core_types[j]) {
  ------------------
  |  Branch (437:19): [True: 0, False: 0]
  ------------------
  438|      0|                found = true;
  439|      0|                break;
  440|      0|              }
  441|      0|            }
  442|      0|            if (!found) {
  ------------------
  |  Branch (442:17): [True: 0, False: 0]
  ------------------
  443|      0|              KMP_ASSERT(num_core_types < KMP_HW_MAX_NUM_CORE_TYPES);
  ------------------
  |  |   50|      0|  if (!(cond)) {                                                               \
  |  |  ------------------
  |  |  |  Branch (50:7): [True: 0, False: 0]
  |  |  ------------------
  |  |   51|      0|    __kmp_debug_assert("assertion failure", __FILE__, __LINE__);               \
  |  |   52|      0|  }
  ------------------
  444|      0|              core_types[num_core_types++] = hw_thread.attrs.get_core_type();
  445|      0|            }
  446|      0|          }
  447|      0|        }
  448|     32|        break;
  449|     32|      }
  450|     79|    }
  451|    128|    for (int layer = 0; layer < depth; ++layer) {
  ------------------
  |  Branch (451:25): [True: 96, False: 32]
  ------------------
  452|     96|      previous_id[layer] = hw_thread.ids[layer];
  453|     96|    }
  454|     32|  }
  455|      4|  for (int layer = 0; layer < depth; ++layer) {
  ------------------
  |  Branch (455:23): [True: 3, False: 1]
  ------------------
  456|      3|    if (max[layer] > ratio[layer])
  ------------------
  |  Branch (456:9): [True: 2, False: 1]
  ------------------
  457|      2|      ratio[layer] = max[layer];
  458|      3|  }
  459|      1|}
_ZN14kmp_topology_t20_discover_uniformityEv:
  498|      1|void kmp_topology_t::_discover_uniformity() {
  499|      1|  int num = 1;
  500|      4|  for (int level = 0; level < depth; ++level)
  ------------------
  |  Branch (500:23): [True: 3, False: 1]
  ------------------
  501|      3|    num *= ratio[level];
  502|      1|  flags.uniform = (num == count[depth - 1]);
  503|      1|}
_ZN14kmp_topology_t12_set_sub_idsEv:
  506|      1|void kmp_topology_t::_set_sub_ids() {
  507|      1|  int previous_id[KMP_HW_LAST];
  508|      1|  int sub_id[KMP_HW_LAST];
  509|       |
  510|      4|  for (int i = 0; i < depth; ++i) {
  ------------------
  |  Branch (510:19): [True: 3, False: 1]
  ------------------
  511|      3|    previous_id[i] = -1;
  512|      3|    sub_id[i] = -1;
  513|      3|  }
  514|     33|  for (int i = 0; i < num_hw_threads; ++i) {
  ------------------
  |  Branch (514:19): [True: 32, False: 1]
  ------------------
  515|     32|    kmp_hw_thread_t &hw_thread = hw_threads[i];
  516|       |    // Setup the sub_id
  517|     79|    for (int j = 0; j < depth; ++j) {
  ------------------
  |  Branch (517:21): [True: 79, False: 0]
  ------------------
  518|     79|      if (hw_thread.ids[j] != previous_id[j]) {
  ------------------
  |  Branch (518:11): [True: 32, False: 47]
  ------------------
  519|     32|        sub_id[j]++;
  520|     49|        for (int k = j + 1; k < depth; ++k) {
  ------------------
  |  Branch (520:29): [True: 17, False: 32]
  ------------------
  521|     17|          sub_id[k] = 0;
  522|     17|        }
  523|     32|        break;
  524|     32|      }
  525|     79|    }
  526|       |    // Set previous_id
  527|    128|    for (int j = 0; j < depth; ++j) {
  ------------------
  |  Branch (527:21): [True: 96, False: 32]
  ------------------
  528|     96|      previous_id[j] = hw_thread.ids[j];
  529|     96|    }
  530|       |    // Set the sub_ids field
  531|    128|    for (int j = 0; j < depth; ++j) {
  ------------------
  |  Branch (531:21): [True: 96, False: 32]
  ------------------
  532|     96|      hw_thread.sub_ids[j] = sub_id[j];
  533|     96|    }
  534|     32|  }
  535|      1|}
_ZN14kmp_topology_t12_set_globalsEv:
  537|      1|void kmp_topology_t::_set_globals() {
  538|       |  // Set nCoresPerPkg, nPackages, __kmp_nThreadsPerCore, __kmp_ncores
  539|      1|  int core_level, thread_level, package_level;
  540|      1|  package_level = get_level(KMP_HW_SOCKET);
  541|       |#if KMP_GROUP_AFFINITY
  542|       |  if (package_level == -1)
  543|       |    package_level = get_level(KMP_HW_PROC_GROUP);
  544|       |#endif
  545|      1|  core_level = get_level(KMP_HW_CORE);
  546|      1|  thread_level = get_level(KMP_HW_THREAD);
  547|       |
  548|      1|  KMP_ASSERT(core_level != -1);
  ------------------
  |  |   50|      1|  if (!(cond)) {                                                               \
  |  |  ------------------
  |  |  |  Branch (50:7): [True: 0, False: 1]
  |  |  ------------------
  |  |   51|      0|    __kmp_debug_assert("assertion failure", __FILE__, __LINE__);               \
  |  |   52|      0|  }
  ------------------
  549|      1|  KMP_ASSERT(thread_level != -1);
  ------------------
  |  |   50|      1|  if (!(cond)) {                                                               \
  |  |  ------------------
  |  |  |  Branch (50:7): [True: 0, False: 1]
  |  |  ------------------
  |  |   51|      0|    __kmp_debug_assert("assertion failure", __FILE__, __LINE__);               \
  |  |   52|      0|  }
  ------------------
  550|       |
  551|      1|  __kmp_nThreadsPerCore = calculate_ratio(thread_level, core_level);
  552|      1|  if (package_level != -1) {
  ------------------
  |  Branch (552:7): [True: 1, False: 0]
  ------------------
  553|      1|    nCoresPerPkg = calculate_ratio(core_level, package_level);
  554|      1|    nPackages = get_count(package_level);
  555|      1|  } else {
  556|       |    // assume one socket
  557|      0|    nCoresPerPkg = get_count(core_level);
  558|      0|    nPackages = 1;
  559|      0|  }
  560|      1|#ifndef KMP_DFLT_NTH_CORES
  561|      1|  __kmp_ncores = get_count(core_level);
  562|      1|#endif
  563|      1|}
_ZN14kmp_topology_t8allocateEiiPK8kmp_hw_t:
  566|      1|                                         const kmp_hw_t *types) {
  567|      1|  kmp_topology_t *retval;
  568|       |  // Allocate all data in one large allocation
  569|      1|  size_t size = sizeof(kmp_topology_t) + sizeof(kmp_hw_thread_t) * nproc +
  570|      1|                sizeof(int) * (size_t)KMP_HW_LAST * 3;
  571|      1|  char *bytes = (char *)__kmp_allocate(size);
  ------------------
  |  | 3617|      1|#define __kmp_allocate(size) ___kmp_allocate((size)KMP_SRC_LOC_CURR)
  ------------------
  572|      1|  retval = (kmp_topology_t *)bytes;
  573|      1|  if (nproc > 0) {
  ------------------
  |  Branch (573:7): [True: 1, False: 0]
  ------------------
  574|      1|    retval->hw_threads = (kmp_hw_thread_t *)(bytes + sizeof(kmp_topology_t));
  575|      1|  } else {
  576|      0|    retval->hw_threads = nullptr;
  577|      0|  }
  578|      1|  retval->num_hw_threads = nproc;
  579|      1|  retval->depth = ndepth;
  580|      1|  int *arr =
  581|      1|      (int *)(bytes + sizeof(kmp_topology_t) + sizeof(kmp_hw_thread_t) * nproc);
  582|      1|  retval->types = (kmp_hw_t *)arr;
  583|      1|  retval->ratio = arr + (size_t)KMP_HW_LAST;
  584|      1|  retval->count = arr + 2 * (size_t)KMP_HW_LAST;
  585|      1|  retval->num_core_efficiencies = 0;
  586|      1|  retval->num_core_types = 0;
  587|      1|  retval->compact = 0;
  588|      4|  for (int i = 0; i < KMP_HW_MAX_NUM_CORE_TYPES; ++i)
  ------------------
  |  Branch (588:19): [True: 3, False: 1]
  ------------------
  589|      3|    retval->core_types[i] = KMP_HW_CORE_TYPE_UNKNOWN;
  590|     12|  KMP_FOREACH_HW_TYPE(type) { retval->equivalent[type] = KMP_HW_UNKNOWN; }
  ------------------
  |  |  640|     13|  for (kmp_hw_t type = (kmp_hw_t)0; type < KMP_HW_LAST;                        \
  |  |  ------------------
  |  |  |  Branch (640:37): [True: 12, False: 1]
  |  |  ------------------
  |  |  641|     12|       type = (kmp_hw_t)((int)type + 1))
  ------------------
  591|      4|  for (int i = 0; i < ndepth; ++i) {
  ------------------
  |  Branch (591:19): [True: 3, False: 1]
  ------------------
  592|      3|    retval->types[i] = types[i];
  593|      3|    retval->equivalent[types[i]] = types[i];
  594|      3|  }
  595|      1|  return retval;
  596|      1|}
_ZN14kmp_topology_t10deallocateEPS_:
  598|      1|void kmp_topology_t::deallocate(kmp_topology_t *topology) {
  599|      1|  if (topology)
  ------------------
  |  Branch (599:7): [True: 1, False: 0]
  ------------------
  600|      1|    __kmp_free(topology);
  ------------------
  |  | 3619|      1|#define __kmp_free(ptr) ___kmp_free((ptr)KMP_SRC_LOC_CURR)
  ------------------
  601|      1|}
_ZNK14kmp_topology_t9check_idsEv:
  603|      1|bool kmp_topology_t::check_ids() const {
  604|       |  // Assume ids have been sorted
  605|      1|  if (num_hw_threads == 0)
  ------------------
  |  Branch (605:7): [True: 0, False: 1]
  ------------------
  606|      0|    return true;
  607|     32|  for (int i = 1; i < num_hw_threads; ++i) {
  ------------------
  |  Branch (607:19): [True: 31, False: 1]
  ------------------
  608|     31|    kmp_hw_thread_t &current_thread = hw_threads[i];
  609|     31|    kmp_hw_thread_t &previous_thread = hw_threads[i - 1];
  610|     31|    bool unique = false;
  611|     78|    for (int j = 0; j < depth; ++j) {
  ------------------
  |  Branch (611:21): [True: 78, False: 0]
  ------------------
  612|     78|      if (previous_thread.ids[j] != current_thread.ids[j]) {
  ------------------
  |  Branch (612:11): [True: 31, False: 47]
  ------------------
  613|     31|        unique = true;
  614|     31|        break;
  615|     31|      }
  616|     78|    }
  617|     31|    if (unique)
  ------------------
  |  Branch (617:9): [True: 31, False: 0]
  ------------------
  618|     31|      continue;
  619|      0|    return false;
  620|     31|  }
  621|      1|  return true;
  622|      1|}
_ZN14kmp_topology_t12canonicalizeEv:
  847|      1|void kmp_topology_t::canonicalize() {
  848|       |#if KMP_GROUP_AFFINITY
  849|       |  _insert_windows_proc_groups();
  850|       |#endif
  851|      1|  _remove_radix1_layers();
  852|      1|  _gather_enumeration_information();
  853|      1|  _discover_uniformity();
  854|      1|  _set_sub_ids();
  855|      1|  _set_globals();
  856|      1|  _set_last_level_cache();
  857|       |
  858|      1|#if KMP_MIC_SUPPORTED
  859|       |  // Manually Add L2 = Tile equivalence
  860|      1|  if (__kmp_mic_type == mic3) {
  ------------------
  |  Branch (860:7): [True: 0, False: 1]
  ------------------
  861|      0|    if (get_level(KMP_HW_L2) != -1)
  ------------------
  |  Branch (861:9): [True: 0, False: 0]
  ------------------
  862|      0|      set_equivalent_type(KMP_HW_TILE, KMP_HW_L2);
  863|      0|    else if (get_level(KMP_HW_TILE) != -1)
  ------------------
  |  Branch (863:14): [True: 0, False: 0]
  ------------------
  864|      0|      set_equivalent_type(KMP_HW_L2, KMP_HW_TILE);
  865|      0|  }
  866|      1|#endif
  867|       |
  868|       |  // Perform post canonicalization checking
  869|      1|  KMP_ASSERT(depth > 0);
  ------------------
  |  |   50|      1|  if (!(cond)) {                                                               \
  |  |  ------------------
  |  |  |  Branch (50:7): [True: 0, False: 1]
  |  |  ------------------
  |  |   51|      0|    __kmp_debug_assert("assertion failure", __FILE__, __LINE__);               \
  |  |   52|      0|  }
  ------------------
  870|      4|  for (int level = 0; level < depth; ++level) {
  ------------------
  |  Branch (870:23): [True: 3, False: 1]
  ------------------
  871|       |    // All counts, ratios, and types must be valid
  872|      3|    KMP_ASSERT(count[level] > 0 && ratio[level] > 0);
  ------------------
  |  |   50|      6|  if (!(cond)) {                                                               \
  |  |  ------------------
  |  |  |  Branch (50:9): [True: 3, False: 0]
  |  |  |  Branch (50:9): [True: 3, False: 0]
  |  |  ------------------
  |  |   51|      0|    __kmp_debug_assert("assertion failure", __FILE__, __LINE__);               \
  |  |   52|      0|  }
  ------------------
  873|      3|    KMP_ASSERT_VALID_HW_TYPE(types[level]);
  ------------------
  |  |  637|      3|  KMP_ASSERT(type >= (kmp_hw_t)0 && type < KMP_HW_LAST)
  |  |  ------------------
  |  |  |  |   50|      6|  if (!(cond)) {                                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (50:9): [True: 3, False: 0]
  |  |  |  |  |  Branch (50:9): [True: 3, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   51|      0|    __kmp_debug_assert("assertion failure", __FILE__, __LINE__);               \
  |  |  |  |   52|      0|  }
  |  |  ------------------
  ------------------
  874|       |    // Detected types must point to themselves
  875|      3|    KMP_ASSERT(equivalent[types[level]] == types[level]);
  ------------------
  |  |   50|      3|  if (!(cond)) {                                                               \
  |  |  ------------------
  |  |  |  Branch (50:7): [True: 0, False: 3]
  |  |  ------------------
  |  |   51|      0|    __kmp_debug_assert("assertion failure", __FILE__, __LINE__);               \
  |  |   52|      0|  }
  ------------------
  876|      3|  }
  877|      1|}
_ZN14kmp_topology_t16filter_hw_subsetEv:
  958|      1|bool kmp_topology_t::filter_hw_subset() {
  959|       |  // If KMP_HW_SUBSET wasn't requested, then do nothing.
  960|      1|  if (!__kmp_hw_subset)
  ------------------
  |  Branch (960:7): [True: 1, False: 0]
  ------------------
  961|      1|    return false;
  962|       |
  963|       |  // First, sort the KMP_HW_SUBSET items by the machine topology
  964|      0|  __kmp_hw_subset->sort();
  965|       |
  966|       |  // Check to see if KMP_HW_SUBSET is a valid subset of the detected topology
  967|      0|  bool using_core_types = false;
  968|      0|  bool using_core_effs = false;
  969|      0|  int hw_subset_depth = __kmp_hw_subset->get_depth();
  970|      0|  kmp_hw_t specified[KMP_HW_LAST];
  971|      0|  int *topology_levels = (int *)KMP_ALLOCA(sizeof(int) * hw_subset_depth);
  ------------------
  |  |   59|      0|#define KMP_ALLOCA alloca
  ------------------
  972|      0|  KMP_ASSERT(hw_subset_depth > 0);
  ------------------
  |  |   50|      0|  if (!(cond)) {                                                               \
  |  |  ------------------
  |  |  |  Branch (50:7): [True: 0, False: 0]
  |  |  ------------------
  |  |   51|      0|    __kmp_debug_assert("assertion failure", __FILE__, __LINE__);               \
  |  |   52|      0|  }
  ------------------
  973|      0|  KMP_FOREACH_HW_TYPE(i) { specified[i] = KMP_HW_UNKNOWN; }
  ------------------
  |  |  640|      0|  for (kmp_hw_t type = (kmp_hw_t)0; type < KMP_HW_LAST;                        \
  |  |  ------------------
  |  |  |  Branch (640:37): [True: 0, False: 0]
  |  |  ------------------
  |  |  641|      0|       type = (kmp_hw_t)((int)type + 1))
  ------------------
  974|      0|  int core_level = get_level(KMP_HW_CORE);
  975|      0|  for (int i = 0; i < hw_subset_depth; ++i) {
  ------------------
  |  Branch (975:19): [True: 0, False: 0]
  ------------------
  976|      0|    int max_count;
  977|      0|    const kmp_hw_subset_t::item_t &item = __kmp_hw_subset->at(i);
  978|      0|    int num = item.num[0];
  979|      0|    int offset = item.offset[0];
  980|      0|    kmp_hw_t type = item.type;
  981|      0|    kmp_hw_t equivalent_type = equivalent[type];
  982|      0|    int level = get_level(type);
  983|      0|    topology_levels[i] = level;
  984|       |
  985|       |    // Check to see if current layer is in detected machine topology
  986|      0|    if (equivalent_type != KMP_HW_UNKNOWN) {
  ------------------
  |  Branch (986:9): [True: 0, False: 0]
  ------------------
  987|      0|      __kmp_hw_subset->at(i).type = equivalent_type;
  988|      0|    } else {
  989|      0|      KMP_AFF_WARNING(__kmp_affinity, AffHWSubsetNotExistGeneric,
  ------------------
  |  |  145|      0|  if (s.flags.verbose || (s.flags.warnings && (s.type != affinity_none))) {    \
  |  |  ------------------
  |  |  |  Branch (145:7): [True: 0, False: 0]
  |  |  |  Branch (145:27): [True: 0, False: 0]
  |  |  |  Branch (145:47): [True: 0, False: 0]
  |  |  ------------------
  |  |  146|      0|    KMP_WARNING(__VA_ARGS__);                                                  \
  |  |  ------------------
  |  |  |  |  145|      0|  __kmp_msg(kmp_ms_warning, KMP_MSG(__VA_ARGS__), __kmp_msg_null)
  |  |  |  |  ------------------
  |  |  |  |  |  |  121|      0|#define KMP_MSG(...) __kmp_msg_format(kmp_i18n_msg_##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  147|      0|  }
  ------------------
  990|      0|                      __kmp_hw_get_catalog_string(type));
  991|      0|      return false;
  992|      0|    }
  993|       |
  994|       |    // Check to see if current layer has already been
  995|       |    // specified either directly or through an equivalent type
  996|      0|    if (specified[equivalent_type] != KMP_HW_UNKNOWN) {
  ------------------
  |  Branch (996:9): [True: 0, False: 0]
  ------------------
  997|      0|      KMP_AFF_WARNING(__kmp_affinity, AffHWSubsetEqvLayers,
  ------------------
  |  |  145|      0|  if (s.flags.verbose || (s.flags.warnings && (s.type != affinity_none))) {    \
  |  |  ------------------
  |  |  |  Branch (145:7): [True: 0, False: 0]
  |  |  |  Branch (145:27): [True: 0, False: 0]
  |  |  |  Branch (145:47): [True: 0, False: 0]
  |  |  ------------------
  |  |  146|      0|    KMP_WARNING(__VA_ARGS__);                                                  \
  |  |  ------------------
  |  |  |  |  145|      0|  __kmp_msg(kmp_ms_warning, KMP_MSG(__VA_ARGS__), __kmp_msg_null)
  |  |  |  |  ------------------
  |  |  |  |  |  |  121|      0|#define KMP_MSG(...) __kmp_msg_format(kmp_i18n_msg_##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  147|      0|  }
  ------------------
  998|      0|                      __kmp_hw_get_catalog_string(type),
  999|      0|                      __kmp_hw_get_catalog_string(specified[equivalent_type]));
 1000|      0|      return false;
 1001|      0|    }
 1002|      0|    specified[equivalent_type] = type;
 1003|       |
 1004|       |    // Check to see if each layer's num & offset parameters are valid
 1005|      0|    max_count = get_ratio(level);
 1006|      0|    if (max_count < 0 ||
  ------------------
  |  Branch (1006:9): [True: 0, False: 0]
  ------------------
 1007|      0|        (num != kmp_hw_subset_t::USE_ALL && num + offset > max_count)) {
  ------------------
  |  Branch (1007:10): [True: 0, False: 0]
  |  Branch (1007:45): [True: 0, False: 0]
  ------------------
 1008|      0|      bool plural = (num > 1);
 1009|      0|      KMP_AFF_WARNING(__kmp_affinity, AffHWSubsetManyGeneric,
  ------------------
  |  |  145|      0|  if (s.flags.verbose || (s.flags.warnings && (s.type != affinity_none))) {    \
  |  |  ------------------
  |  |  |  Branch (145:7): [True: 0, False: 0]
  |  |  |  Branch (145:27): [True: 0, False: 0]
  |  |  |  Branch (145:47): [True: 0, False: 0]
  |  |  ------------------
  |  |  146|      0|    KMP_WARNING(__VA_ARGS__);                                                  \
  |  |  ------------------
  |  |  |  |  145|      0|  __kmp_msg(kmp_ms_warning, KMP_MSG(__VA_ARGS__), __kmp_msg_null)
  |  |  |  |  ------------------
  |  |  |  |  |  |  121|      0|#define KMP_MSG(...) __kmp_msg_format(kmp_i18n_msg_##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  147|      0|  }
  ------------------
 1010|      0|                      __kmp_hw_get_catalog_string(type, plural));
 1011|      0|      return false;
 1012|      0|    }
 1013|       |
 1014|       |    // Check to see if core attributes are consistent
 1015|      0|    if (core_level == level) {
  ------------------
  |  Branch (1015:9): [True: 0, False: 0]
  ------------------
 1016|       |      // Determine which core attributes are specified
 1017|      0|      for (int j = 0; j < item.num_attrs; ++j) {
  ------------------
  |  Branch (1017:23): [True: 0, False: 0]
  ------------------
 1018|      0|        if (item.attr[j].is_core_type_valid())
  ------------------
  |  Branch (1018:13): [True: 0, False: 0]
  ------------------
 1019|      0|          using_core_types = true;
 1020|      0|        if (item.attr[j].is_core_eff_valid())
  ------------------
  |  Branch (1020:13): [True: 0, False: 0]
  ------------------
 1021|      0|          using_core_effs = true;
 1022|      0|      }
 1023|       |
 1024|       |      // Check if using a single core attribute on non-hybrid arch.
 1025|       |      // Do not ignore all of KMP_HW_SUBSET, just ignore the attribute.
 1026|       |      //
 1027|       |      // Check if using multiple core attributes on non-hyrbid arch.
 1028|       |      // Ignore all of KMP_HW_SUBSET if this is the case.
 1029|      0|      if ((using_core_effs || using_core_types) && !__kmp_is_hybrid_cpu()) {
  ------------------
  |  Branch (1029:12): [True: 0, False: 0]
  |  Branch (1029:31): [True: 0, False: 0]
  |  Branch (1029:52): [True: 0, False: 0]
  ------------------
 1030|      0|        if (item.num_attrs == 1) {
  ------------------
  |  Branch (1030:13): [True: 0, False: 0]
  ------------------
 1031|      0|          if (using_core_effs) {
  ------------------
  |  Branch (1031:15): [True: 0, False: 0]
  ------------------
 1032|      0|            KMP_AFF_WARNING(__kmp_affinity, AffHWSubsetIgnoringAttr,
  ------------------
  |  |  145|      0|  if (s.flags.verbose || (s.flags.warnings && (s.type != affinity_none))) {    \
  |  |  ------------------
  |  |  |  Branch (145:7): [True: 0, False: 0]
  |  |  |  Branch (145:27): [True: 0, False: 0]
  |  |  |  Branch (145:47): [True: 0, False: 0]
  |  |  ------------------
  |  |  146|      0|    KMP_WARNING(__VA_ARGS__);                                                  \
  |  |  ------------------
  |  |  |  |  145|      0|  __kmp_msg(kmp_ms_warning, KMP_MSG(__VA_ARGS__), __kmp_msg_null)
  |  |  |  |  ------------------
  |  |  |  |  |  |  121|      0|#define KMP_MSG(...) __kmp_msg_format(kmp_i18n_msg_##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  147|      0|  }
  ------------------
 1033|      0|                            "efficiency");
 1034|      0|          } else {
 1035|      0|            KMP_AFF_WARNING(__kmp_affinity, AffHWSubsetIgnoringAttr,
  ------------------
  |  |  145|      0|  if (s.flags.verbose || (s.flags.warnings && (s.type != affinity_none))) {    \
  |  |  ------------------
  |  |  |  Branch (145:7): [True: 0, False: 0]
  |  |  |  Branch (145:27): [True: 0, False: 0]
  |  |  |  Branch (145:47): [True: 0, False: 0]
  |  |  ------------------
  |  |  146|      0|    KMP_WARNING(__VA_ARGS__);                                                  \
  |  |  ------------------
  |  |  |  |  145|      0|  __kmp_msg(kmp_ms_warning, KMP_MSG(__VA_ARGS__), __kmp_msg_null)
  |  |  |  |  ------------------
  |  |  |  |  |  |  121|      0|#define KMP_MSG(...) __kmp_msg_format(kmp_i18n_msg_##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  147|      0|  }
  ------------------
 1036|      0|                            "core_type");
 1037|      0|          }
 1038|      0|          using_core_effs = false;
 1039|      0|          using_core_types = false;
 1040|      0|        } else {
 1041|      0|          KMP_AFF_WARNING(__kmp_affinity, AffHWSubsetAttrsNonHybrid);
  ------------------
  |  |  145|      0|  if (s.flags.verbose || (s.flags.warnings && (s.type != affinity_none))) {    \
  |  |  ------------------
  |  |  |  Branch (145:7): [True: 0, False: 0]
  |  |  |  Branch (145:27): [True: 0, False: 0]
  |  |  |  Branch (145:47): [True: 0, False: 0]
  |  |  ------------------
  |  |  146|      0|    KMP_WARNING(__VA_ARGS__);                                                  \
  |  |  ------------------
  |  |  |  |  145|      0|  __kmp_msg(kmp_ms_warning, KMP_MSG(__VA_ARGS__), __kmp_msg_null)
  |  |  |  |  ------------------
  |  |  |  |  |  |  121|      0|#define KMP_MSG(...) __kmp_msg_format(kmp_i18n_msg_##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  147|      0|  }
  ------------------
 1042|      0|          return false;
 1043|      0|        }
 1044|      0|      }
 1045|       |
 1046|       |      // Check if using both core types and core efficiencies together
 1047|      0|      if (using_core_types && using_core_effs) {
  ------------------
  |  Branch (1047:11): [True: 0, False: 0]
  |  Branch (1047:31): [True: 0, False: 0]
  ------------------
 1048|      0|        KMP_AFF_WARNING(__kmp_affinity, AffHWSubsetIncompat, "core_type",
  ------------------
  |  |  145|      0|  if (s.flags.verbose || (s.flags.warnings && (s.type != affinity_none))) {    \
  |  |  ------------------
  |  |  |  Branch (145:7): [True: 0, False: 0]
  |  |  |  Branch (145:27): [True: 0, False: 0]
  |  |  |  Branch (145:47): [True: 0, False: 0]
  |  |  ------------------
  |  |  146|      0|    KMP_WARNING(__VA_ARGS__);                                                  \
  |  |  ------------------
  |  |  |  |  145|      0|  __kmp_msg(kmp_ms_warning, KMP_MSG(__VA_ARGS__), __kmp_msg_null)
  |  |  |  |  ------------------
  |  |  |  |  |  |  121|      0|#define KMP_MSG(...) __kmp_msg_format(kmp_i18n_msg_##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  147|      0|  }
  ------------------
 1049|      0|                        "efficiency");
 1050|      0|        return false;
 1051|      0|      }
 1052|       |
 1053|       |      // Check that core efficiency values are valid
 1054|      0|      if (using_core_effs) {
  ------------------
  |  Branch (1054:11): [True: 0, False: 0]
  ------------------
 1055|      0|        for (int j = 0; j < item.num_attrs; ++j) {
  ------------------
  |  Branch (1055:25): [True: 0, False: 0]
  ------------------
 1056|      0|          if (item.attr[j].is_core_eff_valid()) {
  ------------------
  |  Branch (1056:15): [True: 0, False: 0]
  ------------------
 1057|      0|            int core_eff = item.attr[j].get_core_eff();
 1058|      0|            if (core_eff < 0 || core_eff >= num_core_efficiencies) {
  ------------------
  |  Branch (1058:17): [True: 0, False: 0]
  |  Branch (1058:33): [True: 0, False: 0]
  ------------------
 1059|      0|              kmp_str_buf_t buf;
 1060|      0|              __kmp_str_buf_init(&buf);
  ------------------
  |  |   41|      0|  {                                                                            \
  |  |   42|      0|    (b)->str = (b)->bulk;                                                      \
  |  |   43|      0|    (b)->size = sizeof((b)->bulk);                                             \
  |  |   44|      0|    (b)->used = 0;                                                             \
  |  |   45|      0|    (b)->bulk[0] = 0;                                                          \
  |  |   46|      0|  }
  ------------------
 1061|      0|              __kmp_str_buf_print(&buf, "%d", item.attr[j].get_core_eff());
 1062|      0|              __kmp_msg(kmp_ms_warning,
 1063|      0|                        KMP_MSG(AffHWSubsetAttrInvalid, "efficiency", buf.str),
  ------------------
  |  |  121|      0|#define KMP_MSG(...) __kmp_msg_format(kmp_i18n_msg_##__VA_ARGS__)
  ------------------
 1064|      0|                        KMP_HNT(ValidValuesRange, 0, num_core_efficiencies - 1),
  ------------------
  |  |  122|      0|#define KMP_HNT(...) __kmp_msg_format(kmp_i18n_hnt_##__VA_ARGS__)
  ------------------
 1065|      0|                        __kmp_msg_null);
 1066|      0|              __kmp_str_buf_free(&buf);
 1067|      0|              return false;
 1068|      0|            }
 1069|      0|          }
 1070|      0|        }
 1071|      0|      }
 1072|       |
 1073|       |      // Check that the number of requested cores with attributes is valid
 1074|      0|      if (using_core_types || using_core_effs) {
  ------------------
  |  Branch (1074:11): [True: 0, False: 0]
  |  Branch (1074:31): [True: 0, False: 0]
  ------------------
 1075|      0|        for (int j = 0; j < item.num_attrs; ++j) {
  ------------------
  |  Branch (1075:25): [True: 0, False: 0]
  ------------------
 1076|      0|          int num = item.num[j];
 1077|      0|          int offset = item.offset[j];
 1078|      0|          int level_above = core_level - 1;
 1079|      0|          if (level_above >= 0) {
  ------------------
  |  Branch (1079:15): [True: 0, False: 0]
  ------------------
 1080|      0|            max_count = get_ncores_with_attr_per(item.attr[j], level_above);
 1081|      0|            if (max_count <= 0 ||
  ------------------
  |  Branch (1081:17): [True: 0, False: 0]
  ------------------
 1082|      0|                (num != kmp_hw_subset_t::USE_ALL && num + offset > max_count)) {
  ------------------
  |  Branch (1082:18): [True: 0, False: 0]
  |  Branch (1082:53): [True: 0, False: 0]
  ------------------
 1083|      0|              kmp_str_buf_t buf;
 1084|      0|              __kmp_hw_get_catalog_core_string(item.attr[j], &buf, num > 0);
 1085|      0|              KMP_AFF_WARNING(__kmp_affinity, AffHWSubsetManyGeneric, buf.str);
  ------------------
  |  |  145|      0|  if (s.flags.verbose || (s.flags.warnings && (s.type != affinity_none))) {    \
  |  |  ------------------
  |  |  |  Branch (145:7): [True: 0, False: 0]
  |  |  |  Branch (145:27): [True: 0, False: 0]
  |  |  |  Branch (145:47): [True: 0, False: 0]
  |  |  ------------------
  |  |  146|      0|    KMP_WARNING(__VA_ARGS__);                                                  \
  |  |  ------------------
  |  |  |  |  145|      0|  __kmp_msg(kmp_ms_warning, KMP_MSG(__VA_ARGS__), __kmp_msg_null)
  |  |  |  |  ------------------
  |  |  |  |  |  |  121|      0|#define KMP_MSG(...) __kmp_msg_format(kmp_i18n_msg_##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  147|      0|  }
  ------------------
 1086|      0|              __kmp_str_buf_free(&buf);
 1087|      0|              return false;
 1088|      0|            }
 1089|      0|          }
 1090|      0|        }
 1091|      0|      }
 1092|       |
 1093|      0|      if ((using_core_types || using_core_effs) && item.num_attrs > 1) {
  ------------------
  |  Branch (1093:12): [True: 0, False: 0]
  |  Branch (1093:32): [True: 0, False: 0]
  |  Branch (1093:52): [True: 0, False: 0]
  ------------------
 1094|      0|        for (int j = 0; j < item.num_attrs; ++j) {
  ------------------
  |  Branch (1094:25): [True: 0, False: 0]
  ------------------
 1095|       |          // Ambiguous use of specific core attribute + generic core
 1096|       |          // e.g., 4c & 3c:intel_core or 4c & 3c:eff1
 1097|      0|          if (!item.attr[j]) {
  ------------------
  |  Branch (1097:15): [True: 0, False: 0]
  ------------------
 1098|      0|            kmp_hw_attr_t other_attr;
 1099|      0|            for (int k = 0; k < item.num_attrs; ++k) {
  ------------------
  |  Branch (1099:29): [True: 0, False: 0]
  ------------------
 1100|      0|              if (item.attr[k] != item.attr[j]) {
  ------------------
  |  Branch (1100:19): [True: 0, False: 0]
  ------------------
 1101|      0|                other_attr = item.attr[k];
 1102|      0|                break;
 1103|      0|              }
 1104|      0|            }
 1105|      0|            kmp_str_buf_t buf;
 1106|      0|            __kmp_hw_get_catalog_core_string(other_attr, &buf, item.num[j] > 0);
 1107|      0|            KMP_AFF_WARNING(__kmp_affinity, AffHWSubsetIncompat,
  ------------------
  |  |  145|      0|  if (s.flags.verbose || (s.flags.warnings && (s.type != affinity_none))) {    \
  |  |  ------------------
  |  |  |  Branch (145:7): [True: 0, False: 0]
  |  |  |  Branch (145:27): [True: 0, False: 0]
  |  |  |  Branch (145:47): [True: 0, False: 0]
  |  |  ------------------
  |  |  146|      0|    KMP_WARNING(__VA_ARGS__);                                                  \
  |  |  ------------------
  |  |  |  |  145|      0|  __kmp_msg(kmp_ms_warning, KMP_MSG(__VA_ARGS__), __kmp_msg_null)
  |  |  |  |  ------------------
  |  |  |  |  |  |  121|      0|#define KMP_MSG(...) __kmp_msg_format(kmp_i18n_msg_##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  147|      0|  }
  ------------------
 1108|      0|                            __kmp_hw_get_catalog_string(KMP_HW_CORE), buf.str);
 1109|      0|            __kmp_str_buf_free(&buf);
 1110|      0|            return false;
 1111|      0|          }
 1112|       |          // Allow specifying a specific core type or core eff exactly once
 1113|      0|          for (int k = 0; k < j; ++k) {
  ------------------
  |  Branch (1113:27): [True: 0, False: 0]
  ------------------
 1114|      0|            if (!item.attr[j] || !item.attr[k])
  ------------------
  |  Branch (1114:17): [True: 0, False: 0]
  |  Branch (1114:34): [True: 0, False: 0]
  ------------------
 1115|      0|              continue;
 1116|      0|            if (item.attr[k] == item.attr[j]) {
  ------------------
  |  Branch (1116:17): [True: 0, False: 0]
  ------------------
 1117|      0|              kmp_str_buf_t buf;
 1118|      0|              __kmp_hw_get_catalog_core_string(item.attr[j], &buf,
 1119|      0|                                               item.num[j] > 0);
 1120|      0|              KMP_AFF_WARNING(__kmp_affinity, AffHWSubsetAttrRepeat, buf.str);
  ------------------
  |  |  145|      0|  if (s.flags.verbose || (s.flags.warnings && (s.type != affinity_none))) {    \
  |  |  ------------------
  |  |  |  Branch (145:7): [True: 0, False: 0]
  |  |  |  Branch (145:27): [True: 0, False: 0]
  |  |  |  Branch (145:47): [True: 0, False: 0]
  |  |  ------------------
  |  |  146|      0|    KMP_WARNING(__VA_ARGS__);                                                  \
  |  |  ------------------
  |  |  |  |  145|      0|  __kmp_msg(kmp_ms_warning, KMP_MSG(__VA_ARGS__), __kmp_msg_null)
  |  |  |  |  ------------------
  |  |  |  |  |  |  121|      0|#define KMP_MSG(...) __kmp_msg_format(kmp_i18n_msg_##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  147|      0|  }
  ------------------
 1121|      0|              __kmp_str_buf_free(&buf);
 1122|      0|              return false;
 1123|      0|            }
 1124|      0|          }
 1125|      0|        }
 1126|      0|      }
 1127|      0|    }
 1128|      0|  }
 1129|       |
 1130|      0|  struct core_type_indexer {
 1131|      0|    int operator()(const kmp_hw_thread_t &t) const {
 1132|      0|      switch (t.attrs.get_core_type()) {
 1133|      0|#if KMP_ARCH_X86 || KMP_ARCH_X86_64
 1134|      0|      case KMP_HW_CORE_TYPE_ATOM:
 1135|      0|        return 1;
 1136|      0|      case KMP_HW_CORE_TYPE_CORE:
 1137|      0|        return 2;
 1138|      0|#endif
 1139|      0|      case KMP_HW_CORE_TYPE_UNKNOWN:
 1140|      0|        return 0;
 1141|      0|      }
 1142|      0|      KMP_ASSERT(0);
 1143|      0|      return 0;
 1144|      0|    }
 1145|      0|  };
 1146|      0|  struct core_eff_indexer {
 1147|      0|    int operator()(const kmp_hw_thread_t &t) const {
 1148|      0|      return t.attrs.get_core_eff();
 1149|      0|    }
 1150|      0|  };
 1151|       |
 1152|      0|  kmp_sub_ids_t<KMP_HW_MAX_NUM_CORE_TYPES, core_type_indexer> core_type_sub_ids(
 1153|      0|      core_level);
 1154|      0|  kmp_sub_ids_t<KMP_HW_MAX_NUM_CORE_EFFS, core_eff_indexer> core_eff_sub_ids(
 1155|      0|      core_level);
 1156|       |
 1157|       |  // Determine which hardware threads should be filtered.
 1158|      0|  int num_filtered = 0;
 1159|      0|  bool *filtered = (bool *)__kmp_allocate(sizeof(bool) * num_hw_threads);
  ------------------
  |  | 3617|      0|#define __kmp_allocate(size) ___kmp_allocate((size)KMP_SRC_LOC_CURR)
  ------------------
 1160|      0|  for (int i = 0; i < num_hw_threads; ++i) {
  ------------------
  |  Branch (1160:19): [True: 0, False: 0]
  ------------------
 1161|      0|    kmp_hw_thread_t &hw_thread = hw_threads[i];
 1162|       |    // Update type_sub_id
 1163|      0|    if (using_core_types)
  ------------------
  |  Branch (1163:9): [True: 0, False: 0]
  ------------------
 1164|      0|      core_type_sub_ids.update(hw_thread);
 1165|      0|    if (using_core_effs)
  ------------------
  |  Branch (1165:9): [True: 0, False: 0]
  ------------------
 1166|      0|      core_eff_sub_ids.update(hw_thread);
 1167|       |
 1168|       |    // Check to see if this hardware thread should be filtered
 1169|      0|    bool should_be_filtered = false;
 1170|      0|    for (int hw_subset_index = 0; hw_subset_index < hw_subset_depth;
  ------------------
  |  Branch (1170:35): [True: 0, False: 0]
  ------------------
 1171|      0|         ++hw_subset_index) {
 1172|      0|      const auto &hw_subset_item = __kmp_hw_subset->at(hw_subset_index);
 1173|      0|      int level = topology_levels[hw_subset_index];
 1174|      0|      if (level == -1)
  ------------------
  |  Branch (1174:11): [True: 0, False: 0]
  ------------------
 1175|      0|        continue;
 1176|      0|      if ((using_core_effs || using_core_types) && level == core_level) {
  ------------------
  |  Branch (1176:12): [True: 0, False: 0]
  |  Branch (1176:31): [True: 0, False: 0]
  |  Branch (1176:52): [True: 0, False: 0]
  ------------------
 1177|       |        // Look for the core attribute in KMP_HW_SUBSET which corresponds
 1178|       |        // to this hardware thread's core attribute. Use this num,offset plus
 1179|       |        // the running sub_id for the particular core attribute of this hardware
 1180|       |        // thread to determine if the hardware thread should be filtered or not.
 1181|      0|        int attr_idx;
 1182|      0|        kmp_hw_core_type_t core_type = hw_thread.attrs.get_core_type();
 1183|      0|        int core_eff = hw_thread.attrs.get_core_eff();
 1184|      0|        for (attr_idx = 0; attr_idx < hw_subset_item.num_attrs; ++attr_idx) {
  ------------------
  |  Branch (1184:28): [True: 0, False: 0]
  ------------------
 1185|      0|          if (using_core_types &&
  ------------------
  |  Branch (1185:15): [True: 0, False: 0]
  ------------------
 1186|      0|              hw_subset_item.attr[attr_idx].get_core_type() == core_type)
  ------------------
  |  Branch (1186:15): [True: 0, False: 0]
  ------------------
 1187|      0|            break;
 1188|      0|          if (using_core_effs &&
  ------------------
  |  Branch (1188:15): [True: 0, False: 0]
  ------------------
 1189|      0|              hw_subset_item.attr[attr_idx].get_core_eff() == core_eff)
  ------------------
  |  Branch (1189:15): [True: 0, False: 0]
  ------------------
 1190|      0|            break;
 1191|      0|        }
 1192|       |        // This core attribute isn't in the KMP_HW_SUBSET so always filter it.
 1193|      0|        if (attr_idx == hw_subset_item.num_attrs) {
  ------------------
  |  Branch (1193:13): [True: 0, False: 0]
  ------------------
 1194|      0|          should_be_filtered = true;
 1195|      0|          break;
 1196|      0|        }
 1197|      0|        int sub_id;
 1198|      0|        int num = hw_subset_item.num[attr_idx];
 1199|      0|        int offset = hw_subset_item.offset[attr_idx];
 1200|      0|        if (using_core_types)
  ------------------
  |  Branch (1200:13): [True: 0, False: 0]
  ------------------
 1201|      0|          sub_id = core_type_sub_ids.get_sub_id(hw_thread);
 1202|      0|        else
 1203|      0|          sub_id = core_eff_sub_ids.get_sub_id(hw_thread);
 1204|      0|        if (sub_id < offset ||
  ------------------
  |  Branch (1204:13): [True: 0, False: 0]
  ------------------
 1205|      0|            (num != kmp_hw_subset_t::USE_ALL && sub_id >= offset + num)) {
  ------------------
  |  Branch (1205:14): [True: 0, False: 0]
  |  Branch (1205:49): [True: 0, False: 0]
  ------------------
 1206|      0|          should_be_filtered = true;
 1207|      0|          break;
 1208|      0|        }
 1209|      0|      } else {
 1210|      0|        int num = hw_subset_item.num[0];
 1211|      0|        int offset = hw_subset_item.offset[0];
 1212|      0|        if (hw_thread.sub_ids[level] < offset ||
  ------------------
  |  Branch (1212:13): [True: 0, False: 0]
  ------------------
 1213|      0|            (num != kmp_hw_subset_t::USE_ALL &&
  ------------------
  |  Branch (1213:14): [True: 0, False: 0]
  ------------------
 1214|      0|             hw_thread.sub_ids[level] >= offset + num)) {
  ------------------
  |  Branch (1214:14): [True: 0, False: 0]
  ------------------
 1215|      0|          should_be_filtered = true;
 1216|      0|          break;
 1217|      0|        }
 1218|      0|      }
 1219|      0|    }
 1220|       |    // Collect filtering information
 1221|      0|    filtered[i] = should_be_filtered;
 1222|      0|    if (should_be_filtered)
  ------------------
  |  Branch (1222:9): [True: 0, False: 0]
  ------------------
 1223|      0|      num_filtered++;
 1224|      0|  }
 1225|       |
 1226|       |  // One last check that we shouldn't allow filtering entire machine
 1227|      0|  if (num_filtered == num_hw_threads) {
  ------------------
  |  Branch (1227:7): [True: 0, False: 0]
  ------------------
 1228|      0|    KMP_AFF_WARNING(__kmp_affinity, AffHWSubsetAllFiltered);
  ------------------
  |  |  145|      0|  if (s.flags.verbose || (s.flags.warnings && (s.type != affinity_none))) {    \
  |  |  ------------------
  |  |  |  Branch (145:7): [True: 0, False: 0]
  |  |  |  Branch (145:27): [True: 0, False: 0]
  |  |  |  Branch (145:47): [True: 0, False: 0]
  |  |  ------------------
  |  |  146|      0|    KMP_WARNING(__VA_ARGS__);                                                  \
  |  |  ------------------
  |  |  |  |  145|      0|  __kmp_msg(kmp_ms_warning, KMP_MSG(__VA_ARGS__), __kmp_msg_null)
  |  |  |  |  ------------------
  |  |  |  |  |  |  121|      0|#define KMP_MSG(...) __kmp_msg_format(kmp_i18n_msg_##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  147|      0|  }
  ------------------
 1229|      0|    __kmp_free(filtered);
  ------------------
  |  | 3619|      0|#define __kmp_free(ptr) ___kmp_free((ptr)KMP_SRC_LOC_CURR)
  ------------------
 1230|      0|    return false;
 1231|      0|  }
 1232|       |
 1233|       |  // Apply the filter
 1234|      0|  int new_index = 0;
 1235|      0|  for (int i = 0; i < num_hw_threads; ++i) {
  ------------------
  |  Branch (1235:19): [True: 0, False: 0]
  ------------------
 1236|      0|    if (!filtered[i]) {
  ------------------
  |  Branch (1236:9): [True: 0, False: 0]
  ------------------
 1237|      0|      if (i != new_index)
  ------------------
  |  Branch (1237:11): [True: 0, False: 0]
  ------------------
 1238|      0|        hw_threads[new_index] = hw_threads[i];
 1239|      0|      new_index++;
 1240|      0|    } else {
 1241|      0|#if KMP_AFFINITY_SUPPORTED
 1242|      0|      KMP_CPU_CLR(hw_threads[i].os_id, __kmp_affin_fullMask);
  ------------------
  |  |  691|      0|#define KMP_CPU_CLR(i, mask) (mask)->clear(i)
  ------------------
 1243|      0|#endif
 1244|      0|      __kmp_avail_proc--;
 1245|      0|    }
 1246|      0|  }
 1247|       |
 1248|      0|  KMP_DEBUG_ASSERT(new_index <= num_hw_threads);
 1249|      0|  num_hw_threads = new_index;
 1250|       |
 1251|       |  // Post hardware subset canonicalization
 1252|      0|  _gather_enumeration_information();
 1253|      0|  _discover_uniformity();
 1254|      0|  _set_globals();
 1255|      0|  _set_last_level_cache();
 1256|      0|  __kmp_free(filtered);
  ------------------
  |  | 3619|      0|#define __kmp_free(ptr) ___kmp_free((ptr)KMP_SRC_LOC_CURR)
  ------------------
 1257|      0|  return true;
 1258|      0|}
_ZN11KMPAffinity4MasknwEm:
 1279|     68|void *KMPAffinity::Mask::operator new(size_t n) { return __kmp_allocate(n); }
  ------------------
  |  | 3617|     68|#define __kmp_allocate(size) ___kmp_allocate((size)KMP_SRC_LOC_CURR)
  ------------------
_ZN11KMPAffinity4MasknaEm:
 1280|      1|void *KMPAffinity::Mask::operator new[](size_t n) { return __kmp_allocate(n); }
  ------------------
  |  | 3617|      1|#define __kmp_allocate(size) ___kmp_allocate((size)KMP_SRC_LOC_CURR)
  ------------------
_ZN11KMPAffinity4MaskdlEPv:
 1281|     67|void KMPAffinity::Mask::operator delete(void *p) { __kmp_free(p); }
  ------------------
  |  | 3619|     67|#define __kmp_free(ptr) ___kmp_free((ptr)KMP_SRC_LOC_CURR)
  ------------------
_ZN11KMPAffinity4MaskdaEPv:
 1282|      1|void KMPAffinity::Mask::operator delete[](void *p) { __kmp_free(p); }
  ------------------
  |  | 3619|      1|#define __kmp_free(ptr) ___kmp_free((ptr)KMP_SRC_LOC_CURR)
  ------------------
_ZN11KMPAffinitynwEm:
 1283|      1|void *KMPAffinity::operator new(size_t n) { return __kmp_allocate(n); }
  ------------------
  |  | 3617|      1|#define __kmp_allocate(size) ___kmp_allocate((size)KMP_SRC_LOC_CURR)
  ------------------
_ZN11KMPAffinitydlEPv:
 1284|      1|void KMPAffinity::operator delete(void *p) { __kmp_free(p); }
  ------------------
  |  | 3619|      1|#define __kmp_free(ptr) ___kmp_free((ptr)KMP_SRC_LOC_CURR)
  ------------------
_ZN11KMPAffinity8pick_apiEv:
 1286|      1|void KMPAffinity::pick_api() {
 1287|      1|  KMPAffinity *affinity_dispatch;
 1288|      1|  if (picked_api)
  ------------------
  |  Branch (1288:7): [True: 0, False: 1]
  ------------------
 1289|      0|    return;
 1290|       |#if KMP_USE_HWLOC
 1291|       |  // Only use Hwloc if affinity isn't explicitly disabled and
 1292|       |  // user requests Hwloc topology method
 1293|       |  if (__kmp_affinity_top_method == affinity_top_method_hwloc &&
 1294|       |      __kmp_affinity.type != affinity_disabled) {
 1295|       |    affinity_dispatch = new KMPHwlocAffinity();
 1296|       |  } else
 1297|       |#endif
 1298|      1|  {
 1299|      1|    affinity_dispatch = new KMPNativeAffinity();
 1300|      1|  }
 1301|      1|  __kmp_affinity_dispatch = affinity_dispatch;
 1302|      1|  picked_api = true;
 1303|      1|}
_ZN11KMPAffinity11destroy_apiEv:
 1305|      2|void KMPAffinity::destroy_api() {
 1306|      2|  if (__kmp_affinity_dispatch != NULL) {
  ------------------
  |  Branch (1306:7): [True: 1, False: 1]
  ------------------
 1307|      1|    delete __kmp_affinity_dispatch;
 1308|       |    __kmp_affinity_dispatch = NULL;
 1309|      1|    picked_api = false;
 1310|      1|  }
 1311|      2|}
__kmp_affinity_initialize:
 4608|      1|void __kmp_affinity_initialize(kmp_affinity_t &affinity) {
 4609|       |  // Much of the code above was written assuming that if a machine was not
 4610|       |  // affinity capable, then affinity type == affinity_none.
 4611|       |  // We now explicitly represent this as affinity type == affinity_disabled.
 4612|       |  // There are too many checks for affinity type == affinity_none in this code.
 4613|       |  // Instead of trying to change them all, check if
 4614|       |  // affinity type == affinity_disabled, and if so, slam it with affinity_none,
 4615|       |  // call the real initialization routine, then restore affinity type to
 4616|       |  // affinity_disabled.
 4617|      1|  int disabled = (affinity.type == affinity_disabled);
 4618|      1|  if (!KMP_AFFINITY_CAPABLE())
  ------------------
  |  |  684|      1|#define KMP_AFFINITY_CAPABLE() (__kmp_affin_mask_size > 0)
  ------------------
  |  Branch (4618:7): [True: 0, False: 1]
  ------------------
 4619|      0|    KMP_ASSERT(disabled);
  ------------------
  |  |   50|      0|  if (!(cond)) {                                                               \
  |  |  ------------------
  |  |  |  Branch (50:7): [True: 0, False: 0]
  |  |  ------------------
  |  |   51|      0|    __kmp_debug_assert("assertion failure", __FILE__, __LINE__);               \
  |  |   52|      0|  }
  ------------------
 4620|      1|  if (disabled)
  ------------------
  |  Branch (4620:7): [True: 0, False: 1]
  ------------------
 4621|      0|    affinity.type = affinity_none;
 4622|      1|  __kmp_aux_affinity_initialize(affinity);
 4623|      1|  if (disabled)
  ------------------
  |  Branch (4623:7): [True: 0, False: 1]
  ------------------
 4624|      0|    affinity.type = affinity_disabled;
 4625|      1|}
__kmp_affinity_uninitialize:
 4627|      2|void __kmp_affinity_uninitialize(void) {
 4628|      4|  for (kmp_affinity_t *affinity : __kmp_affinities) {
  ------------------
  |  Branch (4628:33): [True: 4, False: 2]
  ------------------
 4629|      4|    if (affinity->masks != NULL)
  ------------------
  |  Branch (4629:9): [True: 1, False: 3]
  ------------------
 4630|      1|      KMP_CPU_FREE_ARRAY(affinity->masks, affinity->num_masks);
  ------------------
  |  |  707|      1|  __kmp_affinity_dispatch->deallocate_mask_array(arr)
  ------------------
 4631|      4|    if (affinity->os_id_masks != NULL)
  ------------------
  |  Branch (4631:9): [True: 0, False: 4]
  ------------------
 4632|      0|      KMP_CPU_FREE_ARRAY(affinity->os_id_masks, affinity->num_os_id_masks);
  ------------------
  |  |  707|      0|  __kmp_affinity_dispatch->deallocate_mask_array(arr)
  ------------------
 4633|      4|    if (affinity->proclist != NULL)
  ------------------
  |  Branch (4633:9): [True: 0, False: 4]
  ------------------
 4634|      0|      __kmp_free(affinity->proclist);
  ------------------
  |  | 3619|      0|#define __kmp_free(ptr) ___kmp_free((ptr)KMP_SRC_LOC_CURR)
  ------------------
 4635|      4|    if (affinity->ids != NULL)
  ------------------
  |  Branch (4635:9): [True: 1, False: 3]
  ------------------
 4636|      1|      __kmp_free(affinity->ids);
  ------------------
  |  | 3619|      1|#define __kmp_free(ptr) ___kmp_free((ptr)KMP_SRC_LOC_CURR)
  ------------------
 4637|      4|    if (affinity->attrs != NULL)
  ------------------
  |  Branch (4637:9): [True: 1, False: 3]
  ------------------
 4638|      1|      __kmp_free(affinity->attrs);
  ------------------
  |  | 3619|      1|#define __kmp_free(ptr) ___kmp_free((ptr)KMP_SRC_LOC_CURR)
  ------------------
 4639|      4|    *affinity = KMP_AFFINITY_INIT(affinity->env_var);
  ------------------
  |  |  911|      4|  {                                                                            \
  |  |  912|      4|    nullptr, affinity_default, KMP_HW_UNKNOWN, -1, 0, 0,                       \
  |  |  913|      4|        {TRUE, FALSE, TRUE, affinity_respect_mask_default, FALSE, FALSE}, 0,   \
  |  |  ------------------
  |  |  |  | 1280|      4|#define TRUE (!FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1279|      4|#define FALSE 0
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                       {TRUE, FALSE, TRUE, affinity_respect_mask_default, FALSE, FALSE}, 0,   \
  |  |  ------------------
  |  |  |  | 1279|      4|#define FALSE 0
  |  |  ------------------
  |  |                       {TRUE, FALSE, TRUE, affinity_respect_mask_default, FALSE, FALSE}, 0,   \
  |  |  ------------------
  |  |  |  | 1280|      4|#define TRUE (!FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1279|      4|#define FALSE 0
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                       {TRUE, FALSE, TRUE, affinity_respect_mask_default, FALSE, FALSE}, 0,   \
  |  |  ------------------
  |  |  |  |  860|      4|#define affinity_respect_mask_default (2)
  |  |  ------------------
  |  |                       {TRUE, FALSE, TRUE, affinity_respect_mask_default, FALSE, FALSE}, 0,   \
  |  |  ------------------
  |  |  |  | 1279|      4|#define FALSE 0
  |  |  ------------------
  |  |                       {TRUE, FALSE, TRUE, affinity_respect_mask_default, FALSE, FALSE}, 0,   \
  |  |  ------------------
  |  |  |  | 1279|      4|#define FALSE 0
  |  |  ------------------
  |  |  914|      4|        nullptr, nullptr, nullptr, 0, nullptr, env                             \
  |  |  915|      4|  }
  ------------------
 4640|      4|  }
 4641|      2|  if (__kmp_affin_origMask != NULL) {
  ------------------
  |  Branch (4641:7): [True: 1, False: 1]
  ------------------
 4642|      1|    if (KMP_AFFINITY_CAPABLE()) {
  ------------------
  |  |  684|      1|#define KMP_AFFINITY_CAPABLE() (__kmp_affin_mask_size > 0)
  |  |  ------------------
  |  |  |  Branch (684:32): [True: 1, False: 0]
  |  |  ------------------
  ------------------
 4643|      1|      __kmp_set_system_affinity(__kmp_affin_origMask, FALSE);
  ------------------
  |  |  713|      1|  (mask)->set_system_affinity(abort_bool)
  ------------------
 4644|      1|    }
 4645|      1|    KMP_CPU_FREE(__kmp_affin_origMask);
  ------------------
  |  |  698|      1|#define KMP_CPU_FREE(ptr) __kmp_affinity_dispatch->deallocate_mask(ptr)
  ------------------
 4646|      1|    __kmp_affin_origMask = NULL;
 4647|      1|  }
 4648|      2|  __kmp_affinity_num_places = 0;
 4649|      2|  if (procarr != NULL) {
  ------------------
  |  Branch (4649:7): [True: 0, False: 2]
  ------------------
 4650|      0|    __kmp_free(procarr);
  ------------------
  |  | 3619|      0|#define __kmp_free(ptr) ___kmp_free((ptr)KMP_SRC_LOC_CURR)
  ------------------
 4651|      0|    procarr = NULL;
 4652|      0|  }
 4653|      2|  if (__kmp_osid_to_hwthread_map) {
  ------------------
  |  Branch (4653:7): [True: 1, False: 1]
  ------------------
 4654|      1|    __kmp_free(__kmp_osid_to_hwthread_map);
  ------------------
  |  | 3619|      1|#define __kmp_free(ptr) ___kmp_free((ptr)KMP_SRC_LOC_CURR)
  ------------------
 4655|      1|    __kmp_osid_to_hwthread_map = NULL;
 4656|      1|  }
 4657|       |#if KMP_USE_HWLOC
 4658|       |  if (__kmp_hwloc_topology != NULL) {
 4659|       |    hwloc_topology_destroy(__kmp_hwloc_topology);
 4660|       |    __kmp_hwloc_topology = NULL;
 4661|       |  }
 4662|       |#endif
 4663|      2|  if (__kmp_hw_subset) {
  ------------------
  |  Branch (4663:7): [True: 0, False: 2]
  ------------------
 4664|      0|    kmp_hw_subset_t::deallocate(__kmp_hw_subset);
 4665|      0|    __kmp_hw_subset = nullptr;
 4666|      0|  }
 4667|      2|  if (__kmp_topology) {
  ------------------
  |  Branch (4667:7): [True: 1, False: 1]
  ------------------
 4668|      1|    kmp_topology_t::deallocate(__kmp_topology);
 4669|      1|    __kmp_topology = nullptr;
 4670|      1|  }
 4671|      2|  KMPAffinity::destroy_api();
 4672|      2|}
__kmp_affinity_set_init_mask:
 4691|     32|void __kmp_affinity_set_init_mask(int gtid, int isa_root) {
 4692|       |
 4693|     32|  kmp_info_t *th = (kmp_info_t *)TCR_SYNC_PTR(__kmp_threads[gtid]);
  ------------------
  |  | 1158|     32|#define TCR_SYNC_PTR(a) ((void *)TCR_SYNC_8(a))
  |  |  ------------------
  |  |  |  | 1140|     32|#define TCR_SYNC_8(a) (a)
  |  |  ------------------
  ------------------
 4694|       |
 4695|       |  // Set the thread topology information to default of unknown
 4696|    416|  for (int id = 0; id < KMP_HW_LAST; ++id)
  ------------------
  |  Branch (4696:20): [True: 384, False: 32]
  ------------------
 4697|    384|    th->th.th_topology_ids[id] = kmp_hw_thread_t::UNKNOWN_ID;
 4698|     32|  th->th.th_topology_attrs = KMP_AFFINITY_ATTRS_UNKNOWN;
  ------------------
  |  |  891|     32|  { KMP_HW_CORE_TYPE_UNKNOWN, kmp_hw_attr_t::UNKNOWN_CORE_EFF, 0, 0 }
  ------------------
 4699|       |
 4700|     32|  if (!KMP_AFFINITY_CAPABLE()) {
  ------------------
  |  |  684|     32|#define KMP_AFFINITY_CAPABLE() (__kmp_affin_mask_size > 0)
  ------------------
  |  Branch (4700:7): [True: 0, False: 32]
  ------------------
 4701|      0|    return;
 4702|      0|  }
 4703|       |
 4704|     32|  if (th->th.th_affin_mask == NULL) {
  ------------------
  |  Branch (4704:7): [True: 32, False: 0]
  ------------------
 4705|     32|    KMP_CPU_ALLOC(th->th.th_affin_mask);
  ------------------
  |  |  697|     32|#define KMP_CPU_ALLOC(ptr) (ptr = __kmp_affinity_dispatch->allocate_mask())
  ------------------
 4706|     32|  } else {
 4707|      0|    KMP_CPU_ZERO(th->th.th_affin_mask);
  ------------------
  |  |  692|      0|#define KMP_CPU_ZERO(mask) (mask)->zero()
  ------------------
 4708|      0|  }
 4709|       |
 4710|       |  // Copy the thread mask to the kmp_info_t structure. If
 4711|       |  // __kmp_affinity.type == affinity_none, copy the "full" mask, i.e.
 4712|       |  // one that has all of the OS proc ids set, or if
 4713|       |  // __kmp_affinity.flags.respect is set, then the full mask is the
 4714|       |  // same as the mask of the initialization thread.
 4715|     32|  kmp_affin_mask_t *mask;
 4716|     32|  int i;
 4717|     32|  const kmp_affinity_t *affinity;
 4718|     32|  const char *env_var;
 4719|     32|  bool is_hidden_helper = KMP_HIDDEN_HELPER_THREAD(gtid);
  ------------------
  |  | 4417|     32|  ((gtid) >= 1 && (gtid) <= __kmp_hidden_helper_threads_num)
  |  |  ------------------
  |  |  |  Branch (4417:4): [True: 31, False: 1]
  |  |  |  Branch (4417:19): [True: 0, False: 31]
  |  |  ------------------
  ------------------
 4720|       |
 4721|     32|  if (is_hidden_helper)
  ------------------
  |  Branch (4721:7): [True: 0, False: 32]
  ------------------
 4722|      0|    affinity = &__kmp_hh_affinity;
 4723|     32|  else
 4724|     32|    affinity = &__kmp_affinity;
 4725|     32|  env_var = affinity->env_var;
 4726|       |
 4727|     32|  if (KMP_AFFINITY_NON_PROC_BIND || is_hidden_helper) {
  ------------------
  |  |  963|     64|  ((__kmp_nested_proc_bind.bind_types[0] == proc_bind_false ||                 \
  |  |  ------------------
  |  |  |  Branch (963:5): [True: 32, False: 0]
  |  |  ------------------
  |  |  964|     32|    __kmp_nested_proc_bind.bind_types[0] == proc_bind_intel) &&                \
  |  |  ------------------
  |  |  |  Branch (964:5): [True: 0, False: 0]
  |  |  ------------------
  |  |  965|     64|   (__kmp_affinity.num_masks > 0 || __kmp_affinity.type == affinity_balanced))
  |  |  ------------------
  |  |  |  Branch (965:5): [True: 32, False: 0]
  |  |  |  Branch (965:37): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (4727:37): [True: 0, False: 0]
  ------------------
 4728|     32|    if ((affinity->type == affinity_none) ||
  ------------------
  |  Branch (4728:9): [True: 32, False: 0]
  ------------------
 4729|      0|        (affinity->type == affinity_balanced) ||
  ------------------
  |  Branch (4729:9): [True: 0, False: 0]
  ------------------
 4730|     32|        KMP_HIDDEN_HELPER_MAIN_THREAD(gtid)) {
  ------------------
  |  | 4423|      0|  ((gtid) == 1 && (gtid) <= __kmp_hidden_helper_threads_num)
  |  |  ------------------
  |  |  |  Branch (4423:4): [True: 0, False: 0]
  |  |  |  Branch (4423:19): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 4731|       |#if KMP_GROUP_AFFINITY
 4732|       |      if (__kmp_num_proc_groups > 1) {
 4733|       |        return;
 4734|       |      }
 4735|       |#endif
 4736|     32|      KMP_ASSERT(__kmp_affin_fullMask != NULL);
  ------------------
  |  |   50|     32|  if (!(cond)) {                                                               \
  |  |  ------------------
  |  |  |  Branch (50:7): [True: 0, False: 32]
  |  |  ------------------
  |  |   51|      0|    __kmp_debug_assert("assertion failure", __FILE__, __LINE__);               \
  |  |   52|      0|  }
  ------------------
 4737|     32|      i = 0;
 4738|     32|      mask = __kmp_affin_fullMask;
 4739|     32|    } else {
 4740|      0|      __kmp_select_mask_by_gtid(gtid, affinity, &i, &mask);
 4741|      0|    }
 4742|     32|  } else {
 4743|      0|    if (!isa_root || __kmp_nested_proc_bind.bind_types[0] == proc_bind_false) {
  ------------------
  |  Branch (4743:9): [True: 0, False: 0]
  |  Branch (4743:22): [True: 0, False: 0]
  ------------------
 4744|       |#if KMP_GROUP_AFFINITY
 4745|       |      if (__kmp_num_proc_groups > 1) {
 4746|       |        return;
 4747|       |      }
 4748|       |#endif
 4749|      0|      KMP_ASSERT(__kmp_affin_fullMask != NULL);
  ------------------
  |  |   50|      0|  if (!(cond)) {                                                               \
  |  |  ------------------
  |  |  |  Branch (50:7): [True: 0, False: 0]
  |  |  ------------------
  |  |   51|      0|    __kmp_debug_assert("assertion failure", __FILE__, __LINE__);               \
  |  |   52|      0|  }
  ------------------
 4750|      0|      i = KMP_PLACE_ALL;
  ------------------
  |  |  959|      0|#define KMP_PLACE_ALL (-1)
  ------------------
 4751|      0|      mask = __kmp_affin_fullMask;
 4752|      0|    } else {
 4753|      0|      __kmp_select_mask_by_gtid(gtid, affinity, &i, &mask);
 4754|      0|    }
 4755|      0|  }
 4756|       |
 4757|     32|  th->th.th_current_place = i;
 4758|     32|  if (isa_root && !is_hidden_helper) {
  ------------------
  |  Branch (4758:7): [True: 1, False: 31]
  |  Branch (4758:19): [True: 1, False: 0]
  ------------------
 4759|      1|    th->th.th_new_place = i;
 4760|      1|    th->th.th_first_place = 0;
 4761|      1|    th->th.th_last_place = affinity->num_masks - 1;
 4762|     31|  } else if (KMP_AFFINITY_NON_PROC_BIND) {
  ------------------
  |  |  963|     31|  ((__kmp_nested_proc_bind.bind_types[0] == proc_bind_false ||                 \
  |  |  ------------------
  |  |  |  Branch (963:5): [True: 31, False: 0]
  |  |  ------------------
  |  |  964|     31|    __kmp_nested_proc_bind.bind_types[0] == proc_bind_intel) &&                \
  |  |  ------------------
  |  |  |  Branch (964:5): [True: 0, False: 0]
  |  |  ------------------
  |  |  965|     31|   (__kmp_affinity.num_masks > 0 || __kmp_affinity.type == affinity_balanced))
  |  |  ------------------
  |  |  |  Branch (965:5): [True: 31, False: 0]
  |  |  |  Branch (965:37): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 4763|       |    // When using a Non-OMP_PROC_BIND affinity method,
 4764|       |    // set all threads' place-partition-var to the entire place list
 4765|     31|    th->th.th_first_place = 0;
 4766|     31|    th->th.th_last_place = affinity->num_masks - 1;
 4767|     31|  }
 4768|       |  // Copy topology information associated with the place
 4769|     32|  if (i >= 0) {
  ------------------
  |  Branch (4769:7): [True: 32, False: 0]
  ------------------
 4770|     32|    th->th.th_topology_ids = __kmp_affinity.ids[i];
 4771|     32|    th->th.th_topology_attrs = __kmp_affinity.attrs[i];
 4772|     32|  }
 4773|       |
 4774|     32|  if (i == KMP_PLACE_ALL) {
  ------------------
  |  |  959|     32|#define KMP_PLACE_ALL (-1)
  ------------------
  |  Branch (4774:7): [True: 0, False: 32]
  ------------------
 4775|      0|    KA_TRACE(100, ("__kmp_affinity_set_init_mask: binding T#%d to all places\n",
 4776|      0|                   gtid));
 4777|     32|  } else {
 4778|     32|    KA_TRACE(100, ("__kmp_affinity_set_init_mask: binding T#%d to place %d\n",
 4779|     32|                   gtid, i));
 4780|     32|  }
 4781|       |
 4782|     32|  KMP_CPU_COPY(th->th.th_affin_mask, mask);
  ------------------
  |  |  693|     32|#define KMP_CPU_COPY(dest, src) (dest)->copy(src)
  ------------------
 4783|       |
 4784|       |  /* to avoid duplicate printing (will be correctly printed on barrier) */
 4785|     32|  if (affinity->flags.verbose &&
  ------------------
  |  Branch (4785:7): [True: 0, False: 32]
  ------------------
 4786|      0|      (affinity->type == affinity_none ||
  ------------------
  |  Branch (4786:8): [True: 0, False: 0]
  ------------------
 4787|      0|       (i != KMP_PLACE_ALL && affinity->type != affinity_balanced)) &&
  ------------------
  |  |  959|      0|#define KMP_PLACE_ALL (-1)
  ------------------
  |  Branch (4787:9): [True: 0, False: 0]
  |  Branch (4787:31): [True: 0, False: 0]
  ------------------
 4788|      0|      !KMP_HIDDEN_HELPER_MAIN_THREAD(gtid)) {
  ------------------
  |  | 4423|      0|  ((gtid) == 1 && (gtid) <= __kmp_hidden_helper_threads_num)
  |  |  ------------------
  |  |  |  Branch (4423:4): [True: 0, False: 0]
  |  |  |  Branch (4423:19): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 4789|      0|    char buf[KMP_AFFIN_MASK_PRINT_LEN];
 4790|      0|    __kmp_affinity_print_mask(buf, KMP_AFFIN_MASK_PRINT_LEN,
  ------------------
  |  |  828|      0|#define KMP_AFFIN_MASK_PRINT_LEN 1024
  ------------------
 4791|      0|                              th->th.th_affin_mask);
 4792|      0|    KMP_INFORM(BoundToOSProcSet, env_var, (kmp_int32)getpid(), __kmp_gettid(),
  ------------------
  |  |  143|      0|  __kmp_msg(kmp_ms_inform, KMP_MSG(__VA_ARGS__), __kmp_msg_null)
  |  |  ------------------
  |  |  |  |  121|      0|#define KMP_MSG(...) __kmp_msg_format(kmp_i18n_msg_##__VA_ARGS__)
  |  |  ------------------
  ------------------
 4793|      0|               gtid, buf);
 4794|      0|  }
 4795|       |
 4796|       |#if KMP_OS_WINDOWS
 4797|       |  // On Windows* OS, the process affinity mask might have changed. If the user
 4798|       |  // didn't request affinity and this call fails, just continue silently.
 4799|       |  // See CQ171393.
 4800|       |  if (affinity->type == affinity_none) {
 4801|       |    __kmp_set_system_affinity(th->th.th_affin_mask, FALSE);
 4802|       |  } else
 4803|       |#endif
 4804|     32|    __kmp_set_system_affinity(th->th.th_affin_mask, TRUE);
  ------------------
  |  |  713|     32|  (mask)->set_system_affinity(abort_bool)
  ------------------
 4805|     32|}
kmp_affinity.cpp:_ZL29__kmp_aux_affinity_initializeR14kmp_affinity_t:
 4398|      1|static void __kmp_aux_affinity_initialize(kmp_affinity_t &affinity) {
 4399|      1|  bool is_regular_affinity = (&affinity == &__kmp_affinity);
 4400|      1|  bool is_hidden_helper_affinity = (&affinity == &__kmp_hh_affinity);
 4401|      1|  const char *env_var = affinity.env_var;
 4402|       |
 4403|      1|  if (affinity.flags.initialized) {
  ------------------
  |  Branch (4403:7): [True: 0, False: 1]
  ------------------
 4404|      0|    KMP_ASSERT(__kmp_affin_fullMask != NULL);
  ------------------
  |  |   50|      0|  if (!(cond)) {                                                               \
  |  |  ------------------
  |  |  |  Branch (50:7): [True: 0, False: 0]
  |  |  ------------------
  |  |   51|      0|    __kmp_debug_assert("assertion failure", __FILE__, __LINE__);               \
  |  |   52|      0|  }
  ------------------
 4405|      0|    return;
 4406|      0|  }
 4407|       |
 4408|      1|  if (is_regular_affinity && (!__kmp_affin_fullMask || !__kmp_affin_origMask))
  ------------------
  |  Branch (4408:7): [True: 1, False: 0]
  |  Branch (4408:31): [True: 1, False: 0]
  |  Branch (4408:56): [True: 0, False: 0]
  ------------------
 4409|      1|    __kmp_aux_affinity_initialize_masks(affinity);
 4410|       |
 4411|      1|  if (is_regular_affinity && !__kmp_topology) {
  ------------------
  |  Branch (4411:7): [True: 1, False: 0]
  |  Branch (4411:30): [True: 1, False: 0]
  ------------------
 4412|      1|    bool success = __kmp_aux_affinity_initialize_topology(affinity);
 4413|      1|    if (success) {
  ------------------
  |  Branch (4413:9): [True: 1, False: 0]
  ------------------
 4414|       |      // Initialize other data structures which depend on the topology
 4415|      1|      machine_hierarchy.init(__kmp_topology->get_num_hw_threads());
 4416|      1|      KMP_ASSERT(__kmp_avail_proc == __kmp_topology->get_num_hw_threads());
  ------------------
  |  |   50|      1|  if (!(cond)) {                                                               \
  |  |  ------------------
  |  |  |  Branch (50:7): [True: 0, False: 1]
  |  |  ------------------
  |  |   51|      0|    __kmp_debug_assert("assertion failure", __FILE__, __LINE__);               \
  |  |   52|      0|  }
  ------------------
 4417|      1|    } else {
 4418|      0|      affinity.type = affinity_none;
 4419|      0|      KMP_AFFINITY_DISABLE();
  ------------------
  |  |  685|      0|#define KMP_AFFINITY_DISABLE() (__kmp_affin_mask_size = 0)
  ------------------
 4420|      0|    }
 4421|      1|  }
 4422|       |
 4423|       |  // If KMP_AFFINITY=none, then only create the single "none" place
 4424|       |  // which is the process's initial affinity mask or the number of
 4425|       |  // hardware threads depending on respect,norespect
 4426|      1|  if (affinity.type == affinity_none) {
  ------------------
  |  Branch (4426:7): [True: 1, False: 0]
  ------------------
 4427|      1|    __kmp_create_affinity_none_places(affinity);
 4428|       |#if KMP_USE_HIER_SCHED
 4429|       |    __kmp_dispatch_set_hierarchy_values();
 4430|       |#endif
 4431|      1|    affinity.flags.initialized = TRUE;
  ------------------
  |  | 1280|      1|#define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  | 1279|      1|#define FALSE 0
  |  |  ------------------
  ------------------
 4432|      1|    return;
 4433|      1|  }
 4434|       |
 4435|      0|  __kmp_topology->set_granularity(affinity);
 4436|      0|  int depth = __kmp_topology->get_depth();
 4437|       |
 4438|       |  // Create the table of masks, indexed by thread Id.
 4439|      0|  unsigned numUnique;
 4440|      0|  __kmp_create_os_id_masks(&numUnique, affinity);
 4441|      0|  if (affinity.gran_levels == 0) {
  ------------------
  |  Branch (4441:7): [True: 0, False: 0]
  ------------------
 4442|      0|    KMP_DEBUG_ASSERT((int)numUnique == __kmp_avail_proc);
 4443|      0|  }
 4444|       |
 4445|      0|  switch (affinity.type) {
 4446|       |
 4447|      0|  case affinity_explicit:
  ------------------
  |  Branch (4447:3): [True: 0, False: 0]
  ------------------
 4448|      0|    KMP_DEBUG_ASSERT(affinity.proclist != NULL);
 4449|      0|    if (is_hidden_helper_affinity ||
  ------------------
  |  Branch (4449:9): [True: 0, False: 0]
  ------------------
 4450|      0|        __kmp_nested_proc_bind.bind_types[0] == proc_bind_intel) {
  ------------------
  |  Branch (4450:9): [True: 0, False: 0]
  ------------------
 4451|      0|      __kmp_affinity_process_proclist(affinity);
 4452|      0|    } else {
 4453|      0|      __kmp_affinity_process_placelist(affinity);
 4454|      0|    }
 4455|      0|    if (affinity.num_masks == 0) {
  ------------------
  |  Branch (4455:9): [True: 0, False: 0]
  ------------------
 4456|      0|      KMP_AFF_WARNING(affinity, AffNoValidProcID);
  ------------------
  |  |  145|      0|  if (s.flags.verbose || (s.flags.warnings && (s.type != affinity_none))) {    \
  |  |  ------------------
  |  |  |  Branch (145:7): [True: 0, False: 0]
  |  |  |  Branch (145:27): [True: 0, False: 0]
  |  |  |  Branch (145:47): [True: 0, False: 0]
  |  |  ------------------
  |  |  146|      0|    KMP_WARNING(__VA_ARGS__);                                                  \
  |  |  ------------------
  |  |  |  |  145|      0|  __kmp_msg(kmp_ms_warning, KMP_MSG(__VA_ARGS__), __kmp_msg_null)
  |  |  |  |  ------------------
  |  |  |  |  |  |  121|      0|#define KMP_MSG(...) __kmp_msg_format(kmp_i18n_msg_##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  147|      0|  }
  ------------------
 4457|      0|      affinity.type = affinity_none;
 4458|      0|      __kmp_create_affinity_none_places(affinity);
 4459|      0|      affinity.flags.initialized = TRUE;
  ------------------
  |  | 1280|      0|#define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  | 1279|      0|#define FALSE 0
  |  |  ------------------
  ------------------
 4460|      0|      return;
 4461|      0|    }
 4462|      0|    break;
 4463|       |
 4464|       |  // The other affinity types rely on sorting the hardware threads according to
 4465|       |  // some permutation of the machine topology tree. Set affinity.compact
 4466|       |  // and affinity.offset appropriately, then jump to a common code
 4467|       |  // fragment to do the sort and create the array of affinity masks.
 4468|      0|  case affinity_logical:
  ------------------
  |  Branch (4468:3): [True: 0, False: 0]
  ------------------
 4469|      0|    affinity.compact = 0;
 4470|      0|    if (affinity.offset) {
  ------------------
  |  Branch (4470:9): [True: 0, False: 0]
  ------------------
 4471|      0|      affinity.offset =
 4472|      0|          __kmp_nThreadsPerCore * affinity.offset % __kmp_avail_proc;
 4473|      0|    }
 4474|      0|    goto sortTopology;
 4475|       |
 4476|      0|  case affinity_physical:
  ------------------
  |  Branch (4476:3): [True: 0, False: 0]
  ------------------
 4477|      0|    if (__kmp_nThreadsPerCore > 1) {
  ------------------
  |  Branch (4477:9): [True: 0, False: 0]
  ------------------
 4478|      0|      affinity.compact = 1;
 4479|      0|      if (affinity.compact >= depth) {
  ------------------
  |  Branch (4479:11): [True: 0, False: 0]
  ------------------
 4480|      0|        affinity.compact = 0;
 4481|      0|      }
 4482|      0|    } else {
 4483|      0|      affinity.compact = 0;
 4484|      0|    }
 4485|      0|    if (affinity.offset) {
  ------------------
  |  Branch (4485:9): [True: 0, False: 0]
  ------------------
 4486|      0|      affinity.offset =
 4487|      0|          __kmp_nThreadsPerCore * affinity.offset % __kmp_avail_proc;
 4488|      0|    }
 4489|      0|    goto sortTopology;
 4490|       |
 4491|      0|  case affinity_scatter:
  ------------------
  |  Branch (4491:3): [True: 0, False: 0]
  ------------------
 4492|      0|    if (affinity.compact >= depth) {
  ------------------
  |  Branch (4492:9): [True: 0, False: 0]
  ------------------
 4493|      0|      affinity.compact = 0;
 4494|      0|    } else {
 4495|      0|      affinity.compact = depth - 1 - affinity.compact;
 4496|      0|    }
 4497|      0|    goto sortTopology;
 4498|       |
 4499|      0|  case affinity_compact:
  ------------------
  |  Branch (4499:3): [True: 0, False: 0]
  ------------------
 4500|      0|    if (affinity.compact >= depth) {
  ------------------
  |  Branch (4500:9): [True: 0, False: 0]
  ------------------
 4501|      0|      affinity.compact = depth - 1;
 4502|      0|    }
 4503|      0|    goto sortTopology;
 4504|       |
 4505|      0|  case affinity_balanced:
  ------------------
  |  Branch (4505:3): [True: 0, False: 0]
  ------------------
 4506|      0|    if (depth <= 1 || is_hidden_helper_affinity) {
  ------------------
  |  Branch (4506:9): [True: 0, False: 0]
  |  Branch (4506:23): [True: 0, False: 0]
  ------------------
 4507|      0|      KMP_AFF_WARNING(affinity, AffBalancedNotAvail, env_var);
  ------------------
  |  |  145|      0|  if (s.flags.verbose || (s.flags.warnings && (s.type != affinity_none))) {    \
  |  |  ------------------
  |  |  |  Branch (145:7): [True: 0, False: 0]
  |  |  |  Branch (145:27): [True: 0, False: 0]
  |  |  |  Branch (145:47): [True: 0, False: 0]
  |  |  ------------------
  |  |  146|      0|    KMP_WARNING(__VA_ARGS__);                                                  \
  |  |  ------------------
  |  |  |  |  145|      0|  __kmp_msg(kmp_ms_warning, KMP_MSG(__VA_ARGS__), __kmp_msg_null)
  |  |  |  |  ------------------
  |  |  |  |  |  |  121|      0|#define KMP_MSG(...) __kmp_msg_format(kmp_i18n_msg_##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  147|      0|  }
  ------------------
 4508|      0|      affinity.type = affinity_none;
 4509|      0|      __kmp_create_affinity_none_places(affinity);
 4510|      0|      affinity.flags.initialized = TRUE;
  ------------------
  |  | 1280|      0|#define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  | 1279|      0|#define FALSE 0
  |  |  ------------------
  ------------------
 4511|      0|      return;
 4512|      0|    } else if (!__kmp_topology->is_uniform()) {
  ------------------
  |  Branch (4512:16): [True: 0, False: 0]
  ------------------
 4513|       |      // Save the depth for further usage
 4514|      0|      __kmp_aff_depth = depth;
 4515|       |
 4516|      0|      int core_level =
 4517|      0|          __kmp_affinity_find_core_level(__kmp_avail_proc, depth - 1);
 4518|      0|      int ncores = __kmp_affinity_compute_ncores(__kmp_avail_proc, depth - 1,
 4519|      0|                                                 core_level);
 4520|      0|      int maxprocpercore = __kmp_affinity_max_proc_per_core(
 4521|      0|          __kmp_avail_proc, depth - 1, core_level);
 4522|       |
 4523|      0|      int nproc = ncores * maxprocpercore;
 4524|      0|      if ((nproc < 2) || (nproc < __kmp_avail_proc)) {
  ------------------
  |  Branch (4524:11): [True: 0, False: 0]
  |  Branch (4524:26): [True: 0, False: 0]
  ------------------
 4525|      0|        KMP_AFF_WARNING(affinity, AffBalancedNotAvail, env_var);
  ------------------
  |  |  145|      0|  if (s.flags.verbose || (s.flags.warnings && (s.type != affinity_none))) {    \
  |  |  ------------------
  |  |  |  Branch (145:7): [True: 0, False: 0]
  |  |  |  Branch (145:27): [True: 0, False: 0]
  |  |  |  Branch (145:47): [True: 0, False: 0]
  |  |  ------------------
  |  |  146|      0|    KMP_WARNING(__VA_ARGS__);                                                  \
  |  |  ------------------
  |  |  |  |  145|      0|  __kmp_msg(kmp_ms_warning, KMP_MSG(__VA_ARGS__), __kmp_msg_null)
  |  |  |  |  ------------------
  |  |  |  |  |  |  121|      0|#define KMP_MSG(...) __kmp_msg_format(kmp_i18n_msg_##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  147|      0|  }
  ------------------
 4526|      0|        affinity.type = affinity_none;
 4527|      0|        __kmp_create_affinity_none_places(affinity);
 4528|      0|        affinity.flags.initialized = TRUE;
  ------------------
  |  | 1280|      0|#define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  | 1279|      0|#define FALSE 0
  |  |  ------------------
  ------------------
 4529|      0|        return;
 4530|      0|      }
 4531|       |
 4532|      0|      procarr = (int *)__kmp_allocate(sizeof(int) * nproc);
  ------------------
  |  | 3617|      0|#define __kmp_allocate(size) ___kmp_allocate((size)KMP_SRC_LOC_CURR)
  ------------------
 4533|      0|      for (int i = 0; i < nproc; i++) {
  ------------------
  |  Branch (4533:23): [True: 0, False: 0]
  ------------------
 4534|      0|        procarr[i] = -1;
 4535|      0|      }
 4536|       |
 4537|      0|      int lastcore = -1;
 4538|      0|      int inlastcore = 0;
 4539|      0|      for (int i = 0; i < __kmp_avail_proc; i++) {
  ------------------
  |  Branch (4539:23): [True: 0, False: 0]
  ------------------
 4540|      0|        int proc = __kmp_topology->at(i).os_id;
 4541|      0|        int core = __kmp_affinity_find_core(i, depth - 1, core_level);
 4542|       |
 4543|      0|        if (core == lastcore) {
  ------------------
  |  Branch (4543:13): [True: 0, False: 0]
  ------------------
 4544|      0|          inlastcore++;
 4545|      0|        } else {
 4546|      0|          inlastcore = 0;
 4547|      0|        }
 4548|      0|        lastcore = core;
 4549|       |
 4550|      0|        procarr[core * maxprocpercore + inlastcore] = proc;
 4551|      0|      }
 4552|      0|    }
 4553|      0|    if (affinity.compact >= depth) {
  ------------------
  |  Branch (4553:9): [True: 0, False: 0]
  ------------------
 4554|      0|      affinity.compact = depth - 1;
 4555|      0|    }
 4556|       |
 4557|      0|  sortTopology:
 4558|       |    // Allocate the gtid->affinity mask table.
 4559|      0|    if (affinity.flags.dups) {
  ------------------
  |  Branch (4559:9): [True: 0, False: 0]
  ------------------
 4560|      0|      affinity.num_masks = __kmp_avail_proc;
 4561|      0|    } else {
 4562|      0|      affinity.num_masks = numUnique;
 4563|      0|    }
 4564|       |
 4565|      0|    if ((__kmp_nested_proc_bind.bind_types[0] != proc_bind_intel) &&
  ------------------
  |  Branch (4565:9): [True: 0, False: 0]
  ------------------
 4566|      0|        (__kmp_affinity_num_places > 0) &&
  ------------------
  |  Branch (4566:9): [True: 0, False: 0]
  ------------------
 4567|      0|        ((unsigned)__kmp_affinity_num_places < affinity.num_masks) &&
  ------------------
  |  Branch (4567:9): [True: 0, False: 0]
  ------------------
 4568|      0|        !is_hidden_helper_affinity) {
  ------------------
  |  Branch (4568:9): [True: 0, False: 0]
  ------------------
 4569|      0|      affinity.num_masks = __kmp_affinity_num_places;
 4570|      0|    }
 4571|       |
 4572|      0|    KMP_CPU_ALLOC_ARRAY(affinity.masks, affinity.num_masks);
  ------------------
  |  |  705|      0|  (arr = __kmp_affinity_dispatch->allocate_mask_array(n))
  ------------------
 4573|       |
 4574|       |    // Sort the topology table according to the current setting of
 4575|       |    // affinity.compact, then fill out affinity.masks.
 4576|      0|    __kmp_topology->sort_compact(affinity);
 4577|      0|    {
 4578|      0|      int i;
 4579|      0|      unsigned j;
 4580|      0|      int num_hw_threads = __kmp_topology->get_num_hw_threads();
 4581|      0|      for (i = 0, j = 0; i < num_hw_threads; i++) {
  ------------------
  |  Branch (4581:26): [True: 0, False: 0]
  ------------------
 4582|      0|        if ((!affinity.flags.dups) && (!__kmp_topology->at(i).leader)) {
  ------------------
  |  Branch (4582:13): [True: 0, False: 0]
  |  Branch (4582:39): [True: 0, False: 0]
  ------------------
 4583|      0|          continue;
 4584|      0|        }
 4585|      0|        int osId = __kmp_topology->at(i).os_id;
 4586|       |
 4587|      0|        kmp_affin_mask_t *src = KMP_CPU_INDEX(affinity.os_id_masks, osId);
  ------------------
  |  |  703|      0|#define KMP_CPU_INDEX(arr, i) __kmp_affinity_dispatch->index_mask_array(arr, i)
  ------------------
 4588|      0|        kmp_affin_mask_t *dest = KMP_CPU_INDEX(affinity.masks, j);
  ------------------
  |  |  703|      0|#define KMP_CPU_INDEX(arr, i) __kmp_affinity_dispatch->index_mask_array(arr, i)
  ------------------
 4589|      0|        KMP_ASSERT(KMP_CPU_ISSET(osId, src));
  ------------------
  |  |   50|      0|  if (!(cond)) {                                                               \
  |  |  ------------------
  |  |  |  Branch (50:7): [True: 0, False: 0]
  |  |  ------------------
  |  |   51|      0|    __kmp_debug_assert("assertion failure", __FILE__, __LINE__);               \
  |  |   52|      0|  }
  ------------------
 4590|      0|        KMP_CPU_COPY(dest, src);
  ------------------
  |  |  693|      0|#define KMP_CPU_COPY(dest, src) (dest)->copy(src)
  ------------------
 4591|      0|        if (++j >= affinity.num_masks) {
  ------------------
  |  Branch (4591:13): [True: 0, False: 0]
  ------------------
 4592|      0|          break;
 4593|      0|        }
 4594|      0|      }
 4595|      0|      KMP_DEBUG_ASSERT(j == affinity.num_masks);
 4596|      0|    }
 4597|       |    // Sort the topology back using ids
 4598|      0|    __kmp_topology->sort_ids();
 4599|      0|    break;
 4600|       |
 4601|      0|  default:
  ------------------
  |  Branch (4601:3): [True: 0, False: 0]
  ------------------
 4602|      0|    KMP_ASSERT2(0, "Unexpected affinity setting");
  ------------------
  |  |   53|      0|#define KMP_ASSERT2(cond, msg) KMP_ASSERT(cond)
  |  |  ------------------
  |  |  |  |   50|      0|  if (!(cond)) {                                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (50:7): [True: 0, Folded]
  |  |  |  |  ------------------
  |  |  |  |   51|      0|    __kmp_debug_assert("assertion failure", __FILE__, __LINE__);               \
  |  |  |  |   52|      0|  }
  |  |  ------------------
  ------------------
 4603|      0|  }
 4604|      0|  __kmp_affinity_get_topology_info(affinity);
 4605|      0|  affinity.flags.initialized = TRUE;
  ------------------
  |  | 1280|      0|#define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  | 1279|      0|#define FALSE 0
  |  |  ------------------
  ------------------
 4606|      0|}
kmp_affinity.cpp:_ZL35__kmp_aux_affinity_initialize_masksR14kmp_affinity_t:
 4160|      1|static void __kmp_aux_affinity_initialize_masks(kmp_affinity_t &affinity) {
 4161|       |  // Create the "full" mask - this defines all of the processors that we
 4162|       |  // consider to be in the machine model. If respect is set, then it is the
 4163|       |  // initialization thread's affinity mask. Otherwise, it is all processors that
 4164|       |  // we know about on the machine.
 4165|      1|  int verbose = affinity.flags.verbose;
 4166|      1|  const char *env_var = affinity.env_var;
 4167|       |
 4168|       |  // Already initialized
 4169|      1|  if (__kmp_affin_fullMask && __kmp_affin_origMask)
  ------------------
  |  Branch (4169:7): [True: 0, False: 1]
  |  Branch (4169:31): [True: 0, False: 0]
  ------------------
 4170|      0|    return;
 4171|       |
 4172|      1|  if (__kmp_affin_fullMask == NULL) {
  ------------------
  |  Branch (4172:7): [True: 1, False: 0]
  ------------------
 4173|      1|    KMP_CPU_ALLOC(__kmp_affin_fullMask);
  ------------------
  |  |  697|      1|#define KMP_CPU_ALLOC(ptr) (ptr = __kmp_affinity_dispatch->allocate_mask())
  ------------------
 4174|      1|  }
 4175|      1|  if (__kmp_affin_origMask == NULL) {
  ------------------
  |  Branch (4175:7): [True: 1, False: 0]
  ------------------
 4176|      1|    KMP_CPU_ALLOC(__kmp_affin_origMask);
  ------------------
  |  |  697|      1|#define KMP_CPU_ALLOC(ptr) (ptr = __kmp_affinity_dispatch->allocate_mask())
  ------------------
 4177|      1|  }
 4178|      1|  if (KMP_AFFINITY_CAPABLE()) {
  ------------------
  |  |  684|      1|#define KMP_AFFINITY_CAPABLE() (__kmp_affin_mask_size > 0)
  |  |  ------------------
  |  |  |  Branch (684:32): [True: 1, False: 0]
  |  |  ------------------
  ------------------
 4179|      1|    __kmp_get_system_affinity(__kmp_affin_fullMask, TRUE);
  ------------------
  |  |  711|      1|  (mask)->get_system_affinity(abort_bool)
  ------------------
 4180|       |    // Make a copy before possible expanding to the entire machine mask
 4181|      1|    __kmp_affin_origMask->copy(__kmp_affin_fullMask);
 4182|      1|    if (affinity.flags.respect) {
  ------------------
  |  Branch (4182:9): [True: 1, False: 0]
  ------------------
 4183|       |      // Count the number of available processors.
 4184|      1|      unsigned i;
 4185|      1|      __kmp_avail_proc = 0;
 4186|     32|      KMP_CPU_SET_ITERATE(i, __kmp_affin_fullMask) {
  ------------------
  |  |  688|     33|  for (i = (mask)->begin(); (int)i != (mask)->end(); i = (mask)->next(i))
  |  |  ------------------
  |  |  |  Branch (688:29): [True: 32, False: 1]
  |  |  ------------------
  ------------------
 4187|     32|        if (!KMP_CPU_ISSET(i, __kmp_affin_fullMask)) {
  ------------------
  |  |  690|     32|#define KMP_CPU_ISSET(i, mask) (mask)->is_set(i)
  ------------------
  |  Branch (4187:13): [True: 0, False: 32]
  ------------------
 4188|      0|          continue;
 4189|      0|        }
 4190|     32|        __kmp_avail_proc++;
 4191|     32|      }
 4192|      1|      if (__kmp_avail_proc > __kmp_xproc) {
  ------------------
  |  Branch (4192:11): [True: 0, False: 1]
  ------------------
 4193|      0|        KMP_AFF_WARNING(affinity, ErrorInitializeAffinity);
  ------------------
  |  |  145|      0|  if (s.flags.verbose || (s.flags.warnings && (s.type != affinity_none))) {    \
  |  |  ------------------
  |  |  |  Branch (145:7): [True: 0, False: 0]
  |  |  |  Branch (145:27): [True: 0, False: 0]
  |  |  |  Branch (145:47): [True: 0, False: 0]
  |  |  ------------------
  |  |  146|      0|    KMP_WARNING(__VA_ARGS__);                                                  \
  |  |  ------------------
  |  |  |  |  145|      0|  __kmp_msg(kmp_ms_warning, KMP_MSG(__VA_ARGS__), __kmp_msg_null)
  |  |  |  |  ------------------
  |  |  |  |  |  |  121|      0|#define KMP_MSG(...) __kmp_msg_format(kmp_i18n_msg_##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  147|      0|  }
  ------------------
 4194|      0|        affinity.type = affinity_none;
 4195|      0|        KMP_AFFINITY_DISABLE();
  ------------------
  |  |  685|      0|#define KMP_AFFINITY_DISABLE() (__kmp_affin_mask_size = 0)
  ------------------
 4196|      0|        return;
 4197|      0|      }
 4198|       |
 4199|      1|      if (verbose) {
  ------------------
  |  Branch (4199:11): [True: 0, False: 1]
  ------------------
 4200|      0|        char buf[KMP_AFFIN_MASK_PRINT_LEN];
 4201|      0|        __kmp_affinity_print_mask(buf, KMP_AFFIN_MASK_PRINT_LEN,
  ------------------
  |  |  828|      0|#define KMP_AFFIN_MASK_PRINT_LEN 1024
  ------------------
 4202|      0|                                  __kmp_affin_fullMask);
 4203|      0|        KMP_INFORM(InitOSProcSetRespect, env_var, buf);
  ------------------
  |  |  143|      0|  __kmp_msg(kmp_ms_inform, KMP_MSG(__VA_ARGS__), __kmp_msg_null)
  |  |  ------------------
  |  |  |  |  121|      0|#define KMP_MSG(...) __kmp_msg_format(kmp_i18n_msg_##__VA_ARGS__)
  |  |  ------------------
  ------------------
 4204|      0|      }
 4205|      1|    } else {
 4206|      0|      if (verbose) {
  ------------------
  |  Branch (4206:11): [True: 0, False: 0]
  ------------------
 4207|      0|        char buf[KMP_AFFIN_MASK_PRINT_LEN];
 4208|      0|        __kmp_affinity_print_mask(buf, KMP_AFFIN_MASK_PRINT_LEN,
  ------------------
  |  |  828|      0|#define KMP_AFFIN_MASK_PRINT_LEN 1024
  ------------------
 4209|      0|                                  __kmp_affin_fullMask);
 4210|      0|        KMP_INFORM(InitOSProcSetNotRespect, env_var, buf);
  ------------------
  |  |  143|      0|  __kmp_msg(kmp_ms_inform, KMP_MSG(__VA_ARGS__), __kmp_msg_null)
  |  |  ------------------
  |  |  |  |  121|      0|#define KMP_MSG(...) __kmp_msg_format(kmp_i18n_msg_##__VA_ARGS__)
  |  |  ------------------
  ------------------
 4211|      0|      }
 4212|      0|      __kmp_avail_proc =
 4213|      0|          __kmp_affinity_entire_machine_mask(__kmp_affin_fullMask);
 4214|       |#if KMP_OS_WINDOWS
 4215|       |      if (__kmp_num_proc_groups <= 1) {
 4216|       |        // Copy expanded full mask if topology has single processor group
 4217|       |        __kmp_affin_origMask->copy(__kmp_affin_fullMask);
 4218|       |      }
 4219|       |      // Set the process affinity mask since threads' affinity
 4220|       |      // masks must be subset of process mask in Windows* OS
 4221|       |      __kmp_affin_fullMask->set_process_affinity(true);
 4222|       |#endif
 4223|      0|    }
 4224|      1|  }
 4225|      1|}
kmp_affinity.cpp:_ZL38__kmp_aux_affinity_initialize_topologyR14kmp_affinity_t:
 4227|      1|static bool __kmp_aux_affinity_initialize_topology(kmp_affinity_t &affinity) {
 4228|      1|  bool success = false;
 4229|      1|  const char *env_var = affinity.env_var;
 4230|      1|  kmp_i18n_id_t msg_id = kmp_i18n_null;
 4231|      1|  int verbose = affinity.flags.verbose;
 4232|       |
 4233|       |  // For backward compatibility, setting KMP_CPUINFO_FILE =>
 4234|       |  // KMP_TOPOLOGY_METHOD=cpuinfo
 4235|      1|  if ((__kmp_cpuinfo_file != NULL) &&
  ------------------
  |  Branch (4235:7): [True: 0, False: 1]
  ------------------
 4236|      0|      (__kmp_affinity_top_method == affinity_top_method_all)) {
  ------------------
  |  Branch (4236:7): [True: 0, False: 0]
  ------------------
 4237|      0|    __kmp_affinity_top_method = affinity_top_method_cpuinfo;
 4238|      0|  }
 4239|       |
 4240|      1|  if (__kmp_affinity_top_method == affinity_top_method_all) {
  ------------------
  |  Branch (4240:7): [True: 1, False: 0]
  ------------------
 4241|       |// In the default code path, errors are not fatal - we just try using
 4242|       |// another method. We only emit a warning message if affinity is on, or the
 4243|       |// verbose flag is set, an the nowarnings flag was not set.
 4244|       |#if KMP_USE_HWLOC
 4245|       |    if (!success &&
 4246|       |        __kmp_affinity_dispatch->get_api_type() == KMPAffinity::HWLOC) {
 4247|       |      if (!__kmp_hwloc_error) {
 4248|       |        success = __kmp_affinity_create_hwloc_map(&msg_id);
 4249|       |        if (!success && verbose) {
 4250|       |          KMP_INFORM(AffIgnoringHwloc, env_var);
 4251|       |        }
 4252|       |      } else if (verbose) {
 4253|       |        KMP_INFORM(AffIgnoringHwloc, env_var);
 4254|       |      }
 4255|       |    }
 4256|       |#endif
 4257|       |
 4258|      1|#if KMP_ARCH_X86 || KMP_ARCH_X86_64
 4259|      1|    if (!success) {
  ------------------
  |  Branch (4259:9): [True: 1, False: 0]
  ------------------
 4260|      1|      success = __kmp_affinity_create_x2apicid_map(&msg_id);
 4261|      1|      if (!success && verbose && msg_id != kmp_i18n_null) {
  ------------------
  |  Branch (4261:11): [True: 0, False: 1]
  |  Branch (4261:23): [True: 0, False: 0]
  |  Branch (4261:34): [True: 0, False: 0]
  ------------------
 4262|      0|        KMP_INFORM(AffInfoStr, env_var, __kmp_i18n_catgets(msg_id));
  ------------------
  |  |  143|      0|  __kmp_msg(kmp_ms_inform, KMP_MSG(__VA_ARGS__), __kmp_msg_null)
  |  |  ------------------
  |  |  |  |  121|      0|#define KMP_MSG(...) __kmp_msg_format(kmp_i18n_msg_##__VA_ARGS__)
  |  |  ------------------
  ------------------
 4263|      0|      }
 4264|      1|    }
 4265|      1|    if (!success) {
  ------------------
  |  Branch (4265:9): [True: 0, False: 1]
  ------------------
 4266|      0|      success = __kmp_affinity_create_apicid_map(&msg_id);
 4267|      0|      if (!success && verbose && msg_id != kmp_i18n_null) {
  ------------------
  |  Branch (4267:11): [True: 0, False: 0]
  |  Branch (4267:23): [True: 0, False: 0]
  |  Branch (4267:34): [True: 0, False: 0]
  ------------------
 4268|      0|        KMP_INFORM(AffInfoStr, env_var, __kmp_i18n_catgets(msg_id));
  ------------------
  |  |  143|      0|  __kmp_msg(kmp_ms_inform, KMP_MSG(__VA_ARGS__), __kmp_msg_null)
  |  |  ------------------
  |  |  |  |  121|      0|#define KMP_MSG(...) __kmp_msg_format(kmp_i18n_msg_##__VA_ARGS__)
  |  |  ------------------
  ------------------
 4269|      0|      }
 4270|      0|    }
 4271|      1|#endif /* KMP_ARCH_X86 || KMP_ARCH_X86_64 */
 4272|       |
 4273|      1|#if KMP_OS_LINUX
 4274|      1|    if (!success) {
  ------------------
  |  Branch (4274:9): [True: 0, False: 1]
  ------------------
 4275|      0|      int line = 0;
 4276|      0|      success = __kmp_affinity_create_cpuinfo_map(&line, &msg_id);
 4277|      0|      if (!success && verbose && msg_id != kmp_i18n_null) {
  ------------------
  |  Branch (4277:11): [True: 0, False: 0]
  |  Branch (4277:23): [True: 0, False: 0]
  |  Branch (4277:34): [True: 0, False: 0]
  ------------------
 4278|      0|        KMP_INFORM(AffInfoStr, env_var, __kmp_i18n_catgets(msg_id));
  ------------------
  |  |  143|      0|  __kmp_msg(kmp_ms_inform, KMP_MSG(__VA_ARGS__), __kmp_msg_null)
  |  |  ------------------
  |  |  |  |  121|      0|#define KMP_MSG(...) __kmp_msg_format(kmp_i18n_msg_##__VA_ARGS__)
  |  |  ------------------
  ------------------
 4279|      0|      }
 4280|      0|    }
 4281|      1|#endif /* KMP_OS_LINUX */
 4282|       |
 4283|       |#if KMP_GROUP_AFFINITY
 4284|       |    if (!success && (__kmp_num_proc_groups > 1)) {
 4285|       |      success = __kmp_affinity_create_proc_group_map(&msg_id);
 4286|       |      if (!success && verbose && msg_id != kmp_i18n_null) {
 4287|       |        KMP_INFORM(AffInfoStr, env_var, __kmp_i18n_catgets(msg_id));
 4288|       |      }
 4289|       |    }
 4290|       |#endif /* KMP_GROUP_AFFINITY */
 4291|       |
 4292|      1|    if (!success) {
  ------------------
  |  Branch (4292:9): [True: 0, False: 1]
  ------------------
 4293|      0|      success = __kmp_affinity_create_flat_map(&msg_id);
 4294|      0|      if (!success && verbose && msg_id != kmp_i18n_null) {
  ------------------
  |  Branch (4294:11): [True: 0, False: 0]
  |  Branch (4294:23): [True: 0, False: 0]
  |  Branch (4294:34): [True: 0, False: 0]
  ------------------
 4295|      0|        KMP_INFORM(AffInfoStr, env_var, __kmp_i18n_catgets(msg_id));
  ------------------
  |  |  143|      0|  __kmp_msg(kmp_ms_inform, KMP_MSG(__VA_ARGS__), __kmp_msg_null)
  |  |  ------------------
  |  |  |  |  121|      0|#define KMP_MSG(...) __kmp_msg_format(kmp_i18n_msg_##__VA_ARGS__)
  |  |  ------------------
  ------------------
 4296|      0|      }
 4297|      0|      KMP_ASSERT(success);
  ------------------
  |  |   50|      0|  if (!(cond)) {                                                               \
  |  |  ------------------
  |  |  |  Branch (50:7): [True: 0, False: 0]
  |  |  ------------------
  |  |   51|      0|    __kmp_debug_assert("assertion failure", __FILE__, __LINE__);               \
  |  |   52|      0|  }
  ------------------
 4298|      0|    }
 4299|      1|  }
 4300|       |
 4301|       |// If the user has specified that a paricular topology discovery method is to be
 4302|       |// used, then we abort if that method fails. The exception is group affinity,
 4303|       |// which might have been implicitly set.
 4304|       |#if KMP_USE_HWLOC
 4305|       |  else if (__kmp_affinity_top_method == affinity_top_method_hwloc) {
 4306|       |    KMP_ASSERT(__kmp_affinity_dispatch->get_api_type() == KMPAffinity::HWLOC);
 4307|       |    success = __kmp_affinity_create_hwloc_map(&msg_id);
 4308|       |    if (!success) {
 4309|       |      KMP_ASSERT(msg_id != kmp_i18n_null);
 4310|       |      KMP_FATAL(MsgExiting, __kmp_i18n_catgets(msg_id));
 4311|       |    }
 4312|       |  }
 4313|       |#endif // KMP_USE_HWLOC
 4314|       |
 4315|      0|#if KMP_ARCH_X86 || KMP_ARCH_X86_64
 4316|      0|  else if (__kmp_affinity_top_method == affinity_top_method_x2apicid ||
  ------------------
  |  Branch (4316:12): [True: 0, False: 0]
  ------------------
 4317|      0|           __kmp_affinity_top_method == affinity_top_method_x2apicid_1f) {
  ------------------
  |  Branch (4317:12): [True: 0, False: 0]
  ------------------
 4318|      0|    success = __kmp_affinity_create_x2apicid_map(&msg_id);
 4319|      0|    if (!success) {
  ------------------
  |  Branch (4319:9): [True: 0, False: 0]
  ------------------
 4320|      0|      KMP_ASSERT(msg_id != kmp_i18n_null);
  ------------------
  |  |   50|      0|  if (!(cond)) {                                                               \
  |  |  ------------------
  |  |  |  Branch (50:7): [True: 0, False: 0]
  |  |  ------------------
  |  |   51|      0|    __kmp_debug_assert("assertion failure", __FILE__, __LINE__);               \
  |  |   52|      0|  }
  ------------------
 4321|      0|      KMP_FATAL(MsgExiting, __kmp_i18n_catgets(msg_id));
  ------------------
  |  |  146|      0|#define KMP_FATAL(...) __kmp_fatal(KMP_MSG(__VA_ARGS__), __kmp_msg_null)
  |  |  ------------------
  |  |  |  |  121|      0|#define KMP_MSG(...) __kmp_msg_format(kmp_i18n_msg_##__VA_ARGS__)
  |  |  ------------------
  ------------------
 4322|      0|    }
 4323|      0|  } else if (__kmp_affinity_top_method == affinity_top_method_apicid) {
  ------------------
  |  Branch (4323:14): [True: 0, False: 0]
  ------------------
 4324|      0|    success = __kmp_affinity_create_apicid_map(&msg_id);
 4325|      0|    if (!success) {
  ------------------
  |  Branch (4325:9): [True: 0, False: 0]
  ------------------
 4326|      0|      KMP_ASSERT(msg_id != kmp_i18n_null);
  ------------------
  |  |   50|      0|  if (!(cond)) {                                                               \
  |  |  ------------------
  |  |  |  Branch (50:7): [True: 0, False: 0]
  |  |  ------------------
  |  |   51|      0|    __kmp_debug_assert("assertion failure", __FILE__, __LINE__);               \
  |  |   52|      0|  }
  ------------------
 4327|      0|      KMP_FATAL(MsgExiting, __kmp_i18n_catgets(msg_id));
  ------------------
  |  |  146|      0|#define KMP_FATAL(...) __kmp_fatal(KMP_MSG(__VA_ARGS__), __kmp_msg_null)
  |  |  ------------------
  |  |  |  |  121|      0|#define KMP_MSG(...) __kmp_msg_format(kmp_i18n_msg_##__VA_ARGS__)
  |  |  ------------------
  ------------------
 4328|      0|    }
 4329|      0|  }
 4330|      0|#endif /* KMP_ARCH_X86 || KMP_ARCH_X86_64 */
 4331|       |
 4332|      0|  else if (__kmp_affinity_top_method == affinity_top_method_cpuinfo) {
  ------------------
  |  Branch (4332:12): [True: 0, False: 0]
  ------------------
 4333|      0|    int line = 0;
 4334|      0|    success = __kmp_affinity_create_cpuinfo_map(&line, &msg_id);
 4335|      0|    if (!success) {
  ------------------
  |  Branch (4335:9): [True: 0, False: 0]
  ------------------
 4336|      0|      KMP_ASSERT(msg_id != kmp_i18n_null);
  ------------------
  |  |   50|      0|  if (!(cond)) {                                                               \
  |  |  ------------------
  |  |  |  Branch (50:7): [True: 0, False: 0]
  |  |  ------------------
  |  |   51|      0|    __kmp_debug_assert("assertion failure", __FILE__, __LINE__);               \
  |  |   52|      0|  }
  ------------------
 4337|      0|      const char *filename = __kmp_cpuinfo_get_filename();
 4338|      0|      if (line > 0) {
  ------------------
  |  Branch (4338:11): [True: 0, False: 0]
  ------------------
 4339|      0|        KMP_FATAL(FileLineMsgExiting, filename, line,
  ------------------
  |  |  146|      0|#define KMP_FATAL(...) __kmp_fatal(KMP_MSG(__VA_ARGS__), __kmp_msg_null)
  |  |  ------------------
  |  |  |  |  121|      0|#define KMP_MSG(...) __kmp_msg_format(kmp_i18n_msg_##__VA_ARGS__)
  |  |  ------------------
  ------------------
 4340|      0|                  __kmp_i18n_catgets(msg_id));
 4341|      0|      } else {
 4342|      0|        KMP_FATAL(FileMsgExiting, filename, __kmp_i18n_catgets(msg_id));
  ------------------
  |  |  146|      0|#define KMP_FATAL(...) __kmp_fatal(KMP_MSG(__VA_ARGS__), __kmp_msg_null)
  |  |  ------------------
  |  |  |  |  121|      0|#define KMP_MSG(...) __kmp_msg_format(kmp_i18n_msg_##__VA_ARGS__)
  |  |  ------------------
  ------------------
 4343|      0|      }
 4344|      0|    }
 4345|      0|  }
 4346|       |
 4347|       |#if KMP_GROUP_AFFINITY
 4348|       |  else if (__kmp_affinity_top_method == affinity_top_method_group) {
 4349|       |    success = __kmp_affinity_create_proc_group_map(&msg_id);
 4350|       |    KMP_ASSERT(success);
 4351|       |    if (!success) {
 4352|       |      KMP_ASSERT(msg_id != kmp_i18n_null);
 4353|       |      KMP_FATAL(MsgExiting, __kmp_i18n_catgets(msg_id));
 4354|       |    }
 4355|       |  }
 4356|       |#endif /* KMP_GROUP_AFFINITY */
 4357|       |
 4358|      0|  else if (__kmp_affinity_top_method == affinity_top_method_flat) {
  ------------------
  |  Branch (4358:12): [True: 0, False: 0]
  ------------------
 4359|      0|    success = __kmp_affinity_create_flat_map(&msg_id);
 4360|       |    // should not fail
 4361|      0|    KMP_ASSERT(success);
  ------------------
  |  |   50|      0|  if (!(cond)) {                                                               \
  |  |  ------------------
  |  |  |  Branch (50:7): [True: 0, False: 0]
  |  |  ------------------
  |  |   51|      0|    __kmp_debug_assert("assertion failure", __FILE__, __LINE__);               \
  |  |   52|      0|  }
  ------------------
 4362|      0|  }
 4363|       |
 4364|       |  // Early exit if topology could not be created
 4365|      1|  if (!__kmp_topology) {
  ------------------
  |  Branch (4365:7): [True: 0, False: 1]
  ------------------
 4366|      0|    if (KMP_AFFINITY_CAPABLE()) {
  ------------------
  |  |  684|      0|#define KMP_AFFINITY_CAPABLE() (__kmp_affin_mask_size > 0)
  |  |  ------------------
  |  |  |  Branch (684:32): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 4367|      0|      KMP_AFF_WARNING(affinity, ErrorInitializeAffinity);
  ------------------
  |  |  145|      0|  if (s.flags.verbose || (s.flags.warnings && (s.type != affinity_none))) {    \
  |  |  ------------------
  |  |  |  Branch (145:7): [True: 0, False: 0]
  |  |  |  Branch (145:27): [True: 0, False: 0]
  |  |  |  Branch (145:47): [True: 0, False: 0]
  |  |  ------------------
  |  |  146|      0|    KMP_WARNING(__VA_ARGS__);                                                  \
  |  |  ------------------
  |  |  |  |  145|      0|  __kmp_msg(kmp_ms_warning, KMP_MSG(__VA_ARGS__), __kmp_msg_null)
  |  |  |  |  ------------------
  |  |  |  |  |  |  121|      0|#define KMP_MSG(...) __kmp_msg_format(kmp_i18n_msg_##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  147|      0|  }
  ------------------
 4368|      0|    }
 4369|      0|    if (nPackages > 0 && nCoresPerPkg > 0 && __kmp_nThreadsPerCore > 0 &&
  ------------------
  |  Branch (4369:9): [True: 0, False: 0]
  |  Branch (4369:26): [True: 0, False: 0]
  |  Branch (4369:46): [True: 0, False: 0]
  ------------------
 4370|      0|        __kmp_ncores > 0) {
  ------------------
  |  Branch (4370:9): [True: 0, False: 0]
  ------------------
 4371|      0|      __kmp_topology = kmp_topology_t::allocate(0, 0, NULL);
 4372|      0|      __kmp_topology->canonicalize(nPackages, nCoresPerPkg,
 4373|      0|                                   __kmp_nThreadsPerCore, __kmp_ncores);
 4374|      0|      if (verbose) {
  ------------------
  |  Branch (4374:11): [True: 0, False: 0]
  ------------------
 4375|      0|        __kmp_topology->print(env_var);
 4376|      0|      }
 4377|      0|    }
 4378|      0|    return false;
 4379|      0|  }
 4380|       |
 4381|       |  // Canonicalize, print (if requested), apply KMP_HW_SUBSET
 4382|      1|  __kmp_topology->canonicalize();
 4383|      1|  if (verbose)
  ------------------
  |  Branch (4383:7): [True: 0, False: 1]
  ------------------
 4384|      0|    __kmp_topology->print(env_var);
 4385|      1|  bool filtered = __kmp_topology->filter_hw_subset();
 4386|      1|  if (filtered) {
  ------------------
  |  Branch (4386:7): [True: 0, False: 1]
  ------------------
 4387|       |#if KMP_OS_WINDOWS
 4388|       |    // Copy filtered full mask if topology has single processor group
 4389|       |    if (__kmp_num_proc_groups <= 1)
 4390|       |#endif
 4391|      0|      __kmp_affin_origMask->copy(__kmp_affin_fullMask);
 4392|      0|  }
 4393|      1|  if (filtered && verbose)
  ------------------
  |  Branch (4393:7): [True: 0, False: 1]
  |  Branch (4393:19): [True: 0, False: 0]
  ------------------
 4394|      0|    __kmp_topology->print("KMP_HW_SUBSET");
 4395|      1|  return success;
 4396|      1|}
kmp_affinity.cpp:_ZL34__kmp_affinity_create_x2apicid_mapP11kmp_i18n_id:
 2510|      1|static bool __kmp_affinity_create_x2apicid_map(kmp_i18n_id_t *const msg_id) {
 2511|       |
 2512|      1|  cpuid_level_info_t levels[INTEL_LEVEL_TYPE_LAST];
 2513|      1|  kmp_hw_t types[INTEL_LEVEL_TYPE_LAST];
 2514|      1|  unsigned levels_index;
 2515|      1|  kmp_cpuid buf;
 2516|      1|  kmp_uint64 known_levels;
 2517|      1|  int topology_leaf, highest_leaf, apic_id;
 2518|      1|  int num_leaves;
 2519|      1|  static int leaves[] = {0, 0};
 2520|       |
 2521|      1|  kmp_i18n_id_t leaf_message_id;
 2522|       |
 2523|      1|  KMP_BUILD_ASSERT(sizeof(known_levels) * CHAR_BIT > KMP_HW_LAST);
  ------------------
  |  |   26|      1|#define KMP_BUILD_ASSERT(expr) static_assert(expr, "Build condition error")
  ------------------
 2524|       |
 2525|      1|  *msg_id = kmp_i18n_null;
 2526|      1|  if (__kmp_affinity.flags.verbose) {
  ------------------
  |  Branch (2526:7): [True: 0, False: 1]
  ------------------
 2527|      0|    KMP_INFORM(AffInfoStr, "KMP_AFFINITY", KMP_I18N_STR(Decodingx2APIC));
  ------------------
  |  |  143|      0|  __kmp_msg(kmp_ms_inform, KMP_MSG(__VA_ARGS__), __kmp_msg_null)
  |  |  ------------------
  |  |  |  |  121|      0|#define KMP_MSG(...) __kmp_msg_format(kmp_i18n_msg_##__VA_ARGS__)
  |  |  ------------------
  ------------------
 2528|      0|  }
 2529|       |
 2530|       |  // Figure out the known topology levels
 2531|      1|  known_levels = 0ull;
 2532|      7|  for (int i = 0; i < INTEL_LEVEL_TYPE_LAST; ++i) {
  ------------------
  |  Branch (2532:19): [True: 6, False: 1]
  ------------------
 2533|      6|    if (__kmp_intel_type_2_topology_type(i) != KMP_HW_UNKNOWN) {
  ------------------
  |  Branch (2533:9): [True: 6, False: 0]
  ------------------
 2534|      6|      known_levels |= (1ull << i);
 2535|      6|    }
 2536|      6|  }
 2537|       |
 2538|       |  // Get the highest cpuid leaf supported
 2539|      1|  __kmp_x86_cpuid(0, 0, &buf);
 2540|      1|  highest_leaf = buf.eax;
 2541|       |
 2542|       |  // If a specific topology method was requested, only allow that specific leaf
 2543|       |  // otherwise, try both leaves 31 and 11 in that order
 2544|      1|  num_leaves = 0;
 2545|      1|  if (__kmp_affinity_top_method == affinity_top_method_x2apicid) {
  ------------------
  |  Branch (2545:7): [True: 0, False: 1]
  ------------------
 2546|      0|    num_leaves = 1;
 2547|      0|    leaves[0] = 11;
 2548|      0|    leaf_message_id = kmp_i18n_str_NoLeaf11Support;
 2549|      1|  } else if (__kmp_affinity_top_method == affinity_top_method_x2apicid_1f) {
  ------------------
  |  Branch (2549:14): [True: 0, False: 1]
  ------------------
 2550|      0|    num_leaves = 1;
 2551|      0|    leaves[0] = 31;
 2552|      0|    leaf_message_id = kmp_i18n_str_NoLeaf31Support;
 2553|      1|  } else {
 2554|      1|    num_leaves = 2;
 2555|      1|    leaves[0] = 31;
 2556|      1|    leaves[1] = 11;
 2557|      1|    leaf_message_id = kmp_i18n_str_NoLeaf11Support;
 2558|      1|  }
 2559|       |
 2560|       |  // Check to see if cpuid leaf 31 or 11 is supported.
 2561|      1|  __kmp_nThreadsPerCore = nCoresPerPkg = nPackages = 1;
 2562|      1|  topology_leaf = -1;
 2563|      2|  for (int i = 0; i < num_leaves; ++i) {
  ------------------
  |  Branch (2563:19): [True: 2, False: 0]
  ------------------
 2564|      2|    int leaf = leaves[i];
 2565|      2|    if (highest_leaf < leaf)
  ------------------
  |  Branch (2565:9): [True: 1, False: 1]
  ------------------
 2566|      1|      continue;
 2567|      1|    __kmp_x86_cpuid(leaf, 0, &buf);
 2568|      1|    if (buf.ebx == 0)
  ------------------
  |  Branch (2568:9): [True: 0, False: 1]
  ------------------
 2569|      0|      continue;
 2570|      1|    topology_leaf = leaf;
 2571|      1|    levels_index = __kmp_x2apicid_get_levels(leaf, levels, known_levels);
 2572|      1|    if (levels_index == 0)
  ------------------
  |  Branch (2572:9): [True: 0, False: 1]
  ------------------
 2573|      0|      continue;
 2574|      1|    break;
 2575|      1|  }
 2576|      1|  if (topology_leaf == -1 || levels_index == 0) {
  ------------------
  |  Branch (2576:7): [True: 0, False: 1]
  |  Branch (2576:30): [True: 0, False: 1]
  ------------------
 2577|      0|    *msg_id = leaf_message_id;
 2578|      0|    return false;
 2579|      0|  }
 2580|      1|  KMP_ASSERT(levels_index <= INTEL_LEVEL_TYPE_LAST);
  ------------------
  |  |   50|      1|  if (!(cond)) {                                                               \
  |  |  ------------------
  |  |  |  Branch (50:7): [True: 0, False: 1]
  |  |  ------------------
  |  |   51|      0|    __kmp_debug_assert("assertion failure", __FILE__, __LINE__);               \
  |  |   52|      0|  }
  ------------------
 2581|       |
 2582|       |  // The algorithm used starts by setting the affinity to each available thread
 2583|       |  // and retrieving info from the cpuid instruction, so if we are not capable of
 2584|       |  // calling __kmp_get_system_affinity() and __kmp_get_system_affinity(), then
 2585|       |  // we need to do something else - use the defaults that we calculated from
 2586|       |  // issuing cpuid without binding to each proc.
 2587|      1|  if (!KMP_AFFINITY_CAPABLE()) {
  ------------------
  |  |  684|      1|#define KMP_AFFINITY_CAPABLE() (__kmp_affin_mask_size > 0)
  ------------------
  |  Branch (2587:7): [True: 0, False: 1]
  ------------------
 2588|       |    // Hack to try and infer the machine topology using only the data
 2589|       |    // available from cpuid on the current thread, and __kmp_xproc.
 2590|      0|    KMP_ASSERT(__kmp_affinity.type == affinity_none);
  ------------------
  |  |   50|      0|  if (!(cond)) {                                                               \
  |  |  ------------------
  |  |  |  Branch (50:7): [True: 0, False: 0]
  |  |  ------------------
  |  |   51|      0|    __kmp_debug_assert("assertion failure", __FILE__, __LINE__);               \
  |  |   52|      0|  }
  ------------------
 2591|      0|    for (unsigned i = 0; i < levels_index; ++i) {
  ------------------
  |  Branch (2591:26): [True: 0, False: 0]
  ------------------
 2592|      0|      if (levels[i].level_type == INTEL_LEVEL_TYPE_SMT) {
  ------------------
  |  Branch (2592:11): [True: 0, False: 0]
  ------------------
 2593|      0|        __kmp_nThreadsPerCore = levels[i].nitems;
 2594|      0|      } else if (levels[i].level_type == INTEL_LEVEL_TYPE_CORE) {
  ------------------
  |  Branch (2594:18): [True: 0, False: 0]
  ------------------
 2595|      0|        nCoresPerPkg = levels[i].nitems;
 2596|      0|      }
 2597|      0|    }
 2598|      0|    __kmp_ncores = __kmp_xproc / __kmp_nThreadsPerCore;
 2599|      0|    nPackages = (__kmp_xproc + nCoresPerPkg - 1) / nCoresPerPkg;
 2600|      0|    return true;
 2601|      0|  }
 2602|       |
 2603|       |  // Allocate the data structure to be returned.
 2604|      1|  int depth = levels_index;
 2605|      4|  for (int i = depth - 1, j = 0; i >= 0; --i, ++j)
  ------------------
  |  Branch (2605:34): [True: 3, False: 1]
  ------------------
 2606|      3|    types[j] = __kmp_intel_type_2_topology_type(levels[i].level_type);
 2607|      1|  __kmp_topology =
 2608|      1|      kmp_topology_t::allocate(__kmp_avail_proc, levels_index, types);
 2609|       |
 2610|       |  // Insert equivalent cache types if they exist
 2611|      1|  kmp_cache_info_t cache_info;
 2612|      1|  for (size_t i = 0; i < cache_info.get_depth(); ++i) {
  ------------------
  |  Branch (2612:22): [True: 0, False: 1]
  ------------------
 2613|      0|    const kmp_cache_info_t::info_t &info = cache_info[i];
 2614|      0|    unsigned cache_mask = info.mask;
 2615|      0|    unsigned cache_level = info.level;
 2616|      0|    for (unsigned j = 0; j < levels_index; ++j) {
  ------------------
  |  Branch (2616:26): [True: 0, False: 0]
  ------------------
 2617|      0|      unsigned hw_cache_mask = levels[j].cache_mask;
 2618|      0|      kmp_hw_t cache_type = kmp_cache_info_t::get_topology_type(cache_level);
 2619|      0|      if (hw_cache_mask == cache_mask && j < levels_index - 1) {
  ------------------
  |  Branch (2619:11): [True: 0, False: 0]
  |  Branch (2619:42): [True: 0, False: 0]
  ------------------
 2620|      0|        kmp_hw_t type =
 2621|      0|            __kmp_intel_type_2_topology_type(levels[j + 1].level_type);
 2622|      0|        __kmp_topology->set_equivalent_type(cache_type, type);
 2623|      0|      }
 2624|      0|    }
 2625|      0|  }
 2626|       |
 2627|       |  // From here on, we can assume that it is safe to call
 2628|       |  // __kmp_get_system_affinity() and __kmp_set_system_affinity(), even if
 2629|       |  // __kmp_affinity.type = affinity_none.
 2630|       |
 2631|       |  // Save the affinity mask for the current thread.
 2632|      1|  kmp_affinity_raii_t previous_affinity;
 2633|       |
 2634|       |  // Run through each of the available contexts, binding the current thread
 2635|       |  // to it, and obtaining the pertinent information using the cpuid instr.
 2636|      1|  unsigned int proc;
 2637|      1|  int hw_thread_index = 0;
 2638|     32|  KMP_CPU_SET_ITERATE(proc, __kmp_affin_fullMask) {
  ------------------
  |  |  688|     33|  for (i = (mask)->begin(); (int)i != (mask)->end(); i = (mask)->next(i))
  |  |  ------------------
  |  |  |  Branch (688:29): [True: 32, False: 1]
  |  |  ------------------
  ------------------
 2639|     32|    cpuid_level_info_t my_levels[INTEL_LEVEL_TYPE_LAST];
 2640|     32|    unsigned my_levels_index;
 2641|       |
 2642|       |    // Skip this proc if it is not included in the machine model.
 2643|     32|    if (!KMP_CPU_ISSET(proc, __kmp_affin_fullMask)) {
  ------------------
  |  |  690|     32|#define KMP_CPU_ISSET(i, mask) (mask)->is_set(i)
  ------------------
  |  Branch (2643:9): [True: 0, False: 32]
  ------------------
 2644|      0|      continue;
 2645|      0|    }
 2646|     32|    KMP_DEBUG_ASSERT(hw_thread_index < __kmp_avail_proc);
 2647|       |
 2648|     32|    __kmp_affinity_dispatch->bind_thread(proc);
 2649|       |
 2650|       |    // New algorithm
 2651|     32|    __kmp_x86_cpuid(topology_leaf, 0, &buf);
 2652|     32|    apic_id = buf.edx;
 2653|     32|    kmp_hw_thread_t &hw_thread = __kmp_topology->at(hw_thread_index);
 2654|     32|    my_levels_index =
 2655|     32|        __kmp_x2apicid_get_levels(topology_leaf, my_levels, known_levels);
 2656|     32|    if (my_levels_index == 0 || my_levels_index != levels_index) {
  ------------------
  |  Branch (2656:9): [True: 0, False: 32]
  |  Branch (2656:33): [True: 0, False: 32]
  ------------------
 2657|      0|      *msg_id = kmp_i18n_str_InvalidCpuidInfo;
 2658|      0|      return false;
 2659|      0|    }
 2660|     32|    hw_thread.clear();
 2661|     32|    hw_thread.os_id = proc;
 2662|       |    // Put in topology information
 2663|    128|    for (unsigned j = 0, idx = depth - 1; j < my_levels_index; ++j, --idx) {
  ------------------
  |  Branch (2663:43): [True: 96, False: 32]
  ------------------
 2664|     96|      hw_thread.ids[idx] = apic_id & my_levels[j].mask;
 2665|     96|      if (j > 0) {
  ------------------
  |  Branch (2665:11): [True: 64, False: 32]
  ------------------
 2666|     64|        hw_thread.ids[idx] >>= my_levels[j - 1].mask_width;
 2667|     64|      }
 2668|     96|    }
 2669|       |    // Hybrid information
 2670|     32|    if (__kmp_is_hybrid_cpu() && highest_leaf >= 0x1a) {
  ------------------
  |  Branch (2670:9): [True: 0, False: 32]
  |  Branch (2670:34): [True: 0, False: 0]
  ------------------
 2671|      0|      kmp_hw_core_type_t type;
 2672|      0|      unsigned native_model_id;
 2673|      0|      int efficiency;
 2674|      0|      __kmp_get_hybrid_info(&type, &efficiency, &native_model_id);
 2675|      0|      hw_thread.attrs.set_core_type(type);
 2676|      0|      hw_thread.attrs.set_core_eff(efficiency);
 2677|      0|    }
 2678|     32|    hw_thread_index++;
 2679|     32|  }
 2680|      1|  KMP_ASSERT(hw_thread_index > 0);
  ------------------
  |  |   50|      1|  if (!(cond)) {                                                               \
  |  |  ------------------
  |  |  |  Branch (50:7): [True: 0, False: 1]
  |  |  ------------------
  |  |   51|      0|    __kmp_debug_assert("assertion failure", __FILE__, __LINE__);               \
  |  |   52|      0|  }
  ------------------
 2681|      1|  __kmp_topology->sort_ids();
 2682|      1|  if (!__kmp_topology->check_ids()) {
  ------------------
  |  Branch (2682:7): [True: 0, False: 1]
  ------------------
 2683|      0|    kmp_topology_t::deallocate(__kmp_topology);
 2684|      0|    __kmp_topology = nullptr;
 2685|      0|    *msg_id = kmp_i18n_str_x2ApicIDsNotUnique;
 2686|      0|    return false;
 2687|      0|  }
 2688|      1|  return true;
 2689|      1|}
kmp_affinity.cpp:_ZL32__kmp_intel_type_2_topology_typei:
 2428|      9|static kmp_hw_t __kmp_intel_type_2_topology_type(int intel_type) {
 2429|      9|  switch (intel_type) {
  ------------------
  |  Branch (2429:11): [True: 9, False: 0]
  ------------------
 2430|      2|  case INTEL_LEVEL_TYPE_INVALID:
  ------------------
  |  Branch (2430:3): [True: 2, False: 7]
  ------------------
 2431|      2|    return KMP_HW_SOCKET;
 2432|      2|  case INTEL_LEVEL_TYPE_SMT:
  ------------------
  |  Branch (2432:3): [True: 2, False: 7]
  ------------------
 2433|      2|    return KMP_HW_THREAD;
 2434|      2|  case INTEL_LEVEL_TYPE_CORE:
  ------------------
  |  Branch (2434:3): [True: 2, False: 7]
  ------------------
 2435|      2|    return KMP_HW_CORE;
 2436|      1|  case INTEL_LEVEL_TYPE_TILE:
  ------------------
  |  Branch (2436:3): [True: 1, False: 8]
  ------------------
 2437|      1|    return KMP_HW_TILE;
 2438|      1|  case INTEL_LEVEL_TYPE_MODULE:
  ------------------
  |  Branch (2438:3): [True: 1, False: 8]
  ------------------
 2439|      1|    return KMP_HW_MODULE;
 2440|      1|  case INTEL_LEVEL_TYPE_DIE:
  ------------------
  |  Branch (2440:3): [True: 1, False: 8]
  ------------------
 2441|      1|    return KMP_HW_DIE;
 2442|      9|  }
 2443|      0|  return KMP_HW_UNKNOWN;
 2444|      9|}
kmp_affinity.cpp:_ZL25__kmp_x2apicid_get_levelsiP18cpuid_level_info_ty:
 2452|     33|                          kmp_uint64 known_levels) {
 2453|     33|  unsigned level, levels_index;
 2454|     33|  unsigned level_type, mask_width, nitems;
 2455|     33|  kmp_cpuid buf;
 2456|       |
 2457|       |  // New algorithm has known topology layers act as highest unknown topology
 2458|       |  // layers when unknown topology layers exist.
 2459|       |  // e.g., Suppose layers were SMT <X> CORE <Y> <Z> PACKAGE, where <X> <Y> <Z>
 2460|       |  // are unknown topology layers, Then SMT will take the characteristics of
 2461|       |  // (SMT x <X>) and CORE will take the characteristics of (CORE x <Y> x <Z>).
 2462|       |  // This eliminates unknown portions of the topology while still keeping the
 2463|       |  // correct structure.
 2464|     33|  level = levels_index = 0;
 2465|     99|  do {
 2466|     99|    __kmp_x86_cpuid(leaf, level, &buf);
 2467|     99|    level_type = __kmp_extract_bits<8, 15>(buf.ecx);
 2468|     99|    mask_width = __kmp_extract_bits<0, 4>(buf.eax);
 2469|     99|    nitems = __kmp_extract_bits<0, 15>(buf.ebx);
 2470|     99|    if (level_type != INTEL_LEVEL_TYPE_INVALID && nitems == 0)
  ------------------
  |  Branch (2470:9): [True: 66, False: 33]
  |  Branch (2470:51): [True: 0, False: 66]
  ------------------
 2471|      0|      return 0;
 2472|       |
 2473|     99|    if (known_levels & (1ull << level_type)) {
  ------------------
  |  Branch (2473:9): [True: 99, False: 0]
  ------------------
 2474|       |      // Add a new level to the topology
 2475|     99|      KMP_ASSERT(levels_index < INTEL_LEVEL_TYPE_LAST);
  ------------------
  |  |   50|     99|  if (!(cond)) {                                                               \
  |  |  ------------------
  |  |  |  Branch (50:7): [True: 0, False: 99]
  |  |  ------------------
  |  |   51|      0|    __kmp_debug_assert("assertion failure", __FILE__, __LINE__);               \
  |  |   52|      0|  }
  ------------------
 2476|     99|      levels[levels_index].level_type = level_type;
 2477|     99|      levels[levels_index].mask_width = mask_width;
 2478|     99|      levels[levels_index].nitems = nitems;
 2479|     99|      levels_index++;
 2480|     99|    } else {
 2481|       |      // If it is an unknown level, then logically move the previous layer up
 2482|      0|      if (levels_index > 0) {
  ------------------
  |  Branch (2482:11): [True: 0, False: 0]
  ------------------
 2483|      0|        levels[levels_index - 1].mask_width = mask_width;
 2484|      0|        levels[levels_index - 1].nitems = nitems;
 2485|      0|      }
 2486|      0|    }
 2487|     99|    level++;
 2488|     99|  } while (level_type != INTEL_LEVEL_TYPE_INVALID);
  ------------------
  |  Branch (2488:12): [True: 66, False: 33]
  ------------------
 2489|       |
 2490|       |  // Ensure the INTEL_LEVEL_TYPE_INVALID (Socket) layer isn't first
 2491|     33|  if (levels_index == 0 || levels[0].level_type == INTEL_LEVEL_TYPE_INVALID)
  ------------------
  |  Branch (2491:7): [True: 0, False: 33]
  |  Branch (2491:28): [True: 0, False: 33]
  ------------------
 2492|      0|    return 0;
 2493|       |
 2494|       |  // Set the masks to & with apicid
 2495|    132|  for (unsigned i = 0; i < levels_index; ++i) {
  ------------------
  |  Branch (2495:24): [True: 99, False: 33]
  ------------------
 2496|     99|    if (levels[i].level_type != INTEL_LEVEL_TYPE_INVALID) {
  ------------------
  |  Branch (2496:9): [True: 66, False: 33]
  ------------------
 2497|     66|      levels[i].mask = ~((-1) << levels[i].mask_width);
 2498|     66|      levels[i].cache_mask = (-1) << levels[i].mask_width;
 2499|     99|      for (unsigned j = 0; j < i; ++j)
  ------------------
  |  Branch (2499:28): [True: 33, False: 66]
  ------------------
 2500|     33|        levels[i].mask ^= levels[j].mask;
 2501|     66|    } else {
 2502|     33|      KMP_DEBUG_ASSERT(i > 0);
 2503|     33|      levels[i].mask = (-1) << levels[i - 1].mask_width;
 2504|     33|      levels[i].cache_mask = 0;
 2505|     33|    }
 2506|     99|  }
 2507|     33|  return levels_index;
 2508|     33|}
kmp_affinity.cpp:_ZL18__kmp_extract_bitsILj8ELj15EEjj:
 1956|     99|static inline unsigned __kmp_extract_bits(kmp_uint32 v) {
 1957|     99|  const kmp_uint32 SHIFT_LEFT = sizeof(kmp_uint32) * 8 - 1 - MSB;
 1958|     99|  const kmp_uint32 SHIFT_RIGHT = LSB;
 1959|     99|  kmp_uint32 retval = v;
 1960|     99|  retval <<= SHIFT_LEFT;
 1961|     99|  retval >>= (SHIFT_LEFT + SHIFT_RIGHT);
 1962|     99|  return retval;
 1963|     99|}
kmp_affinity.cpp:_ZL18__kmp_extract_bitsILj0ELj4EEjj:
 1956|    100|static inline unsigned __kmp_extract_bits(kmp_uint32 v) {
 1957|    100|  const kmp_uint32 SHIFT_LEFT = sizeof(kmp_uint32) * 8 - 1 - MSB;
 1958|    100|  const kmp_uint32 SHIFT_RIGHT = LSB;
 1959|    100|  kmp_uint32 retval = v;
 1960|    100|  retval <<= SHIFT_LEFT;
 1961|    100|  retval >>= (SHIFT_LEFT + SHIFT_RIGHT);
 1962|    100|  return retval;
 1963|    100|}
kmp_affinity.cpp:_ZL18__kmp_extract_bitsILj0ELj15EEjj:
 1956|     99|static inline unsigned __kmp_extract_bits(kmp_uint32 v) {
 1957|     99|  const kmp_uint32 SHIFT_LEFT = sizeof(kmp_uint32) * 8 - 1 - MSB;
 1958|     99|  const kmp_uint32 SHIFT_RIGHT = LSB;
 1959|     99|  kmp_uint32 retval = v;
 1960|     99|  retval <<= SHIFT_LEFT;
 1961|     99|  retval >>= (SHIFT_LEFT + SHIFT_RIGHT);
 1962|     99|  return retval;
 1963|     99|}
_ZN16kmp_cache_info_tC2Ev:
 2008|      1|  kmp_cache_info_t() : depth(0) { get_leaf4_levels(); }
_ZN16kmp_cache_info_t16get_leaf4_levelsEv:
 2032|      1|  void get_leaf4_levels() {
 2033|      1|    unsigned level = 0;
 2034|      1|    while (depth < MAX_CACHE_LEVEL) {
  ------------------
  |  Branch (2034:12): [True: 1, False: 0]
  ------------------
 2035|      1|      unsigned cache_type, max_threads_sharing;
 2036|      1|      unsigned cache_level, cache_mask_width;
 2037|      1|      kmp_cpuid buf2;
 2038|      1|      __kmp_x86_cpuid(4, level, &buf2);
 2039|      1|      cache_type = __kmp_extract_bits<0, 4>(buf2.eax);
 2040|      1|      if (!cache_type)
  ------------------
  |  Branch (2040:11): [True: 1, False: 0]
  ------------------
 2041|      1|        break;
 2042|       |      // Skip instruction caches
 2043|      0|      if (cache_type == 2) {
  ------------------
  |  Branch (2043:11): [True: 0, False: 0]
  ------------------
 2044|      0|        level++;
 2045|      0|        continue;
 2046|      0|      }
 2047|      0|      max_threads_sharing = __kmp_extract_bits<14, 25>(buf2.eax) + 1;
 2048|      0|      cache_mask_width = __kmp_cpuid_mask_width(max_threads_sharing);
 2049|      0|      cache_level = __kmp_extract_bits<5, 7>(buf2.eax);
 2050|      0|      table[depth].level = cache_level;
 2051|      0|      table[depth].mask = ((-1) << cache_mask_width);
 2052|      0|      depth++;
 2053|      0|      level++;
 2054|      0|    }
 2055|      1|  }
_ZNK16kmp_cache_info_t9get_depthEv:
 2009|      1|  size_t get_depth() const { return depth; }
kmp_affinity.cpp:_ZL33__kmp_create_affinity_none_placesR14kmp_affinity_t:
 4150|      1|static void __kmp_create_affinity_none_places(kmp_affinity_t &affinity) {
 4151|      1|  KMP_ASSERT(__kmp_affin_fullMask != NULL);
  ------------------
  |  |   50|      1|  if (!(cond)) {                                                               \
  |  |  ------------------
  |  |  |  Branch (50:7): [True: 0, False: 1]
  |  |  ------------------
  |  |   51|      0|    __kmp_debug_assert("assertion failure", __FILE__, __LINE__);               \
  |  |   52|      0|  }
  ------------------
 4152|      1|  KMP_ASSERT(affinity.type == affinity_none);
  ------------------
  |  |   50|      1|  if (!(cond)) {                                                               \
  |  |  ------------------
  |  |  |  Branch (50:7): [True: 0, False: 1]
  |  |  ------------------
  |  |   51|      0|    __kmp_debug_assert("assertion failure", __FILE__, __LINE__);               \
  |  |   52|      0|  }
  ------------------
 4153|      1|  affinity.num_masks = 1;
 4154|      1|  KMP_CPU_ALLOC_ARRAY(affinity.masks, affinity.num_masks);
  ------------------
  |  |  705|      1|  (arr = __kmp_affinity_dispatch->allocate_mask_array(n))
  ------------------
 4155|      1|  kmp_affin_mask_t *dest = KMP_CPU_INDEX(affinity.masks, 0);
  ------------------
  |  |  703|      1|#define KMP_CPU_INDEX(arr, i) __kmp_affinity_dispatch->index_mask_array(arr, i)
  ------------------
 4156|      1|  KMP_CPU_COPY(dest, __kmp_affin_fullMask);
  ------------------
  |  |  693|      1|#define KMP_CPU_COPY(dest, src) (dest)->copy(src)
  ------------------
 4157|      1|  __kmp_affinity_get_topology_info(affinity);
 4158|      1|}
kmp_affinity.cpp:_ZL32__kmp_affinity_get_topology_infoR14kmp_affinity_t:
 4107|      1|static void __kmp_affinity_get_topology_info(kmp_affinity_t &affinity) {
 4108|      1|  if (!KMP_AFFINITY_CAPABLE())
  ------------------
  |  |  684|      1|#define KMP_AFFINITY_CAPABLE() (__kmp_affin_mask_size > 0)
  ------------------
  |  Branch (4108:7): [True: 0, False: 1]
  ------------------
 4109|      0|    return;
 4110|      1|  if (affinity.type != affinity_none) {
  ------------------
  |  Branch (4110:7): [True: 0, False: 1]
  ------------------
 4111|      0|    KMP_ASSERT(affinity.num_os_id_masks);
  ------------------
  |  |   50|      0|  if (!(cond)) {                                                               \
  |  |  ------------------
  |  |  |  Branch (50:7): [True: 0, False: 0]
  |  |  ------------------
  |  |   51|      0|    __kmp_debug_assert("assertion failure", __FILE__, __LINE__);               \
  |  |   52|      0|  }
  ------------------
 4112|      0|    KMP_ASSERT(affinity.os_id_masks);
  ------------------
  |  |   50|      0|  if (!(cond)) {                                                               \
  |  |  ------------------
  |  |  |  Branch (50:7): [True: 0, False: 0]
  |  |  ------------------
  |  |   51|      0|    __kmp_debug_assert("assertion failure", __FILE__, __LINE__);               \
  |  |   52|      0|  }
  ------------------
 4113|      0|  }
 4114|      1|  KMP_ASSERT(affinity.num_masks);
  ------------------
  |  |   50|      1|  if (!(cond)) {                                                               \
  |  |  ------------------
  |  |  |  Branch (50:7): [True: 0, False: 1]
  |  |  ------------------
  |  |   51|      0|    __kmp_debug_assert("assertion failure", __FILE__, __LINE__);               \
  |  |   52|      0|  }
  ------------------
 4115|      1|  KMP_ASSERT(affinity.masks);
  ------------------
  |  |   50|      1|  if (!(cond)) {                                                               \
  |  |  ------------------
  |  |  |  Branch (50:7): [True: 0, False: 1]
  |  |  ------------------
  |  |   51|      0|    __kmp_debug_assert("assertion failure", __FILE__, __LINE__);               \
  |  |   52|      0|  }
  ------------------
 4116|      1|  KMP_ASSERT(__kmp_affin_fullMask);
  ------------------
  |  |   50|      1|  if (!(cond)) {                                                               \
  |  |  ------------------
  |  |  |  Branch (50:7): [True: 0, False: 1]
  |  |  ------------------
  |  |   51|      0|    __kmp_debug_assert("assertion failure", __FILE__, __LINE__);               \
  |  |   52|      0|  }
  ------------------
 4117|       |
 4118|      1|  int max_cpu = __kmp_affin_fullMask->get_max_cpu();
 4119|      1|  int num_hw_threads = __kmp_topology->get_num_hw_threads();
 4120|       |
 4121|       |  // Allocate thread topology information
 4122|      1|  if (!affinity.ids) {
  ------------------
  |  Branch (4122:7): [True: 1, False: 0]
  ------------------
 4123|      1|    affinity.ids = (kmp_affinity_ids_t *)__kmp_allocate(
  ------------------
  |  | 3617|      1|#define __kmp_allocate(size) ___kmp_allocate((size)KMP_SRC_LOC_CURR)
  ------------------
 4124|      1|        sizeof(kmp_affinity_ids_t) * affinity.num_masks);
 4125|      1|  }
 4126|      1|  if (!affinity.attrs) {
  ------------------
  |  Branch (4126:7): [True: 1, False: 0]
  ------------------
 4127|      1|    affinity.attrs = (kmp_affinity_attrs_t *)__kmp_allocate(
  ------------------
  |  | 3617|      1|#define __kmp_allocate(size) ___kmp_allocate((size)KMP_SRC_LOC_CURR)
  ------------------
 4128|      1|        sizeof(kmp_affinity_attrs_t) * affinity.num_masks);
 4129|      1|  }
 4130|      1|  if (!__kmp_osid_to_hwthread_map) {
  ------------------
  |  Branch (4130:7): [True: 1, False: 0]
  ------------------
 4131|       |    // Want the +1 because max_cpu should be valid index into map
 4132|      1|    __kmp_osid_to_hwthread_map =
 4133|      1|        (int *)__kmp_allocate(sizeof(int) * (max_cpu + 1));
  ------------------
  |  | 3617|      1|#define __kmp_allocate(size) ___kmp_allocate((size)KMP_SRC_LOC_CURR)
  ------------------
 4134|      1|  }
 4135|       |
 4136|       |  // Create the OS proc to hardware thread map
 4137|     33|  for (int hw_thread = 0; hw_thread < num_hw_threads; ++hw_thread)
  ------------------
  |  Branch (4137:27): [True: 32, False: 1]
  ------------------
 4138|     32|    __kmp_osid_to_hwthread_map[__kmp_topology->at(hw_thread).os_id] = hw_thread;
 4139|       |
 4140|      2|  for (unsigned i = 0; i < affinity.num_masks; ++i) {
  ------------------
  |  Branch (4140:24): [True: 1, False: 1]
  ------------------
 4141|      1|    kmp_affinity_ids_t &ids = affinity.ids[i];
 4142|      1|    kmp_affinity_attrs_t &attrs = affinity.attrs[i];
 4143|      1|    kmp_affin_mask_t *mask = KMP_CPU_INDEX(affinity.masks, i);
  ------------------
  |  |  703|      1|#define KMP_CPU_INDEX(arr, i) __kmp_affinity_dispatch->index_mask_array(arr, i)
  ------------------
 4144|      1|    __kmp_affinity_get_mask_topology_info(mask, ids, attrs);
 4145|      1|  }
 4146|      1|}
kmp_affinity.cpp:_ZL37__kmp_affinity_get_mask_topology_infoPKN11KMPAffinity4MaskER18kmp_affinity_ids_tR20kmp_affinity_attrs_t:
 4050|      1|                                                  kmp_affinity_attrs_t &attrs) {
 4051|      1|  if (!KMP_AFFINITY_CAPABLE())
  ------------------
  |  |  684|      1|#define KMP_AFFINITY_CAPABLE() (__kmp_affin_mask_size > 0)
  ------------------
  |  Branch (4051:7): [True: 0, False: 1]
  ------------------
 4052|      0|    return;
 4053|       |
 4054|       |  // Initiailze ids and attrs thread data
 4055|     13|  for (int i = 0; i < KMP_HW_LAST; ++i)
  ------------------
  |  Branch (4055:19): [True: 12, False: 1]
  ------------------
 4056|     12|    ids[i] = kmp_hw_thread_t::UNKNOWN_ID;
 4057|      1|  attrs = KMP_AFFINITY_ATTRS_UNKNOWN;
  ------------------
  |  |  891|      1|  { KMP_HW_CORE_TYPE_UNKNOWN, kmp_hw_attr_t::UNKNOWN_CORE_EFF, 0, 0 }
  ------------------
 4058|       |
 4059|       |  // Iterate through each os id within the mask and determine
 4060|       |  // the topology id and attribute information
 4061|      1|  int cpu;
 4062|      1|  int depth = __kmp_topology->get_depth();
 4063|     32|  KMP_CPU_SET_ITERATE(cpu, mask) {
  ------------------
  |  |  688|     33|  for (i = (mask)->begin(); (int)i != (mask)->end(); i = (mask)->next(i))
  |  |  ------------------
  |  |  |  Branch (688:29): [True: 32, False: 1]
  |  |  ------------------
  ------------------
 4064|     32|    int osid_idx = __kmp_osid_to_hwthread_map[cpu];
 4065|     32|    const kmp_hw_thread_t &hw_thread = __kmp_topology->at(osid_idx);
 4066|     97|    for (int level = 0; level < depth; ++level) {
  ------------------
  |  Branch (4066:25): [True: 65, False: 32]
  ------------------
 4067|     65|      kmp_hw_t type = __kmp_topology->get_type(level);
 4068|     65|      int id = hw_thread.sub_ids[level];
 4069|     65|      if (ids[type] == kmp_hw_thread_t::UNKNOWN_ID || ids[type] == id) {
  ------------------
  |  Branch (4069:11): [True: 3, False: 62]
  |  Branch (4069:55): [True: 31, False: 31]
  ------------------
 4070|     34|        ids[type] = id;
 4071|     34|      } else {
 4072|       |        // This mask spans across multiple topology units, set it as such
 4073|       |        // and mark every level below as such as well.
 4074|     31|        ids[type] = kmp_hw_thread_t::MULTIPLE_ID;
 4075|     93|        for (; level < depth; ++level) {
  ------------------
  |  Branch (4075:16): [True: 62, False: 31]
  ------------------
 4076|     62|          kmp_hw_t type = __kmp_topology->get_type(level);
 4077|     62|          ids[type] = kmp_hw_thread_t::MULTIPLE_ID;
 4078|     62|        }
 4079|     31|      }
 4080|     65|    }
 4081|     32|    if (!attrs.valid) {
  ------------------
  |  Branch (4081:9): [True: 1, False: 31]
  ------------------
 4082|      1|      attrs.core_type = hw_thread.attrs.get_core_type();
 4083|      1|      attrs.core_eff = hw_thread.attrs.get_core_eff();
 4084|      1|      attrs.valid = 1;
 4085|     31|    } else {
 4086|       |      // This mask spans across multiple attributes, set it as such
 4087|     31|      if (attrs.core_type != hw_thread.attrs.get_core_type())
  ------------------
  |  Branch (4087:11): [True: 0, False: 31]
  ------------------
 4088|      0|        attrs.core_type = KMP_HW_CORE_TYPE_UNKNOWN;
 4089|     31|      if (attrs.core_eff != hw_thread.attrs.get_core_eff())
  ------------------
  |  Branch (4089:11): [True: 0, False: 31]
  ------------------
 4090|      0|        attrs.core_eff = kmp_hw_attr_t::UNKNOWN_CORE_EFF;
 4091|     31|    }
 4092|     32|  }
 4093|      1|}

_ZNK17KMPNativeAffinity4Mask18get_num_mask_typesEv:
  297|    458|    mask_size_type get_num_mask_types() const {
  298|    458|      return __kmp_affin_mask_size / sizeof(mask_t);
  299|    458|    }
_ZN17KMPNativeAffinity4MaskC2Ev:
  303|     69|    Mask() { mask = (mask_t *)__kmp_allocate(__kmp_affin_mask_size); }
  ------------------
  |  | 3617|     69|#define __kmp_allocate(size) ___kmp_allocate((size)KMP_SRC_LOC_CURR)
  ------------------
_ZN17KMPNativeAffinity4MaskD2Ev:
  304|     68|    ~Mask() {
  305|     68|      if (mask)
  ------------------
  |  Branch (305:11): [True: 68, False: 0]
  ------------------
  306|     68|        __kmp_free(mask);
  ------------------
  |  | 3619|     68|#define __kmp_free(ptr) ___kmp_free((ptr)KMP_SRC_LOC_CURR)
  ------------------
  307|     68|    }
_ZN17KMPNativeAffinity4Mask3setEi:
  308|     32|    void set(int i) override {
  309|     32|      mask[i / BITS_PER_MASK_T] |= (ONE << (i % BITS_PER_MASK_T));
  310|     32|    }
_ZNK17KMPNativeAffinity4Mask6is_setEi:
  311|    320|    bool is_set(int i) const override {
  312|    320|      return (mask[i / BITS_PER_MASK_T] & (ONE << (i % BITS_PER_MASK_T)));
  313|    320|    }
_ZN17KMPNativeAffinity4Mask4zeroEv:
  317|     32|    void zero() override {
  318|     32|      mask_size_type e = get_num_mask_types();
  319|     64|      for (mask_size_type i = 0; i < e; ++i)
  ------------------
  |  Branch (319:34): [True: 32, False: 32]
  ------------------
  320|     32|        mask[i] = (mask_t)0;
  321|     32|    }
_ZN17KMPNativeAffinity4Mask4copyEPKN11KMPAffinity4MaskE:
  322|     34|    void copy(const KMPAffinity::Mask *src) override {
  323|     34|      const Mask *convert = static_cast<const Mask *>(src);
  324|     34|      mask_size_type e = get_num_mask_types();
  325|     68|      for (mask_size_type i = 0; i < e; ++i)
  ------------------
  |  Branch (325:34): [True: 34, False: 34]
  ------------------
  326|     34|        mask[i] = convert->mask[i];
  327|     34|    }
_ZNK17KMPNativeAffinity4Mask5beginEv:
  345|      4|    int begin() const override {
  346|      4|      int retval = 0;
  347|      4|      while (retval < end() && !is_set(retval))
  ------------------
  |  Branch (347:14): [True: 4, False: 0]
  |  Branch (347:32): [True: 0, False: 4]
  ------------------
  348|      0|        ++retval;
  349|      4|      return retval;
  350|      4|    }
_ZNK17KMPNativeAffinity4Mask3endEv:
  351|    392|    int end() const override {
  352|    392|      int e;
  353|    392|      __kmp_type_convert(get_num_mask_types() * BITS_PER_MASK_T, &e);
  354|    392|      return e;
  355|    392|    }
_ZNK17KMPNativeAffinity4Mask4nextEi:
  356|    128|    int next(int previous) const override {
  357|    128|      int retval = previous + 1;
  358|    256|      while (retval < end() && !is_set(retval))
  ------------------
  |  Branch (358:14): [True: 252, False: 4]
  |  Branch (358:32): [True: 128, False: 124]
  ------------------
  359|    128|        ++retval;
  360|    128|      return retval;
  361|    128|    }
_ZN17KMPNativeAffinity4Mask19get_system_affinityEb:
  362|      3|    int get_system_affinity(bool abort_on_error) override {
  363|      3|      KMP_ASSERT2(KMP_AFFINITY_CAPABLE(),
  ------------------
  |  |   53|      3|#define KMP_ASSERT2(cond, msg) KMP_ASSERT(cond)
  |  |  ------------------
  |  |  |  |   50|      3|  if (!(cond)) {                                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (50:7): [True: 0, False: 3]
  |  |  |  |  ------------------
  |  |  |  |   51|      0|    __kmp_debug_assert("assertion failure", __FILE__, __LINE__);               \
  |  |  |  |   52|      0|  }
  |  |  ------------------
  ------------------
  364|      3|                  "Illegal get affinity operation when not capable");
  365|      3|#if KMP_OS_LINUX
  366|      3|      long retval =
  367|      3|          syscall(__NR_sched_getaffinity, 0, __kmp_affin_mask_size, mask);
  368|       |#elif KMP_OS_FREEBSD
  369|       |      int r = pthread_getaffinity_np(pthread_self(), __kmp_affin_mask_size,
  370|       |                                     reinterpret_cast<cpuset_t *>(mask));
  371|       |      int retval = (r == 0 ? 0 : -1);
  372|       |#endif
  373|      3|      if (retval >= 0) {
  ------------------
  |  Branch (373:11): [True: 3, False: 0]
  ------------------
  374|      3|        return 0;
  375|      3|      }
  376|      0|      int error = errno;
  377|      0|      if (abort_on_error) {
  ------------------
  |  Branch (377:11): [True: 0, False: 0]
  ------------------
  378|      0|        __kmp_fatal(KMP_MSG(FunctionError, "pthread_getaffinity_np()"),
  ------------------
  |  |  121|      0|#define KMP_MSG(...) __kmp_msg_format(kmp_i18n_msg_##__VA_ARGS__)
  ------------------
  379|      0|                    KMP_ERR(error), __kmp_msg_null);
  ------------------
  |  |  125|      0|#define KMP_ERR KMP_SYSERRCODE
  |  |  ------------------
  |  |  |  |  123|      0|#define KMP_SYSERRCODE(code) __kmp_msg_error_code(code)
  |  |  ------------------
  ------------------
  380|      0|      }
  381|      0|      return error;
  382|      3|    }
_ZNK17KMPNativeAffinity4Mask19set_system_affinityEb:
  383|     68|    int set_system_affinity(bool abort_on_error) const override {
  384|     68|      KMP_ASSERT2(KMP_AFFINITY_CAPABLE(),
  ------------------
  |  |   53|     68|#define KMP_ASSERT2(cond, msg) KMP_ASSERT(cond)
  |  |  ------------------
  |  |  |  |   50|     68|  if (!(cond)) {                                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (50:7): [True: 0, False: 68]
  |  |  |  |  ------------------
  |  |  |  |   51|      0|    __kmp_debug_assert("assertion failure", __FILE__, __LINE__);               \
  |  |  |  |   52|      0|  }
  |  |  ------------------
  ------------------
  385|     68|                  "Illegal set affinity operation when not capable");
  386|     68|#if KMP_OS_LINUX
  387|     68|      long retval =
  388|     68|          syscall(__NR_sched_setaffinity, 0, __kmp_affin_mask_size, mask);
  389|       |#elif KMP_OS_FREEBSD
  390|       |      int r = pthread_setaffinity_np(pthread_self(), __kmp_affin_mask_size,
  391|       |                                     reinterpret_cast<cpuset_t *>(mask));
  392|       |      int retval = (r == 0 ? 0 : -1);
  393|       |#endif
  394|     68|      if (retval >= 0) {
  ------------------
  |  Branch (394:11): [True: 68, False: 0]
  ------------------
  395|     68|        return 0;
  396|     68|      }
  397|      0|      int error = errno;
  398|      0|      if (abort_on_error) {
  ------------------
  |  Branch (398:11): [True: 0, False: 0]
  ------------------
  399|      0|        __kmp_fatal(KMP_MSG(FunctionError, "pthread_setaffinity_np()"),
  ------------------
  |  |  121|      0|#define KMP_MSG(...) __kmp_msg_format(kmp_i18n_msg_##__VA_ARGS__)
  ------------------
  400|      0|                    KMP_ERR(error), __kmp_msg_null);
  ------------------
  |  |  125|      0|#define KMP_ERR KMP_SYSERRCODE
  |  |  ------------------
  |  |  |  |  123|      0|#define KMP_SYSERRCODE(code) __kmp_msg_error_code(code)
  |  |  ------------------
  ------------------
  401|      0|      }
  402|      0|      return error;
  403|     68|    }
_ZN17KMPNativeAffinity17determine_capableEPKc:
  405|      1|  void determine_capable(const char *env_var) override {
  406|      1|    __kmp_affinity_determine_capable(env_var);
  407|      1|  }
_ZN17KMPNativeAffinity11bind_threadEi:
  408|     32|  void bind_thread(int which) override { __kmp_affinity_bind_thread(which); }
_ZN17KMPNativeAffinity13allocate_maskEv:
  409|     68|  KMPAffinity::Mask *allocate_mask() override {
  410|     68|    KMPNativeAffinity::Mask *retval = new Mask();
  411|     68|    return retval;
  412|     68|  }
_ZN17KMPNativeAffinity15deallocate_maskEPN11KMPAffinity4MaskE:
  413|     67|  void deallocate_mask(KMPAffinity::Mask *m) override {
  414|     67|    KMPNativeAffinity::Mask *native_mask =
  415|     67|        static_cast<KMPNativeAffinity::Mask *>(m);
  416|     67|    delete native_mask;
  417|     67|  }
_ZN17KMPNativeAffinity19allocate_mask_arrayEi:
  418|      1|  KMPAffinity::Mask *allocate_mask_array(int num) override {
  419|      1|    return new Mask[num];
  420|      1|  }
_ZN17KMPNativeAffinity21deallocate_mask_arrayEPN11KMPAffinity4MaskE:
  421|      1|  void deallocate_mask_array(KMPAffinity::Mask *array) override {
  422|      1|    Mask *linux_array = static_cast<Mask *>(array);
  423|      1|    delete[] linux_array;
  424|      1|  }
_ZN17KMPNativeAffinity16index_mask_arrayEPN11KMPAffinity4MaskEi:
  426|      2|                                      int index) override {
  427|      2|    Mask *linux_array = static_cast<Mask *>(array);
  428|      2|    return &(linux_array[index]);
  429|      2|  }
_ZNK13kmp_hw_attr_t13get_core_typeEv:
  652|     32|  kmp_hw_core_type_t get_core_type() const {
  653|     32|    return (kmp_hw_core_type_t)core_type;
  654|     32|  }
_ZNK13kmp_hw_attr_t12get_core_effEv:
  655|     32|  int get_core_eff() const { return core_eff; }
_ZN13kmp_hw_attr_t5clearEv:
  661|     32|  void clear() {
  662|     32|    core_type = KMP_HW_CORE_TYPE_UNKNOWN;
  663|     32|    core_eff = UNKNOWN_CORE_EFF;
  664|     32|    valid = 0;
  665|     32|  }
_ZN15kmp_hw_thread_t5clearEv:
  706|     32|  void clear() {
  707|    416|    for (int i = 0; i < (int)KMP_HW_LAST; ++i)
  ------------------
  |  Branch (707:21): [True: 384, False: 32]
  ------------------
  708|    384|      ids[i] = UNKNOWN_ID;
  709|     32|    leader = false;
  710|     32|    attrs.clear();
  711|     32|  }
_ZN14kmp_topology_t2atEi:
  811|     96|  kmp_hw_thread_t &at(int index) {
  812|     96|    KMP_DEBUG_ASSERT(index >= 0 && index < num_hw_threads);
  813|     96|    return hw_threads[index];
  814|     96|  }
_ZNK14kmp_topology_t18get_num_hw_threadsEv:
  819|      3|  int get_num_hw_threads() const { return num_hw_threads; }
_ZN14kmp_topology_t8sort_idsEv:
  820|      1|  void sort_ids() {
  821|      1|    qsort(hw_threads, num_hw_threads, sizeof(kmp_hw_thread_t),
  822|      1|          kmp_hw_thread_t::compare_ids);
  823|      1|  }
_ZNK14kmp_topology_t19get_equivalent_typeE8kmp_hw_t:
  843|      6|  kmp_hw_t get_equivalent_type(kmp_hw_t type) const { return equivalent[type]; }
_ZN14kmp_topology_t19set_equivalent_typeE8kmp_hw_tS0_:
  845|      1|  void set_equivalent_type(kmp_hw_t type1, kmp_hw_t type2) {
  846|      1|    KMP_DEBUG_ASSERT_VALID_HW_TYPE(type1);
  847|      1|    KMP_DEBUG_ASSERT_VALID_HW_TYPE(type2);
  848|      1|    kmp_hw_t real_type2 = equivalent[type2];
  849|      1|    if (real_type2 == KMP_HW_UNKNOWN)
  ------------------
  |  Branch (849:9): [True: 0, False: 1]
  ------------------
  850|      0|      real_type2 = type2;
  851|      1|    equivalent[type1] = real_type2;
  852|       |    // This loop is required since any of the types may have been set to
  853|       |    // be equivalent to type1.  They all must be checked and reset to type2.
  854|     12|    KMP_FOREACH_HW_TYPE(type) {
  ------------------
  |  |  640|     13|  for (kmp_hw_t type = (kmp_hw_t)0; type < KMP_HW_LAST;                        \
  |  |  ------------------
  |  |  |  Branch (640:37): [True: 12, False: 1]
  |  |  ------------------
  |  |  641|     12|       type = (kmp_hw_t)((int)type + 1))
  ------------------
  855|     12|      if (equivalent[type] == type1) {
  ------------------
  |  Branch (855:11): [True: 0, False: 12]
  ------------------
  856|      0|        equivalent[type] = real_type2;
  857|      0|      }
  858|     12|    }
  859|      1|  }
_ZNK14kmp_topology_t15calculate_ratioEii:
  862|      2|  int calculate_ratio(int level1, int level2) const {
  863|      2|    KMP_DEBUG_ASSERT(level1 >= 0 && level1 < depth);
  864|      2|    KMP_DEBUG_ASSERT(level2 >= 0 && level2 < depth);
  865|      2|    int r = 1;
  866|      4|    for (int level = level1; level > level2; --level)
  ------------------
  |  Branch (866:30): [True: 2, False: 2]
  ------------------
  867|      2|      r *= ratio[level];
  868|      2|    return r;
  869|      2|  }
_ZNK14kmp_topology_t9get_ratioEi:
  870|      3|  int get_ratio(int level) const {
  871|      3|    KMP_DEBUG_ASSERT(level >= 0 && level < depth);
  872|      3|    return ratio[level];
  873|      3|  }
_ZNK14kmp_topology_t9get_depthEv:
  874|     98|  int get_depth() const { return depth; };
_ZNK14kmp_topology_t8get_typeEi:
  875|    127|  kmp_hw_t get_type(int level) const {
  876|    127|    KMP_DEBUG_ASSERT(level >= 0 && level < depth);
  877|    127|    return types[level];
  878|    127|  }
_ZNK14kmp_topology_t9get_levelE8kmp_hw_t:
  879|      4|  int get_level(kmp_hw_t type) const {
  880|      4|    KMP_DEBUG_ASSERT_VALID_HW_TYPE(type);
  881|      4|    int eq_type = equivalent[type];
  882|      4|    if (eq_type == KMP_HW_UNKNOWN)
  ------------------
  |  Branch (882:9): [True: 0, False: 4]
  ------------------
  883|      0|      return -1;
  884|      8|    for (int i = 0; i < depth; ++i)
  ------------------
  |  Branch (884:21): [True: 8, False: 0]
  ------------------
  885|      8|      if (types[i] == eq_type)
  ------------------
  |  Branch (885:11): [True: 4, False: 4]
  ------------------
  886|      4|        return i;
  887|      0|    return -1;
  888|      4|  }
_ZNK14kmp_topology_t9get_countEi:
  889|      2|  int get_count(int level) const {
  890|      2|    KMP_DEBUG_ASSERT(level >= 0 && level < depth);
  891|      2|    return count[level];
  892|      2|  }
_ZN14hierarchy_info12deriveLevelsEv:
 1090|      1|  void deriveLevels() {
 1091|      1|    int hier_depth = __kmp_topology->get_depth();
 1092|      4|    for (int i = hier_depth - 1, level = 0; i >= 0; --i, ++level) {
  ------------------
  |  Branch (1092:45): [True: 3, False: 1]
  ------------------
 1093|      3|      numPerLevel[level] = __kmp_topology->get_ratio(i);
 1094|      3|    }
 1095|      1|  }
_ZN14hierarchy_infoC2Ev:
 1098|      2|      : maxLevels(7), depth(1), uninitialized(not_initialized), resizing(0) {}
_ZN14hierarchy_info4finiEv:
 1100|      1|  void fini() {
 1101|      1|    if (!uninitialized && numPerLevel) {
  ------------------
  |  Branch (1101:9): [True: 1, False: 0]
  |  Branch (1101:27): [True: 1, False: 0]
  ------------------
 1102|      1|      __kmp_free(numPerLevel);
  ------------------
  |  | 3619|      1|#define __kmp_free(ptr) ___kmp_free((ptr)KMP_SRC_LOC_CURR)
  ------------------
 1103|       |      numPerLevel = NULL;
 1104|      1|      uninitialized = not_initialized;
 1105|      1|    }
 1106|      1|  }
_ZN14hierarchy_info4initEi:
 1108|      1|  void init(int num_addrs) {
 1109|      1|    kmp_int8 bool_result = KMP_COMPARE_AND_STORE_ACQ8(
  ------------------
  |  |  795|      1|  __sync_bool_compare_and_swap((volatile kmp_uint8 *)(p), (kmp_uint8)(cv),     \
  |  |  796|      1|                               (kmp_uint8)(sv))
  ------------------
 1110|      1|        &uninitialized, not_initialized, initializing);
 1111|      1|    if (bool_result == 0) { // Wait for initialization
  ------------------
  |  Branch (1111:9): [True: 0, False: 1]
  ------------------
 1112|      0|      while (TCR_1(uninitialized) != initialized)
  ------------------
  |  | 1125|      0|#define TCR_1(a) (a)
  ------------------
  |  Branch (1112:14): [True: 0, False: 0]
  ------------------
 1113|      0|        KMP_CPU_PAUSE();
  ------------------
  |  | 1498|      0|#define KMP_CPU_PAUSE() __kmp_x86_pause()
  ------------------
 1114|      0|      return;
 1115|      0|    }
 1116|      1|    KMP_DEBUG_ASSERT(bool_result == 1);
 1117|       |
 1118|       |    /* Added explicit initialization of the data fields here to prevent usage of
 1119|       |       dirty value observed when static library is re-initialized multiple times
 1120|       |       (e.g. when non-OpenMP thread repeatedly launches/joins thread that uses
 1121|       |       OpenMP). */
 1122|      1|    depth = 1;
 1123|      1|    resizing = 0;
 1124|      1|    maxLevels = 7;
 1125|      1|    numPerLevel =
 1126|      1|        (kmp_uint32 *)__kmp_allocate(maxLevels * 2 * sizeof(kmp_uint32));
  ------------------
  |  | 3617|      1|#define __kmp_allocate(size) ___kmp_allocate((size)KMP_SRC_LOC_CURR)
  ------------------
 1127|      1|    skipPerLevel = &(numPerLevel[maxLevels]);
 1128|      8|    for (kmp_uint32 i = 0; i < maxLevels;
  ------------------
  |  Branch (1128:28): [True: 7, False: 1]
  ------------------
 1129|      7|         ++i) { // init numPerLevel[*] to 1 item per level
 1130|      7|      numPerLevel[i] = 1;
 1131|      7|      skipPerLevel[i] = 1;
 1132|      7|    }
 1133|       |
 1134|       |    // Sort table by physical ID
 1135|      1|    if (__kmp_topology && __kmp_topology->get_depth() > 0) {
  ------------------
  |  Branch (1135:9): [True: 1, False: 0]
  |  Branch (1135:27): [True: 1, False: 0]
  ------------------
 1136|      1|      deriveLevels();
 1137|      1|    } else {
 1138|      0|      numPerLevel[0] = maxLeaves;
 1139|      0|      numPerLevel[1] = num_addrs / maxLeaves;
 1140|      0|      if (num_addrs % maxLeaves)
  ------------------
  |  Branch (1140:11): [True: 0, False: 0]
  ------------------
 1141|      0|        numPerLevel[1]++;
 1142|      0|    }
 1143|       |
 1144|      1|    base_num_threads = num_addrs;
 1145|      8|    for (int i = maxLevels - 1; i >= 0;
  ------------------
  |  Branch (1145:33): [True: 7, False: 1]
  ------------------
 1146|      7|         --i) // count non-empty levels to get depth
 1147|      7|      if (numPerLevel[i] != 1 || depth > 1) // only count one top-level '1'
  ------------------
  |  Branch (1147:11): [True: 2, False: 5]
  |  Branch (1147:34): [True: 0, False: 5]
  ------------------
 1148|      2|        depth++;
 1149|       |
 1150|      1|    kmp_uint32 branch = minBranch;
 1151|      1|    if (numPerLevel[0] == 1)
  ------------------
  |  Branch (1151:9): [True: 0, False: 1]
  ------------------
 1152|      0|      branch = num_addrs / maxLeaves;
 1153|      1|    if (branch < minBranch)
  ------------------
  |  Branch (1153:9): [True: 0, False: 1]
  ------------------
 1154|      0|      branch = minBranch;
 1155|      4|    for (kmp_uint32 d = 0; d < depth - 1; ++d) { // optimize hierarchy width
  ------------------
  |  Branch (1155:28): [True: 3, False: 1]
  ------------------
 1156|      5|      while (numPerLevel[d] > branch ||
  ------------------
  |  Branch (1156:14): [True: 2, False: 3]
  ------------------
 1157|      3|             (d == 0 && numPerLevel[d] > maxLeaves)) { // max 4 on level 0!
  ------------------
  |  Branch (1157:15): [True: 1, False: 2]
  |  Branch (1157:25): [True: 0, False: 1]
  ------------------
 1158|      2|        if (numPerLevel[d] & 1)
  ------------------
  |  Branch (1158:13): [True: 0, False: 2]
  ------------------
 1159|      0|          numPerLevel[d]++;
 1160|      2|        numPerLevel[d] = numPerLevel[d] >> 1;
 1161|      2|        if (numPerLevel[d + 1] == 1)
  ------------------
  |  Branch (1161:13): [True: 1, False: 1]
  ------------------
 1162|      1|          depth++;
 1163|      2|        numPerLevel[d + 1] = numPerLevel[d + 1] << 1;
 1164|      2|      }
 1165|      3|      if (numPerLevel[0] == 1) {
  ------------------
  |  Branch (1165:11): [True: 0, False: 3]
  ------------------
 1166|      0|        branch = branch >> 1;
 1167|      0|        if (branch < 4)
  ------------------
  |  Branch (1167:13): [True: 0, False: 0]
  ------------------
 1168|      0|          branch = minBranch;
 1169|      0|      }
 1170|      3|    }
 1171|       |
 1172|      4|    for (kmp_uint32 i = 1; i < depth; ++i)
  ------------------
  |  Branch (1172:28): [True: 3, False: 1]
  ------------------
 1173|      3|      skipPerLevel[i] = numPerLevel[i - 1] * skipPerLevel[i - 1];
 1174|       |    // Fill in hierarchy in the case of oversubscription
 1175|      4|    for (kmp_uint32 i = depth; i < maxLevels; ++i)
  ------------------
  |  Branch (1175:32): [True: 3, False: 1]
  ------------------
 1176|      3|      skipPerLevel[i] = 2 * skipPerLevel[i - 1];
 1177|       |
 1178|      1|    uninitialized = initialized; // One writer
 1179|      1|  }

__kmp_initialize_bget:
  992|     32|void __kmp_initialize_bget(kmp_info_t *th) {
  993|     32|  KMP_DEBUG_ASSERT(SizeQuant >= sizeof(void *) && (th != 0));
  994|       |
  995|     32|  set_thr_data(th);
  996|       |
  997|     32|  bectl(th, (bget_compact_t)0, (bget_acquire_t)malloc, (bget_release_t)free,
  998|     32|        (bufsize)__kmp_malloc_pool_incr);
  999|     32|}
__kmp_finalize_bget:
 1001|     32|void __kmp_finalize_bget(kmp_info_t *th) {
 1002|     32|  thr_data_t *thr;
 1003|     32|  bfhead_t *b;
 1004|       |
 1005|     32|  KMP_DEBUG_ASSERT(th != 0);
 1006|       |
 1007|     32|#if BufStats
 1008|     32|  thr = (thr_data_t *)th->th.th_local.bget_data;
 1009|     32|  KMP_DEBUG_ASSERT(thr != NULL);
 1010|     32|  b = thr->last_pool;
 1011|       |
 1012|       |  /*  If a block-release function is defined, and this free buffer constitutes
 1013|       |      the entire block, release it. Note that pool_len is defined in such a way
 1014|       |      that the test will fail unless all pool blocks are the same size.  */
 1015|       |
 1016|       |  // Deallocate the last pool if one exists because we no longer do it in brel()
 1017|     32|  if (thr->relfcn != 0 && b != 0 && thr->numpblk != 0 &&
  ------------------
  |  Branch (1017:7): [True: 32, False: 0]
  |  Branch (1017:27): [True: 0, False: 32]
  |  Branch (1017:37): [True: 0, False: 0]
  ------------------
 1018|      0|      b->bh.bb.bsize == (bufsize)(thr->pool_len - sizeof(bhead_t))) {
  ------------------
  |  Branch (1018:7): [True: 0, False: 0]
  ------------------
 1019|      0|    KMP_DEBUG_ASSERT(b->bh.bb.prevfree == 0);
 1020|      0|    KMP_DEBUG_ASSERT(BH((char *)b + b->bh.bb.bsize)->bb.bsize == ESent);
 1021|      0|    KMP_DEBUG_ASSERT(BH((char *)b + b->bh.bb.bsize)->bb.prevfree ==
 1022|      0|                     b->bh.bb.bsize);
 1023|       |
 1024|       |    /*  Unlink the buffer from the free list  */
 1025|      0|    __kmp_bget_remove_from_freelist(b);
 1026|       |
 1027|      0|    KE_TRACE(10, ("%%%%%% FREE( %p )\n", (void *)b));
 1028|       |
 1029|      0|    (*thr->relfcn)(b);
 1030|      0|    thr->numprel++; /* Nr of expansion block releases */
 1031|      0|    thr->numpblk--; /* Total number of blocks */
 1032|      0|    KMP_DEBUG_ASSERT(thr->numpblk == thr->numpget - thr->numprel);
 1033|      0|  }
 1034|     32|#endif /* BufStats */
 1035|       |
 1036|       |  /* Deallocate bget_data */
 1037|     32|  if (th->th.th_local.bget_data != NULL) {
  ------------------
  |  Branch (1037:7): [True: 32, False: 0]
  ------------------
 1038|     32|    __kmp_free(th->th.th_local.bget_data);
  ------------------
  |  | 3619|     32|#define __kmp_free(ptr) ___kmp_free((ptr)KMP_SRC_LOC_CURR)
  ------------------
 1039|       |    th->th.th_local.bget_data = NULL;
 1040|     32|  }
 1041|     32|}
__kmp_init_memkind:
 1272|      1|void __kmp_init_memkind() {
 1273|       |// as of 2018-07-31 memkind does not support Windows*, exclude it for now
 1274|       |#if KMP_OS_UNIX && KMP_DYNAMIC_LIB && !KMP_OS_DARWIN
 1275|       |  // use of statically linked memkind is problematic, as it depends on libnuma
 1276|       |  kmp_mk_lib_name = "libmemkind.so";
 1277|       |  h_memkind = dlopen(kmp_mk_lib_name, RTLD_LAZY);
 1278|       |  if (h_memkind) {
 1279|       |    kmp_mk_check = (int (*)(void *))dlsym(h_memkind, "memkind_check_available");
 1280|       |    kmp_mk_alloc =
 1281|       |        (void *(*)(void *, size_t))dlsym(h_memkind, "memkind_malloc");
 1282|       |    kmp_mk_free = (void (*)(void *, void *))dlsym(h_memkind, "memkind_free");
 1283|       |    mk_default = (void **)dlsym(h_memkind, "MEMKIND_DEFAULT");
 1284|       |    if (kmp_mk_check && kmp_mk_alloc && kmp_mk_free && mk_default &&
 1285|       |        !kmp_mk_check(*mk_default)) {
 1286|       |      __kmp_memkind_available = 1;
 1287|       |      mk_interleave = (void **)dlsym(h_memkind, "MEMKIND_INTERLEAVE");
 1288|       |      chk_kind(&mk_interleave);
 1289|       |      mk_hbw = (void **)dlsym(h_memkind, "MEMKIND_HBW");
 1290|       |      chk_kind(&mk_hbw);
 1291|       |      mk_hbw_interleave = (void **)dlsym(h_memkind, "MEMKIND_HBW_INTERLEAVE");
 1292|       |      chk_kind(&mk_hbw_interleave);
 1293|       |      mk_hbw_preferred = (void **)dlsym(h_memkind, "MEMKIND_HBW_PREFERRED");
 1294|       |      chk_kind(&mk_hbw_preferred);
 1295|       |      mk_hugetlb = (void **)dlsym(h_memkind, "MEMKIND_HUGETLB");
 1296|       |      chk_kind(&mk_hugetlb);
 1297|       |      mk_hbw_hugetlb = (void **)dlsym(h_memkind, "MEMKIND_HBW_HUGETLB");
 1298|       |      chk_kind(&mk_hbw_hugetlb);
 1299|       |      mk_hbw_preferred_hugetlb =
 1300|       |          (void **)dlsym(h_memkind, "MEMKIND_HBW_PREFERRED_HUGETLB");
 1301|       |      chk_kind(&mk_hbw_preferred_hugetlb);
 1302|       |      mk_dax_kmem = (void **)dlsym(h_memkind, "MEMKIND_DAX_KMEM");
 1303|       |      chk_kind(&mk_dax_kmem);
 1304|       |      mk_dax_kmem_all = (void **)dlsym(h_memkind, "MEMKIND_DAX_KMEM_ALL");
 1305|       |      chk_kind(&mk_dax_kmem_all);
 1306|       |      mk_dax_kmem_preferred =
 1307|       |          (void **)dlsym(h_memkind, "MEMKIND_DAX_KMEM_PREFERRED");
 1308|       |      chk_kind(&mk_dax_kmem_preferred);
 1309|       |      KE_TRACE(25, ("__kmp_init_memkind: memkind library initialized\n"));
 1310|       |      return; // success
 1311|       |    }
 1312|       |    dlclose(h_memkind); // failure
 1313|       |  }
 1314|       |#else // !(KMP_OS_UNIX && KMP_DYNAMIC_LIB)
 1315|      1|  kmp_mk_lib_name = "";
 1316|      1|#endif // !(KMP_OS_UNIX && KMP_DYNAMIC_LIB)
 1317|      1|  h_memkind = NULL;
 1318|      1|  kmp_mk_check = NULL;
 1319|      1|  kmp_mk_alloc = NULL;
 1320|      1|  kmp_mk_free = NULL;
 1321|      1|  mk_default = NULL;
 1322|      1|  mk_interleave = NULL;
 1323|      1|  mk_hbw = NULL;
 1324|      1|  mk_hbw_interleave = NULL;
 1325|      1|  mk_hbw_preferred = NULL;
 1326|      1|  mk_hugetlb = NULL;
 1327|      1|  mk_hbw_hugetlb = NULL;
 1328|      1|  mk_hbw_preferred_hugetlb = NULL;
 1329|      1|  mk_dax_kmem = NULL;
 1330|      1|  mk_dax_kmem_all = NULL;
 1331|       |  mk_dax_kmem_preferred = NULL;
 1332|      1|}
__kmp_fini_memkind:
 1334|      1|void __kmp_fini_memkind() {
 1335|       |#if KMP_OS_UNIX && KMP_DYNAMIC_LIB
 1336|       |  if (__kmp_memkind_available)
 1337|       |    KE_TRACE(25, ("__kmp_fini_memkind: finalize memkind library\n"));
 1338|       |  if (h_memkind) {
 1339|       |    dlclose(h_memkind);
 1340|       |    h_memkind = NULL;
 1341|       |  }
 1342|       |  kmp_mk_check = NULL;
 1343|       |  kmp_mk_alloc = NULL;
 1344|       |  kmp_mk_free = NULL;
 1345|       |  mk_default = NULL;
 1346|       |  mk_interleave = NULL;
 1347|       |  mk_hbw = NULL;
 1348|       |  mk_hbw_interleave = NULL;
 1349|       |  mk_hbw_preferred = NULL;
 1350|       |  mk_hugetlb = NULL;
 1351|       |  mk_hbw_hugetlb = NULL;
 1352|       |  mk_hbw_preferred_hugetlb = NULL;
 1353|       |  mk_dax_kmem = NULL;
 1354|       |  mk_dax_kmem_all = NULL;
 1355|       |  mk_dax_kmem_preferred = NULL;
 1356|       |#endif
 1357|      1|}
__kmp_init_target_mem:
 1359|      1|void __kmp_init_target_mem() {
 1360|      1|  *(void **)(&kmp_target_alloc_host) = KMP_DLSYM("llvm_omp_target_alloc_host");
  ------------------
  |  | 1289|      1|#define KMP_DLSYM(name) dlsym(RTLD_DEFAULT, name)
  ------------------
 1361|      1|  *(void **)(&kmp_target_alloc_shared) =
 1362|      1|      KMP_DLSYM("llvm_omp_target_alloc_shared");
  ------------------
  |  | 1289|      1|#define KMP_DLSYM(name) dlsym(RTLD_DEFAULT, name)
  ------------------
 1363|      1|  *(void **)(&kmp_target_alloc_device) =
 1364|      1|      KMP_DLSYM("llvm_omp_target_alloc_device");
  ------------------
  |  | 1289|      1|#define KMP_DLSYM(name) dlsym(RTLD_DEFAULT, name)
  ------------------
 1365|      1|  *(void **)(&kmp_target_free_host) = KMP_DLSYM("llvm_omp_target_free_host");
  ------------------
  |  | 1289|      1|#define KMP_DLSYM(name) dlsym(RTLD_DEFAULT, name)
  ------------------
 1366|      1|  *(void **)(&kmp_target_free_shared) =
 1367|      1|      KMP_DLSYM("llvm_omp_target_free_shared");
  ------------------
  |  | 1289|      1|#define KMP_DLSYM(name) dlsym(RTLD_DEFAULT, name)
  ------------------
 1368|      1|  *(void **)(&kmp_target_free_device) =
 1369|      1|      KMP_DLSYM("llvm_omp_target_free_device");
  ------------------
  |  | 1289|      1|#define KMP_DLSYM(name) dlsym(RTLD_DEFAULT, name)
  ------------------
 1370|      1|  __kmp_target_mem_available =
 1371|      1|      kmp_target_alloc_host && kmp_target_alloc_shared &&
  ------------------
  |  Branch (1371:7): [True: 0, False: 1]
  |  Branch (1371:32): [True: 0, False: 0]
  ------------------
 1372|      0|      kmp_target_alloc_device && kmp_target_free_host &&
  ------------------
  |  Branch (1372:7): [True: 0, False: 0]
  |  Branch (1372:34): [True: 0, False: 0]
  ------------------
 1373|      0|      kmp_target_free_shared && kmp_target_free_device;
  ------------------
  |  Branch (1373:7): [True: 0, False: 0]
  |  Branch (1373:33): [True: 0, False: 0]
  ------------------
 1374|       |  // lock/pin and unlock/unpin target calls
 1375|      1|  *(void **)(&kmp_target_lock_mem) = KMP_DLSYM("llvm_omp_target_lock_mem");
  ------------------
  |  | 1289|      1|#define KMP_DLSYM(name) dlsym(RTLD_DEFAULT, name)
  ------------------
 1376|       |  *(void **)(&kmp_target_unlock_mem) = KMP_DLSYM("llvm_omp_target_unlock_mem");
  ------------------
  |  | 1289|      1|#define KMP_DLSYM(name) dlsym(RTLD_DEFAULT, name)
  ------------------
 1377|      1|}
___kmp_allocate:
 1997|  3.49k|void *___kmp_allocate(size_t size KMP_SRC_LOC_DECL) {
 1998|  3.49k|  void *ptr;
 1999|  3.49k|  KE_TRACE(25, ("-> __kmp_allocate( %d ) called from %s:%d\n",
 2000|  3.49k|                (int)size KMP_SRC_LOC_PARM));
 2001|  3.49k|  ptr = ___kmp_allocate_align(size, __kmp_align_alloc KMP_SRC_LOC_PARM);
 2002|  3.49k|  KE_TRACE(25, ("<- __kmp_allocate() returns %p\n", ptr));
 2003|  3.49k|  return ptr;
 2004|  3.49k|} // func ___kmp_allocate
___kmp_free:
 2023|  3.49k|void ___kmp_free(void *ptr KMP_SRC_LOC_DECL) {
 2024|  3.49k|  kmp_mem_descr_t descr;
 2025|       |#if KMP_DEBUG
 2026|       |  kmp_uintptr_t addr_allocated; // Address returned by malloc().
 2027|       |  kmp_uintptr_t addr_aligned; // Aligned address passed by caller.
 2028|       |#endif
 2029|  3.49k|  KE_TRACE(25,
 2030|  3.49k|           ("-> __kmp_free( %p ) called from %s:%d\n", ptr KMP_SRC_LOC_PARM));
 2031|  3.49k|  KMP_ASSERT(ptr != NULL);
  ------------------
  |  |   50|  3.49k|  if (!(cond)) {                                                               \
  |  |  ------------------
  |  |  |  Branch (50:7): [True: 0, False: 3.49k]
  |  |  ------------------
  |  |   51|      0|    __kmp_debug_assert("assertion failure", __FILE__, __LINE__);               \
  |  |   52|      0|  }
  ------------------
 2032|       |
 2033|  3.49k|  descr = *(kmp_mem_descr_t *)((kmp_uintptr_t)ptr - sizeof(kmp_mem_descr_t));
 2034|       |
 2035|  3.49k|  KE_TRACE(26, ("   __kmp_free:     "
 2036|  3.49k|                "ptr_allocated=%p, size_allocated=%d, "
 2037|  3.49k|                "ptr_aligned=%p, size_aligned=%d\n",
 2038|  3.49k|                descr.ptr_allocated, (int)descr.size_allocated,
 2039|  3.49k|                descr.ptr_aligned, (int)descr.size_aligned));
 2040|       |#if KMP_DEBUG
 2041|       |  addr_allocated = (kmp_uintptr_t)descr.ptr_allocated;
 2042|       |  addr_aligned = (kmp_uintptr_t)descr.ptr_aligned;
 2043|       |  KMP_DEBUG_ASSERT(addr_aligned % CACHE_LINE == 0);
 2044|       |  KMP_DEBUG_ASSERT(descr.ptr_aligned == ptr);
 2045|       |  KMP_DEBUG_ASSERT(addr_allocated + sizeof(kmp_mem_descr_t) <= addr_aligned);
 2046|       |  KMP_DEBUG_ASSERT(descr.size_aligned < descr.size_allocated);
 2047|       |  KMP_DEBUG_ASSERT(addr_aligned + descr.size_aligned <=
 2048|       |                   addr_allocated + descr.size_allocated);
 2049|       |  memset(descr.ptr_allocated, 0xEF, descr.size_allocated);
 2050|       |// Fill memory block with 0xEF, it helps catch using freed memory.
 2051|       |#endif
 2052|       |
 2053|  3.49k|#ifndef LEAK_MEMORY
 2054|  3.49k|  KE_TRACE(10, ("   free( %p )\n", descr.ptr_allocated));
 2055|       |#ifdef KMP_DEBUG
 2056|       |  _free_src_loc(descr.ptr_allocated, _file_, _line_);
 2057|       |#else
 2058|  3.49k|  free_src_loc(descr.ptr_allocated KMP_SRC_LOC_PARM);
  ------------------
  |  |  145|  3.49k|#define free_src_loc(args) _free_src_loc(args)
  |  |  ------------------
  |  |  |  |  190|  3.49k|#define _free_src_loc(ptr) free((ptr))
  |  |  ------------------
  ------------------
 2059|  3.49k|#endif
 2060|  3.49k|#endif
 2061|  3.49k|  KMP_MB();
 2062|  3.49k|  KE_TRACE(25, ("<- __kmp_free() returns\n"));
 2063|  3.49k|} // func ___kmp_free
__kmp_initialize_fast_memory:
 2276|     32|void __kmp_initialize_fast_memory(kmp_info_t *this_thr) {
 2277|     32|  KE_TRACE(10, ("__kmp_initialize_fast_memory: Called from th %p\n", this_thr));
 2278|       |
 2279|     32|  memset(this_thr->th.th_free_lists, 0, NUM_LISTS * sizeof(kmp_free_list_t));
  ------------------
  |  | 2926|     32|#define NUM_LISTS 4
  ------------------
 2280|     32|}
__kmp_free_fast_memory:
 2284|     32|void __kmp_free_fast_memory(kmp_info_t *th) {
 2285|       |  // Suppose we use BGET underlying allocator, walk through its structures...
 2286|     32|  int bin;
 2287|     32|  thr_data_t *thr = get_thr_data(th);
 2288|     32|  void **lst = NULL;
 2289|       |
 2290|     32|  KE_TRACE(
 2291|     32|      5, ("__kmp_free_fast_memory: Called T#%d\n", __kmp_gtid_from_thread(th)));
 2292|       |
 2293|     32|  __kmp_bget_dequeue(th); // Release any queued buffers
 2294|       |
 2295|       |  // Dig through free lists and extract all allocated blocks
 2296|    672|  for (bin = 0; bin < MAX_BGET_BINS; ++bin) {
  ------------------
  |  |  124|    672|#define MAX_BGET_BINS (int)(sizeof(bget_bin_size) / sizeof(bufsize))
  ------------------
  |  Branch (2296:17): [True: 640, False: 32]
  ------------------
 2297|    640|    bfhead_t *b = thr->freelist[bin].ql.flink;
 2298|    640|    while (b != &thr->freelist[bin]) {
  ------------------
  |  Branch (2298:12): [True: 0, False: 640]
  ------------------
 2299|      0|      if ((kmp_uintptr_t)b->bh.bb.bthr & 1) { // the buffer is allocated address
  ------------------
  |  Branch (2299:11): [True: 0, False: 0]
  ------------------
 2300|      0|        *((void **)b) =
 2301|      0|            lst; // link the list (override bthr, but keep flink yet)
 2302|      0|        lst = (void **)b; // push b into lst
 2303|      0|      }
 2304|      0|      b = b->ql.flink; // get next buffer
 2305|      0|    }
 2306|    640|  }
 2307|     32|  while (lst != NULL) {
  ------------------
  |  Branch (2307:10): [True: 0, False: 32]
  ------------------
 2308|      0|    void *next = *lst;
 2309|      0|    KE_TRACE(10, ("__kmp_free_fast_memory: freeing %p, next=%p th %p (%d)\n",
 2310|      0|                  lst, next, th, __kmp_gtid_from_thread(th)));
 2311|      0|    (*thr->relfcn)(lst);
 2312|      0|#if BufStats
 2313|       |    // count blocks to prevent problems in __kmp_finalize_bget()
 2314|      0|    thr->numprel++; /* Nr of expansion block releases */
 2315|      0|    thr->numpblk--; /* Total number of blocks */
 2316|      0|#endif
 2317|      0|    lst = (void **)next;
 2318|      0|  }
 2319|       |
 2320|     32|  KE_TRACE(
 2321|     32|      5, ("__kmp_free_fast_memory: Freed T#%d\n", __kmp_gtid_from_thread(th)));
 2322|     32|}
kmp_alloc.cpp:_ZL12set_thr_dataP8kmp_info:
  227|     32|static void set_thr_data(kmp_info_t *th) {
  228|     32|  int i;
  229|     32|  thr_data_t *data;
  230|       |
  231|     32|  data = (thr_data_t *)((!th->th.th_local.bget_data)
  ------------------
  |  Branch (231:25): [True: 32, False: 0]
  ------------------
  232|     32|                            ? __kmp_allocate(sizeof(*data))
  ------------------
  |  | 3617|     32|#define __kmp_allocate(size) ___kmp_allocate((size)KMP_SRC_LOC_CURR)
  ------------------
  233|     32|                            : th->th.th_local.bget_data);
  234|       |
  235|     32|  memset(data, '\0', sizeof(*data));
  236|       |
  237|    672|  for (i = 0; i < MAX_BGET_BINS; ++i) {
  ------------------
  |  |  124|    672|#define MAX_BGET_BINS (int)(sizeof(bget_bin_size) / sizeof(bufsize))
  ------------------
  |  Branch (237:15): [True: 640, False: 32]
  ------------------
  238|    640|    data->freelist[i].ql.flink = &data->freelist[i];
  239|    640|    data->freelist[i].ql.blink = &data->freelist[i];
  240|    640|  }
  241|       |
  242|     32|  th->th.th_local.bget_data = data;
  243|     32|  th->th.th_local.bget_list = 0;
  244|       |#if !USE_CMP_XCHG_FOR_BGET
  245|       |#ifdef USE_QUEUING_LOCK_FOR_BGET
  246|       |  __kmp_init_lock(&th->th.th_local.bget_lock);
  247|       |#else
  248|       |  __kmp_init_bootstrap_lock(&th->th.th_local.bget_lock);
  249|       |#endif /* USE_LOCK_FOR_BGET */
  250|       |#endif /* ! USE_CMP_XCHG_FOR_BGET */
  251|     32|}
kmp_alloc.cpp:_ZL5bectlP8kmp_infoPFimiEPFPvmEPFvS3_El:
  867|     32|                  bufsize pool_incr) {
  868|     32|  thr_data_t *thr = get_thr_data(th);
  869|       |
  870|     32|  thr->compfcn = compact;
  871|     32|  thr->acqfcn = acquire;
  872|     32|  thr->relfcn = release;
  873|     32|  thr->exp_incr = pool_incr;
  874|     32|}
kmp_alloc.cpp:_ZL12get_thr_dataP8kmp_info:
  253|     64|static thr_data_t *get_thr_data(kmp_info_t *th) {
  254|     64|  thr_data_t *data;
  255|       |
  256|     64|  data = (thr_data_t *)th->th.th_local.bget_data;
  257|       |
  258|     64|  KMP_DEBUG_ASSERT(data != 0);
  259|       |
  260|     64|  return data;
  261|     64|}
kmp_alloc.cpp:_ZL18__kmp_bget_dequeueP8kmp_info:
  264|     32|static void __kmp_bget_dequeue(kmp_info_t *th) {
  265|     32|  void *p = TCR_SYNC_PTR(th->th.th_local.bget_list);
  ------------------
  |  | 1158|     32|#define TCR_SYNC_PTR(a) ((void *)TCR_SYNC_8(a))
  |  |  ------------------
  |  |  |  | 1140|     32|#define TCR_SYNC_8(a) (a)
  |  |  ------------------
  ------------------
  266|       |
  267|     32|  if (p != 0) {
  ------------------
  |  Branch (267:7): [True: 0, False: 32]
  ------------------
  268|      0|#if USE_CMP_XCHG_FOR_BGET
  269|      0|    {
  270|      0|      volatile void *old_value = TCR_SYNC_PTR(th->th.th_local.bget_list);
  ------------------
  |  | 1158|      0|#define TCR_SYNC_PTR(a) ((void *)TCR_SYNC_8(a))
  |  |  ------------------
  |  |  |  | 1140|      0|#define TCR_SYNC_8(a) (a)
  |  |  ------------------
  ------------------
  271|      0|      while (!KMP_COMPARE_AND_STORE_PTR(&th->th.th_local.bget_list,
  ------------------
  |  |  813|      0|  __sync_bool_compare_and_swap((void *volatile *)(p), (void *)(cv),            \
  |  |  814|      0|                               (void *)(sv))
  ------------------
  |  Branch (271:14): [True: 0, False: 0]
  ------------------
  272|      0|                                        CCAST(void *, old_value), nullptr)) {
  273|      0|        KMP_CPU_PAUSE();
  ------------------
  |  | 1498|      0|#define KMP_CPU_PAUSE() __kmp_x86_pause()
  ------------------
  274|      0|        old_value = TCR_SYNC_PTR(th->th.th_local.bget_list);
  ------------------
  |  | 1158|      0|#define TCR_SYNC_PTR(a) ((void *)TCR_SYNC_8(a))
  |  |  ------------------
  |  |  |  | 1140|      0|#define TCR_SYNC_8(a) (a)
  |  |  ------------------
  ------------------
  275|      0|      }
  276|      0|      p = CCAST(void *, old_value);
  ------------------
  |  |  229|      0|#define CCAST(type, var) const_cast<type>(var)
  ------------------
  277|      0|    }
  278|       |#else /* ! USE_CMP_XCHG_FOR_BGET */
  279|       |#ifdef USE_QUEUING_LOCK_FOR_BGET
  280|       |    __kmp_acquire_lock(&th->th.th_local.bget_lock, __kmp_gtid_from_thread(th));
  281|       |#else
  282|       |    __kmp_acquire_bootstrap_lock(&th->th.th_local.bget_lock);
  283|       |#endif /* USE_QUEUING_LOCK_FOR_BGET */
  284|       |
  285|       |    p = (void *)th->th.th_local.bget_list;
  286|       |    th->th.th_local.bget_list = 0;
  287|       |
  288|       |#ifdef USE_QUEUING_LOCK_FOR_BGET
  289|       |    __kmp_release_lock(&th->th.th_local.bget_lock, __kmp_gtid_from_thread(th));
  290|       |#else
  291|       |    __kmp_release_bootstrap_lock(&th->th.th_local.bget_lock);
  292|       |#endif
  293|       |#endif /* USE_CMP_XCHG_FOR_BGET */
  294|       |
  295|       |    /* Check again to make sure the list is not empty */
  296|      0|    while (p != 0) {
  ------------------
  |  Branch (296:12): [True: 0, False: 0]
  ------------------
  297|      0|      void *buf = p;
  298|      0|      bfhead_t *b = BFH(((char *)p) - sizeof(bhead_t));
  ------------------
  |  |  165|      0|#define BFH(p) ((bfhead_t *)(p))
  ------------------
  299|       |
  300|      0|      KMP_DEBUG_ASSERT(b->bh.bb.bsize != 0);
  301|      0|      KMP_DEBUG_ASSERT(((kmp_uintptr_t)TCR_PTR(b->bh.bb.bthr) & ~1) ==
  302|      0|                       (kmp_uintptr_t)th); // clear possible mark
  303|      0|      KMP_DEBUG_ASSERT(b->ql.blink == 0);
  304|       |
  305|      0|      p = (void *)b->ql.flink;
  306|       |
  307|      0|      brel(th, buf);
  308|      0|    }
  309|      0|  }
  310|     32|}
kmp_alloc.cpp:_ZL21___kmp_allocate_alignmm:
 1913|  3.49k|                                   size_t alignment KMP_SRC_LOC_DECL) {
 1914|       |  /* __kmp_allocate() allocates (by call to malloc()) bigger memory block than
 1915|       |     requested to return properly aligned pointer. Original pointer returned
 1916|       |     by malloc() and size of allocated block is saved in descriptor just
 1917|       |     before the aligned pointer. This information used by __kmp_free() -- it
 1918|       |     has to pass to free() original pointer, not aligned one.
 1919|       |
 1920|       |          +---------+------------+-----------------------------------+---------+
 1921|       |          | padding | descriptor |           aligned block           | padding |
 1922|       |          +---------+------------+-----------------------------------+---------+
 1923|       |          ^                      ^
 1924|       |          |                      |
 1925|       |          |                      +- Aligned pointer returned to caller
 1926|       |          +- Pointer returned by malloc()
 1927|       |
 1928|       |      Aligned block is filled with zeros, paddings are filled with 0xEF. */
 1929|       |
 1930|  3.49k|  kmp_mem_descr_t descr;
 1931|  3.49k|  kmp_uintptr_t addr_allocated; // Address returned by malloc().
 1932|  3.49k|  kmp_uintptr_t addr_aligned; // Aligned address to return to caller.
 1933|  3.49k|  kmp_uintptr_t addr_descr; // Address of memory block descriptor.
 1934|       |
 1935|  3.49k|  KE_TRACE(25, ("-> ___kmp_allocate_align( %d, %d ) called from %s:%d\n",
 1936|  3.49k|                (int)size, (int)alignment KMP_SRC_LOC_PARM));
 1937|       |
 1938|  3.49k|  KMP_DEBUG_ASSERT(alignment < 32 * 1024); // Alignment should not be too
 1939|  3.49k|  KMP_DEBUG_ASSERT(sizeof(void *) <= sizeof(kmp_uintptr_t));
 1940|       |  // Make sure kmp_uintptr_t is enough to store addresses.
 1941|       |
 1942|  3.49k|  descr.size_aligned = size;
 1943|  3.49k|  descr.size_allocated =
 1944|  3.49k|      descr.size_aligned + sizeof(kmp_mem_descr_t) + alignment;
 1945|       |
 1946|       |#if KMP_DEBUG
 1947|       |  descr.ptr_allocated = _malloc_src_loc(descr.size_allocated, _file_, _line_);
 1948|       |#else
 1949|  3.49k|  descr.ptr_allocated = malloc_src_loc(descr.size_allocated KMP_SRC_LOC_PARM);
  ------------------
  |  |  144|  3.49k|#define malloc_src_loc(args) _malloc_src_loc(args)
  |  |  ------------------
  |  |  |  |  189|  3.49k|#define _malloc_src_loc(size) malloc((size))
  |  |  ------------------
  ------------------
 1950|  3.49k|#endif
 1951|  3.49k|  KE_TRACE(10, ("   malloc( %d ) returned %p\n", (int)descr.size_allocated,
 1952|  3.49k|                descr.ptr_allocated));
 1953|  3.49k|  if (descr.ptr_allocated == NULL) {
  ------------------
  |  Branch (1953:7): [True: 0, False: 3.49k]
  ------------------
 1954|      0|    KMP_FATAL(OutOfHeapMemory);
  ------------------
  |  |  146|      0|#define KMP_FATAL(...) __kmp_fatal(KMP_MSG(__VA_ARGS__), __kmp_msg_null)
  |  |  ------------------
  |  |  |  |  121|      0|#define KMP_MSG(...) __kmp_msg_format(kmp_i18n_msg_##__VA_ARGS__)
  |  |  ------------------
  ------------------
 1955|      0|  }
 1956|       |
 1957|  3.49k|  addr_allocated = (kmp_uintptr_t)descr.ptr_allocated;
 1958|  3.49k|  addr_aligned =
 1959|  3.49k|      (addr_allocated + sizeof(kmp_mem_descr_t) + alignment) & ~(alignment - 1);
 1960|  3.49k|  addr_descr = addr_aligned - sizeof(kmp_mem_descr_t);
 1961|       |
 1962|  3.49k|  descr.ptr_aligned = (void *)addr_aligned;
 1963|       |
 1964|  3.49k|  KE_TRACE(26, ("   ___kmp_allocate_align: "
 1965|  3.49k|                "ptr_allocated=%p, size_allocated=%d, "
 1966|  3.49k|                "ptr_aligned=%p, size_aligned=%d\n",
 1967|  3.49k|                descr.ptr_allocated, (int)descr.size_allocated,
 1968|  3.49k|                descr.ptr_aligned, (int)descr.size_aligned));
 1969|       |
 1970|  3.49k|  KMP_DEBUG_ASSERT(addr_allocated <= addr_descr);
 1971|  3.49k|  KMP_DEBUG_ASSERT(addr_descr + sizeof(kmp_mem_descr_t) == addr_aligned);
 1972|  3.49k|  KMP_DEBUG_ASSERT(addr_aligned + descr.size_aligned <=
 1973|  3.49k|                   addr_allocated + descr.size_allocated);
 1974|  3.49k|  KMP_DEBUG_ASSERT(addr_aligned % alignment == 0);
 1975|       |#ifdef KMP_DEBUG
 1976|       |  memset(descr.ptr_allocated, 0xEF, descr.size_allocated);
 1977|       |// Fill allocated memory block with 0xEF.
 1978|       |#endif
 1979|  3.49k|  memset(descr.ptr_aligned, 0x00, descr.size_aligned);
 1980|       |  // Fill the aligned memory block (which is intended for using by caller) with
 1981|       |  // 0x00. Do not
 1982|       |  // put this filling under KMP_DEBUG condition! Many callers expect zeroed
 1983|       |  // memory. (Padding
 1984|       |  // bytes remain filled with 0xEF in debugging library.)
 1985|  3.49k|  *((kmp_mem_descr_t *)addr_descr) = descr;
 1986|       |
 1987|  3.49k|  KMP_MB();
 1988|       |
 1989|  3.49k|  KE_TRACE(25, ("<- ___kmp_allocate_align() returns %p\n", descr.ptr_aligned));
 1990|  3.49k|  return descr.ptr_aligned;
 1991|  3.49k|} // func ___kmp_allocate_align

kmp_runtime.cpp:_ZL22__kmp_init_atomic_lockP16kmp_queuing_lock:
  405|     13|static inline void __kmp_init_atomic_lock(kmp_atomic_lock_t *lck) {
  406|     13|  __kmp_init_queuing_lock(lck);
  407|     13|}

__kmp_barrier:
 2084|  37.1k|                  void (*reduce)(void *, void *)) {
 2085|  37.1k|  return __kmp_barrier_template<>(bt, gtid, is_split, reduce_size, reduce_data,
 2086|  37.1k|                                  reduce);
 2087|  37.1k|}
_Z18__kmp_join_barrieri:
 2158|  42.3k|void __kmp_join_barrier(int gtid) {
 2159|  42.3k|  KMP_TIME_PARTITIONED_BLOCK(OMP_join_barrier);
  ------------------
  |  | 1013|  42.3k|#define KMP_TIME_PARTITIONED_BLOCK(name) ((void)0)
  ------------------
 2160|  42.3k|  KMP_SET_THREAD_STATE_BLOCK(FORK_JOIN_BARRIER);
  ------------------
  |  | 1018|  42.3k|#define KMP_SET_THREAD_STATE_BLOCK(state_name) ((void)0)
  ------------------
 2161|       |
 2162|  42.3k|  KMP_DEBUG_ASSERT(__kmp_threads && __kmp_threads[gtid]);
 2163|       |
 2164|  42.3k|  kmp_info_t *this_thr = __kmp_threads[gtid];
 2165|  42.3k|  kmp_team_t *team;
 2166|  42.3k|  int tid;
 2167|       |#ifdef KMP_DEBUG
 2168|       |  int team_id;
 2169|       |#endif /* KMP_DEBUG */
 2170|       |#if USE_ITT_BUILD
 2171|       |  void *itt_sync_obj = NULL;
 2172|       |#if USE_ITT_NOTIFY
 2173|       |  if (__itt_sync_create_ptr || KMP_ITT_DEBUG) // Don't call routine without need
 2174|       |    // Get object created at fork_barrier
 2175|       |    itt_sync_obj = __kmp_itt_barrier_object(gtid, bs_forkjoin_barrier);
 2176|       |#endif
 2177|       |#endif /* USE_ITT_BUILD */
 2178|       |#if ((USE_ITT_BUILD && USE_ITT_NOTIFY) || defined KMP_DEBUG)
 2179|       |  int nproc = this_thr->th.th_team_nproc;
 2180|       |#endif
 2181|  42.3k|  KMP_MB();
 2182|       |
 2183|       |  // Get current info
 2184|  42.3k|  team = this_thr->th.th_team;
 2185|  42.3k|  KMP_DEBUG_ASSERT(nproc == team->t.t_nproc);
 2186|  42.3k|  tid = __kmp_tid_from_gtid(gtid);
 2187|       |#ifdef KMP_DEBUG
 2188|       |  team_id = team->t.t_id;
 2189|       |  kmp_info_t *master_thread = this_thr->th.th_team_master;
 2190|       |  if (master_thread != team->t.t_threads[0]) {
 2191|       |    __kmp_print_structure();
 2192|       |  }
 2193|       |#endif /* KMP_DEBUG */
 2194|  42.3k|  KMP_DEBUG_ASSERT(master_thread == team->t.t_threads[0]);
 2195|  42.3k|  KMP_MB();
 2196|       |
 2197|       |  // Verify state
 2198|  42.3k|  KMP_DEBUG_ASSERT(TCR_PTR(this_thr->th.th_team));
 2199|  42.3k|  KMP_DEBUG_ASSERT(TCR_PTR(this_thr->th.th_root));
 2200|  42.3k|  KMP_DEBUG_ASSERT(this_thr == team->t.t_threads[tid]);
 2201|  42.3k|  KA_TRACE(10, ("__kmp_join_barrier: T#%d(%d:%d) arrived at join barrier\n",
 2202|  42.3k|                gtid, team_id, tid));
 2203|       |
 2204|  42.3k|#if OMPT_SUPPORT
 2205|  42.3k|  if (ompt_enabled.enabled) {
  ------------------
  |  Branch (2205:7): [True: 0, False: 42.3k]
  ------------------
 2206|      0|#if OMPT_OPTIONAL
 2207|      0|    ompt_data_t *my_task_data;
 2208|      0|    ompt_data_t *my_parallel_data;
 2209|      0|    void *codeptr = NULL;
 2210|      0|    int ds_tid = this_thr->th.th_info.ds.ds_tid;
 2211|      0|    if (KMP_MASTER_TID(ds_tid) &&
  ------------------
  |  | 1271|      0|#define KMP_MASTER_TID(tid) (0 == (tid))
  |  |  ------------------
  |  |  |  Branch (1271:29): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2212|      0|        (ompt_callbacks.ompt_callback(ompt_callback_sync_region_wait) ||
  ------------------
  |  |   27|      0|#define ompt_callback(e) e##_callback
  ------------------
  |  Branch (2212:10): [True: 0, False: 0]
  ------------------
 2213|      0|         ompt_callbacks.ompt_callback(ompt_callback_sync_region)))
  ------------------
  |  |   27|      0|#define ompt_callback(e) e##_callback
  ------------------
  |  Branch (2213:10): [True: 0, False: 0]
  ------------------
 2214|      0|      codeptr = team->t.ompt_team_info.master_return_address;
 2215|      0|    my_task_data = OMPT_CUR_TASK_DATA(this_thr);
  ------------------
  |  |   70|      0|  (&((thr)->th.th_current_task->ompt_task_info.task_data))
  ------------------
 2216|      0|    my_parallel_data = OMPT_CUR_TEAM_DATA(this_thr);
  ------------------
  |  |   73|      0|  (&((thr)->th.th_team->t.ompt_team_info.parallel_data))
  ------------------
 2217|      0|    if (ompt_enabled.ompt_callback_sync_region) {
  ------------------
  |  Branch (2217:9): [True: 0, False: 0]
  ------------------
 2218|      0|      ompt_callbacks.ompt_callback(ompt_callback_sync_region)(
  ------------------
  |  |   27|      0|#define ompt_callback(e) e##_callback
  ------------------
 2219|      0|          ompt_sync_region_barrier_implicit, ompt_scope_begin, my_parallel_data,
 2220|      0|          my_task_data, codeptr);
 2221|      0|    }
 2222|      0|    if (ompt_enabled.ompt_callback_sync_region_wait) {
  ------------------
  |  Branch (2222:9): [True: 0, False: 0]
  ------------------
 2223|      0|      ompt_callbacks.ompt_callback(ompt_callback_sync_region_wait)(
  ------------------
  |  |   27|      0|#define ompt_callback(e) e##_callback
  ------------------
 2224|      0|          ompt_sync_region_barrier_implicit, ompt_scope_begin, my_parallel_data,
 2225|      0|          my_task_data, codeptr);
 2226|      0|    }
 2227|      0|    if (!KMP_MASTER_TID(ds_tid))
  ------------------
  |  | 1271|      0|#define KMP_MASTER_TID(tid) (0 == (tid))
  ------------------
  |  Branch (2227:9): [True: 0, False: 0]
  ------------------
 2228|      0|      this_thr->th.ompt_thread_info.task_data = *OMPT_CUR_TASK_DATA(this_thr);
  ------------------
  |  |   70|      0|  (&((thr)->th.th_current_task->ompt_task_info.task_data))
  ------------------
 2229|      0|#endif
 2230|      0|    this_thr->th.ompt_thread_info.state = ompt_state_wait_barrier_implicit;
 2231|      0|  }
 2232|  42.3k|#endif
 2233|       |
 2234|  42.3k|  if (__kmp_tasking_mode == tskm_extra_barrier) {
  ------------------
  |  Branch (2234:7): [True: 0, False: 42.3k]
  ------------------
 2235|      0|    __kmp_tasking_barrier(team, this_thr, gtid);
 2236|      0|    KA_TRACE(10, ("__kmp_join_barrier: T#%d(%d:%d) past tasking barrier\n",
 2237|      0|                  gtid, team_id, tid));
 2238|      0|  }
 2239|       |#ifdef KMP_DEBUG
 2240|       |  if (__kmp_tasking_mode != tskm_immediate_exec) {
 2241|       |    KA_TRACE(20, ("__kmp_join_barrier: T#%d, old team = %d, old task_team = "
 2242|       |                  "%p, th_task_team = %p\n",
 2243|       |                  __kmp_gtid_from_thread(this_thr), team_id,
 2244|       |                  team->t.t_task_team[this_thr->th.th_task_state],
 2245|       |                  this_thr->th.th_task_team));
 2246|       |    if (this_thr->th.th_task_team)
 2247|       |      KMP_DEBUG_ASSERT(this_thr->th.th_task_team ==
 2248|       |                       team->t.t_task_team[this_thr->th.th_task_state]);
 2249|       |  }
 2250|       |#endif /* KMP_DEBUG */
 2251|       |
 2252|       |  /* Copy the blocktime info to the thread, where __kmp_wait_template() can
 2253|       |     access it when the team struct is not guaranteed to exist. Doing these
 2254|       |     loads causes a cache miss slows down EPCC parallel by 2x. As a workaround,
 2255|       |     we do not perform the copy if blocktime=infinite, since the values are not
 2256|       |     used by __kmp_wait_template() in that case. */
 2257|  42.3k|  if (__kmp_dflt_blocktime != KMP_MAX_BLOCKTIME) {
  ------------------
  |  | 1184|  42.3k|  (INT_MAX) /* Must be this for "infinite" setting the work */
  ------------------
  |  Branch (2257:7): [True: 42.3k, False: 18.4E]
  ------------------
 2258|       |#if KMP_USE_MONITOR
 2259|       |    this_thr->th.th_team_bt_intervals =
 2260|       |        team->t.t_implicit_task_taskdata[tid].td_icvs.bt_intervals;
 2261|       |    this_thr->th.th_team_bt_set =
 2262|       |        team->t.t_implicit_task_taskdata[tid].td_icvs.bt_set;
 2263|       |#else
 2264|  42.3k|    this_thr->th.th_team_bt_intervals = KMP_BLOCKTIME_INTERVAL(team, tid);
  ------------------
  |  | 1221|  42.3k|  (KMP_BLOCKTIME(team, tid) * __kmp_ticks_per_msec)
  |  |  ------------------
  |  |  |  | 1210|  42.3k|  (get__bt_set(team, tid) ? get__blocktime(team, tid) : __kmp_dflt_blocktime)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2289|  42.3k|  ((xteam)->t.t_threads[(xtid)]->th.th_current_task->td_icvs.bt_set)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2289:3): [True: 0, False: 42.3k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                 (get__bt_set(team, tid) ? get__blocktime(team, tid) : __kmp_dflt_blocktime)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2287|      0|  ((xteam)->t.t_threads[(xtid)]->th.th_current_task->td_icvs.blocktime)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2265|  42.3k|#endif
 2266|  42.3k|  }
 2267|       |
 2268|       |#if USE_ITT_BUILD
 2269|       |  if (__itt_sync_create_ptr || KMP_ITT_DEBUG)
 2270|       |    __kmp_itt_barrier_starting(gtid, itt_sync_obj);
 2271|       |#endif /* USE_ITT_BUILD */
 2272|       |
 2273|  42.3k|  switch (__kmp_barrier_gather_pattern[bs_forkjoin_barrier]) {
 2274|      0|  case bp_dist_bar: {
  ------------------
  |  Branch (2274:3): [True: 0, False: 42.3k]
  ------------------
 2275|      0|    __kmp_dist_barrier_gather(bs_forkjoin_barrier, this_thr, gtid, tid,
 2276|      0|                              NULL USE_ITT_BUILD_ARG(itt_sync_obj));
 2277|      0|    break;
 2278|      0|  }
 2279|  42.4k|  case bp_hyper_bar: {
  ------------------
  |  Branch (2279:3): [True: 42.4k, False: 18.4E]
  ------------------
 2280|  42.4k|    KMP_ASSERT(__kmp_barrier_gather_branch_bits[bs_forkjoin_barrier]);
  ------------------
  |  |   50|  42.4k|  if (!(cond)) {                                                               \
  |  |  ------------------
  |  |  |  Branch (50:7): [True: 0, False: 42.4k]
  |  |  ------------------
  |  |   51|      0|    __kmp_debug_assert("assertion failure", __FILE__, __LINE__);               \
  |  |   52|      0|  }
  ------------------
 2281|  42.4k|    __kmp_hyper_barrier_gather(bs_forkjoin_barrier, this_thr, gtid, tid,
 2282|  42.4k|                               NULL USE_ITT_BUILD_ARG(itt_sync_obj));
 2283|  42.4k|    break;
 2284|      0|  }
 2285|      0|  case bp_hierarchical_bar: {
  ------------------
  |  Branch (2285:3): [True: 0, False: 42.3k]
  ------------------
 2286|      0|    __kmp_hierarchical_barrier_gather(bs_forkjoin_barrier, this_thr, gtid, tid,
 2287|      0|                                      NULL USE_ITT_BUILD_ARG(itt_sync_obj));
 2288|      0|    break;
 2289|      0|  }
 2290|      0|  case bp_tree_bar: {
  ------------------
  |  Branch (2290:3): [True: 0, False: 42.3k]
  ------------------
 2291|      0|    KMP_ASSERT(__kmp_barrier_gather_branch_bits[bs_forkjoin_barrier]);
  ------------------
  |  |   50|      0|  if (!(cond)) {                                                               \
  |  |  ------------------
  |  |  |  Branch (50:7): [True: 0, False: 0]
  |  |  ------------------
  |  |   51|      0|    __kmp_debug_assert("assertion failure", __FILE__, __LINE__);               \
  |  |   52|      0|  }
  ------------------
 2292|      0|    __kmp_tree_barrier_gather(bs_forkjoin_barrier, this_thr, gtid, tid,
 2293|      0|                              NULL USE_ITT_BUILD_ARG(itt_sync_obj));
 2294|      0|    break;
 2295|      0|  }
 2296|      0|  default: {
  ------------------
  |  Branch (2296:3): [True: 0, False: 42.3k]
  ------------------
 2297|      0|    __kmp_linear_barrier_gather(bs_forkjoin_barrier, this_thr, gtid, tid,
 2298|      0|                                NULL USE_ITT_BUILD_ARG(itt_sync_obj));
 2299|      0|  }
 2300|  42.3k|  }
 2301|       |
 2302|       |  /* From this point on, the team data structure may be deallocated at any time
 2303|       |     by the primary thread - it is unsafe to reference it in any of the worker
 2304|       |     threads. Any per-team data items that need to be referenced before the
 2305|       |     end of the barrier should be moved to the kmp_task_team_t structs.  */
 2306|  43.1k|  if (KMP_MASTER_TID(tid)) {
  ------------------
  |  | 1271|  43.1k|#define KMP_MASTER_TID(tid) (0 == (tid))
  |  |  ------------------
  |  |  |  Branch (1271:29): [True: 1.35k, False: 41.8k]
  |  |  ------------------
  ------------------
 2307|  1.35k|    if (__kmp_tasking_mode != tskm_immediate_exec) {
  ------------------
  |  Branch (2307:9): [True: 1.35k, False: 0]
  ------------------
 2308|  1.35k|      __kmp_task_team_wait(this_thr, team USE_ITT_BUILD_ARG(itt_sync_obj));
 2309|  1.35k|    }
 2310|  1.35k|    if (__kmp_display_affinity) {
  ------------------
  |  Branch (2310:9): [True: 0, False: 1.35k]
  ------------------
 2311|      0|      KMP_CHECK_UPDATE(team->t.t_display_affinity, 0);
  ------------------
  |  | 2280|      0|  if ((a) != (b))                                                              \
  |  |  ------------------
  |  |  |  Branch (2280:7): [True: 0, False: 0]
  |  |  ------------------
  |  | 2281|      0|  (a) = (b)
  ------------------
 2312|      0|    }
 2313|       |#if KMP_STATS_ENABLED
 2314|       |    // Have primary thread flag the workers to indicate they are now waiting for
 2315|       |    // next parallel region, Also wake them up so they switch their timers to
 2316|       |    // idle.
 2317|       |    for (int i = 0; i < team->t.t_nproc; ++i) {
 2318|       |      kmp_info_t *team_thread = team->t.t_threads[i];
 2319|       |      if (team_thread == this_thr)
 2320|       |        continue;
 2321|       |      team_thread->th.th_stats->setIdleFlag();
 2322|       |      if (__kmp_dflt_blocktime != KMP_MAX_BLOCKTIME &&
 2323|       |          team_thread->th.th_sleep_loc != NULL)
 2324|       |        __kmp_null_resume_wrapper(team_thread);
 2325|       |    }
 2326|       |#endif
 2327|       |#if USE_ITT_BUILD
 2328|       |    if (__itt_sync_create_ptr || KMP_ITT_DEBUG)
 2329|       |      __kmp_itt_barrier_middle(gtid, itt_sync_obj);
 2330|       |#endif /* USE_ITT_BUILD */
 2331|       |
 2332|       |#if USE_ITT_BUILD && USE_ITT_NOTIFY
 2333|       |    // Join barrier - report frame end
 2334|       |    if ((__itt_frame_submit_v3_ptr || KMP_ITT_DEBUG) &&
 2335|       |        __kmp_forkjoin_frames_mode &&
 2336|       |        (this_thr->th.th_teams_microtask == NULL || // either not in teams
 2337|       |         this_thr->th.th_teams_size.nteams == 1) && // or inside single team
 2338|       |        team->t.t_active_level == 1) {
 2339|       |      kmp_uint64 cur_time = __itt_get_timestamp();
 2340|       |      ident_t *loc = team->t.t_ident;
 2341|       |      kmp_info_t **other_threads = team->t.t_threads;
 2342|       |      switch (__kmp_forkjoin_frames_mode) {
 2343|       |      case 1:
 2344|       |        __kmp_itt_frame_submit(gtid, this_thr->th.th_frame_time, cur_time, 0,
 2345|       |                               loc, nproc);
 2346|       |        break;
 2347|       |      case 2:
 2348|       |        __kmp_itt_frame_submit(gtid, this_thr->th.th_bar_min_time, cur_time, 1,
 2349|       |                               loc, nproc);
 2350|       |        break;
 2351|       |      case 3:
 2352|       |        if (__itt_metadata_add_ptr) {
 2353|       |          // Initialize with primary thread's wait time
 2354|       |          kmp_uint64 delta = cur_time - this_thr->th.th_bar_arrive_time;
 2355|       |          // Set arrive time to zero to be able to check it in
 2356|       |          // __kmp_invoke_task(); the same is done inside the loop below
 2357|       |          this_thr->th.th_bar_arrive_time = 0;
 2358|       |          for (int i = 1; i < nproc; ++i) {
 2359|       |            delta += (cur_time - other_threads[i]->th.th_bar_arrive_time);
 2360|       |            other_threads[i]->th.th_bar_arrive_time = 0;
 2361|       |          }
 2362|       |          __kmp_itt_metadata_imbalance(gtid, this_thr->th.th_frame_time,
 2363|       |                                       cur_time, delta, 0);
 2364|       |        }
 2365|       |        __kmp_itt_frame_submit(gtid, this_thr->th.th_frame_time, cur_time, 0,
 2366|       |                               loc, nproc);
 2367|       |        this_thr->th.th_frame_time = cur_time;
 2368|       |        break;
 2369|       |      }
 2370|       |    }
 2371|       |#endif /* USE_ITT_BUILD */
 2372|  1.35k|  }
 2373|       |#if USE_ITT_BUILD
 2374|       |  else {
 2375|       |    if (__itt_sync_create_ptr || KMP_ITT_DEBUG)
 2376|       |      __kmp_itt_barrier_middle(gtid, itt_sync_obj);
 2377|       |  }
 2378|       |#endif /* USE_ITT_BUILD */
 2379|       |
 2380|       |#if KMP_DEBUG
 2381|       |  if (KMP_MASTER_TID(tid)) {
 2382|       |    KA_TRACE(
 2383|       |        15,
 2384|       |        ("__kmp_join_barrier: T#%d(%d:%d) says all %d team threads arrived\n",
 2385|       |         gtid, team_id, tid, nproc));
 2386|       |  }
 2387|       |#endif /* KMP_DEBUG */
 2388|       |
 2389|       |  // TODO now, mark worker threads as done so they may be disbanded
 2390|  43.1k|  KMP_MB(); // Flush all pending memory write invalidates.
 2391|  43.1k|  KA_TRACE(10,
 2392|  43.1k|           ("__kmp_join_barrier: T#%d(%d:%d) leaving\n", gtid, team_id, tid));
 2393|       |
 2394|  43.1k|}
_Z18__kmp_fork_barrierii:
 2398|  43.2k|void __kmp_fork_barrier(int gtid, int tid) {
 2399|  43.2k|  KMP_TIME_PARTITIONED_BLOCK(OMP_fork_barrier);
  ------------------
  |  | 1013|  43.2k|#define KMP_TIME_PARTITIONED_BLOCK(name) ((void)0)
  ------------------
 2400|  43.2k|  KMP_SET_THREAD_STATE_BLOCK(FORK_JOIN_BARRIER);
  ------------------
  |  | 1018|  43.2k|#define KMP_SET_THREAD_STATE_BLOCK(state_name) ((void)0)
  ------------------
 2401|  43.2k|  kmp_info_t *this_thr = __kmp_threads[gtid];
 2402|  43.2k|  kmp_team_t *team = (tid == 0) ? this_thr->th.th_team : NULL;
  ------------------
  |  Branch (2402:22): [True: 1.35k, False: 41.8k]
  ------------------
 2403|       |#if USE_ITT_BUILD
 2404|       |  void *itt_sync_obj = NULL;
 2405|       |#endif /* USE_ITT_BUILD */
 2406|  43.2k|  if (team)
  ------------------
  |  Branch (2406:7): [True: 1.35k, False: 41.8k]
  ------------------
 2407|       |
 2408|  1.35k|  KA_TRACE(10, ("__kmp_fork_barrier: T#%d(%d:%d) has arrived\n", gtid,
 2409|  1.35k|                (team != NULL) ? team->t.t_id : -1, tid));
 2410|       |
 2411|       |  // th_team pointer only valid for primary thread here
 2412|  43.2k|  if (KMP_MASTER_TID(tid)) {
  ------------------
  |  | 1271|  43.2k|#define KMP_MASTER_TID(tid) (0 == (tid))
  |  |  ------------------
  |  |  |  Branch (1271:29): [True: 1.35k, False: 41.8k]
  |  |  ------------------
  ------------------
 2413|       |#if USE_ITT_BUILD && USE_ITT_NOTIFY
 2414|       |    if (__itt_sync_create_ptr || KMP_ITT_DEBUG) {
 2415|       |      // Create itt barrier object
 2416|       |      itt_sync_obj = __kmp_itt_barrier_object(gtid, bs_forkjoin_barrier, 1);
 2417|       |      __kmp_itt_barrier_middle(gtid, itt_sync_obj); // Call acquired/releasing
 2418|       |    }
 2419|       |#endif /* USE_ITT_BUILD && USE_ITT_NOTIFY */
 2420|       |
 2421|       |#ifdef KMP_DEBUG
 2422|       |    KMP_DEBUG_ASSERT(team);
 2423|       |    kmp_info_t **other_threads = team->t.t_threads;
 2424|       |    int i;
 2425|       |
 2426|       |    // Verify state
 2427|       |    KMP_MB();
 2428|       |
 2429|       |    for (i = 1; i < team->t.t_nproc; ++i) {
 2430|       |      KA_TRACE(500,
 2431|       |               ("__kmp_fork_barrier: T#%d(%d:0) checking T#%d(%d:%d) fork go "
 2432|       |                "== %u.\n",
 2433|       |                gtid, team->t.t_id, other_threads[i]->th.th_info.ds.ds_gtid,
 2434|       |                team->t.t_id, other_threads[i]->th.th_info.ds.ds_tid,
 2435|       |                other_threads[i]->th.th_bar[bs_forkjoin_barrier].bb.b_go));
 2436|       |      KMP_DEBUG_ASSERT(
 2437|       |          (TCR_4(other_threads[i]->th.th_bar[bs_forkjoin_barrier].bb.b_go) &
 2438|       |           ~(KMP_BARRIER_SLEEP_STATE)) == KMP_INIT_BARRIER_STATE);
 2439|       |      KMP_DEBUG_ASSERT(other_threads[i]->th.th_team == team);
 2440|       |    }
 2441|       |#endif
 2442|       |
 2443|  1.35k|    if (__kmp_tasking_mode != tskm_immediate_exec) {
  ------------------
  |  Branch (2443:9): [True: 1.35k, False: 0]
  ------------------
 2444|       |      // 0 indicates setup current task team if nthreads > 1
 2445|  1.35k|      __kmp_task_team_setup(this_thr, team, 0);
 2446|  1.35k|    }
 2447|       |
 2448|       |    /* The primary thread may have changed its blocktime between join barrier
 2449|       |       and fork barrier. Copy the blocktime info to the thread, where
 2450|       |       __kmp_wait_template() can access it when the team struct is not
 2451|       |       guaranteed to exist. */
 2452|       |    // See note about the corresponding code in __kmp_join_barrier() being
 2453|       |    // performance-critical
 2454|  1.35k|    if (__kmp_dflt_blocktime != KMP_MAX_BLOCKTIME) {
  ------------------
  |  | 1184|  1.35k|  (INT_MAX) /* Must be this for "infinite" setting the work */
  ------------------
  |  Branch (2454:9): [True: 1.35k, False: 0]
  ------------------
 2455|       |#if KMP_USE_MONITOR
 2456|       |      this_thr->th.th_team_bt_intervals =
 2457|       |          team->t.t_implicit_task_taskdata[tid].td_icvs.bt_intervals;
 2458|       |      this_thr->th.th_team_bt_set =
 2459|       |          team->t.t_implicit_task_taskdata[tid].td_icvs.bt_set;
 2460|       |#else
 2461|  1.35k|      this_thr->th.th_team_bt_intervals = KMP_BLOCKTIME_INTERVAL(team, tid);
  ------------------
  |  | 1221|  1.35k|  (KMP_BLOCKTIME(team, tid) * __kmp_ticks_per_msec)
  |  |  ------------------
  |  |  |  | 1210|  1.35k|  (get__bt_set(team, tid) ? get__blocktime(team, tid) : __kmp_dflt_blocktime)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2289|  1.35k|  ((xteam)->t.t_threads[(xtid)]->th.th_current_task->td_icvs.bt_set)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2289:3): [True: 0, False: 1.35k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                 (get__bt_set(team, tid) ? get__blocktime(team, tid) : __kmp_dflt_blocktime)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2287|      0|  ((xteam)->t.t_threads[(xtid)]->th.th_current_task->td_icvs.blocktime)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2462|  1.35k|#endif
 2463|  1.35k|    }
 2464|  1.35k|  } // primary thread
 2465|       |
 2466|  43.2k|  switch (__kmp_barrier_release_pattern[bs_forkjoin_barrier]) {
 2467|      0|  case bp_dist_bar: {
  ------------------
  |  Branch (2467:3): [True: 0, False: 43.2k]
  ------------------
 2468|      0|    __kmp_dist_barrier_release(bs_forkjoin_barrier, this_thr, gtid, tid,
 2469|      0|                               TRUE USE_ITT_BUILD_ARG(NULL));
  ------------------
  |  | 1280|      0|#define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  | 1279|      0|#define FALSE 0
  |  |  ------------------
  ------------------
 2470|      0|    break;
 2471|      0|  }
 2472|  43.1k|  case bp_hyper_bar: {
  ------------------
  |  Branch (2472:3): [True: 43.1k, False: 5]
  ------------------
 2473|  43.1k|    KMP_ASSERT(__kmp_barrier_release_branch_bits[bs_forkjoin_barrier]);
  ------------------
  |  |   50|  43.1k|  if (!(cond)) {                                                               \
  |  |  ------------------
  |  |  |  Branch (50:7): [True: 0, False: 43.1k]
  |  |  ------------------
  |  |   51|      0|    __kmp_debug_assert("assertion failure", __FILE__, __LINE__);               \
  |  |   52|      0|  }
  ------------------
 2474|  43.1k|    __kmp_hyper_barrier_release(bs_forkjoin_barrier, this_thr, gtid, tid,
 2475|  43.1k|                                TRUE USE_ITT_BUILD_ARG(itt_sync_obj));
  ------------------
  |  | 1280|  43.1k|#define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  | 1279|  43.1k|#define FALSE 0
  |  |  ------------------
  ------------------
 2476|  43.1k|    break;
 2477|      0|  }
 2478|      0|  case bp_hierarchical_bar: {
  ------------------
  |  Branch (2478:3): [True: 0, False: 43.2k]
  ------------------
 2479|      0|    __kmp_hierarchical_barrier_release(bs_forkjoin_barrier, this_thr, gtid, tid,
 2480|      0|                                       TRUE USE_ITT_BUILD_ARG(itt_sync_obj));
  ------------------
  |  | 1280|      0|#define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  | 1279|      0|#define FALSE 0
  |  |  ------------------
  ------------------
 2481|      0|    break;
 2482|      0|  }
 2483|      0|  case bp_tree_bar: {
  ------------------
  |  Branch (2483:3): [True: 0, False: 43.2k]
  ------------------
 2484|      0|    KMP_ASSERT(__kmp_barrier_release_branch_bits[bs_forkjoin_barrier]);
  ------------------
  |  |   50|      0|  if (!(cond)) {                                                               \
  |  |  ------------------
  |  |  |  Branch (50:7): [True: 0, False: 0]
  |  |  ------------------
  |  |   51|      0|    __kmp_debug_assert("assertion failure", __FILE__, __LINE__);               \
  |  |   52|      0|  }
  ------------------
 2485|      0|    __kmp_tree_barrier_release(bs_forkjoin_barrier, this_thr, gtid, tid,
 2486|      0|                               TRUE USE_ITT_BUILD_ARG(itt_sync_obj));
  ------------------
  |  | 1280|      0|#define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  | 1279|      0|#define FALSE 0
  |  |  ------------------
  ------------------
 2487|      0|    break;
 2488|      0|  }
 2489|      0|  default: {
  ------------------
  |  Branch (2489:3): [True: 0, False: 43.2k]
  ------------------
 2490|      0|    __kmp_linear_barrier_release(bs_forkjoin_barrier, this_thr, gtid, tid,
 2491|      0|                                 TRUE USE_ITT_BUILD_ARG(itt_sync_obj));
  ------------------
  |  | 1280|      0|#define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  | 1279|      0|#define FALSE 0
  |  |  ------------------
  ------------------
 2492|      0|  }
 2493|  43.2k|  }
 2494|       |
 2495|  42.2k|#if OMPT_SUPPORT
 2496|  42.2k|  if (ompt_enabled.enabled &&
  ------------------
  |  Branch (2496:7): [True: 0, False: 42.2k]
  ------------------
 2497|      0|      this_thr->th.ompt_thread_info.state == ompt_state_wait_barrier_implicit) {
  ------------------
  |  Branch (2497:7): [True: 0, False: 0]
  ------------------
 2498|      0|    int ds_tid = this_thr->th.th_info.ds.ds_tid;
 2499|      0|    ompt_data_t *task_data = (team)
  ------------------
  |  Branch (2499:30): [True: 0, False: 0]
  ------------------
 2500|      0|                                 ? OMPT_CUR_TASK_DATA(this_thr)
  ------------------
  |  |   70|      0|  (&((thr)->th.th_current_task->ompt_task_info.task_data))
  ------------------
 2501|      0|                                 : &(this_thr->th.ompt_thread_info.task_data);
 2502|      0|    this_thr->th.ompt_thread_info.state = ompt_state_overhead;
 2503|      0|#if OMPT_OPTIONAL
 2504|      0|    void *codeptr = NULL;
 2505|      0|    if (KMP_MASTER_TID(ds_tid) &&
  ------------------
  |  | 1271|      0|#define KMP_MASTER_TID(tid) (0 == (tid))
  |  |  ------------------
  |  |  |  Branch (1271:29): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2506|      0|        (ompt_callbacks.ompt_callback(ompt_callback_sync_region_wait) ||
  ------------------
  |  |   27|      0|#define ompt_callback(e) e##_callback
  ------------------
  |  Branch (2506:10): [True: 0, False: 0]
  ------------------
 2507|      0|         ompt_callbacks.ompt_callback(ompt_callback_sync_region)))
  ------------------
  |  |   27|      0|#define ompt_callback(e) e##_callback
  ------------------
  |  Branch (2507:10): [True: 0, False: 0]
  ------------------
 2508|      0|      codeptr = team ? team->t.ompt_team_info.master_return_address : NULL;
  ------------------
  |  Branch (2508:17): [True: 0, False: 0]
  ------------------
 2509|      0|    if (ompt_enabled.ompt_callback_sync_region_wait) {
  ------------------
  |  Branch (2509:9): [True: 0, False: 0]
  ------------------
 2510|      0|      ompt_callbacks.ompt_callback(ompt_callback_sync_region_wait)(
  ------------------
  |  |   27|      0|#define ompt_callback(e) e##_callback
  ------------------
 2511|      0|          ompt_sync_region_barrier_implicit, ompt_scope_end, NULL, task_data,
 2512|      0|          codeptr);
 2513|      0|    }
 2514|      0|    if (ompt_enabled.ompt_callback_sync_region) {
  ------------------
  |  Branch (2514:9): [True: 0, False: 0]
  ------------------
 2515|      0|      ompt_callbacks.ompt_callback(ompt_callback_sync_region)(
  ------------------
  |  |   27|      0|#define ompt_callback(e) e##_callback
  ------------------
 2516|      0|          ompt_sync_region_barrier_implicit, ompt_scope_end, NULL, task_data,
 2517|      0|          codeptr);
 2518|      0|    }
 2519|      0|#endif
 2520|      0|    if (!KMP_MASTER_TID(ds_tid) && ompt_enabled.ompt_callback_implicit_task) {
  ------------------
  |  | 1271|      0|#define KMP_MASTER_TID(tid) (0 == (tid))
  ------------------
  |  Branch (2520:9): [True: 0, False: 0]
  |  Branch (2520:36): [True: 0, False: 0]
  ------------------
 2521|      0|      ompt_callbacks.ompt_callback(ompt_callback_implicit_task)(
  ------------------
  |  |   27|      0|#define ompt_callback(e) e##_callback
  ------------------
 2522|      0|          ompt_scope_end, NULL, task_data, 0, ds_tid,
 2523|      0|          ompt_task_implicit); // TODO: Can this be ompt_task_initial?
 2524|      0|    }
 2525|      0|  }
 2526|  42.2k|#endif
 2527|       |
 2528|       |  // Early exit for reaping threads releasing forkjoin barrier
 2529|  42.2k|  if (TCR_4(__kmp_global.g.g_done)) {
  ------------------
  |  | 1127|  42.2k|#define TCR_4(a) (a)
  |  |  ------------------
  |  |  |  Branch (1127:18): [True: 31, False: 42.1k]
  |  |  ------------------
  ------------------
 2530|     31|    this_thr->th.th_task_team = NULL;
 2531|       |
 2532|       |#if USE_ITT_BUILD && USE_ITT_NOTIFY
 2533|       |    if (__itt_sync_create_ptr || KMP_ITT_DEBUG) {
 2534|       |      if (!KMP_MASTER_TID(tid)) {
 2535|       |        itt_sync_obj = __kmp_itt_barrier_object(gtid, bs_forkjoin_barrier);
 2536|       |        if (itt_sync_obj)
 2537|       |          __kmp_itt_barrier_finished(gtid, itt_sync_obj);
 2538|       |      }
 2539|       |    }
 2540|       |#endif /* USE_ITT_BUILD && USE_ITT_NOTIFY */
 2541|     31|    KA_TRACE(10, ("__kmp_fork_barrier: T#%d is leaving early\n", gtid));
 2542|     31|    return;
 2543|     31|  }
 2544|       |
 2545|       |  /* We can now assume that a valid team structure has been allocated by the
 2546|       |     primary thread and propagated to all worker threads. The current thread,
 2547|       |     however, may not be part of the team, so we can't blindly assume that the
 2548|       |     team pointer is non-null.  */
 2549|  42.1k|  team = (kmp_team_t *)TCR_PTR(this_thr->th.th_team);
  ------------------
  |  | 1156|  42.1k|#define TCR_PTR(a) ((void *)TCR_8(a))
  |  |  ------------------
  |  |  |  | 1131|  42.1k|#define TCR_8(a) (a)
  |  |  ------------------
  ------------------
 2550|  42.1k|  KMP_DEBUG_ASSERT(team != NULL);
 2551|  42.1k|  tid = __kmp_tid_from_gtid(gtid);
 2552|       |
 2553|       |#if KMP_BARRIER_ICV_PULL
 2554|       |  /* Primary thread's copy of the ICVs was set up on the implicit taskdata in
 2555|       |     __kmp_reinitialize_team. __kmp_fork_call() assumes the primary thread's
 2556|       |     implicit task has this data before this function is called. We cannot
 2557|       |     modify __kmp_fork_call() to look at the fixed ICVs in the primary thread's
 2558|       |     thread struct, because it is not always the case that the threads arrays
 2559|       |     have been allocated when __kmp_fork_call() is executed. */
 2560|       |  {
 2561|       |    KMP_TIME_DEVELOPER_PARTITIONED_BLOCK(USER_icv_copy);
 2562|       |    if (!KMP_MASTER_TID(tid)) { // primary thread already has ICVs
 2563|       |      // Copy the initial ICVs from the primary thread's thread struct to the
 2564|       |      // implicit task for this tid.
 2565|       |      KA_TRACE(10,
 2566|       |               ("__kmp_fork_barrier: T#%d(%d) is PULLing ICVs\n", gtid, tid));
 2567|       |      __kmp_init_implicit_task(team->t.t_ident, team->t.t_threads[tid], team,
 2568|       |                               tid, FALSE);
 2569|       |      copy_icvs(&team->t.t_implicit_task_taskdata[tid].td_icvs,
 2570|       |                &team->t.t_threads[0]
 2571|       |                     ->th.th_bar[bs_forkjoin_barrier]
 2572|       |                     .bb.th_fixed_icvs);
 2573|       |    }
 2574|       |  }
 2575|       |#endif // KMP_BARRIER_ICV_PULL
 2576|       |
 2577|  42.2k|  if (__kmp_tasking_mode != tskm_immediate_exec) {
  ------------------
  |  Branch (2577:7): [True: 42.2k, False: 18.4E]
  ------------------
 2578|  42.2k|    __kmp_task_team_sync(this_thr, team);
 2579|  42.2k|  }
 2580|       |
 2581|  42.1k|#if KMP_AFFINITY_SUPPORTED
 2582|  42.1k|  kmp_proc_bind_t proc_bind = team->t.t_proc_bind;
 2583|  42.1k|  if (proc_bind == proc_bind_intel) {
  ------------------
  |  Branch (2583:7): [True: 0, False: 42.1k]
  ------------------
 2584|       |    // Call dynamic affinity settings
 2585|      0|    if (__kmp_affinity.type == affinity_balanced && team->t.t_size_changed) {
  ------------------
  |  Branch (2585:9): [True: 0, False: 0]
  |  Branch (2585:53): [True: 0, False: 0]
  ------------------
 2586|      0|      __kmp_balanced_affinity(this_thr, team->t.t_nproc);
 2587|      0|    }
 2588|  42.1k|  } else if (proc_bind != proc_bind_false) {
  ------------------
  |  Branch (2588:14): [True: 0, False: 42.1k]
  ------------------
 2589|      0|    if (this_thr->th.th_new_place == this_thr->th.th_current_place) {
  ------------------
  |  Branch (2589:9): [True: 0, False: 0]
  ------------------
 2590|      0|      KA_TRACE(100, ("__kmp_fork_barrier: T#%d already in correct place %d\n",
 2591|      0|                     __kmp_gtid_from_thread(this_thr),
 2592|      0|                     this_thr->th.th_current_place));
 2593|      0|    } else {
 2594|      0|      __kmp_affinity_set_place(gtid);
 2595|      0|    }
 2596|      0|  }
 2597|  42.1k|#endif // KMP_AFFINITY_SUPPORTED
 2598|       |  // Perform the display affinity functionality
 2599|  42.1k|  if (__kmp_display_affinity) {
  ------------------
  |  Branch (2599:7): [True: 0, False: 42.1k]
  ------------------
 2600|      0|    if (team->t.t_display_affinity
  ------------------
  |  Branch (2600:9): [True: 0, False: 0]
  ------------------
 2601|      0|#if KMP_AFFINITY_SUPPORTED
 2602|      0|        || (__kmp_affinity.type == affinity_balanced && team->t.t_size_changed)
  ------------------
  |  Branch (2602:13): [True: 0, False: 0]
  |  Branch (2602:57): [True: 0, False: 0]
  ------------------
 2603|      0|#endif
 2604|      0|    ) {
 2605|       |      // NULL means use the affinity-format-var ICV
 2606|      0|      __kmp_aux_display_affinity(gtid, NULL);
 2607|      0|      this_thr->th.th_prev_num_threads = team->t.t_nproc;
 2608|      0|      this_thr->th.th_prev_level = team->t.t_level;
 2609|      0|    }
 2610|      0|  }
 2611|  42.1k|  if (!KMP_MASTER_TID(tid))
  ------------------
  |  | 1271|  42.1k|#define KMP_MASTER_TID(tid) (0 == (tid))
  ------------------
  |  Branch (2611:7): [True: 41.1k, False: 1.07k]
  ------------------
 2612|  41.1k|    KMP_CHECK_UPDATE(this_thr->th.th_def_allocator, team->t.t_def_allocator);
  ------------------
  |  | 2280|  41.1k|  if ((a) != (b))                                                              \
  |  |  ------------------
  |  |  |  Branch (2280:7): [True: 0, False: 41.1k]
  |  |  ------------------
  |  | 2281|  41.1k|  (a) = (b)
  ------------------
 2613|       |
 2614|       |#if USE_ITT_BUILD && USE_ITT_NOTIFY
 2615|       |  if (__itt_sync_create_ptr || KMP_ITT_DEBUG) {
 2616|       |    if (!KMP_MASTER_TID(tid)) {
 2617|       |      // Get correct barrier object
 2618|       |      itt_sync_obj = __kmp_itt_barrier_object(gtid, bs_forkjoin_barrier);
 2619|       |      __kmp_itt_barrier_finished(gtid, itt_sync_obj); // Workers call acquired
 2620|       |    } // (prepare called inside barrier_release)
 2621|       |  }
 2622|       |#endif /* USE_ITT_BUILD && USE_ITT_NOTIFY */
 2623|  42.1k|  KA_TRACE(10, ("__kmp_fork_barrier: T#%d(%d:%d) is leaving\n", gtid,
 2624|  42.1k|                team->t.t_id, tid));
 2625|  42.1k|}
_Z20__kmp_setup_icv_copyP8kmp_teamiP20kmp_internal_controlP5ident:
 2628|  1.35k|                          kmp_internal_control_t *new_icvs, ident_t *loc) {
 2629|  1.35k|  KMP_TIME_DEVELOPER_PARTITIONED_BLOCK(KMP_setup_icv_copy);
  ------------------
  |  | 1008|  1.35k|#define KMP_TIME_DEVELOPER_PARTITIONED_BLOCK(n) ((void)0)
  ------------------
 2630|       |
 2631|  1.35k|  KMP_DEBUG_ASSERT(team && new_nproc && new_icvs);
 2632|  1.35k|  KMP_DEBUG_ASSERT((!TCR_4(__kmp_init_parallel)) || new_icvs->nproc);
 2633|       |
 2634|       |/* Primary thread's copy of the ICVs was set up on the implicit taskdata in
 2635|       |   __kmp_reinitialize_team. __kmp_fork_call() assumes the primary thread's
 2636|       |   implicit task has this data before this function is called. */
 2637|       |#if KMP_BARRIER_ICV_PULL
 2638|       |  /* Copy ICVs to primary thread's thread structure into th_fixed_icvs (which
 2639|       |     remains untouched), where all of the worker threads can access them and
 2640|       |     make their own copies after the barrier. */
 2641|       |  KMP_DEBUG_ASSERT(team->t.t_threads[0]); // The threads arrays should be
 2642|       |  // allocated at this point
 2643|       |  copy_icvs(
 2644|       |      &team->t.t_threads[0]->th.th_bar[bs_forkjoin_barrier].bb.th_fixed_icvs,
 2645|       |      new_icvs);
 2646|       |  KF_TRACE(10, ("__kmp_setup_icv_copy: PULL: T#%d this_thread=%p team=%p\n", 0,
 2647|       |                team->t.t_threads[0], team));
 2648|       |#elif KMP_BARRIER_ICV_PUSH
 2649|       |  // The ICVs will be propagated in the fork barrier, so nothing needs to be
 2650|       |  // done here.
 2651|  1.35k|  KF_TRACE(10, ("__kmp_setup_icv_copy: PUSH: T#%d this_thread=%p team=%p\n", 0,
 2652|  1.35k|                team->t.t_threads[0], team));
 2653|       |#else
 2654|       |  // Copy the ICVs to each of the non-primary threads.  This takes O(nthreads)
 2655|       |  // time.
 2656|       |  ngo_load(new_icvs);
 2657|       |  KMP_DEBUG_ASSERT(team->t.t_threads[0]); // The threads arrays should be
 2658|       |  // allocated at this point
 2659|       |  for (int f = 1; f < new_nproc; ++f) { // Skip the primary thread
 2660|       |    // TODO: GEH - pass in better source location info since usually NULL here
 2661|       |    KF_TRACE(10, ("__kmp_setup_icv_copy: LINEAR: T#%d this_thread=%p team=%p\n",
 2662|       |                  f, team->t.t_threads[f], team));
 2663|       |    __kmp_init_implicit_task(loc, team->t.t_threads[f], team, f, FALSE);
 2664|       |    ngo_store_icvs(&team->t.t_implicit_task_taskdata[f].td_icvs, new_icvs);
 2665|       |    KF_TRACE(10, ("__kmp_setup_icv_copy: LINEAR: T#%d this_thread=%p team=%p\n",
 2666|       |                  f, team->t.t_threads[f], team));
 2667|       |  }
 2668|       |  ngo_sync();
 2669|       |#endif // KMP_BARRIER_ICV_PULL
 2670|  1.35k|}
kmp_barrier.cpp:_ZL27__kmp_hyper_barrier_release12barrier_typeP8kmp_infoiii:
 1127|  77.5k|    int propagate_icvs USE_ITT_BUILD_ARG(void *itt_sync_obj)) {
 1128|  77.5k|  KMP_TIME_DEVELOPER_PARTITIONED_BLOCK(KMP_hyper_release);
  ------------------
  |  | 1008|  77.5k|#define KMP_TIME_DEVELOPER_PARTITIONED_BLOCK(n) ((void)0)
  ------------------
 1129|  77.5k|  kmp_team_t *team;
 1130|  77.5k|  kmp_bstate_t *thr_bar = &this_thr->th.th_bar[bt].bb;
 1131|  77.5k|  kmp_info_t **other_threads;
 1132|  77.5k|  kmp_uint32 num_threads;
 1133|  77.5k|  kmp_uint32 branch_bits = __kmp_barrier_release_branch_bits[bt];
 1134|  77.5k|  kmp_uint32 branch_factor = 1 << branch_bits;
 1135|  77.5k|  kmp_uint32 child;
 1136|  77.5k|  kmp_uint32 child_tid;
 1137|  77.5k|  kmp_uint32 offset;
 1138|  77.5k|  kmp_uint32 level;
 1139|       |
 1140|       |  /* Perform a hypercube-embedded tree release for all of the threads that have
 1141|       |     been gathered. If KMP_REVERSE_HYPER_BAR is defined (default) the threads
 1142|       |     are released in the reverse order of the corresponding gather, otherwise
 1143|       |     threads are released in the same order. */
 1144|  77.5k|  if (KMP_MASTER_TID(tid)) { // primary thread
  ------------------
  |  | 1271|  77.5k|#define KMP_MASTER_TID(tid) (0 == (tid))
  |  |  ------------------
  |  |  |  Branch (1271:29): [True: 2.42k, False: 75.0k]
  |  |  ------------------
  ------------------
 1145|  2.42k|    team = __kmp_threads[gtid]->th.th_team;
 1146|  2.42k|    KMP_DEBUG_ASSERT(team != NULL);
 1147|  2.42k|    KA_TRACE(20, ("__kmp_hyper_barrier_release: T#%d(%d:%d) primary enter for "
 1148|  2.42k|                  "barrier type %d\n",
 1149|  2.42k|                  gtid, team->t.t_id, tid, bt));
 1150|  2.42k|#if KMP_BARRIER_ICV_PUSH
 1151|  2.42k|    if (propagate_icvs) { // primary already has ICVs in final destination; copy
  ------------------
  |  Branch (1151:9): [True: 1.35k, False: 1.07k]
  ------------------
 1152|  1.35k|      copy_icvs(&thr_bar->th_fixed_icvs,
 1153|  1.35k|                &team->t.t_implicit_task_taskdata[tid].td_icvs);
 1154|  1.35k|    }
 1155|  2.42k|#endif
 1156|  75.0k|  } else { // Handle fork barrier workers who aren't part of a team yet
 1157|  75.0k|    KA_TRACE(20, ("__kmp_hyper_barrier_release: T#%d wait go(%p) == %u\n", gtid,
 1158|  75.0k|                  &thr_bar->b_go, KMP_BARRIER_STATE_BUMP));
 1159|       |    // Wait for parent thread to release us
 1160|  75.0k|    kmp_flag_64<> flag(&thr_bar->b_go, KMP_BARRIER_STATE_BUMP);
  ------------------
  |  | 2025|  75.0k|#define KMP_BARRIER_STATE_BUMP (1 << KMP_BARRIER_BUMP_BIT)
  |  |  ------------------
  |  |  |  | 2021|  75.0k|#define KMP_BARRIER_BUMP_BIT 2 /* lsb used for bump of go/arrived state */
  |  |  ------------------
  ------------------
 1161|  75.0k|    flag.wait(this_thr, TRUE USE_ITT_BUILD_ARG(itt_sync_obj));
  ------------------
  |  | 1280|  75.0k|#define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  | 1279|  75.0k|#define FALSE 0
  |  |  ------------------
  ------------------
 1162|       |#if USE_ITT_BUILD && USE_ITT_NOTIFY
 1163|       |    if ((__itt_sync_create_ptr && itt_sync_obj == NULL) || KMP_ITT_DEBUG) {
 1164|       |      // In fork barrier where we could not get the object reliably
 1165|       |      itt_sync_obj = __kmp_itt_barrier_object(gtid, bs_forkjoin_barrier, 0, -1);
 1166|       |      // Cancel wait on previous parallel region...
 1167|       |      __kmp_itt_task_starting(itt_sync_obj);
 1168|       |
 1169|       |      if (bt == bs_forkjoin_barrier && TCR_4(__kmp_global.g.g_done))
 1170|       |        return;
 1171|       |
 1172|       |      itt_sync_obj = __kmp_itt_barrier_object(gtid, bs_forkjoin_barrier);
 1173|       |      if (itt_sync_obj != NULL)
 1174|       |        // Call prepare as early as possible for "new" barrier
 1175|       |        __kmp_itt_task_finished(itt_sync_obj);
 1176|       |    } else
 1177|       |#endif /* USE_ITT_BUILD && USE_ITT_NOTIFY */
 1178|       |        // Early exit for reaping threads releasing forkjoin barrier
 1179|  75.0k|        if (bt == bs_forkjoin_barrier && TCR_4(__kmp_global.g.g_done))
  ------------------
  |  | 1127|  41.7k|#define TCR_4(a) (a)
  |  |  ------------------
  |  |  |  Branch (1127:18): [True: 31, False: 41.7k]
  |  |  ------------------
  ------------------
  |  Branch (1179:13): [True: 41.7k, False: 33.3k]
  ------------------
 1180|     31|      return;
 1181|       |
 1182|       |    // The worker thread may now assume that the team is valid.
 1183|  75.0k|    team = __kmp_threads[gtid]->th.th_team;
 1184|  75.0k|    KMP_DEBUG_ASSERT(team != NULL);
 1185|  75.0k|    tid = __kmp_tid_from_gtid(gtid);
 1186|       |
 1187|  75.0k|    TCW_4(thr_bar->b_go, KMP_INIT_BARRIER_STATE);
  ------------------
  |  | 1128|  75.0k|#define TCW_4(a, b) (a) = (b)
  ------------------
 1188|  75.0k|    KA_TRACE(20,
 1189|  75.0k|             ("__kmp_hyper_barrier_release: T#%d(%d:%d) set go(%p) = %u\n",
 1190|  75.0k|              gtid, team->t.t_id, tid, &thr_bar->b_go, KMP_INIT_BARRIER_STATE));
 1191|  75.0k|    KMP_MB(); // Flush all pending memory write invalidates.
 1192|  75.0k|  }
 1193|  77.4k|  num_threads = this_thr->th.th_team_nproc;
 1194|  77.4k|  other_threads = team->t.t_threads;
 1195|       |
 1196|  77.4k|#ifdef KMP_REVERSE_HYPER_BAR
 1197|       |  // Count up to correct level for parent
 1198|  77.4k|  for (level = 0, offset = 1;
 1199|   103k|       offset < num_threads && (((tid >> level) & (branch_factor - 1)) == 0);
  ------------------
  |  Branch (1199:8): [True: 100k, False: 3.13k]
  |  Branch (1199:32): [True: 26.5k, False: 74.2k]
  ------------------
 1200|  77.4k|       level += branch_bits, offset <<= branch_bits)
 1201|  26.4k|    ;
 1202|       |
 1203|       |  // Now go down from there
 1204|   103k|  for (level -= branch_bits, offset >>= branch_bits; offset != 0;
  ------------------
  |  Branch (1204:54): [True: 26.0k, False: 77.4k]
  ------------------
 1205|  77.4k|       level -= branch_bits, offset >>= branch_bits)
 1206|       |#else
 1207|       |  // Go down the tree, level by level
 1208|       |  for (level = 0, offset = 1; offset < num_threads;
 1209|       |       level += branch_bits, offset <<= branch_bits)
 1210|       |#endif // KMP_REVERSE_HYPER_BAR
 1211|  26.0k|  {
 1212|  26.0k|#ifdef KMP_REVERSE_HYPER_BAR
 1213|       |    /* Now go in reverse order through the children, highest to lowest.
 1214|       |       Initial setting of child is conservative here. */
 1215|  26.0k|    child = num_threads >> ((level == 0) ? level : level - 1);
  ------------------
  |  Branch (1215:29): [True: 18.9k, False: 7.09k]
  ------------------
 1216|  26.0k|    for (child = (child < branch_factor - 1) ? child : branch_factor - 1,
  ------------------
  |  Branch (1216:18): [True: 0, False: 26.0k]
  ------------------
 1217|  26.0k|        child_tid = tid + (child << level);
 1218|   103k|         child >= 1; child--, child_tid -= (1 << level))
  ------------------
  |  Branch (1218:10): [True: 77.8k, False: 26.0k]
  ------------------
 1219|       |#else
 1220|       |    if (((tid >> level) & (branch_factor - 1)) != 0)
 1221|       |      // No need to go lower than this, since this is the level parent would be
 1222|       |      // notified
 1223|       |      break;
 1224|       |    // Iterate through children on this level of the tree
 1225|       |    for (child = 1, child_tid = tid + (1 << level);
 1226|       |         child < branch_factor && child_tid < num_threads;
 1227|       |         child++, child_tid += (1 << level))
 1228|       |#endif // KMP_REVERSE_HYPER_BAR
 1229|  77.8k|    {
 1230|  77.8k|      if (child_tid >= num_threads)
  ------------------
  |  Branch (1230:11): [True: 4.85k, False: 73.0k]
  ------------------
 1231|  4.85k|        continue; // Child doesn't exist so keep going
 1232|  73.0k|      else {
 1233|  73.0k|        kmp_info_t *child_thr = other_threads[child_tid];
 1234|  73.0k|        kmp_bstate_t *child_bar = &child_thr->th.th_bar[bt].bb;
 1235|       |#if KMP_CACHE_MANAGE
 1236|       |        kmp_uint32 next_child_tid = child_tid - (1 << level);
 1237|       |// Prefetch next thread's go count
 1238|       |#ifdef KMP_REVERSE_HYPER_BAR
 1239|       |        if (child - 1 >= 1 && next_child_tid < num_threads)
 1240|       |#else
 1241|       |        if (child + 1 < branch_factor && next_child_tid < num_threads)
 1242|       |#endif // KMP_REVERSE_HYPER_BAR
 1243|       |          KMP_CACHE_PREFETCH(
 1244|       |              &other_threads[next_child_tid]->th.th_bar[bt].bb.b_go);
 1245|       |#endif /* KMP_CACHE_MANAGE */
 1246|       |
 1247|  73.0k|#if KMP_BARRIER_ICV_PUSH
 1248|  73.0k|        if (propagate_icvs) // push my fixed ICVs to my child
  ------------------
  |  Branch (1248:13): [True: 40.7k, False: 32.2k]
  ------------------
 1249|  40.7k|          copy_icvs(&child_bar->th_fixed_icvs, &thr_bar->th_fixed_icvs);
 1250|  73.0k|#endif // KMP_BARRIER_ICV_PUSH
 1251|       |
 1252|  73.0k|        KA_TRACE(
 1253|  73.0k|            20,
 1254|  73.0k|            ("__kmp_hyper_barrier_release: T#%d(%d:%d) releasing T#%d(%d:%u)"
 1255|  73.0k|             "go(%p): %u => %u\n",
 1256|  73.0k|             gtid, team->t.t_id, tid, __kmp_gtid_from_tid(child_tid, team),
 1257|  73.0k|             team->t.t_id, child_tid, &child_bar->b_go, child_bar->b_go,
 1258|  73.0k|             child_bar->b_go + KMP_BARRIER_STATE_BUMP));
 1259|       |        // Release child from barrier
 1260|  73.0k|        kmp_flag_64<> flag(&child_bar->b_go, child_thr);
 1261|  73.0k|        flag.release();
 1262|  73.0k|      }
 1263|  77.8k|    }
 1264|  26.0k|  }
 1265|  77.4k|#if KMP_BARRIER_ICV_PUSH
 1266|  77.4k|  if (propagate_icvs &&
  ------------------
  |  Branch (1266:7): [True: 42.5k, False: 34.9k]
  ------------------
 1267|  42.5k|      !KMP_MASTER_TID(tid)) { // copy ICVs locally to final dest
  ------------------
  |  | 1271|  42.5k|#define KMP_MASTER_TID(tid) (0 == (tid))
  ------------------
  |  Branch (1267:7): [True: 41.3k, False: 1.26k]
  ------------------
 1268|  41.1k|    __kmp_init_implicit_task(team->t.t_ident, team->t.t_threads[tid], team, tid,
 1269|  41.1k|                             FALSE);
  ------------------
  |  | 1279|  41.1k|#define FALSE 0
  ------------------
 1270|  41.1k|    copy_icvs(&team->t.t_implicit_task_taskdata[tid].td_icvs,
 1271|  41.1k|              &thr_bar->th_fixed_icvs);
 1272|  41.1k|  }
 1273|  77.4k|#endif
 1274|  77.4k|  KA_TRACE(
 1275|  77.4k|      20,
 1276|  77.4k|      ("__kmp_hyper_barrier_release: T#%d(%d:%d) exit for barrier type %d\n",
 1277|  77.4k|       gtid, team->t.t_id, tid, bt));
 1278|  77.4k|}
kmp_barrier.cpp:_ZL26__kmp_hyper_barrier_gather12barrier_typeP8kmp_infoiiPFvPvS2_E:
 1008|  76.5k|    void (*reduce)(void *, void *) USE_ITT_BUILD_ARG(void *itt_sync_obj)) {
 1009|  76.5k|  KMP_TIME_DEVELOPER_PARTITIONED_BLOCK(KMP_hyper_gather);
  ------------------
  |  | 1008|  76.5k|#define KMP_TIME_DEVELOPER_PARTITIONED_BLOCK(n) ((void)0)
  ------------------
 1010|  76.5k|  kmp_team_t *team = this_thr->th.th_team;
 1011|  76.5k|  kmp_bstate_t *thr_bar = &this_thr->th.th_bar[bt].bb;
 1012|  76.5k|  kmp_info_t **other_threads = team->t.t_threads;
 1013|  76.5k|  kmp_uint64 new_state = KMP_BARRIER_UNUSED_STATE;
  ------------------
  |  | 2024|  76.5k|#define KMP_BARRIER_UNUSED_STATE (1 << KMP_BARRIER_UNUSED_BIT)
  |  |  ------------------
  |  |  |  | 2020|  76.5k|#define KMP_BARRIER_UNUSED_BIT 1 // bit that must never be set for valid state
  |  |  ------------------
  ------------------
 1014|  76.5k|  kmp_uint32 num_threads = this_thr->th.th_team_nproc;
 1015|  76.5k|  kmp_uint32 branch_bits = __kmp_barrier_gather_branch_bits[bt];
 1016|  76.5k|  kmp_uint32 branch_factor = 1 << branch_bits;
 1017|  76.5k|  kmp_uint32 offset;
 1018|  76.5k|  kmp_uint32 level;
 1019|       |
 1020|  76.5k|  KA_TRACE(
 1021|  76.5k|      20,
 1022|  76.5k|      ("__kmp_hyper_barrier_gather: T#%d(%d:%d) enter for barrier type %d\n",
 1023|  76.5k|       gtid, team->t.t_id, tid, bt));
 1024|  76.5k|  KMP_DEBUG_ASSERT(this_thr == other_threads[this_thr->th.th_info.ds.ds_tid]);
 1025|       |
 1026|       |#if USE_ITT_BUILD && USE_ITT_NOTIFY
 1027|       |  // Barrier imbalance - save arrive time to the thread
 1028|       |  if (__kmp_forkjoin_frames_mode == 3 || __kmp_forkjoin_frames_mode == 2) {
 1029|       |    this_thr->th.th_bar_arrive_time = this_thr->th.th_bar_min_time =
 1030|       |        __itt_get_timestamp();
 1031|       |  }
 1032|       |#endif
 1033|       |  /* Perform a hypercube-embedded tree gather to wait until all of the threads
 1034|       |     have arrived, and reduce any required data as we go.  */
 1035|  76.5k|  kmp_flag_64<> p_flag(&thr_bar->b_arrived);
 1036|   102k|  for (level = 0, offset = 1; offset < num_threads;
  ------------------
  |  Branch (1036:31): [True: 100k, False: 1.52k]
  ------------------
 1037|   100k|       level += branch_bits, offset <<= branch_bits) {
 1038|   100k|    kmp_uint32 child;
 1039|   100k|    kmp_uint32 child_tid;
 1040|       |
 1041|   100k|    if (((tid >> level) & (branch_factor - 1)) != 0) {
  ------------------
  |  Branch (1041:9): [True: 75.0k, False: 25.6k]
  ------------------
 1042|  75.0k|      kmp_int32 parent_tid = tid & ~((1 << (level + branch_bits)) - 1);
 1043|       |
 1044|  75.0k|      KMP_MB(); // Synchronize parent and child threads.
 1045|  75.0k|      KA_TRACE(20,
 1046|  75.0k|               ("__kmp_hyper_barrier_gather: T#%d(%d:%d) releasing T#%d(%d:%d) "
 1047|  75.0k|                "arrived(%p): %llu => %llu\n",
 1048|  75.0k|                gtid, team->t.t_id, tid, __kmp_gtid_from_tid(parent_tid, team),
 1049|  75.0k|                team->t.t_id, parent_tid, &thr_bar->b_arrived,
 1050|  75.0k|                thr_bar->b_arrived,
 1051|  75.0k|                thr_bar->b_arrived + KMP_BARRIER_STATE_BUMP));
 1052|       |      // Mark arrival to parent thread
 1053|       |      /* After performing this write (in the last iteration of the enclosing for
 1054|       |         loop), a worker thread may not assume that the team is valid any more
 1055|       |         - it could be deallocated by the primary thread at any time.  */
 1056|  75.0k|      p_flag.set_waiter(other_threads[parent_tid]);
 1057|  75.0k|      p_flag.release();
 1058|  75.0k|      break;
 1059|  75.0k|    }
 1060|       |
 1061|       |    // Parent threads wait for children to arrive
 1062|  25.6k|    if (new_state == KMP_BARRIER_UNUSED_STATE)
  ------------------
  |  | 2024|  25.6k|#define KMP_BARRIER_UNUSED_STATE (1 << KMP_BARRIER_UNUSED_BIT)
  |  |  ------------------
  |  |  |  | 2020|  25.6k|#define KMP_BARRIER_UNUSED_BIT 1 // bit that must never be set for valid state
  |  |  ------------------
  ------------------
  |  Branch (1062:9): [True: 19.1k, False: 6.47k]
  ------------------
 1063|  19.1k|      new_state = team->t.t_bar[bt].b_arrived + KMP_BARRIER_STATE_BUMP;
  ------------------
  |  | 2025|  19.1k|#define KMP_BARRIER_STATE_BUMP (1 << KMP_BARRIER_BUMP_BIT)
  |  |  ------------------
  |  |  |  | 2021|  19.1k|#define KMP_BARRIER_BUMP_BIT 2 /* lsb used for bump of go/arrived state */
  |  |  ------------------
  ------------------
 1064|  25.6k|    for (child = 1, child_tid = tid + (1 << level);
 1065|   100k|         child < branch_factor && child_tid < num_threads;
  ------------------
  |  Branch (1065:10): [True: 77.4k, False: 23.2k]
  |  Branch (1065:35): [True: 74.9k, False: 2.42k]
  ------------------
 1066|  74.9k|         child++, child_tid += (1 << level)) {
 1067|  74.9k|      kmp_info_t *child_thr = other_threads[child_tid];
 1068|  74.9k|      kmp_bstate_t *child_bar = &child_thr->th.th_bar[bt].bb;
 1069|       |#if KMP_CACHE_MANAGE
 1070|       |      kmp_uint32 next_child_tid = child_tid + (1 << level);
 1071|       |      // Prefetch next thread's arrived count
 1072|       |      if (child + 1 < branch_factor && next_child_tid < num_threads)
 1073|       |        KMP_CACHE_PREFETCH(
 1074|       |            &other_threads[next_child_tid]->th.th_bar[bt].bb.b_arrived);
 1075|       |#endif /* KMP_CACHE_MANAGE */
 1076|  74.9k|      KA_TRACE(20,
 1077|  74.9k|               ("__kmp_hyper_barrier_gather: T#%d(%d:%d) wait T#%d(%d:%u) "
 1078|  74.9k|                "arrived(%p) == %llu\n",
 1079|  74.9k|                gtid, team->t.t_id, tid, __kmp_gtid_from_tid(child_tid, team),
 1080|  74.9k|                team->t.t_id, child_tid, &child_bar->b_arrived, new_state));
 1081|       |      // Wait for child to arrive
 1082|  74.9k|      kmp_flag_64<> c_flag(&child_bar->b_arrived, new_state);
 1083|  74.9k|      c_flag.wait(this_thr, FALSE USE_ITT_BUILD_ARG(itt_sync_obj));
  ------------------
  |  | 1279|  74.9k|#define FALSE 0
  ------------------
 1084|  74.9k|      KMP_MB(); // Synchronize parent and child threads.
 1085|       |#if USE_ITT_BUILD && USE_ITT_NOTIFY
 1086|       |      // Barrier imbalance - write min of the thread time and a child time to
 1087|       |      // the thread.
 1088|       |      if (__kmp_forkjoin_frames_mode == 2) {
 1089|       |        this_thr->th.th_bar_min_time = KMP_MIN(this_thr->th.th_bar_min_time,
 1090|       |                                               child_thr->th.th_bar_min_time);
 1091|       |      }
 1092|       |#endif
 1093|  74.9k|      if (reduce) {
  ------------------
  |  Branch (1093:11): [True: 0, False: 74.9k]
  ------------------
 1094|      0|        KA_TRACE(100,
 1095|      0|                 ("__kmp_hyper_barrier_gather: T#%d(%d:%d) += T#%d(%d:%u)\n",
 1096|      0|                  gtid, team->t.t_id, tid, __kmp_gtid_from_tid(child_tid, team),
 1097|      0|                  team->t.t_id, child_tid));
 1098|      0|        OMPT_REDUCTION_DECL(this_thr, gtid);
  ------------------
  |  |  157|      0|  ompt_data_t *my_task_data = OMPT_CUR_TASK_DATA(this_thr);                    \
  |  |  ------------------
  |  |  |  |   70|      0|  (&((thr)->th.th_current_task->ompt_task_info.task_data))
  |  |  ------------------
  |  |  158|      0|  ompt_data_t *my_parallel_data = OMPT_CUR_TEAM_DATA(this_thr);                \
  |  |  ------------------
  |  |  |  |   73|      0|  (&((thr)->th.th_team->t.ompt_team_info.parallel_data))
  |  |  ------------------
  |  |  159|      0|  void *return_address = OMPT_LOAD_RETURN_ADDRESS(gtid);
  |  |  ------------------
  |  |  |  |   93|      0|#define OMPT_LOAD_RETURN_ADDRESS(gtid) __ompt_load_return_address(gtid)
  |  |  ------------------
  ------------------
 1099|      0|        OMPT_REDUCTION_BEGIN;
  ------------------
  |  |  161|      0|  if (ompt_enabled.enabled && ompt_enabled.ompt_callback_reduction) {          \
  |  |  ------------------
  |  |  |  Branch (161:7): [True: 0, False: 0]
  |  |  |  Branch (161:31): [True: 0, False: 0]
  |  |  ------------------
  |  |  162|      0|    ompt_callbacks.ompt_callback(ompt_callback_reduction)(                     \
  |  |  ------------------
  |  |  |  |   27|      0|#define ompt_callback(e) e##_callback
  |  |  ------------------
  |  |  163|      0|        ompt_sync_region_reduction, ompt_scope_begin, my_parallel_data,        \
  |  |  164|      0|        my_task_data, return_address);                                         \
  |  |  165|      0|  }
  ------------------
 1100|      0|        (*reduce)(this_thr->th.th_local.reduce_data,
 1101|      0|                  child_thr->th.th_local.reduce_data);
 1102|      0|        OMPT_REDUCTION_END;
  ------------------
  |  |  167|      0|  if (ompt_enabled.enabled && ompt_enabled.ompt_callback_reduction) {          \
  |  |  ------------------
  |  |  |  Branch (167:7): [True: 0, False: 0]
  |  |  |  Branch (167:31): [True: 0, False: 0]
  |  |  ------------------
  |  |  168|      0|    ompt_callbacks.ompt_callback(ompt_callback_reduction)(                     \
  |  |  ------------------
  |  |  |  |   27|      0|#define ompt_callback(e) e##_callback
  |  |  ------------------
  |  |  169|      0|        ompt_sync_region_reduction, ompt_scope_end, my_parallel_data,          \
  |  |  170|      0|        my_task_data, return_address);                                         \
  |  |  171|      0|  }
  ------------------
 1103|      0|      }
 1104|  74.9k|    }
 1105|  25.6k|  }
 1106|       |
 1107|  76.5k|  if (KMP_MASTER_TID(tid)) {
  ------------------
  |  | 1271|  76.5k|#define KMP_MASTER_TID(tid) (0 == (tid))
  |  |  ------------------
  |  |  |  Branch (1271:29): [True: 2.42k, False: 74.0k]
  |  |  ------------------
  ------------------
 1108|       |    // Need to update the team arrived pointer if we are the primary thread
 1109|  2.42k|    if (new_state == KMP_BARRIER_UNUSED_STATE)
  ------------------
  |  | 2024|  2.42k|#define KMP_BARRIER_UNUSED_STATE (1 << KMP_BARRIER_UNUSED_BIT)
  |  |  ------------------
  |  |  |  | 2020|  2.42k|#define KMP_BARRIER_UNUSED_BIT 1 // bit that must never be set for valid state
  |  |  ------------------
  ------------------
  |  Branch (1109:9): [True: 0, False: 2.42k]
  ------------------
 1110|      0|      team->t.t_bar[bt].b_arrived += KMP_BARRIER_STATE_BUMP;
  ------------------
  |  | 2025|      0|#define KMP_BARRIER_STATE_BUMP (1 << KMP_BARRIER_BUMP_BIT)
  |  |  ------------------
  |  |  |  | 2021|      0|#define KMP_BARRIER_BUMP_BIT 2 /* lsb used for bump of go/arrived state */
  |  |  ------------------
  ------------------
 1111|  2.42k|    else
 1112|  2.42k|      team->t.t_bar[bt].b_arrived = new_state;
 1113|  2.42k|    KA_TRACE(20, ("__kmp_hyper_barrier_gather: T#%d(%d:%d) set team %d "
 1114|  2.42k|                  "arrived(%p) = %llu\n",
 1115|  2.42k|                  gtid, team->t.t_id, tid, team->t.t_id,
 1116|  2.42k|                  &team->t.t_bar[bt].b_arrived, team->t.t_bar[bt].b_arrived));
 1117|  2.42k|  }
 1118|  76.5k|  KA_TRACE(
 1119|  76.5k|      20, ("__kmp_hyper_barrier_gather: T#%d(%d:%d) exit for barrier type %d\n",
 1120|  76.5k|           gtid, team->t.t_id, tid, bt));
 1121|  76.5k|}
kmp_barrier.cpp:_ZL22__kmp_barrier_templateILb0EEi12barrier_typeiimPvPFvS1_S1_E:
 1769|  37.1k|                                  void (*reduce)(void *, void *)) {
 1770|  37.1k|  KMP_TIME_PARTITIONED_BLOCK(OMP_plain_barrier);
  ------------------
  |  | 1013|  37.1k|#define KMP_TIME_PARTITIONED_BLOCK(name) ((void)0)
  ------------------
 1771|  37.1k|  KMP_SET_THREAD_STATE_BLOCK(PLAIN_BARRIER);
  ------------------
  |  | 1018|  37.1k|#define KMP_SET_THREAD_STATE_BLOCK(state_name) ((void)0)
  ------------------
 1772|  37.1k|  int tid = __kmp_tid_from_gtid(gtid);
 1773|  37.1k|  kmp_info_t *this_thr = __kmp_threads[gtid];
 1774|  37.1k|  kmp_team_t *team = this_thr->th.th_team;
 1775|  37.1k|  int status = 0;
 1776|  37.1k|  is_cancellable<cancellable> cancelled;
 1777|  37.1k|#if OMPT_SUPPORT && OMPT_OPTIONAL
 1778|  37.1k|  ompt_data_t *my_task_data;
 1779|  37.1k|  ompt_data_t *my_parallel_data;
 1780|  37.1k|  void *return_address;
 1781|  37.1k|  ompt_sync_region_t barrier_kind;
 1782|  37.1k|#endif
 1783|       |
 1784|  37.1k|  KA_TRACE(15, ("__kmp_barrier: T#%d(%d:%d) has arrived\n", gtid,
 1785|  37.1k|                __kmp_team_from_gtid(gtid)->t.t_id, __kmp_tid_from_gtid(gtid)));
 1786|       |
 1787|  37.1k|#if OMPT_SUPPORT
 1788|  37.1k|  if (ompt_enabled.enabled) {
  ------------------
  |  Branch (1788:7): [True: 0, False: 37.1k]
  ------------------
 1789|      0|#if OMPT_OPTIONAL
 1790|      0|    my_task_data = OMPT_CUR_TASK_DATA(this_thr);
  ------------------
  |  |   70|      0|  (&((thr)->th.th_current_task->ompt_task_info.task_data))
  ------------------
 1791|      0|    my_parallel_data = OMPT_CUR_TEAM_DATA(this_thr);
  ------------------
  |  |   73|      0|  (&((thr)->th.th_team->t.ompt_team_info.parallel_data))
  ------------------
 1792|      0|    return_address = OMPT_LOAD_RETURN_ADDRESS(gtid);
  ------------------
  |  |   93|      0|#define OMPT_LOAD_RETURN_ADDRESS(gtid) __ompt_load_return_address(gtid)
  ------------------
 1793|      0|    barrier_kind = __ompt_get_barrier_kind(bt, this_thr);
 1794|      0|    if (ompt_enabled.ompt_callback_sync_region) {
  ------------------
  |  Branch (1794:9): [True: 0, False: 0]
  ------------------
 1795|      0|      ompt_callbacks.ompt_callback(ompt_callback_sync_region)(
  ------------------
  |  |   27|      0|#define ompt_callback(e) e##_callback
  ------------------
 1796|      0|          barrier_kind, ompt_scope_begin, my_parallel_data, my_task_data,
 1797|      0|          return_address);
 1798|      0|    }
 1799|      0|    if (ompt_enabled.ompt_callback_sync_region_wait) {
  ------------------
  |  Branch (1799:9): [True: 0, False: 0]
  ------------------
 1800|      0|      ompt_callbacks.ompt_callback(ompt_callback_sync_region_wait)(
  ------------------
  |  |   27|      0|#define ompt_callback(e) e##_callback
  ------------------
 1801|      0|          barrier_kind, ompt_scope_begin, my_parallel_data, my_task_data,
 1802|      0|          return_address);
 1803|      0|    }
 1804|      0|#endif
 1805|       |    // It is OK to report the barrier state after the barrier begin callback.
 1806|       |    // According to the OMPT specification, a compliant implementation may
 1807|       |    // even delay reporting this state until the barrier begins to wait.
 1808|      0|    this_thr->th.ompt_thread_info.state = ompt_state_wait_barrier;
 1809|      0|  }
 1810|  37.1k|#endif
 1811|       |
 1812|  37.1k|  if (!team->t.t_serialized) {
  ------------------
  |  Branch (1812:7): [True: 34.1k, False: 2.99k]
  ------------------
 1813|       |#if USE_ITT_BUILD
 1814|       |    // This value will be used in itt notify events below.
 1815|       |    void *itt_sync_obj = NULL;
 1816|       |#if USE_ITT_NOTIFY
 1817|       |    if (__itt_sync_create_ptr || KMP_ITT_DEBUG)
 1818|       |      itt_sync_obj = __kmp_itt_barrier_object(gtid, bt, 1);
 1819|       |#endif
 1820|       |#endif /* USE_ITT_BUILD */
 1821|  34.1k|    if (__kmp_tasking_mode == tskm_extra_barrier) {
  ------------------
  |  Branch (1821:9): [True: 0, False: 34.1k]
  ------------------
 1822|      0|      __kmp_tasking_barrier(team, this_thr, gtid);
 1823|      0|      KA_TRACE(15,
 1824|      0|               ("__kmp_barrier: T#%d(%d:%d) past tasking barrier\n", gtid,
 1825|      0|                __kmp_team_from_gtid(gtid)->t.t_id, __kmp_tid_from_gtid(gtid)));
 1826|      0|    }
 1827|       |
 1828|       |    /* Copy the blocktime info to the thread, where __kmp_wait_template() can
 1829|       |       access it when the team struct is not guaranteed to exist. */
 1830|       |    // See note about the corresponding code in __kmp_join_barrier() being
 1831|       |    // performance-critical.
 1832|  34.1k|    if (__kmp_dflt_blocktime != KMP_MAX_BLOCKTIME) {
  ------------------
  |  | 1184|  34.1k|  (INT_MAX) /* Must be this for "infinite" setting the work */
  ------------------
  |  Branch (1832:9): [True: 34.1k, False: 16]
  ------------------
 1833|       |#if KMP_USE_MONITOR
 1834|       |      this_thr->th.th_team_bt_intervals =
 1835|       |          team->t.t_implicit_task_taskdata[tid].td_icvs.bt_intervals;
 1836|       |      this_thr->th.th_team_bt_set =
 1837|       |          team->t.t_implicit_task_taskdata[tid].td_icvs.bt_set;
 1838|       |#else
 1839|  34.1k|      this_thr->th.th_team_bt_intervals = KMP_BLOCKTIME_INTERVAL(team, tid);
  ------------------
  |  | 1221|  34.1k|  (KMP_BLOCKTIME(team, tid) * __kmp_ticks_per_msec)
  |  |  ------------------
  |  |  |  | 1210|  34.1k|  (get__bt_set(team, tid) ? get__blocktime(team, tid) : __kmp_dflt_blocktime)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2289|  34.1k|  ((xteam)->t.t_threads[(xtid)]->th.th_current_task->td_icvs.bt_set)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2289:3): [True: 0, False: 34.1k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                 (get__bt_set(team, tid) ? get__blocktime(team, tid) : __kmp_dflt_blocktime)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2287|      0|  ((xteam)->t.t_threads[(xtid)]->th.th_current_task->td_icvs.blocktime)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1840|  34.1k|#endif
 1841|  34.1k|    }
 1842|       |
 1843|       |#if USE_ITT_BUILD
 1844|       |    if (__itt_sync_create_ptr || KMP_ITT_DEBUG)
 1845|       |      __kmp_itt_barrier_starting(gtid, itt_sync_obj);
 1846|       |#endif /* USE_ITT_BUILD */
 1847|       |#if USE_DEBUGGER
 1848|       |    // Let the debugger know: the thread arrived to the barrier and waiting.
 1849|       |    if (KMP_MASTER_TID(tid)) { // Primary thread counter stored in team struct
 1850|       |      team->t.t_bar[bt].b_master_arrived += 1;
 1851|       |    } else {
 1852|       |      this_thr->th.th_bar[bt].bb.b_worker_arrived += 1;
 1853|       |    } // if
 1854|       |#endif /* USE_DEBUGGER */
 1855|  34.1k|    if (reduce != NULL) {
  ------------------
  |  Branch (1855:9): [True: 0, False: 34.1k]
  ------------------
 1856|       |      // KMP_DEBUG_ASSERT( is_split == TRUE );  // #C69956
 1857|      0|      this_thr->th.th_local.reduce_data = reduce_data;
 1858|      0|    }
 1859|       |
 1860|  34.1k|    if (KMP_MASTER_TID(tid) && __kmp_tasking_mode != tskm_immediate_exec)
  ------------------
  |  | 1271|  68.2k|#define KMP_MASTER_TID(tid) (0 == (tid))
  |  |  ------------------
  |  |  |  Branch (1271:29): [True: 1.07k, False: 33.0k]
  |  |  ------------------
  ------------------
  |  Branch (1860:32): [True: 1.07k, False: 0]
  ------------------
 1861|       |      // use 0 to only setup the current team if nthreads > 1
 1862|  1.07k|      __kmp_task_team_setup(this_thr, team, 0);
 1863|       |
 1864|  34.1k|    if (cancellable) {
  ------------------
  |  Branch (1864:9): [Folded, False: 34.1k]
  ------------------
 1865|      0|      cancelled = __kmp_linear_barrier_gather_cancellable(
 1866|      0|          bt, this_thr, gtid, tid, reduce USE_ITT_BUILD_ARG(itt_sync_obj));
 1867|  34.1k|    } else {
 1868|  34.1k|      switch (__kmp_barrier_gather_pattern[bt]) {
 1869|      0|      case bp_dist_bar: {
  ------------------
  |  Branch (1869:7): [True: 0, False: 34.1k]
  ------------------
 1870|      0|        __kmp_dist_barrier_gather(bt, this_thr, gtid, tid,
 1871|      0|                                  reduce USE_ITT_BUILD_ARG(itt_sync_obj));
 1872|      0|        break;
 1873|      0|      }
 1874|  34.1k|      case bp_hyper_bar: {
  ------------------
  |  Branch (1874:7): [True: 34.1k, False: 3]
  ------------------
 1875|       |        // don't set branch bits to 0; use linear
 1876|  34.1k|        KMP_ASSERT(__kmp_barrier_gather_branch_bits[bt]);
  ------------------
  |  |   50|  34.1k|  if (!(cond)) {                                                               \
  |  |  ------------------
  |  |  |  Branch (50:7): [True: 0, False: 34.1k]
  |  |  ------------------
  |  |   51|      0|    __kmp_debug_assert("assertion failure", __FILE__, __LINE__);               \
  |  |   52|      0|  }
  ------------------
 1877|  34.1k|        __kmp_hyper_barrier_gather(bt, this_thr, gtid, tid,
 1878|  34.1k|                                   reduce USE_ITT_BUILD_ARG(itt_sync_obj));
 1879|  34.1k|        break;
 1880|      0|      }
 1881|      0|      case bp_hierarchical_bar: {
  ------------------
  |  Branch (1881:7): [True: 0, False: 34.1k]
  ------------------
 1882|      0|        __kmp_hierarchical_barrier_gather(
 1883|      0|            bt, this_thr, gtid, tid, reduce USE_ITT_BUILD_ARG(itt_sync_obj));
 1884|      0|        break;
 1885|      0|      }
 1886|      0|      case bp_tree_bar: {
  ------------------
  |  Branch (1886:7): [True: 0, False: 34.1k]
  ------------------
 1887|       |        // don't set branch bits to 0; use linear
 1888|      0|        KMP_ASSERT(__kmp_barrier_gather_branch_bits[bt]);
  ------------------
  |  |   50|      0|  if (!(cond)) {                                                               \
  |  |  ------------------
  |  |  |  Branch (50:7): [True: 0, False: 0]
  |  |  ------------------
  |  |   51|      0|    __kmp_debug_assert("assertion failure", __FILE__, __LINE__);               \
  |  |   52|      0|  }
  ------------------
 1889|      0|        __kmp_tree_barrier_gather(bt, this_thr, gtid, tid,
 1890|      0|                                  reduce USE_ITT_BUILD_ARG(itt_sync_obj));
 1891|      0|        break;
 1892|      0|      }
 1893|      0|      default: {
  ------------------
  |  Branch (1893:7): [True: 0, False: 34.1k]
  ------------------
 1894|      0|        __kmp_linear_barrier_gather(bt, this_thr, gtid, tid,
 1895|      0|                                    reduce USE_ITT_BUILD_ARG(itt_sync_obj));
 1896|      0|      }
 1897|  34.1k|      }
 1898|  34.1k|    }
 1899|       |
 1900|  34.3k|    KMP_MB();
 1901|       |
 1902|  34.3k|    if (KMP_MASTER_TID(tid)) {
  ------------------
  |  | 1271|  34.3k|#define KMP_MASTER_TID(tid) (0 == (tid))
  |  |  ------------------
  |  |  |  Branch (1271:29): [True: 1.07k, False: 33.2k]
  |  |  ------------------
  ------------------
 1903|  1.07k|      status = 0;
 1904|  1.07k|      if (__kmp_tasking_mode != tskm_immediate_exec && !cancelled) {
  ------------------
  |  Branch (1904:11): [True: 1.07k, False: 0]
  |  Branch (1904:56): [True: 0, Folded]
  ------------------
 1905|  1.07k|        __kmp_task_team_wait(this_thr, team USE_ITT_BUILD_ARG(itt_sync_obj));
 1906|  1.07k|      }
 1907|       |#if USE_DEBUGGER
 1908|       |      // Let the debugger know: All threads are arrived and starting leaving the
 1909|       |      // barrier.
 1910|       |      team->t.t_bar[bt].b_team_arrived += 1;
 1911|       |#endif
 1912|       |
 1913|  1.07k|      if (__kmp_omp_cancellation) {
  ------------------
  |  Branch (1913:11): [True: 0, False: 1.07k]
  ------------------
 1914|      0|        kmp_int32 cancel_request = KMP_ATOMIC_LD_RLX(&team->t.t_cancel_request);
  ------------------
  |  | 1250|      0|#define KMP_ATOMIC_LD_RLX(p) KMP_ATOMIC_LD(p, relaxed)
  |  |  ------------------
  |  |  |  | 1245|      0|#define KMP_ATOMIC_LD(p, order) (p)->load(std::memory_order_##order)
  |  |  ------------------
  ------------------
 1915|       |        // Reset cancellation flag for worksharing constructs
 1916|      0|        if (cancel_request == cancel_loop ||
  ------------------
  |  Branch (1916:13): [True: 0, False: 0]
  ------------------
 1917|      0|            cancel_request == cancel_sections) {
  ------------------
  |  Branch (1917:13): [True: 0, False: 0]
  ------------------
 1918|      0|          KMP_ATOMIC_ST_RLX(&team->t.t_cancel_request, cancel_noreq);
  ------------------
  |  | 1252|      0|#define KMP_ATOMIC_ST_RLX(p, v) KMP_ATOMIC_OP(store, p, v, relaxed)
  |  |  ------------------
  |  |  |  | 1246|      0|#define KMP_ATOMIC_OP(op, p, v, order) (p)->op(v, std::memory_order_##order)
  |  |  ------------------
  ------------------
 1919|      0|        }
 1920|      0|      }
 1921|       |#if USE_ITT_BUILD
 1922|       |      /* TODO: In case of split reduction barrier, primary thread may send
 1923|       |         acquired event early, before the final summation into the shared
 1924|       |         variable is done (final summation can be a long operation for array
 1925|       |         reductions).  */
 1926|       |      if (__itt_sync_create_ptr || KMP_ITT_DEBUG)
 1927|       |        __kmp_itt_barrier_middle(gtid, itt_sync_obj);
 1928|       |#endif /* USE_ITT_BUILD */
 1929|       |#if USE_ITT_BUILD && USE_ITT_NOTIFY
 1930|       |      // Barrier - report frame end (only if active_level == 1)
 1931|       |      if ((__itt_frame_submit_v3_ptr || KMP_ITT_DEBUG) &&
 1932|       |          __kmp_forkjoin_frames_mode &&
 1933|       |          (this_thr->th.th_teams_microtask == NULL || // either not in teams
 1934|       |           this_thr->th.th_teams_size.nteams == 1) && // or inside single team
 1935|       |          team->t.t_active_level == 1) {
 1936|       |        ident_t *loc = __kmp_threads[gtid]->th.th_ident;
 1937|       |        kmp_uint64 cur_time = __itt_get_timestamp();
 1938|       |        kmp_info_t **other_threads = team->t.t_threads;
 1939|       |        int nproc = this_thr->th.th_team_nproc;
 1940|       |        int i;
 1941|       |        switch (__kmp_forkjoin_frames_mode) {
 1942|       |        case 1:
 1943|       |          __kmp_itt_frame_submit(gtid, this_thr->th.th_frame_time, cur_time, 0,
 1944|       |                                 loc, nproc);
 1945|       |          this_thr->th.th_frame_time = cur_time;
 1946|       |          break;
 1947|       |        case 2: // AC 2015-01-19: currently does not work for hierarchical (to
 1948|       |          // be fixed)
 1949|       |          __kmp_itt_frame_submit(gtid, this_thr->th.th_bar_min_time, cur_time,
 1950|       |                                 1, loc, nproc);
 1951|       |          break;
 1952|       |        case 3:
 1953|       |          if (__itt_metadata_add_ptr) {
 1954|       |            // Initialize with primary thread's wait time
 1955|       |            kmp_uint64 delta = cur_time - this_thr->th.th_bar_arrive_time;
 1956|       |            // Set arrive time to zero to be able to check it in
 1957|       |            // __kmp_invoke_task(); the same is done inside the loop below
 1958|       |            this_thr->th.th_bar_arrive_time = 0;
 1959|       |            for (i = 1; i < nproc; ++i) {
 1960|       |              delta += (cur_time - other_threads[i]->th.th_bar_arrive_time);
 1961|       |              other_threads[i]->th.th_bar_arrive_time = 0;
 1962|       |            }
 1963|       |            __kmp_itt_metadata_imbalance(gtid, this_thr->th.th_frame_time,
 1964|       |                                         cur_time, delta,
 1965|       |                                         (kmp_uint64)(reduce != NULL));
 1966|       |          }
 1967|       |          __kmp_itt_frame_submit(gtid, this_thr->th.th_frame_time, cur_time, 0,
 1968|       |                                 loc, nproc);
 1969|       |          this_thr->th.th_frame_time = cur_time;
 1970|       |          break;
 1971|       |        }
 1972|       |      }
 1973|       |#endif /* USE_ITT_BUILD */
 1974|  33.2k|    } else {
 1975|  33.2k|      status = 1;
 1976|       |#if USE_ITT_BUILD
 1977|       |      if (__itt_sync_create_ptr || KMP_ITT_DEBUG)
 1978|       |        __kmp_itt_barrier_middle(gtid, itt_sync_obj);
 1979|       |#endif /* USE_ITT_BUILD */
 1980|  33.2k|    }
 1981|  34.3k|    if ((status == 1 || !is_split) && !cancelled) {
  ------------------
  |  Branch (1981:10): [True: 33.2k, False: 1.07k]
  |  Branch (1981:25): [True: 1.07k, False: 0]
  |  Branch (1981:39): [True: 0, Folded]
  ------------------
 1982|  34.3k|      if (cancellable) {
  ------------------
  |  Branch (1982:11): [Folded, False: 34.3k]
  ------------------
 1983|      0|        cancelled = __kmp_linear_barrier_release_cancellable(
 1984|      0|            bt, this_thr, gtid, tid, FALSE USE_ITT_BUILD_ARG(itt_sync_obj));
  ------------------
  |  | 1279|      0|#define FALSE 0
  ------------------
 1985|  34.3k|      } else {
 1986|  34.3k|        switch (__kmp_barrier_release_pattern[bt]) {
 1987|      0|        case bp_dist_bar: {
  ------------------
  |  Branch (1987:9): [True: 0, False: 34.3k]
  ------------------
 1988|      0|          KMP_ASSERT(__kmp_barrier_release_branch_bits[bt]);
  ------------------
  |  |   50|      0|  if (!(cond)) {                                                               \
  |  |  ------------------
  |  |  |  Branch (50:7): [True: 0, False: 0]
  |  |  ------------------
  |  |   51|      0|    __kmp_debug_assert("assertion failure", __FILE__, __LINE__);               \
  |  |   52|      0|  }
  ------------------
 1989|      0|          __kmp_dist_barrier_release(bt, this_thr, gtid, tid,
 1990|      0|                                     FALSE USE_ITT_BUILD_ARG(itt_sync_obj));
  ------------------
  |  | 1279|      0|#define FALSE 0
  ------------------
 1991|      0|          break;
 1992|      0|        }
 1993|  34.3k|        case bp_hyper_bar: {
  ------------------
  |  Branch (1993:9): [True: 34.3k, False: 1]
  ------------------
 1994|  34.3k|          KMP_ASSERT(__kmp_barrier_release_branch_bits[bt]);
  ------------------
  |  |   50|  34.3k|  if (!(cond)) {                                                               \
  |  |  ------------------
  |  |  |  Branch (50:7): [True: 0, False: 34.3k]
  |  |  ------------------
  |  |   51|      0|    __kmp_debug_assert("assertion failure", __FILE__, __LINE__);               \
  |  |   52|      0|  }
  ------------------
 1995|  34.3k|          __kmp_hyper_barrier_release(bt, this_thr, gtid, tid,
 1996|  34.3k|                                      FALSE USE_ITT_BUILD_ARG(itt_sync_obj));
  ------------------
  |  | 1279|  34.3k|#define FALSE 0
  ------------------
 1997|  34.3k|          break;
 1998|      0|        }
 1999|      0|        case bp_hierarchical_bar: {
  ------------------
  |  Branch (1999:9): [True: 0, False: 34.3k]
  ------------------
 2000|      0|          __kmp_hierarchical_barrier_release(
 2001|      0|              bt, this_thr, gtid, tid, FALSE USE_ITT_BUILD_ARG(itt_sync_obj));
  ------------------
  |  | 1279|      0|#define FALSE 0
  ------------------
 2002|      0|          break;
 2003|      0|        }
 2004|      0|        case bp_tree_bar: {
  ------------------
  |  Branch (2004:9): [True: 0, False: 34.3k]
  ------------------
 2005|      0|          KMP_ASSERT(__kmp_barrier_release_branch_bits[bt]);
  ------------------
  |  |   50|      0|  if (!(cond)) {                                                               \
  |  |  ------------------
  |  |  |  Branch (50:7): [True: 0, False: 0]
  |  |  ------------------
  |  |   51|      0|    __kmp_debug_assert("assertion failure", __FILE__, __LINE__);               \
  |  |   52|      0|  }
  ------------------
 2006|      0|          __kmp_tree_barrier_release(bt, this_thr, gtid, tid,
 2007|      0|                                     FALSE USE_ITT_BUILD_ARG(itt_sync_obj));
  ------------------
  |  | 1279|      0|#define FALSE 0
  ------------------
 2008|      0|          break;
 2009|      0|        }
 2010|      0|        default: {
  ------------------
  |  Branch (2010:9): [True: 0, False: 34.3k]
  ------------------
 2011|      0|          __kmp_linear_barrier_release(bt, this_thr, gtid, tid,
 2012|      0|                                       FALSE USE_ITT_BUILD_ARG(itt_sync_obj));
  ------------------
  |  | 1279|      0|#define FALSE 0
  ------------------
 2013|      0|        }
 2014|  34.3k|        }
 2015|  34.3k|      }
 2016|  33.7k|      if (__kmp_tasking_mode != tskm_immediate_exec && !cancelled) {
  ------------------
  |  Branch (2016:11): [True: 33.1k, False: 561]
  |  Branch (2016:56): [True: 0, Folded]
  ------------------
 2017|  33.1k|        __kmp_task_team_sync(this_thr, team);
 2018|  33.1k|      }
 2019|  33.7k|    }
 2020|       |
 2021|       |#if USE_ITT_BUILD
 2022|       |    /* GEH: TODO: Move this under if-condition above and also include in
 2023|       |       __kmp_end_split_barrier(). This will more accurately represent the actual
 2024|       |       release time of the threads for split barriers.  */
 2025|       |    if (__itt_sync_create_ptr || KMP_ITT_DEBUG)
 2026|       |      __kmp_itt_barrier_finished(gtid, itt_sync_obj);
 2027|       |#endif /* USE_ITT_BUILD */
 2028|  34.3k|  } else { // Team is serialized.
 2029|  2.99k|    status = 0;
 2030|  3.01k|    if (__kmp_tasking_mode != tskm_immediate_exec) {
  ------------------
  |  Branch (2030:9): [True: 3.01k, False: 18.4E]
  ------------------
 2031|  3.01k|      if (this_thr->th.th_task_team != NULL) {
  ------------------
  |  Branch (2031:11): [True: 0, False: 3.01k]
  ------------------
 2032|       |#if USE_ITT_NOTIFY
 2033|       |        void *itt_sync_obj = NULL;
 2034|       |        if (__itt_sync_create_ptr || KMP_ITT_DEBUG) {
 2035|       |          itt_sync_obj = __kmp_itt_barrier_object(gtid, bt, 1);
 2036|       |          __kmp_itt_barrier_starting(gtid, itt_sync_obj);
 2037|       |        }
 2038|       |#endif
 2039|       |
 2040|      0|        KMP_DEBUG_ASSERT(
 2041|      0|            this_thr->th.th_task_team->tt.tt_found_proxy_tasks == TRUE ||
 2042|      0|            this_thr->th.th_task_team->tt.tt_hidden_helper_task_encountered ==
 2043|      0|                TRUE);
 2044|      0|        __kmp_task_team_wait(this_thr, team USE_ITT_BUILD_ARG(itt_sync_obj));
 2045|      0|        __kmp_task_team_setup(this_thr, team, 0);
 2046|       |
 2047|       |#if USE_ITT_BUILD
 2048|       |        if (__itt_sync_create_ptr || KMP_ITT_DEBUG)
 2049|       |          __kmp_itt_barrier_finished(gtid, itt_sync_obj);
 2050|       |#endif /* USE_ITT_BUILD */
 2051|      0|      }
 2052|  3.01k|    }
 2053|  2.99k|  }
 2054|  36.7k|  KA_TRACE(15, ("__kmp_barrier: T#%d(%d:%d) is leaving with return value %d\n",
 2055|  36.7k|                gtid, __kmp_team_from_gtid(gtid)->t.t_id,
 2056|  36.7k|                __kmp_tid_from_gtid(gtid), status));
 2057|       |
 2058|  36.7k|#if OMPT_SUPPORT
 2059|  36.7k|  if (ompt_enabled.enabled) {
  ------------------
  |  Branch (2059:7): [True: 0, False: 36.7k]
  ------------------
 2060|      0|#if OMPT_OPTIONAL
 2061|      0|    if (ompt_enabled.ompt_callback_sync_region_wait) {
  ------------------
  |  Branch (2061:9): [True: 0, False: 0]
  ------------------
 2062|      0|      ompt_callbacks.ompt_callback(ompt_callback_sync_region_wait)(
  ------------------
  |  |   27|      0|#define ompt_callback(e) e##_callback
  ------------------
 2063|      0|          barrier_kind, ompt_scope_end, my_parallel_data, my_task_data,
 2064|      0|          return_address);
 2065|      0|    }
 2066|      0|    if (ompt_enabled.ompt_callback_sync_region) {
  ------------------
  |  Branch (2066:9): [True: 0, False: 0]
  ------------------
 2067|      0|      ompt_callbacks.ompt_callback(ompt_callback_sync_region)(
  ------------------
  |  |   27|      0|#define ompt_callback(e) e##_callback
  ------------------
 2068|      0|          barrier_kind, ompt_scope_end, my_parallel_data, my_task_data,
 2069|      0|          return_address);
 2070|      0|    }
 2071|      0|#endif
 2072|      0|    this_thr->th.ompt_thread_info.state = ompt_state_work_parallel;
 2073|      0|  }
 2074|  36.7k|#endif
 2075|       |
 2076|  36.7k|  if (cancellable)
  ------------------
  |  Branch (2076:7): [Folded, False: 36.7k]
  ------------------
 2077|      0|    return (int)cancelled;
 2078|  36.7k|  return status;
 2079|  36.7k|}

__kmpc_cancel:
   29|  14.1k|kmp_int32 __kmpc_cancel(ident_t *loc_ref, kmp_int32 gtid, kmp_int32 cncl_kind) {
   30|  14.1k|  kmp_info_t *this_thr = __kmp_threads[gtid];
   31|       |
   32|  14.1k|  KC_TRACE(10, ("__kmpc_cancel: T#%d request %d OMP_CANCELLATION=%d\n", gtid,
   33|  14.1k|                cncl_kind, __kmp_omp_cancellation));
   34|       |
   35|  14.1k|  KMP_DEBUG_ASSERT(cncl_kind != cancel_noreq);
   36|  14.1k|  KMP_DEBUG_ASSERT(cncl_kind == cancel_parallel || cncl_kind == cancel_loop ||
   37|  14.1k|                   cncl_kind == cancel_sections ||
   38|  14.1k|                   cncl_kind == cancel_taskgroup);
   39|  14.1k|  KMP_DEBUG_ASSERT(__kmp_get_gtid() == gtid);
   40|       |
   41|  14.1k|  if (__kmp_omp_cancellation) {
  ------------------
  |  Branch (41:7): [True: 0, False: 14.1k]
  ------------------
   42|      0|    switch (cncl_kind) {
   43|      0|    case cancel_parallel:
  ------------------
  |  Branch (43:5): [True: 0, False: 0]
  ------------------
   44|      0|    case cancel_loop:
  ------------------
  |  Branch (44:5): [True: 0, False: 0]
  ------------------
   45|      0|    case cancel_sections:
  ------------------
  |  Branch (45:5): [True: 0, False: 0]
  ------------------
   46|       |      // cancellation requests for parallel and worksharing constructs
   47|       |      // are handled through the team structure
   48|      0|      {
   49|      0|        kmp_team_t *this_team = this_thr->th.th_team;
   50|      0|        KMP_DEBUG_ASSERT(this_team);
   51|      0|        kmp_int32 old = cancel_noreq;
   52|      0|        this_team->t.t_cancel_request.compare_exchange_strong(old, cncl_kind);
   53|      0|        if (old == cancel_noreq || old == cncl_kind) {
  ------------------
  |  Branch (53:13): [True: 0, False: 0]
  |  Branch (53:36): [True: 0, False: 0]
  ------------------
   54|       |// we do not have a cancellation request in this team or we do have
   55|       |// one that matches the current request -> cancel
   56|      0|#if OMPT_SUPPORT && OMPT_OPTIONAL
   57|      0|          if (ompt_enabled.ompt_callback_cancel) {
  ------------------
  |  Branch (57:15): [True: 0, False: 0]
  ------------------
   58|      0|            ompt_data_t *task_data;
   59|      0|            __ompt_get_task_info_internal(0, NULL, &task_data, NULL, NULL,
   60|      0|                                          NULL);
   61|      0|            ompt_cancel_flag_t type = ompt_cancel_parallel;
   62|      0|            if (cncl_kind == cancel_parallel)
  ------------------
  |  Branch (62:17): [True: 0, False: 0]
  ------------------
   63|      0|              type = ompt_cancel_parallel;
   64|      0|            else if (cncl_kind == cancel_loop)
  ------------------
  |  Branch (64:22): [True: 0, False: 0]
  ------------------
   65|      0|              type = ompt_cancel_loop;
   66|      0|            else if (cncl_kind == cancel_sections)
  ------------------
  |  Branch (66:22): [True: 0, False: 0]
  ------------------
   67|      0|              type = ompt_cancel_sections;
   68|      0|            ompt_callbacks.ompt_callback(ompt_callback_cancel)(
  ------------------
  |  |   27|      0|#define ompt_callback(e) e##_callback
  ------------------
   69|      0|                task_data, type | ompt_cancel_activated,
   70|      0|                OMPT_GET_RETURN_ADDRESS(0));
  ------------------
  |  |  108|      0|#define OMPT_GET_RETURN_ADDRESS(level) __builtin_return_address(level)
  ------------------
   71|      0|          }
   72|      0|#endif // OMPT_SUPPORT && OMPT_OPTIONAL
   73|      0|          return 1 /* true */;
   74|      0|        }
   75|      0|        break;
   76|      0|      }
   77|      0|    case cancel_taskgroup:
  ------------------
  |  Branch (77:5): [True: 0, False: 0]
  ------------------
   78|       |      // cancellation requests for a task group
   79|       |      // are handled through the taskgroup structure
   80|      0|      {
   81|      0|        kmp_taskdata_t *task;
   82|      0|        kmp_taskgroup_t *taskgroup;
   83|       |
   84|      0|        task = this_thr->th.th_current_task;
   85|      0|        KMP_DEBUG_ASSERT(task);
   86|       |
   87|      0|        taskgroup = task->td_taskgroup;
   88|      0|        if (taskgroup) {
  ------------------
  |  Branch (88:13): [True: 0, False: 0]
  ------------------
   89|      0|          kmp_int32 old = cancel_noreq;
   90|      0|          taskgroup->cancel_request.compare_exchange_strong(old, cncl_kind);
   91|      0|          if (old == cancel_noreq || old == cncl_kind) {
  ------------------
  |  Branch (91:15): [True: 0, False: 0]
  |  Branch (91:38): [True: 0, False: 0]
  ------------------
   92|       |// we do not have a cancellation request in this taskgroup or we do
   93|       |// have one that matches the current request -> cancel
   94|      0|#if OMPT_SUPPORT && OMPT_OPTIONAL
   95|      0|            if (ompt_enabled.ompt_callback_cancel) {
  ------------------
  |  Branch (95:17): [True: 0, False: 0]
  ------------------
   96|      0|              ompt_data_t *task_data;
   97|      0|              __ompt_get_task_info_internal(0, NULL, &task_data, NULL, NULL,
   98|      0|                                            NULL);
   99|      0|              ompt_callbacks.ompt_callback(ompt_callback_cancel)(
  ------------------
  |  |   27|      0|#define ompt_callback(e) e##_callback
  ------------------
  100|      0|                  task_data, ompt_cancel_taskgroup | ompt_cancel_activated,
  101|      0|                  OMPT_GET_RETURN_ADDRESS(0));
  ------------------
  |  |  108|      0|#define OMPT_GET_RETURN_ADDRESS(level) __builtin_return_address(level)
  ------------------
  102|      0|            }
  103|      0|#endif
  104|      0|            return 1 /* true */;
  105|      0|          }
  106|      0|        } else {
  107|       |          // TODO: what needs to happen here?
  108|       |          // the specification disallows cancellation w/o taskgroups
  109|       |          // so we might do anything here, let's abort for now
  110|      0|          KMP_ASSERT(0 /* false */);
  ------------------
  |  |   50|      0|  if (!(cond)) {                                                               \
  |  |  ------------------
  |  |  |  Branch (50:7): [True: 0, Folded]
  |  |  ------------------
  |  |   51|      0|    __kmp_debug_assert("assertion failure", __FILE__, __LINE__);               \
  |  |   52|      0|  }
  ------------------
  111|      0|        }
  112|      0|      }
  113|      0|      break;
  114|      0|    default:
  ------------------
  |  Branch (114:5): [True: 0, False: 0]
  ------------------
  115|      0|      KMP_ASSERT(0 /* false */);
  ------------------
  |  |   50|      0|  if (!(cond)) {                                                               \
  |  |  ------------------
  |  |  |  Branch (50:7): [True: 0, Folded]
  |  |  ------------------
  |  |   51|      0|    __kmp_debug_assert("assertion failure", __FILE__, __LINE__);               \
  |  |   52|      0|  }
  ------------------
  116|      0|    }
  117|      0|  }
  118|       |
  119|       |  // ICV OMP_CANCELLATION=false, so we ignored this cancel request
  120|  14.1k|  KMP_DEBUG_ASSERT(!__kmp_omp_cancellation);
  121|  14.1k|  return 0 /* false */;
  122|  14.1k|}

__kmpc_global_thread_num:
   99|  40.7k|kmp_int32 __kmpc_global_thread_num(ident_t *loc) {
  100|  40.7k|  kmp_int32 gtid = __kmp_entry_gtid();
  ------------------
  |  | 3467|  40.7k|#define __kmp_entry_gtid() __kmp_get_global_thread_id_reg()
  ------------------
  101|       |
  102|  40.7k|  KC_TRACE(10, ("__kmpc_global_thread_num: T#%d\n", gtid));
  103|       |
  104|  40.7k|  return gtid;
  105|  40.7k|}
__kmpc_push_num_threads:
  232|  4.36k|                             kmp_int32 num_threads) {
  233|  4.36k|  KA_TRACE(20, ("__kmpc_push_num_threads: enter T#%d num_threads=%d\n",
  234|  4.36k|                global_tid, num_threads));
  235|  4.36k|  __kmp_assert_valid_gtid(global_tid);
  236|  4.36k|  __kmp_push_num_threads(loc, global_tid, num_threads);
  237|  4.36k|}
__kmpc_fork_call:
  262|  1.35k|void __kmpc_fork_call(ident_t *loc, kmp_int32 argc, kmpc_micro microtask, ...) {
  263|  1.35k|  int gtid = __kmp_entry_gtid();
  ------------------
  |  | 3467|  1.35k|#define __kmp_entry_gtid() __kmp_get_global_thread_id_reg()
  ------------------
  264|       |
  265|       |#if (KMP_STATS_ENABLED)
  266|       |  // If we were in a serial region, then stop the serial timer, record
  267|       |  // the event, and start parallel region timer
  268|       |  stats_state_e previous_state = KMP_GET_THREAD_STATE();
  269|       |  if (previous_state == stats_state_e::SERIAL_REGION) {
  270|       |    KMP_EXCHANGE_PARTITIONED_TIMER(OMP_parallel_overhead);
  271|       |  } else {
  272|       |    KMP_PUSH_PARTITIONED_TIMER(OMP_parallel_overhead);
  273|       |  }
  274|       |  int inParallel = __kmpc_in_parallel(loc);
  275|       |  if (inParallel) {
  276|       |    KMP_COUNT_BLOCK(OMP_NESTED_PARALLEL);
  277|       |  } else {
  278|       |    KMP_COUNT_BLOCK(OMP_PARALLEL);
  279|       |  }
  280|       |#endif
  281|       |
  282|       |  // maybe to save thr_state is enough here
  283|  1.35k|  {
  284|  1.35k|    va_list ap;
  285|  1.35k|    va_start(ap, microtask);
  286|       |
  287|  1.35k|#if OMPT_SUPPORT
  288|  1.35k|    ompt_frame_t *ompt_frame;
  289|  1.35k|    if (ompt_enabled.enabled) {
  ------------------
  |  Branch (289:9): [True: 0, False: 1.35k]
  ------------------
  290|      0|      kmp_info_t *master_th = __kmp_threads[gtid];
  291|      0|      ompt_frame = &master_th->th.th_current_task->ompt_task_info.frame;
  292|      0|      ompt_frame->enter_frame.ptr = OMPT_GET_FRAME_ADDRESS(0);
  ------------------
  |  |  109|      0|#define OMPT_GET_FRAME_ADDRESS(level) __builtin_frame_address(level)
  ------------------
  293|      0|    }
  294|  1.35k|    OMPT_STORE_RETURN_ADDRESS(gtid);
  ------------------
  |  |   92|  1.35k|  OmptReturnAddressGuard ReturnAddressGuard{gtid, __builtin_return_address(0)};
  ------------------
  295|  1.35k|#endif
  296|       |
  297|       |#if INCLUDE_SSC_MARKS
  298|       |    SSC_MARK_FORKING();
  299|       |#endif
  300|  1.35k|    __kmp_fork_call(loc, gtid, fork_context_intel, argc,
  301|  1.35k|                    VOLATILE_CAST(microtask_t) microtask, // "wrapped" task
  ------------------
  |  | 1180|  1.35k|#define VOLATILE_CAST(x) (x)
  ------------------
  302|  1.35k|                    VOLATILE_CAST(launch_t) __kmp_invoke_task_func,
  ------------------
  |  | 1180|  1.35k|#define VOLATILE_CAST(x) (x)
  ------------------
  303|  1.35k|                    kmp_va_addr_of(ap));
  ------------------
  |  |  220|  1.35k|#define kmp_va_addr_of(ap) (&(ap))
  ------------------
  304|       |#if INCLUDE_SSC_MARKS
  305|       |    SSC_MARK_JOINING();
  306|       |#endif
  307|  1.35k|    __kmp_join_call(loc, gtid
  308|  1.35k|#if OMPT_SUPPORT
  309|  1.35k|                    ,
  310|  1.35k|                    fork_context_intel
  311|  1.35k|#endif
  312|  1.35k|    );
  313|       |
  314|  1.35k|    va_end(ap);
  315|       |
  316|  1.35k|#if OMPT_SUPPORT
  317|  1.35k|    if (ompt_enabled.enabled) {
  ------------------
  |  Branch (317:9): [True: 0, False: 1.35k]
  ------------------
  318|      0|      ompt_frame->enter_frame = ompt_data_none;
  ------------------
  |  | 1408|      0|#define ompt_data_none {0}
  ------------------
  319|      0|    }
  320|  1.35k|#endif
  321|  1.35k|  }
  322|       |
  323|       |#if KMP_STATS_ENABLED
  324|       |  if (previous_state == stats_state_e::SERIAL_REGION) {
  325|       |    KMP_EXCHANGE_PARTITIONED_TIMER(OMP_serial);
  326|       |    KMP_SET_THREAD_STATE(previous_state);
  327|       |  } else {
  328|       |    KMP_POP_PARTITIONED_TIMER();
  329|       |  }
  330|       |#endif // KMP_STATS_ENABLED
  331|  1.35k|}
__kmpc_serialized_parallel:
  522|  3.01k|void __kmpc_serialized_parallel(ident_t *loc, kmp_int32 global_tid) {
  523|       |  // The implementation is now in kmp_runtime.cpp so that it can share static
  524|       |  // functions with kmp_fork_call since the tasks to be done are similar in
  525|       |  // each case.
  526|  3.01k|  __kmp_assert_valid_gtid(global_tid);
  527|  3.01k|#if OMPT_SUPPORT
  528|  3.01k|  OMPT_STORE_RETURN_ADDRESS(global_tid);
  ------------------
  |  |   92|  3.01k|  OmptReturnAddressGuard ReturnAddressGuard{gtid, __builtin_return_address(0)};
  ------------------
  529|  3.01k|#endif
  530|  3.01k|  __kmp_serialized_parallel(loc, global_tid);
  531|  3.01k|}
__kmpc_end_serialized_parallel:
  540|  3.01k|void __kmpc_end_serialized_parallel(ident_t *loc, kmp_int32 global_tid) {
  541|  3.01k|  kmp_internal_control_t *top;
  542|  3.01k|  kmp_info_t *this_thr;
  543|  3.01k|  kmp_team_t *serial_team;
  544|       |
  545|  3.01k|  KC_TRACE(10,
  546|  3.01k|           ("__kmpc_end_serialized_parallel: called by T#%d\n", global_tid));
  547|       |
  548|       |  /* skip all this code for autopar serialized loops since it results in
  549|       |     unacceptable overhead */
  550|  3.01k|  if (loc != NULL && (loc->flags & KMP_IDENT_AUTOPAR))
  ------------------
  |  Branch (550:7): [True: 3.01k, False: 0]
  |  Branch (550:22): [True: 0, False: 3.01k]
  ------------------
  551|      0|    return;
  552|       |
  553|       |  // Not autopar code
  554|  3.01k|  __kmp_assert_valid_gtid(global_tid);
  555|  3.01k|  if (!TCR_4(__kmp_init_parallel))
  ------------------
  |  | 1127|  3.01k|#define TCR_4(a) (a)
  ------------------
  |  Branch (555:7): [True: 0, False: 3.01k]
  ------------------
  556|      0|    __kmp_parallel_initialize();
  557|       |
  558|  3.01k|  __kmp_resume_if_soft_paused();
  559|       |
  560|  3.01k|  this_thr = __kmp_threads[global_tid];
  561|  3.01k|  serial_team = this_thr->th.th_serial_team;
  562|       |
  563|  3.01k|  kmp_task_team_t *task_team = this_thr->th.th_task_team;
  564|       |  // we need to wait for the proxy tasks before finishing the thread
  565|  3.01k|  if (task_team != NULL && (task_team->tt.tt_found_proxy_tasks ||
  ------------------
  |  Branch (565:7): [True: 0, False: 3.01k]
  |  Branch (565:29): [True: 0, False: 0]
  ------------------
  566|      0|                            task_team->tt.tt_hidden_helper_task_encountered))
  ------------------
  |  Branch (566:29): [True: 0, False: 0]
  ------------------
  567|      0|    __kmp_task_team_wait(this_thr, serial_team USE_ITT_BUILD_ARG(NULL));
  568|       |
  569|  3.01k|  KMP_MB();
  570|  3.01k|  KMP_DEBUG_ASSERT(serial_team);
  571|  3.01k|  KMP_ASSERT(serial_team->t.t_serialized);
  ------------------
  |  |   50|  3.01k|  if (!(cond)) {                                                               \
  |  |  ------------------
  |  |  |  Branch (50:7): [True: 0, False: 3.01k]
  |  |  ------------------
  |  |   51|      0|    __kmp_debug_assert("assertion failure", __FILE__, __LINE__);               \
  |  |   52|      0|  }
  ------------------
  572|  3.01k|  KMP_DEBUG_ASSERT(this_thr->th.th_team == serial_team);
  573|  3.01k|  KMP_DEBUG_ASSERT(serial_team != this_thr->th.th_root->r.r_root_team);
  574|  3.01k|  KMP_DEBUG_ASSERT(serial_team->t.t_threads);
  575|  3.01k|  KMP_DEBUG_ASSERT(serial_team->t.t_threads[0] == this_thr);
  576|       |
  577|  3.01k|#if OMPT_SUPPORT
  578|  3.01k|  if (ompt_enabled.enabled &&
  ------------------
  |  Branch (578:7): [True: 0, False: 3.01k]
  ------------------
  579|      0|      this_thr->th.ompt_thread_info.state != ompt_state_overhead) {
  ------------------
  |  Branch (579:7): [True: 0, False: 0]
  ------------------
  580|      0|    OMPT_CUR_TASK_INFO(this_thr)->frame.exit_frame = ompt_data_none;
  ------------------
  |  |   68|      0|#define OMPT_CUR_TASK_INFO(thr) (&((thr)->th.th_current_task->ompt_task_info))
  ------------------
                  OMPT_CUR_TASK_INFO(this_thr)->frame.exit_frame = ompt_data_none;
  ------------------
  |  | 1408|      0|#define ompt_data_none {0}
  ------------------
  581|      0|    if (ompt_enabled.ompt_callback_implicit_task) {
  ------------------
  |  Branch (581:9): [True: 0, False: 0]
  ------------------
  582|      0|      ompt_callbacks.ompt_callback(ompt_callback_implicit_task)(
  ------------------
  |  |   27|      0|#define ompt_callback(e) e##_callback
  ------------------
  583|      0|          ompt_scope_end, NULL, OMPT_CUR_TASK_DATA(this_thr), 1,
  ------------------
  |  |   70|      0|  (&((thr)->th.th_current_task->ompt_task_info.task_data))
  ------------------
  584|      0|          OMPT_CUR_TASK_INFO(this_thr)->thread_num, ompt_task_implicit);
  ------------------
  |  |   68|      0|#define OMPT_CUR_TASK_INFO(thr) (&((thr)->th.th_current_task->ompt_task_info))
  ------------------
  585|      0|    }
  586|       |
  587|       |    // reset clear the task id only after unlinking the task
  588|      0|    ompt_data_t *parent_task_data;
  589|      0|    __ompt_get_task_info_internal(1, NULL, &parent_task_data, NULL, NULL, NULL);
  590|       |
  591|      0|    if (ompt_enabled.ompt_callback_parallel_end) {
  ------------------
  |  Branch (591:9): [True: 0, False: 0]
  ------------------
  592|      0|      ompt_callbacks.ompt_callback(ompt_callback_parallel_end)(
  ------------------
  |  |   27|      0|#define ompt_callback(e) e##_callback
  ------------------
  593|      0|          &(serial_team->t.ompt_team_info.parallel_data), parent_task_data,
  594|      0|          ompt_parallel_invoker_program | ompt_parallel_team,
  595|      0|          OMPT_LOAD_RETURN_ADDRESS(global_tid));
  ------------------
  |  |   93|      0|#define OMPT_LOAD_RETURN_ADDRESS(gtid) __ompt_load_return_address(gtid)
  ------------------
  596|      0|    }
  597|      0|    __ompt_lw_taskteam_unlink(this_thr);
  598|      0|    this_thr->th.ompt_thread_info.state = ompt_state_overhead;
  599|      0|  }
  600|  3.01k|#endif
  601|       |
  602|       |  /* If necessary, pop the internal control stack values and replace the team
  603|       |   * values */
  604|  3.01k|  top = serial_team->t.t_control_stack_top;
  605|  3.01k|  if (top && top->serial_nesting_level == serial_team->t.t_serialized) {
  ------------------
  |  Branch (605:7): [True: 0, False: 3.01k]
  |  Branch (605:14): [True: 0, False: 0]
  ------------------
  606|      0|    copy_icvs(&serial_team->t.t_threads[0]->th.th_current_task->td_icvs, top);
  607|      0|    serial_team->t.t_control_stack_top = top->next;
  608|      0|    __kmp_free(top);
  ------------------
  |  | 3619|      0|#define __kmp_free(ptr) ___kmp_free((ptr)KMP_SRC_LOC_CURR)
  ------------------
  609|      0|  }
  610|       |
  611|       |  /* pop dispatch buffers stack */
  612|  3.01k|  KMP_DEBUG_ASSERT(serial_team->t.t_dispatch->th_disp_buffer);
  613|  3.01k|  {
  614|  3.01k|    dispatch_private_info_t *disp_buffer =
  615|  3.01k|        serial_team->t.t_dispatch->th_disp_buffer;
  616|  3.01k|    serial_team->t.t_dispatch->th_disp_buffer =
  617|  3.01k|        serial_team->t.t_dispatch->th_disp_buffer->next;
  618|  3.01k|    __kmp_free(disp_buffer);
  ------------------
  |  | 3619|  3.01k|#define __kmp_free(ptr) ___kmp_free((ptr)KMP_SRC_LOC_CURR)
  ------------------
  619|  3.01k|  }
  620|  3.01k|  this_thr->th.th_def_allocator = serial_team->t.t_def_allocator; // restore
  621|       |
  622|  3.01k|  --serial_team->t.t_serialized;
  623|  3.01k|  if (serial_team->t.t_serialized == 0) {
  ------------------
  |  Branch (623:7): [True: 3.01k, False: 0]
  ------------------
  624|       |
  625|       |    /* return to the parallel section */
  626|       |
  627|  3.01k|#if KMP_ARCH_X86 || KMP_ARCH_X86_64
  628|  3.01k|    if (__kmp_inherit_fp_control && serial_team->t.t_fp_control_saved) {
  ------------------
  |  Branch (628:9): [True: 3.01k, False: 0]
  |  Branch (628:37): [True: 3.01k, False: 0]
  ------------------
  629|  3.01k|      __kmp_clear_x87_fpu_status_word();
  630|  3.01k|      __kmp_load_x87_fpu_control_word(&serial_team->t.t_x87_fpu_control_word);
  631|  3.01k|      __kmp_load_mxcsr(&serial_team->t.t_mxcsr);
  632|  3.01k|    }
  633|  3.01k|#endif /* KMP_ARCH_X86 || KMP_ARCH_X86_64 */
  634|       |
  635|  3.01k|    __kmp_pop_current_task_from_thread(this_thr);
  636|  3.01k|#if OMPD_SUPPORT
  637|  3.01k|    if (ompd_state & OMPD_ENABLE_BP)
  ------------------
  |  |   35|  3.01k|#define OMPD_ENABLE_BP 0x1
  ------------------
  |  Branch (637:9): [True: 0, False: 3.01k]
  ------------------
  638|      0|      ompd_bp_parallel_end();
  639|  3.01k|#endif
  640|       |
  641|  3.01k|    this_thr->th.th_team = serial_team->t.t_parent;
  642|  3.01k|    this_thr->th.th_info.ds.ds_tid = serial_team->t.t_master_tid;
  643|       |
  644|       |    /* restore values cached in the thread */
  645|  3.01k|    this_thr->th.th_team_nproc = serial_team->t.t_parent->t.t_nproc; /*  JPH */
  646|  3.01k|    this_thr->th.th_team_master =
  647|  3.01k|        serial_team->t.t_parent->t.t_threads[0]; /* JPH */
  648|  3.01k|    this_thr->th.th_team_serialized = this_thr->th.th_team->t.t_serialized;
  649|       |
  650|       |    /* TODO the below shouldn't need to be adjusted for serialized teams */
  651|  3.01k|    this_thr->th.th_dispatch =
  652|  3.01k|        &this_thr->th.th_team->t.t_dispatch[serial_team->t.t_master_tid];
  653|       |
  654|  3.01k|    KMP_ASSERT(this_thr->th.th_current_task->td_flags.executing == 0);
  ------------------
  |  |   50|  3.01k|  if (!(cond)) {                                                               \
  |  |  ------------------
  |  |  |  Branch (50:7): [True: 0, False: 3.01k]
  |  |  ------------------
  |  |   51|      0|    __kmp_debug_assert("assertion failure", __FILE__, __LINE__);               \
  |  |   52|      0|  }
  ------------------
  655|  3.01k|    this_thr->th.th_current_task->td_flags.executing = 1;
  656|       |
  657|  3.01k|    if (__kmp_tasking_mode != tskm_immediate_exec) {
  ------------------
  |  Branch (657:9): [True: 3.01k, False: 0]
  ------------------
  658|       |      // Copy the task team from the new child / old parent team to the thread.
  659|  3.01k|      this_thr->th.th_task_team =
  660|  3.01k|          this_thr->th.th_team->t.t_task_team[this_thr->th.th_task_state];
  661|  3.01k|      KA_TRACE(20,
  662|  3.01k|               ("__kmpc_end_serialized_parallel: T#%d restoring task_team %p / "
  663|  3.01k|                "team %p\n",
  664|  3.01k|                global_tid, this_thr->th.th_task_team, this_thr->th.th_team));
  665|  3.01k|    }
  666|  3.01k|#if KMP_AFFINITY_SUPPORTED
  667|  3.01k|    if (this_thr->th.th_team->t.t_level == 0 && __kmp_affinity.flags.reset) {
  ------------------
  |  Branch (667:9): [True: 3.01k, False: 0]
  |  Branch (667:49): [True: 0, False: 3.01k]
  ------------------
  668|      0|      __kmp_reset_root_init_mask(global_tid);
  669|      0|    }
  670|  3.01k|#endif
  671|  3.01k|  } else {
  672|      0|    if (__kmp_tasking_mode != tskm_immediate_exec) {
  ------------------
  |  Branch (672:9): [True: 0, False: 0]
  ------------------
  673|      0|      KA_TRACE(20, ("__kmpc_end_serialized_parallel: T#%d decreasing nesting "
  674|      0|                    "depth of serial team %p to %d\n",
  675|      0|                    global_tid, serial_team, serial_team->t.t_serialized));
  676|      0|    }
  677|      0|  }
  678|       |
  679|  3.01k|  serial_team->t.t_level--;
  680|  3.01k|  if (__kmp_env_consistency_check)
  ------------------
  |  Branch (680:7): [True: 0, False: 3.01k]
  ------------------
  681|      0|    __kmp_pop_parallel(global_tid, NULL);
  682|  3.01k|#if OMPT_SUPPORT
  683|  3.01k|  if (ompt_enabled.enabled)
  ------------------
  |  Branch (683:7): [True: 0, False: 3.01k]
  ------------------
  684|      0|    this_thr->th.ompt_thread_info.state =
  685|      0|        ((this_thr->th.th_team_serialized) ? ompt_state_work_serial
  ------------------
  |  Branch (685:10): [True: 0, False: 0]
  ------------------
  686|      0|                                           : ompt_state_work_parallel);
  687|  3.01k|#endif
  688|  3.01k|}
__kmpc_barrier:
  720|  37.0k|void __kmpc_barrier(ident_t *loc, kmp_int32 global_tid) {
  721|  37.0k|  KMP_COUNT_BLOCK(OMP_BARRIER);
  ------------------
  |  | 1001|  37.0k|#define KMP_COUNT_BLOCK(n) ((void)0)
  ------------------
  722|  37.0k|  KC_TRACE(10, ("__kmpc_barrier: called T#%d\n", global_tid));
  723|  37.0k|  __kmp_assert_valid_gtid(global_tid);
  724|       |
  725|  37.0k|  if (!TCR_4(__kmp_init_parallel))
  ------------------
  |  | 1127|  37.0k|#define TCR_4(a) (a)
  ------------------
  |  Branch (725:7): [True: 0, False: 37.0k]
  ------------------
  726|      0|    __kmp_parallel_initialize();
  727|       |
  728|  37.0k|  __kmp_resume_if_soft_paused();
  729|       |
  730|  37.0k|  if (__kmp_env_consistency_check) {
  ------------------
  |  Branch (730:7): [True: 0, False: 37.0k]
  ------------------
  731|      0|    if (loc == 0) {
  ------------------
  |  Branch (731:9): [True: 0, False: 0]
  ------------------
  732|      0|      KMP_WARNING(ConstructIdentInvalid); // ??? What does it mean for the user?
  ------------------
  |  |  145|      0|  __kmp_msg(kmp_ms_warning, KMP_MSG(__VA_ARGS__), __kmp_msg_null)
  |  |  ------------------
  |  |  |  |  121|      0|#define KMP_MSG(...) __kmp_msg_format(kmp_i18n_msg_##__VA_ARGS__)
  |  |  ------------------
  ------------------
  733|      0|    }
  734|      0|    __kmp_check_barrier(global_tid, ct_barrier, loc);
  735|      0|  }
  736|       |
  737|  37.0k|#if OMPT_SUPPORT
  738|  37.0k|  ompt_frame_t *ompt_frame;
  739|  37.0k|  if (ompt_enabled.enabled) {
  ------------------
  |  Branch (739:7): [True: 0, False: 37.0k]
  ------------------
  740|      0|    __ompt_get_task_info_internal(0, NULL, NULL, &ompt_frame, NULL, NULL);
  741|      0|    if (ompt_frame->enter_frame.ptr == NULL)
  ------------------
  |  Branch (741:9): [True: 0, False: 0]
  ------------------
  742|      0|      ompt_frame->enter_frame.ptr = OMPT_GET_FRAME_ADDRESS(0);
  ------------------
  |  |  109|      0|#define OMPT_GET_FRAME_ADDRESS(level) __builtin_frame_address(level)
  ------------------
  743|      0|  }
  744|  37.0k|  OMPT_STORE_RETURN_ADDRESS(global_tid);
  ------------------
  |  |   92|  37.0k|  OmptReturnAddressGuard ReturnAddressGuard{gtid, __builtin_return_address(0)};
  ------------------
  745|  37.0k|#endif
  746|  37.0k|  __kmp_threads[global_tid]->th.th_ident = loc;
  747|       |  // TODO: explicit barrier_wait_id:
  748|       |  //   this function is called when 'barrier' directive is present or
  749|       |  //   implicit barrier at the end of a worksharing construct.
  750|       |  // 1) better to add a per-thread barrier counter to a thread data structure
  751|       |  // 2) set to 0 when a new team is created
  752|       |  // 4) no sync is required
  753|       |
  754|  37.0k|  __kmp_barrier(bs_plain_barrier, global_tid, FALSE, 0, NULL, NULL);
  ------------------
  |  | 1279|  37.0k|#define FALSE 0
  ------------------
  755|  37.0k|#if OMPT_SUPPORT && OMPT_OPTIONAL
  756|  37.0k|  if (ompt_enabled.enabled) {
  ------------------
  |  Branch (756:7): [True: 0, False: 37.0k]
  ------------------
  757|      0|    ompt_frame->enter_frame = ompt_data_none;
  ------------------
  |  | 1408|      0|#define ompt_data_none {0}
  ------------------
  758|      0|  }
  759|  37.0k|#endif
  760|  37.0k|}
__kmpc_for_static_fini:
 1910|  45.8k|void __kmpc_for_static_fini(ident_t *loc, kmp_int32 global_tid) {
 1911|  45.8k|  KMP_POP_PARTITIONED_TIMER();
  ------------------
  |  | 1015|  45.8k|#define KMP_POP_PARTITIONED_TIMER() ((void)0)
  ------------------
 1912|  45.8k|  KE_TRACE(10, ("__kmpc_for_static_fini called T#%d\n", global_tid));
 1913|       |
 1914|  45.8k|#if OMPT_SUPPORT && OMPT_OPTIONAL
 1915|  45.8k|  if (ompt_enabled.ompt_callback_work) {
  ------------------
  |  Branch (1915:7): [True: 0, False: 45.8k]
  ------------------
 1916|      0|    ompt_work_t ompt_work_type = ompt_work_loop;
 1917|      0|    ompt_team_info_t *team_info = __ompt_get_teaminfo(0, NULL);
 1918|      0|    ompt_task_info_t *task_info = __ompt_get_task_info_object(0);
 1919|       |    // Determine workshare type
 1920|      0|    if (loc != NULL) {
  ------------------
  |  Branch (1920:9): [True: 0, False: 0]
  ------------------
 1921|      0|      if ((loc->flags & KMP_IDENT_WORK_LOOP) != 0) {
  ------------------
  |  Branch (1921:11): [True: 0, False: 0]
  ------------------
 1922|      0|        ompt_work_type = ompt_work_loop;
 1923|      0|      } else if ((loc->flags & KMP_IDENT_WORK_SECTIONS) != 0) {
  ------------------
  |  Branch (1923:18): [True: 0, False: 0]
  ------------------
 1924|      0|        ompt_work_type = ompt_work_sections;
 1925|      0|      } else if ((loc->flags & KMP_IDENT_WORK_DISTRIBUTE) != 0) {
  ------------------
  |  Branch (1925:18): [True: 0, False: 0]
  ------------------
 1926|      0|        ompt_work_type = ompt_work_distribute;
 1927|      0|      } else {
 1928|       |        // use default set above.
 1929|       |        // a warning about this case is provided in __kmpc_for_static_init
 1930|      0|      }
 1931|      0|      KMP_DEBUG_ASSERT(ompt_work_type);
 1932|      0|    }
 1933|      0|    ompt_callbacks.ompt_callback(ompt_callback_work)(
  ------------------
  |  |   27|      0|#define ompt_callback(e) e##_callback
  ------------------
 1934|      0|        ompt_work_type, ompt_scope_end, &(team_info->parallel_data),
 1935|      0|        &(task_info->task_data), 0, OMPT_GET_RETURN_ADDRESS(0));
  ------------------
  |  |  108|      0|#define OMPT_GET_RETURN_ADDRESS(level) __builtin_return_address(level)
  ------------------
 1936|      0|  }
 1937|  45.8k|#endif
 1938|  45.8k|  if (__kmp_env_consistency_check)
  ------------------
  |  Branch (1938:7): [True: 0, False: 45.8k]
  ------------------
 1939|      0|    __kmp_pop_workshare(global_tid, ct_pdo, loc);
 1940|  45.8k|}
__kmpc_init_lock:
 2419|  30.8k|void __kmpc_init_lock(ident_t *loc, kmp_int32 gtid, void **user_lock) {
 2420|  30.8k|#if KMP_USE_DYNAMIC_LOCK
 2421|       |
 2422|  30.8k|  KMP_DEBUG_ASSERT(__kmp_init_serial);
 2423|  30.8k|  if (__kmp_env_consistency_check && user_lock == NULL) {
  ------------------
  |  Branch (2423:7): [True: 0, False: 30.8k]
  |  Branch (2423:38): [True: 0, False: 0]
  ------------------
 2424|      0|    KMP_FATAL(LockIsUninitialized, "omp_init_lock");
  ------------------
  |  |  146|      0|#define KMP_FATAL(...) __kmp_fatal(KMP_MSG(__VA_ARGS__), __kmp_msg_null)
  |  |  ------------------
  |  |  |  |  121|      0|#define KMP_MSG(...) __kmp_msg_format(kmp_i18n_msg_##__VA_ARGS__)
  |  |  ------------------
  ------------------
 2425|      0|  }
 2426|  30.8k|  __kmp_init_lock_with_hint(loc, user_lock, __kmp_user_lock_seq);
 2427|       |
 2428|  30.8k|#if OMPT_SUPPORT && OMPT_OPTIONAL
 2429|       |  // This is the case, if called from omp_init_lock_with_hint:
 2430|  30.8k|  void *codeptr = OMPT_LOAD_RETURN_ADDRESS(gtid);
  ------------------
  |  |   93|  30.8k|#define OMPT_LOAD_RETURN_ADDRESS(gtid) __ompt_load_return_address(gtid)
  ------------------
 2431|  30.8k|  if (!codeptr)
  ------------------
  |  Branch (2431:7): [True: 30.8k, False: 0]
  ------------------
 2432|  30.8k|    codeptr = OMPT_GET_RETURN_ADDRESS(0);
  ------------------
  |  |  108|  30.8k|#define OMPT_GET_RETURN_ADDRESS(level) __builtin_return_address(level)
  ------------------
 2433|  30.8k|  if (ompt_enabled.ompt_callback_lock_init) {
  ------------------
  |  Branch (2433:7): [True: 0, False: 30.8k]
  ------------------
 2434|      0|    ompt_callbacks.ompt_callback(ompt_callback_lock_init)(
  ------------------
  |  |   27|      0|#define ompt_callback(e) e##_callback
  ------------------
 2435|      0|        ompt_mutex_lock, omp_lock_hint_none,
 2436|      0|        __ompt_get_mutex_impl_type(user_lock),
 2437|      0|        (ompt_wait_id_t)(uintptr_t)user_lock, codeptr);
 2438|      0|  }
 2439|  30.8k|#endif
 2440|       |
 2441|       |#else // KMP_USE_DYNAMIC_LOCK
 2442|       |
 2443|       |  static char const *const func = "omp_init_lock";
 2444|       |  kmp_user_lock_p lck;
 2445|       |  KMP_DEBUG_ASSERT(__kmp_init_serial);
 2446|       |
 2447|       |  if (__kmp_env_consistency_check) {
 2448|       |    if (user_lock == NULL) {
 2449|       |      KMP_FATAL(LockIsUninitialized, func);
 2450|       |    }
 2451|       |  }
 2452|       |
 2453|       |  KMP_CHECK_USER_LOCK_INIT();
 2454|       |
 2455|       |  if ((__kmp_user_lock_kind == lk_tas) &&
 2456|       |      (sizeof(lck->tas.lk.poll) <= OMP_LOCK_T_SIZE)) {
 2457|       |    lck = (kmp_user_lock_p)user_lock;
 2458|       |  }
 2459|       |#if KMP_USE_FUTEX
 2460|       |  else if ((__kmp_user_lock_kind == lk_futex) &&
 2461|       |           (sizeof(lck->futex.lk.poll) <= OMP_LOCK_T_SIZE)) {
 2462|       |    lck = (kmp_user_lock_p)user_lock;
 2463|       |  }
 2464|       |#endif
 2465|       |  else {
 2466|       |    lck = __kmp_user_lock_allocate(user_lock, gtid, 0);
 2467|       |  }
 2468|       |  INIT_LOCK(lck);
 2469|       |  __kmp_set_user_lock_location(lck, loc);
 2470|       |
 2471|       |#if OMPT_SUPPORT && OMPT_OPTIONAL
 2472|       |  // This is the case, if called from omp_init_lock_with_hint:
 2473|       |  void *codeptr = OMPT_LOAD_RETURN_ADDRESS(gtid);
 2474|       |  if (!codeptr)
 2475|       |    codeptr = OMPT_GET_RETURN_ADDRESS(0);
 2476|       |  if (ompt_enabled.ompt_callback_lock_init) {
 2477|       |    ompt_callbacks.ompt_callback(ompt_callback_lock_init)(
 2478|       |        ompt_mutex_lock, omp_lock_hint_none, __ompt_get_mutex_impl_type(),
 2479|       |        (ompt_wait_id_t)(uintptr_t)user_lock, codeptr);
 2480|       |  }
 2481|       |#endif
 2482|       |
 2483|       |#if USE_ITT_BUILD
 2484|       |  __kmp_itt_lock_creating(lck);
 2485|       |#endif /* USE_ITT_BUILD */
 2486|       |
 2487|       |#endif // KMP_USE_DYNAMIC_LOCK
 2488|  30.8k|} // __kmpc_init_lock
__kmpc_destroy_lock:
 2565|  30.8k|void __kmpc_destroy_lock(ident_t *loc, kmp_int32 gtid, void **user_lock) {
 2566|  30.8k|#if KMP_USE_DYNAMIC_LOCK
 2567|       |
 2568|       |#if USE_ITT_BUILD
 2569|       |  kmp_user_lock_p lck;
 2570|       |  if (KMP_EXTRACT_D_TAG(user_lock) == 0) {
 2571|       |    lck = ((kmp_indirect_lock_t *)KMP_LOOKUP_I_LOCK(user_lock))->lock;
 2572|       |  } else {
 2573|       |    lck = (kmp_user_lock_p)user_lock;
 2574|       |  }
 2575|       |  __kmp_itt_lock_destroyed(lck);
 2576|       |#endif
 2577|  30.8k|#if OMPT_SUPPORT && OMPT_OPTIONAL
 2578|       |  // This is the case, if called from omp_init_lock_with_hint:
 2579|  30.8k|  void *codeptr = OMPT_LOAD_RETURN_ADDRESS(gtid);
  ------------------
  |  |   93|  30.8k|#define OMPT_LOAD_RETURN_ADDRESS(gtid) __ompt_load_return_address(gtid)
  ------------------
 2580|  30.8k|  if (!codeptr)
  ------------------
  |  Branch (2580:7): [True: 30.8k, False: 0]
  ------------------
 2581|  30.8k|    codeptr = OMPT_GET_RETURN_ADDRESS(0);
  ------------------
  |  |  108|  30.8k|#define OMPT_GET_RETURN_ADDRESS(level) __builtin_return_address(level)
  ------------------
 2582|  30.8k|  if (ompt_enabled.ompt_callback_lock_destroy) {
  ------------------
  |  Branch (2582:7): [True: 0, False: 30.8k]
  ------------------
 2583|      0|    ompt_callbacks.ompt_callback(ompt_callback_lock_destroy)(
  ------------------
  |  |   27|      0|#define ompt_callback(e) e##_callback
  ------------------
 2584|      0|        ompt_mutex_lock, (ompt_wait_id_t)(uintptr_t)user_lock, codeptr);
 2585|      0|  }
 2586|  30.8k|#endif
 2587|  30.8k|  KMP_D_LOCK_FUNC(user_lock, destroy)((kmp_dyna_lock_t *)user_lock);
  ------------------
  |  | 1149|  30.8k|#define KMP_D_LOCK_FUNC(l, op) __kmp_direct_##op[KMP_EXTRACT_D_TAG(l)]
  |  |  ------------------
  |  |  |  | 1141|  30.8k|  (*((kmp_dyna_lock_t *)(l)) & ((1 << KMP_LOCK_SHIFT) - 1) &                   \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1076|  30.8k|  8 // number of low bits to be used as tag for direct locks
  |  |  |  |  ------------------
  |  |  |  | 1142|  30.8k|   -(*((kmp_dyna_lock_t *)(l)) & 1))
  |  |  ------------------
  ------------------
 2588|       |#else
 2589|       |  kmp_user_lock_p lck;
 2590|       |
 2591|       |  if ((__kmp_user_lock_kind == lk_tas) &&
 2592|       |      (sizeof(lck->tas.lk.poll) <= OMP_LOCK_T_SIZE)) {
 2593|       |    lck = (kmp_user_lock_p)user_lock;
 2594|       |  }
 2595|       |#if KMP_USE_FUTEX
 2596|       |  else if ((__kmp_user_lock_kind == lk_futex) &&
 2597|       |           (sizeof(lck->futex.lk.poll) <= OMP_LOCK_T_SIZE)) {
 2598|       |    lck = (kmp_user_lock_p)user_lock;
 2599|       |  }
 2600|       |#endif
 2601|       |  else {
 2602|       |    lck = __kmp_lookup_user_lock(user_lock, "omp_destroy_lock");
 2603|       |  }
 2604|       |
 2605|       |#if OMPT_SUPPORT && OMPT_OPTIONAL
 2606|       |  // This is the case, if called from omp_init_lock_with_hint:
 2607|       |  void *codeptr = OMPT_LOAD_RETURN_ADDRESS(gtid);
 2608|       |  if (!codeptr)
 2609|       |    codeptr = OMPT_GET_RETURN_ADDRESS(0);
 2610|       |  if (ompt_enabled.ompt_callback_lock_destroy) {
 2611|       |    ompt_callbacks.ompt_callback(ompt_callback_lock_destroy)(
 2612|       |        ompt_mutex_lock, (ompt_wait_id_t)(uintptr_t)user_lock, codeptr);
 2613|       |  }
 2614|       |#endif
 2615|       |
 2616|       |#if USE_ITT_BUILD
 2617|       |  __kmp_itt_lock_destroyed(lck);
 2618|       |#endif /* USE_ITT_BUILD */
 2619|       |  DESTROY_LOCK(lck);
 2620|       |
 2621|       |  if ((__kmp_user_lock_kind == lk_tas) &&
 2622|       |      (sizeof(lck->tas.lk.poll) <= OMP_LOCK_T_SIZE)) {
 2623|       |    ;
 2624|       |  }
 2625|       |#if KMP_USE_FUTEX
 2626|       |  else if ((__kmp_user_lock_kind == lk_futex) &&
 2627|       |           (sizeof(lck->futex.lk.poll) <= OMP_LOCK_T_SIZE)) {
 2628|       |    ;
 2629|       |  }
 2630|       |#endif
 2631|       |  else {
 2632|       |    __kmp_user_lock_free(user_lock, gtid, lck);
 2633|       |  }
 2634|       |#endif // KMP_USE_DYNAMIC_LOCK
 2635|  30.8k|} // __kmpc_destroy_lock
__kmpc_set_lock:
 2712|  25.1k|void __kmpc_set_lock(ident_t *loc, kmp_int32 gtid, void **user_lock) {
 2713|  25.1k|  KMP_COUNT_BLOCK(OMP_set_lock);
  ------------------
  |  | 1001|  25.1k|#define KMP_COUNT_BLOCK(n) ((void)0)
  ------------------
 2714|  25.1k|#if KMP_USE_DYNAMIC_LOCK
 2715|  25.1k|  int tag = KMP_EXTRACT_D_TAG(user_lock);
  ------------------
  |  | 1141|  25.1k|  (*((kmp_dyna_lock_t *)(l)) & ((1 << KMP_LOCK_SHIFT) - 1) &                   \
  |  |  ------------------
  |  |  |  | 1076|  25.1k|  8 // number of low bits to be used as tag for direct locks
  |  |  ------------------
  |  | 1142|  25.1k|   -(*((kmp_dyna_lock_t *)(l)) & 1))
  ------------------
 2716|       |#if USE_ITT_BUILD
 2717|       |  __kmp_itt_lock_acquiring(
 2718|       |      (kmp_user_lock_p)
 2719|       |          user_lock); // itt function will get to the right lock object.
 2720|       |#endif
 2721|  25.1k|#if OMPT_SUPPORT && OMPT_OPTIONAL
 2722|       |  // This is the case, if called from omp_init_lock_with_hint:
 2723|  25.1k|  void *codeptr = OMPT_LOAD_RETURN_ADDRESS(gtid);
  ------------------
  |  |   93|  25.1k|#define OMPT_LOAD_RETURN_ADDRESS(gtid) __ompt_load_return_address(gtid)
  ------------------
 2724|  25.1k|  if (!codeptr)
  ------------------
  |  Branch (2724:7): [True: 25.1k, False: 1]
  ------------------
 2725|  25.1k|    codeptr = OMPT_GET_RETURN_ADDRESS(0);
  ------------------
  |  |  108|  25.1k|#define OMPT_GET_RETURN_ADDRESS(level) __builtin_return_address(level)
  ------------------
 2726|  25.1k|  if (ompt_enabled.ompt_callback_mutex_acquire) {
  ------------------
  |  Branch (2726:7): [True: 0, False: 25.1k]
  ------------------
 2727|      0|    ompt_callbacks.ompt_callback(ompt_callback_mutex_acquire)(
  ------------------
  |  |   27|      0|#define ompt_callback(e) e##_callback
  ------------------
 2728|      0|        ompt_mutex_lock, omp_lock_hint_none,
 2729|      0|        __ompt_get_mutex_impl_type(user_lock),
 2730|      0|        (ompt_wait_id_t)(uintptr_t)user_lock, codeptr);
 2731|      0|  }
 2732|  25.1k|#endif
 2733|  25.1k|#if KMP_USE_INLINED_TAS
 2734|  25.1k|  if (tag == locktag_tas && !__kmp_env_consistency_check) {
  ------------------
  |  Branch (2734:7): [True: 0, False: 25.1k]
  |  Branch (2734:29): [True: 0, False: 0]
  ------------------
 2735|      0|    KMP_ACQUIRE_TAS_LOCK(user_lock, gtid);
  ------------------
  |  | 1080|      0|  {                                                                            \
  |  | 1081|      0|    kmp_tas_lock_t *l = (kmp_tas_lock_t *)lock;                                \
  |  | 1082|      0|    kmp_int32 tas_free = KMP_LOCK_FREE(tas);                                   \
  |  |  ------------------
  |  |  |  | 1165|      0|#define KMP_LOCK_FREE(type) (locktag_##type)
  |  |  ------------------
  |  | 1083|      0|    kmp_int32 tas_busy = KMP_LOCK_BUSY(gtid + 1, tas);                         \
  |  |  ------------------
  |  |  |  | 1168|      0|#define KMP_LOCK_BUSY(v, type) ((v) << KMP_LOCK_SHIFT | locktag_##type)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1076|      0|  8 // number of low bits to be used as tag for direct locks
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1084|      0|    if (KMP_ATOMIC_LD_RLX(&l->lk.poll) != tas_free ||                          \
  |  |  ------------------
  |  |  |  | 1250|      0|#define KMP_ATOMIC_LD_RLX(p) KMP_ATOMIC_LD(p, relaxed)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1245|      0|#define KMP_ATOMIC_LD(p, order) (p)->load(std::memory_order_##order)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (1084:9): [True: 0, False: 0]
  |  |  ------------------
  |  | 1085|      0|        !__kmp_atomic_compare_store_acq(&l->lk.poll, tas_free, tas_busy)) {    \
  |  |  ------------------
  |  |  |  Branch (1085:9): [True: 0, False: 0]
  |  |  ------------------
  |  | 1086|      0|      kmp_uint32 spins;                                                        \
  |  | 1087|      0|      KMP_FSYNC_PREPARE(l);                                                    \
  |  |  ------------------
  |  |  |  |  332|      0|#define KMP_FSYNC_PREPARE(obj) ((void)0)
  |  |  ------------------
  |  | 1088|      0|      KMP_INIT_YIELD(spins);                                                   \
  |  |  ------------------
  |  |  |  | 1514|      0|  { (count) = __kmp_yield_init; }
  |  |  ------------------
  |  | 1089|      0|      kmp_backoff_t backoff = __kmp_spin_backoff_params;                       \
  |  | 1090|      0|      do {                                                                     \
  |  | 1091|      0|        if (TCR_4(__kmp_nth) >                                                 \
  |  |  ------------------
  |  |  |  | 1127|      0|#define TCR_4(a) (a)
  |  |  ------------------
  |  |  |  Branch (1091:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 1092|      0|            (__kmp_avail_proc ? __kmp_avail_proc : __kmp_xproc)) {             \
  |  |  ------------------
  |  |  |  Branch (1092:14): [True: 0, False: 0]
  |  |  ------------------
  |  | 1093|      0|          KMP_YIELD(TRUE);                                                     \
  |  |  ------------------
  |  |  |  | 1529|      0|  {                                                                            \
  |  |  |  | 1530|      0|    KMP_CPU_PAUSE();                                                           \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1498|      0|#define KMP_CPU_PAUSE() __kmp_x86_pause()
  |  |  |  |  ------------------
  |  |  |  | 1531|      0|    if ((cond) && (KMP_TRY_YIELD))                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1523|      0|  ((__kmp_use_yield == 1) || (__kmp_use_yield == 2 && (KMP_OVERSUBSCRIBED)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 1520|      0|  (TCR_4(__kmp_nth) > (__kmp_avail_proc ? __kmp_avail_proc : __kmp_xproc))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 1127|      0|#define TCR_4(a) (a)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (1520:24): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1523:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (1523:31): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (1523:55): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1531:9): [True: 0, Folded]
  |  |  |  |  ------------------
  |  |  |  | 1532|      0|      __kmp_yield();                                                           \
  |  |  |  | 1533|      0|  }
  |  |  ------------------
  |  | 1094|      0|        } else {                                                               \
  |  | 1095|      0|          KMP_YIELD_SPIN(spins);                                               \
  |  |  ------------------
  |  |  |  | 1545|      0|  {                                                                            \
  |  |  |  | 1546|      0|    KMP_CPU_PAUSE();                                                           \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1498|      0|#define KMP_CPU_PAUSE() __kmp_x86_pause()
  |  |  |  |  ------------------
  |  |  |  | 1547|      0|    if (KMP_TRY_YIELD) {                                                       \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1523|      0|  ((__kmp_use_yield == 1) || (__kmp_use_yield == 2 && (KMP_OVERSUBSCRIBED)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 1520|      0|  (TCR_4(__kmp_nth) > (__kmp_avail_proc ? __kmp_avail_proc : __kmp_xproc))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 1127|      0|#define TCR_4(a) (a)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (1520:24): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1523:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (1523:31): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (1523:55): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1548|      0|      (count) -= 2;                                                            \
  |  |  |  | 1549|      0|      if (!(count)) {                                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1549:11): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1550|      0|        __kmp_yield();                                                         \
  |  |  |  | 1551|      0|        (count) = __kmp_yield_next;                                            \
  |  |  |  | 1552|      0|      }                                                                        \
  |  |  |  | 1553|      0|    }                                                                          \
  |  |  |  | 1554|      0|  }
  |  |  ------------------
  |  | 1096|      0|        }                                                                      \
  |  | 1097|      0|        __kmp_spin_backoff(&backoff);                                          \
  |  | 1098|      0|      } while (                                                                \
  |  | 1099|      0|          KMP_ATOMIC_LD_RLX(&l->lk.poll) != tas_free ||                        \
  |  |  ------------------
  |  |  |  | 1250|      0|#define KMP_ATOMIC_LD_RLX(p) KMP_ATOMIC_LD(p, relaxed)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1245|      0|#define KMP_ATOMIC_LD(p, order) (p)->load(std::memory_order_##order)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (1099:11): [True: 0, False: 0]
  |  |  ------------------
  |  | 1100|      0|          !__kmp_atomic_compare_store_acq(&l->lk.poll, tas_free, tas_busy));   \
  |  |  ------------------
  |  |  |  Branch (1100:11): [True: 0, False: 0]
  |  |  ------------------
  |  | 1101|      0|    }                                                                          \
  |  | 1102|      0|    KMP_FSYNC_ACQUIRED(l);                                                     \
  |  |  ------------------
  |  |  |  |  334|      0|#define KMP_FSYNC_ACQUIRED(obj) ((void)0)
  |  |  ------------------
  |  | 1103|      0|  }
  ------------------
 2736|      0|  } else
 2737|       |#elif KMP_USE_INLINED_FUTEX
 2738|       |  if (tag == locktag_futex && !__kmp_env_consistency_check) {
 2739|       |    KMP_ACQUIRE_FUTEX_LOCK(user_lock, gtid);
 2740|       |  } else
 2741|       |#endif
 2742|  25.1k|  {
 2743|  25.1k|    __kmp_direct_set[tag]((kmp_dyna_lock_t *)user_lock, gtid);
 2744|  25.1k|  }
 2745|       |#if USE_ITT_BUILD
 2746|       |  __kmp_itt_lock_acquired((kmp_user_lock_p)user_lock);
 2747|       |#endif
 2748|  25.1k|#if OMPT_SUPPORT && OMPT_OPTIONAL
 2749|  25.1k|  if (ompt_enabled.ompt_callback_mutex_acquired) {
  ------------------
  |  Branch (2749:7): [True: 0, False: 25.1k]
  ------------------
 2750|      0|    ompt_callbacks.ompt_callback(ompt_callback_mutex_acquired)(
  ------------------
  |  |   27|      0|#define ompt_callback(e) e##_callback
  ------------------
 2751|      0|        ompt_mutex_lock, (ompt_wait_id_t)(uintptr_t)user_lock, codeptr);
 2752|      0|  }
 2753|  25.1k|#endif
 2754|       |
 2755|       |#else // KMP_USE_DYNAMIC_LOCK
 2756|       |
 2757|       |  kmp_user_lock_p lck;
 2758|       |
 2759|       |  if ((__kmp_user_lock_kind == lk_tas) &&
 2760|       |      (sizeof(lck->tas.lk.poll) <= OMP_LOCK_T_SIZE)) {
 2761|       |    lck = (kmp_user_lock_p)user_lock;
 2762|       |  }
 2763|       |#if KMP_USE_FUTEX
 2764|       |  else if ((__kmp_user_lock_kind == lk_futex) &&
 2765|       |           (sizeof(lck->futex.lk.poll) <= OMP_LOCK_T_SIZE)) {
 2766|       |    lck = (kmp_user_lock_p)user_lock;
 2767|       |  }
 2768|       |#endif
 2769|       |  else {
 2770|       |    lck = __kmp_lookup_user_lock(user_lock, "omp_set_lock");
 2771|       |  }
 2772|       |
 2773|       |#if USE_ITT_BUILD
 2774|       |  __kmp_itt_lock_acquiring(lck);
 2775|       |#endif /* USE_ITT_BUILD */
 2776|       |#if OMPT_SUPPORT && OMPT_OPTIONAL
 2777|       |  // This is the case, if called from omp_init_lock_with_hint:
 2778|       |  void *codeptr = OMPT_LOAD_RETURN_ADDRESS(gtid);
 2779|       |  if (!codeptr)
 2780|       |    codeptr = OMPT_GET_RETURN_ADDRESS(0);
 2781|       |  if (ompt_enabled.ompt_callback_mutex_acquire) {
 2782|       |    ompt_callbacks.ompt_callback(ompt_callback_mutex_acquire)(
 2783|       |        ompt_mutex_lock, omp_lock_hint_none, __ompt_get_mutex_impl_type(),
 2784|       |        (ompt_wait_id_t)(uintptr_t)lck, codeptr);
 2785|       |  }
 2786|       |#endif
 2787|       |
 2788|       |  ACQUIRE_LOCK(lck, gtid);
 2789|       |
 2790|       |#if USE_ITT_BUILD
 2791|       |  __kmp_itt_lock_acquired(lck);
 2792|       |#endif /* USE_ITT_BUILD */
 2793|       |
 2794|       |#if OMPT_SUPPORT && OMPT_OPTIONAL
 2795|       |  if (ompt_enabled.ompt_callback_mutex_acquired) {
 2796|       |    ompt_callbacks.ompt_callback(ompt_callback_mutex_acquired)(
 2797|       |        ompt_mutex_lock, (ompt_wait_id_t)(uintptr_t)lck, codeptr);
 2798|       |  }
 2799|       |#endif
 2800|       |
 2801|       |#endif // KMP_USE_DYNAMIC_LOCK
 2802|  25.1k|}
__kmpc_unset_lock:
 2915|  25.2k|void __kmpc_unset_lock(ident_t *loc, kmp_int32 gtid, void **user_lock) {
 2916|  25.2k|#if KMP_USE_DYNAMIC_LOCK
 2917|       |
 2918|  25.2k|  int tag = KMP_EXTRACT_D_TAG(user_lock);
  ------------------
  |  | 1141|  25.2k|  (*((kmp_dyna_lock_t *)(l)) & ((1 << KMP_LOCK_SHIFT) - 1) &                   \
  |  |  ------------------
  |  |  |  | 1076|  25.2k|  8 // number of low bits to be used as tag for direct locks
  |  |  ------------------
  |  | 1142|  25.2k|   -(*((kmp_dyna_lock_t *)(l)) & 1))
  ------------------
 2919|       |#if USE_ITT_BUILD
 2920|       |  __kmp_itt_lock_releasing((kmp_user_lock_p)user_lock);
 2921|       |#endif
 2922|  25.2k|#if KMP_USE_INLINED_TAS
 2923|  25.2k|  if (tag == locktag_tas && !__kmp_env_consistency_check) {
  ------------------
  |  Branch (2923:7): [True: 0, False: 25.2k]
  |  Branch (2923:29): [True: 0, False: 0]
  ------------------
 2924|      0|    KMP_RELEASE_TAS_LOCK(user_lock, gtid);
  ------------------
  |  | 1117|      0|  { KMP_ATOMIC_ST_REL(&((kmp_tas_lock_t *)lock)->lk.poll, KMP_LOCK_FREE(tas)); }
  |  |  ------------------
  |  |  |  | 1251|      0|#define KMP_ATOMIC_ST_REL(p, v) KMP_ATOMIC_OP(store, p, v, release)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1246|      0|#define KMP_ATOMIC_OP(op, p, v, order) (p)->op(v, std::memory_order_##order)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2925|      0|  } else
 2926|       |#elif KMP_USE_INLINED_FUTEX
 2927|       |  if (tag == locktag_futex && !__kmp_env_consistency_check) {
 2928|       |    KMP_RELEASE_FUTEX_LOCK(user_lock, gtid);
 2929|       |  } else
 2930|       |#endif
 2931|  25.2k|  {
 2932|  25.2k|    __kmp_direct_unset[tag]((kmp_dyna_lock_t *)user_lock, gtid);
 2933|  25.2k|  }
 2934|       |
 2935|  25.2k|#if OMPT_SUPPORT && OMPT_OPTIONAL
 2936|       |  // This is the case, if called from omp_init_lock_with_hint:
 2937|  25.2k|  void *codeptr = OMPT_LOAD_RETURN_ADDRESS(gtid);
  ------------------
  |  |   93|  25.2k|#define OMPT_LOAD_RETURN_ADDRESS(gtid) __ompt_load_return_address(gtid)
  ------------------
 2938|  25.2k|  if (!codeptr)
  ------------------
  |  Branch (2938:7): [True: 25.2k, False: 0]
  ------------------
 2939|  25.2k|    codeptr = OMPT_GET_RETURN_ADDRESS(0);
  ------------------
  |  |  108|  25.2k|#define OMPT_GET_RETURN_ADDRESS(level) __builtin_return_address(level)
  ------------------
 2940|  25.2k|  if (ompt_enabled.ompt_callback_mutex_released) {
  ------------------
  |  Branch (2940:7): [True: 0, False: 25.2k]
  ------------------
 2941|      0|    ompt_callbacks.ompt_callback(ompt_callback_mutex_released)(
  ------------------
  |  |   27|      0|#define ompt_callback(e) e##_callback
  ------------------
 2942|      0|        ompt_mutex_lock, (ompt_wait_id_t)(uintptr_t)user_lock, codeptr);
 2943|      0|  }
 2944|  25.2k|#endif
 2945|       |
 2946|       |#else // KMP_USE_DYNAMIC_LOCK
 2947|       |
 2948|       |  kmp_user_lock_p lck;
 2949|       |
 2950|       |  /* Can't use serial interval since not block structured */
 2951|       |  /* release the lock */
 2952|       |
 2953|       |  if ((__kmp_user_lock_kind == lk_tas) &&
 2954|       |      (sizeof(lck->tas.lk.poll) <= OMP_LOCK_T_SIZE)) {
 2955|       |#if KMP_OS_LINUX &&                                                            \
 2956|       |    (KMP_ARCH_X86 || KMP_ARCH_X86_64 || KMP_ARCH_ARM || KMP_ARCH_AARCH64)
 2957|       |// "fast" path implemented to fix customer performance issue
 2958|       |#if USE_ITT_BUILD
 2959|       |    __kmp_itt_lock_releasing((kmp_user_lock_p)user_lock);
 2960|       |#endif /* USE_ITT_BUILD */
 2961|       |    TCW_4(((kmp_user_lock_p)user_lock)->tas.lk.poll, 0);
 2962|       |    KMP_MB();
 2963|       |
 2964|       |#if OMPT_SUPPORT && OMPT_OPTIONAL
 2965|       |    // This is the case, if called from omp_init_lock_with_hint:
 2966|       |    void *codeptr = OMPT_LOAD_RETURN_ADDRESS(gtid);
 2967|       |    if (!codeptr)
 2968|       |      codeptr = OMPT_GET_RETURN_ADDRESS(0);
 2969|       |    if (ompt_enabled.ompt_callback_mutex_released) {
 2970|       |      ompt_callbacks.ompt_callback(ompt_callback_mutex_released)(
 2971|       |          ompt_mutex_lock, (ompt_wait_id_t)(uintptr_t)lck, codeptr);
 2972|       |    }
 2973|       |#endif
 2974|       |
 2975|       |    return;
 2976|       |#else
 2977|       |    lck = (kmp_user_lock_p)user_lock;
 2978|       |#endif
 2979|       |  }
 2980|       |#if KMP_USE_FUTEX
 2981|       |  else if ((__kmp_user_lock_kind == lk_futex) &&
 2982|       |           (sizeof(lck->futex.lk.poll) <= OMP_LOCK_T_SIZE)) {
 2983|       |    lck = (kmp_user_lock_p)user_lock;
 2984|       |  }
 2985|       |#endif
 2986|       |  else {
 2987|       |    lck = __kmp_lookup_user_lock(user_lock, "omp_unset_lock");
 2988|       |  }
 2989|       |
 2990|       |#if USE_ITT_BUILD
 2991|       |  __kmp_itt_lock_releasing(lck);
 2992|       |#endif /* USE_ITT_BUILD */
 2993|       |
 2994|       |  RELEASE_LOCK(lck, gtid);
 2995|       |
 2996|       |#if OMPT_SUPPORT && OMPT_OPTIONAL
 2997|       |  // This is the case, if called from omp_init_lock_with_hint:
 2998|       |  void *codeptr = OMPT_LOAD_RETURN_ADDRESS(gtid);
 2999|       |  if (!codeptr)
 3000|       |    codeptr = OMPT_GET_RETURN_ADDRESS(0);
 3001|       |  if (ompt_enabled.ompt_callback_mutex_released) {
 3002|       |    ompt_callbacks.ompt_callback(ompt_callback_mutex_released)(
 3003|       |        ompt_mutex_lock, (ompt_wait_id_t)(uintptr_t)lck, codeptr);
 3004|       |  }
 3005|       |#endif
 3006|       |
 3007|       |#endif // KMP_USE_DYNAMIC_LOCK
 3008|  25.2k|}
kmp_csupport.cpp:_ZL25__kmp_init_lock_with_hintP5identPPv18kmp_dyna_lockseq_t:
 2315|  30.8k|                                                    kmp_dyna_lockseq_t seq) {
 2316|  30.8k|  if (KMP_IS_D_LOCK(seq)) {
  ------------------
  |  | 1104|  30.8k|  ((seq) >= KMP_FIRST_D_LOCK && (seq) <= KMP_LAST_D_LOCK)
  |  |  ------------------
  |  |  |  | 1077|  61.6k|#define KMP_FIRST_D_LOCK lockseq_tas
  |  |  ------------------
  |  |                 ((seq) >= KMP_FIRST_D_LOCK && (seq) <= KMP_LAST_D_LOCK)
  |  |  ------------------
  |  |  |  | 1057|  30.8k|#define KMP_LAST_D_LOCK lockseq_rtm_spin
  |  |  ------------------
  |  |  |  Branch (1104:4): [True: 30.8k, False: 0]
  |  |  |  Branch (1104:33): [True: 0, False: 30.8k]
  |  |  ------------------
  ------------------
 2317|      0|    KMP_INIT_D_LOCK(lock, seq);
  ------------------
  |  | 1158|      0|  __kmp_direct_init[KMP_GET_D_TAG(seq)]((kmp_dyna_lock_t *)l, seq)
  |  |  ------------------
  |  |  |  | 1108|      0|#define KMP_GET_D_TAG(seq) ((seq) << 1 | 1)
  |  |  ------------------
  ------------------
 2318|       |#if USE_ITT_BUILD
 2319|       |    __kmp_itt_lock_creating((kmp_user_lock_p)lock, NULL);
 2320|       |#endif
 2321|  30.8k|  } else {
 2322|  30.8k|    KMP_INIT_I_LOCK(lock, seq);
  ------------------
  |  | 1162|  30.8k|  __kmp_direct_init[0]((kmp_dyna_lock_t *)(l), seq)
  ------------------
 2323|       |#if USE_ITT_BUILD
 2324|       |    kmp_indirect_lock_t *ilk = KMP_LOOKUP_I_LOCK(lock);
 2325|       |    __kmp_itt_lock_creating(ilk->lock, loc);
 2326|       |#endif
 2327|  30.8k|  }
 2328|  30.8k|}

__kmp_eq_4:
 2854|  11.9M|kmp_uint32 __kmp_eq_4(kmp_uint32 value, kmp_uint32 checker) {
 2855|  11.9M|  return value == checker;
 2856|  11.9M|}
__kmp_neq_4:
 2858|  1.21k|kmp_uint32 __kmp_neq_4(kmp_uint32 value, kmp_uint32 checker) {
 2859|  1.21k|  return value != checker;
 2860|  1.21k|}
__kmp_wait_4:
 2878|  2.71k|) {
 2879|       |  // note: we may not belong to a team at this point
 2880|  2.71k|  volatile kmp_uint32 *spin = spinner;
 2881|  2.71k|  kmp_uint32 check = checker;
 2882|  2.71k|  kmp_uint32 spins;
 2883|  2.71k|  kmp_uint32 (*f)(kmp_uint32, kmp_uint32) = pred;
 2884|  2.71k|  kmp_uint32 r;
 2885|  2.71k|  kmp_uint64 time;
 2886|       |
 2887|  2.71k|  KMP_FSYNC_SPIN_INIT(obj, CCAST(kmp_uint32 *, spin));
  ------------------
  |  |  337|  2.71k|#define KMP_FSYNC_SPIN_INIT(obj, spin) ((void)0)
  ------------------
 2888|  2.71k|  KMP_INIT_YIELD(spins);
  ------------------
  |  | 1514|  2.71k|  { (count) = __kmp_yield_init; }
  ------------------
 2889|  2.71k|  KMP_INIT_BACKOFF(time);
  ------------------
  |  | 1517|  2.71k|  { (time) = __kmp_pause_init; }
  ------------------
 2890|       |  // main wait spin loop
 2891|  11.9M|  while (!f(r = TCR_4(*spin), check)) {
  ------------------
  |  | 1127|  11.9M|#define TCR_4(a) (a)
  ------------------
  |  Branch (2891:10): [True: 11.9M, False: 2.71k]
  ------------------
 2892|  11.9M|    KMP_FSYNC_SPIN_PREPARE(obj);
  ------------------
  |  |  338|  11.9M|#define KMP_FSYNC_SPIN_PREPARE(obj) ((void)0)
  ------------------
 2893|       |    /* GEH - remove this since it was accidentally introduced when kmp_wait was
 2894|       |       split. It causes problems with infinite recursion because of exit lock */
 2895|       |    /* if ( TCR_4(__kmp_global.g.g_done) && __kmp_global.g.g_abort)
 2896|       |        __kmp_abort_thread(); */
 2897|  11.9M|    KMP_YIELD_OVERSUB_ELSE_SPIN(spins, time);
  ------------------
  |  | 1564|  11.9M|  {                                                                            \
  |  | 1565|  11.9M|    if (__kmp_tpause_enabled) {                                                \
  |  |  ------------------
  |  |  |  Branch (1565:9): [True: 0, False: 11.9M]
  |  |  ------------------
  |  | 1566|      0|      if (KMP_OVERSUBSCRIBED) {                                                \
  |  |  ------------------
  |  |  |  | 1520|      0|  (TCR_4(__kmp_nth) > (__kmp_avail_proc ? __kmp_avail_proc : __kmp_xproc))
  |  |  |  |  ------------------
  |  |  |  |  |  | 1127|      0|#define TCR_4(a) (a)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1520:3): [True: 0, False: 0]
  |  |  |  |  |  Branch (1520:24): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1567|      0|        __kmp_tpause(0, (time));                                               \
  |  | 1568|      0|      } else {                                                                 \
  |  | 1569|      0|        __kmp_tpause(__kmp_tpause_hint, (time));                               \
  |  | 1570|      0|      }                                                                        \
  |  | 1571|      0|      (time) = (time << 1 | 1) & KMP_TPAUSE_MAX_MASK;                          \
  |  |  ------------------
  |  |  |  | 1562|      0|#define KMP_TPAUSE_MAX_MASK ((kmp_uint64)0xFFFF)
  |  |  ------------------
  |  | 1572|  11.9M|    } else {                                                                   \
  |  | 1573|  11.9M|      KMP_CPU_PAUSE();                                                         \
  |  |  ------------------
  |  |  |  | 1498|  11.9M|#define KMP_CPU_PAUSE() __kmp_x86_pause()
  |  |  ------------------
  |  | 1574|  11.9M|      if ((KMP_TRY_YIELD_OVERSUB)) {                                           \
  |  |  ------------------
  |  |  |  | 1526|  11.9M|  ((__kmp_use_yield == 1 || __kmp_use_yield == 2) && (KMP_OVERSUBSCRIBED))
  |  |  |  |  ------------------
  |  |  |  |  |  | 1520|  18.4E|  (TCR_4(__kmp_nth) > (__kmp_avail_proc ? __kmp_avail_proc : __kmp_xproc))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 1127|  11.9M|#define TCR_4(a) (a)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1520:24): [True: 12.0M, False: 18.4E]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1526:5): [True: 11.9M, False: 0]
  |  |  |  |  |  Branch (1526:29): [True: 0, False: 0]
  |  |  |  |  |  Branch (1526:54): [True: 0, False: 11.9M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1575|      0|        __kmp_yield();                                                         \
  |  | 1576|  12.1M|      } else if (__kmp_use_yield == 1) {                                       \
  |  |  ------------------
  |  |  |  Branch (1576:18): [True: 12.1M, False: 18.4E]
  |  |  ------------------
  |  | 1577|  12.1M|        (count) -= 2;                                                          \
  |  | 1578|  12.1M|        if (!(count)) {                                                        \
  |  |  ------------------
  |  |  |  Branch (1578:13): [True: 74.7k, False: 12.0M]
  |  |  ------------------
  |  | 1579|  74.7k|          __kmp_yield();                                                       \
  |  | 1580|  74.7k|          (count) = __kmp_yield_next;                                          \
  |  | 1581|  74.7k|        }                                                                      \
  |  | 1582|  12.1M|      }                                                                        \
  |  | 1583|  11.9M|    }                                                                          \
  |  | 1584|  11.9M|  }
  ------------------
 2898|  11.9M|  }
 2899|  2.71k|  KMP_FSYNC_SPIN_ACQUIRED(obj);
  ------------------
  |  |  339|  2.71k|#define KMP_FSYNC_SPIN_ACQUIRED(obj) ((void)0)
  ------------------
 2900|  2.71k|  return r;
 2901|  2.71k|}

__kmp_env_get:
   84|      3|char *__kmp_env_get(char const *name) {
   85|       |
   86|      3|  char *result = NULL;
   87|       |
   88|      3|#if KMP_OS_UNIX
   89|      3|  char const *value = getenv(name);
   90|      3|  if (value != NULL) {
  ------------------
  |  Branch (90:7): [True: 2, False: 1]
  ------------------
   91|      2|    size_t len = KMP_STRLEN(value) + 1;
  ------------------
  |  |   68|      2|#define KMP_STRLEN strlen
  ------------------
   92|      2|    result = (char *)KMP_INTERNAL_MALLOC(len);
  ------------------
  |  |  110|      2|#define KMP_INTERNAL_MALLOC(sz) malloc(sz)
  ------------------
   93|      2|    if (result == NULL) {
  ------------------
  |  Branch (93:9): [True: 0, False: 2]
  ------------------
   94|      0|      KMP_FATAL(MemoryAllocFailed);
  ------------------
  |  |  146|      0|#define KMP_FATAL(...) __kmp_fatal(KMP_MSG(__VA_ARGS__), __kmp_msg_null)
  |  |  ------------------
  |  |  |  |  121|      0|#define KMP_MSG(...) __kmp_msg_format(kmp_i18n_msg_##__VA_ARGS__)
  |  |  ------------------
  ------------------
   95|      0|    }
   96|      2|    KMP_STRNCPY_S(result, len, value, len);
  ------------------
  |  |   64|      2|#define KMP_STRNCPY_S(dst, bsz, src, cnt) strncpy(dst, src, cnt)
  ------------------
   97|      2|  }
   98|       |#elif KMP_OS_WINDOWS
   99|       |  /* We use GetEnvironmentVariable for Windows* OS instead of getenv because the
  100|       |     act of loading a DLL on Windows* OS makes any user-set environment
  101|       |     variables (i.e. with putenv()) unavailable. getenv() apparently gets a
  102|       |     clean copy of the env variables as they existed at the start of the run.
  103|       |     JH 12/23/2002 */
  104|       |  DWORD rc;
  105|       |  rc = GetEnvironmentVariable(name, NULL, 0);
  106|       |  if (!rc) {
  107|       |    DWORD error = GetLastError();
  108|       |    if (error != ERROR_ENVVAR_NOT_FOUND) {
  109|       |      __kmp_fatal(KMP_MSG(CantGetEnvVar, name), KMP_ERR(error), __kmp_msg_null);
  110|       |    }
  111|       |    // Variable is not found, it's ok, just continue.
  112|       |  } else {
  113|       |    DWORD len = rc;
  114|       |    result = (char *)KMP_INTERNAL_MALLOC(len);
  115|       |    if (result == NULL) {
  116|       |      KMP_FATAL(MemoryAllocFailed);
  117|       |    }
  118|       |    rc = GetEnvironmentVariable(name, result, len);
  119|       |    if (!rc) {
  120|       |      // GetEnvironmentVariable() may return 0 if variable is empty.
  121|       |      // In such a case GetLastError() returns ERROR_SUCCESS.
  122|       |      DWORD error = GetLastError();
  123|       |      if (error != ERROR_SUCCESS) {
  124|       |        // Unexpected error. The variable should be in the environment,
  125|       |        // and buffer should be large enough.
  126|       |        __kmp_fatal(KMP_MSG(CantGetEnvVar, name), KMP_ERR(error),
  127|       |                    __kmp_msg_null);
  128|       |        KMP_INTERNAL_FREE((void *)result);
  129|       |        result = NULL;
  130|       |      }
  131|       |    }
  132|       |  }
  133|       |#else
  134|       |#error Unknown or unsupported OS.
  135|       |#endif
  136|       |
  137|      3|  return result;
  138|       |
  139|      3|} // func __kmp_env_get
__kmp_env_set:
  173|      1|void __kmp_env_set(char const *name, char const *value, int overwrite) {
  174|       |
  175|      1|#if KMP_OS_UNIX
  176|      1|  int rc = setenv(name, value, overwrite);
  177|      1|  if (rc != 0) {
  ------------------
  |  Branch (177:7): [True: 0, False: 1]
  ------------------
  178|       |    // Dead code. I tried to put too many variables into Linux* OS
  179|       |    // environment on IA-32 architecture. When application consumes
  180|       |    // more than ~2.5 GB of memory, entire system feels bad. Sometimes
  181|       |    // application is killed (by OS?), sometimes system stops
  182|       |    // responding... But this error message never appears. --ln
  183|      0|    __kmp_fatal(KMP_MSG(CantSetEnvVar, name), KMP_HNT(NotEnoughMemory),
  ------------------
  |  |  121|      0|#define KMP_MSG(...) __kmp_msg_format(kmp_i18n_msg_##__VA_ARGS__)
  ------------------
                  __kmp_fatal(KMP_MSG(CantSetEnvVar, name), KMP_HNT(NotEnoughMemory),
  ------------------
  |  |  122|      0|#define KMP_HNT(...) __kmp_msg_format(kmp_i18n_hnt_##__VA_ARGS__)
  ------------------
  184|      0|                __kmp_msg_null);
  185|      0|  }
  186|       |#elif KMP_OS_WINDOWS
  187|       |  BOOL rc;
  188|       |  if (!overwrite) {
  189|       |    rc = GetEnvironmentVariable(name, NULL, 0);
  190|       |    if (rc) {
  191|       |      // Variable exists, do not overwrite.
  192|       |      return;
  193|       |    }
  194|       |    DWORD error = GetLastError();
  195|       |    if (error != ERROR_ENVVAR_NOT_FOUND) {
  196|       |      __kmp_fatal(KMP_MSG(CantGetEnvVar, name), KMP_ERR(error), __kmp_msg_null);
  197|       |    }
  198|       |  }
  199|       |  rc = SetEnvironmentVariable(name, value);
  200|       |  if (!rc) {
  201|       |    DWORD error = GetLastError();
  202|       |    __kmp_fatal(KMP_MSG(CantSetEnvVar, name), KMP_ERR(error), __kmp_msg_null);
  203|       |  }
  204|       |#else
  205|       |#error Unknown or unsupported OS.
  206|       |#endif
  207|       |
  208|      1|} // func __kmp_env_set
__kmp_env_unset:
  210|      1|void __kmp_env_unset(char const *name) {
  211|       |
  212|      1|#if KMP_OS_UNIX
  213|      1|  unsetenv(name);
  214|       |#elif KMP_OS_WINDOWS
  215|       |  BOOL rc = SetEnvironmentVariable(name, NULL);
  216|       |  if (!rc) {
  217|       |    DWORD error = GetLastError();
  218|       |    __kmp_fatal(KMP_MSG(CantSetEnvVar, name), KMP_ERR(error), __kmp_msg_null);
  219|       |  }
  220|       |#else
  221|       |#error Unknown or unsupported OS.
  222|       |#endif
  223|       |
  224|      1|} // func __kmp_env_unset
__kmp_env_blk_init:
  431|      2|) {
  432|       |
  433|      2|  if (bulk != NULL) {
  ------------------
  |  Branch (433:7): [True: 0, False: 2]
  ------------------
  434|      0|    ___kmp_env_blk_parse_string(block, bulk);
  435|      2|  } else {
  436|      2|#if KMP_OS_UNIX
  437|      2|    ___kmp_env_blk_parse_unix(block, environ);
  438|       |#elif KMP_OS_WINDOWS
  439|       |    {
  440|       |      char *mem = GetEnvironmentStrings();
  441|       |      if (mem == NULL) {
  442|       |        DWORD error = GetLastError();
  443|       |        __kmp_fatal(KMP_MSG(CantGetEnvironment), KMP_ERR(error),
  444|       |                    __kmp_msg_null);
  445|       |      }
  446|       |      ___kmp_env_blk_parse_windows(block, mem);
  447|       |      FreeEnvironmentStrings(mem);
  448|       |    }
  449|       |#else
  450|       |#error Unknown or unsupported OS.
  451|       |#endif
  452|      2|  }
  453|       |
  454|      2|} // __kmp_env_blk_init
__kmp_env_blk_sort:
  463|      1|) {
  464|       |
  465|      1|  qsort(CCAST(kmp_env_var_t *, block->vars), block->count,
  ------------------
  |  |  229|      1|#define CCAST(type, var) const_cast<type>(var)
  ------------------
  466|      1|        sizeof(kmp_env_var_t),
  467|      1|        (int (*)(void const *, void const *)) & ___kmp_env_var_cmp);
  468|       |
  469|      1|} // __kmp_env_block_sort
__kmp_env_blk_free:
  473|      2|) {
  474|       |
  475|      2|  KMP_INTERNAL_FREE(CCAST(kmp_env_var_t *, block->vars));
  ------------------
  |  |  111|      2|#define KMP_INTERNAL_FREE(p) free(p)
  ------------------
  476|      2|  __kmp_str_free(&(block->bulk));
  477|       |
  478|      2|  block->count = 0;
  479|      2|  block->vars = NULL;
  480|       |
  481|      2|} // __kmp_env_blk_free
__kmp_env_blk_var:
  486|      3|) {
  487|       |
  488|      3|  int i;
  489|    105|  for (i = 0; i < block->count; ++i) {
  ------------------
  |  Branch (489:15): [True: 102, False: 3]
  ------------------
  490|    102|    if (strcmp(block->vars[i].name, name) == 0) {
  ------------------
  |  Branch (490:9): [True: 0, False: 102]
  ------------------
  491|      0|      return block->vars[i].value;
  492|      0|    }
  493|    102|  }
  494|      3|  return NULL;
  495|       |
  496|      3|} // __kmp_env_block_var
kmp_environment.cpp:_ZL8allocatem:
   76|      4|static inline void *allocate(size_t size) {
   77|      4|  void *ptr = KMP_INTERNAL_MALLOC(size);
  ------------------
  |  |  110|      4|#define KMP_INTERNAL_MALLOC(sz) malloc(sz)
  ------------------
   78|      4|  if (ptr == NULL) {
  ------------------
  |  Branch (78:7): [True: 0, False: 4]
  ------------------
   79|      0|    KMP_FATAL(MemoryAllocFailed);
  ------------------
  |  |  146|      0|#define KMP_FATAL(...) __kmp_fatal(KMP_MSG(__VA_ARGS__), __kmp_msg_null)
  |  |  ------------------
  |  |  |  |  121|      0|#define KMP_MSG(...) __kmp_msg_format(kmp_i18n_msg_##__VA_ARGS__)
  |  |  ------------------
  ------------------
   80|      0|  }
   81|      4|  return ptr;
   82|      4|} // allocate
kmp_environment.cpp:_ZL25___kmp_env_blk_parse_unixP13__kmp_env_blkPPc:
  383|      2|) {
  384|      2|  char *bulk = NULL;
  385|      2|  kmp_env_var_t *vars = NULL;
  386|      2|  int count = 0;
  387|      2|  size_t size = 0; // Size of bulk.
  388|       |
  389|       |  // Count number of variables and length of required bulk.
  390|      2|  {
  391|     69|    while (env[count] != NULL) {
  ------------------
  |  Branch (391:12): [True: 67, False: 2]
  ------------------
  392|     67|      size += KMP_STRLEN(env[count]) + 1;
  ------------------
  |  |   68|     67|#define KMP_STRLEN strlen
  ------------------
  393|     67|      ++count;
  394|     67|    }
  395|      2|  }
  396|       |
  397|       |  // Allocate memory.
  398|      2|  bulk = (char *)allocate(size);
  399|      2|  vars = (kmp_env_var_t *)allocate(count * sizeof(kmp_env_var_t));
  400|       |
  401|       |  // Loop thru all the vars.
  402|      2|  {
  403|      2|    char *var; // Pointer to beginning of var.
  404|      2|    char *name; // Pointer to name of variable.
  405|      2|    char *value; // Pointer to value.
  406|      2|    size_t len; // Length of variable.
  407|      2|    int i;
  408|      2|    var = bulk;
  409|     69|    for (i = 0; i < count; ++i) {
  ------------------
  |  Branch (409:17): [True: 67, False: 2]
  ------------------
  410|       |      // Copy variable to bulk.
  411|     67|      len = KMP_STRLEN(env[i]);
  ------------------
  |  |   68|     67|#define KMP_STRLEN strlen
  ------------------
  412|     67|      KMP_MEMCPY_S(var, size, env[i], len + 1);
  ------------------
  |  |   60|     67|#define KMP_MEMCPY_S(dst, bsz, src, cnt) memcpy(dst, src, cnt)
  ------------------
  413|       |      // Save found variable in vars array.
  414|     67|      __kmp_str_split(var, '=', &name, &value);
  415|     67|      vars[i].name = name;
  416|     67|      vars[i].value = value;
  417|       |      // Move pointer.
  418|     67|      var += len + 1;
  419|     67|    }
  420|      2|  }
  421|       |
  422|       |  // Fill out result.
  423|      2|  block->bulk = bulk;
  424|      2|  block->vars = vars;
  425|      2|  block->count = count;
  426|      2|}
kmp_environment.cpp:_ZL18___kmp_env_var_cmpPK13__kmp_env_varS1_:
  457|    122|    kmp_env_var_t const *lhs, kmp_env_var_t const *rhs) {
  458|    122|  return strcmp(lhs->name, rhs->name);
  459|    122|}

omp_get_max_threads:
  357|  4.36k|int FTN_STDCALL KMP_EXPAND_NAME(FTN_GET_MAX_THREADS)(void) {
  358|       |#ifdef KMP_STUB
  359|       |  return 1;
  360|       |#else
  361|  4.36k|  int gtid;
  362|  4.36k|  kmp_info_t *thread;
  363|  4.36k|  if (!TCR_4(__kmp_init_middle)) {
  ------------------
  |  | 1127|  4.36k|#define TCR_4(a) (a)
  ------------------
  |  Branch (363:7): [True: 1, False: 4.36k]
  ------------------
  364|      1|    __kmp_middle_initialize();
  365|      1|  }
  366|  4.36k|  gtid = __kmp_entry_gtid();
  ------------------
  |  | 3467|  4.36k|#define __kmp_entry_gtid() __kmp_get_global_thread_id_reg()
  ------------------
  367|  4.36k|  thread = __kmp_threads[gtid];
  368|  4.36k|#if KMP_AFFINITY_SUPPORTED
  369|  4.36k|  if (thread->th.th_team->t.t_level == 0 && !__kmp_affinity.flags.reset) {
  ------------------
  |  Branch (369:7): [True: 4.36k, False: 0]
  |  Branch (369:45): [True: 4.36k, False: 0]
  ------------------
  370|  4.36k|    __kmp_assign_root_init_mask();
  371|  4.36k|  }
  372|  4.36k|#endif
  373|       |  // return thread -> th.th_team -> t.t_current_task[
  374|       |  // thread->th.th_info.ds.ds_tid ] -> icvs.nproc;
  375|  4.36k|  return thread->th.th_current_task->td_icvs.nproc;
  376|  4.36k|#endif
  377|  4.36k|}
omp_init_lock:
 1136|  30.8k|void FTN_STDCALL KMP_EXPAND_NAME(FTN_INIT_LOCK)(void **user_lock) {
 1137|       |#ifdef KMP_STUB
 1138|       |  *((kmp_stub_lock_t *)user_lock) = UNLOCKED;
 1139|       |#else
 1140|  30.8k|  int gtid = __kmp_entry_gtid();
  ------------------
  |  | 3467|  30.8k|#define __kmp_entry_gtid() __kmp_get_global_thread_id_reg()
  ------------------
 1141|  30.8k|#if OMPT_SUPPORT && OMPT_OPTIONAL
 1142|  30.8k|  OMPT_STORE_RETURN_ADDRESS(gtid);
  ------------------
  |  |   92|  30.8k|  OmptReturnAddressGuard ReturnAddressGuard{gtid, __builtin_return_address(0)};
  ------------------
 1143|  30.8k|#endif
 1144|       |  __kmpc_init_lock(NULL, gtid, user_lock);
 1145|  30.8k|#endif
 1146|  30.8k|}
omp_destroy_lock:
 1161|  30.8k|void FTN_STDCALL KMP_EXPAND_NAME(FTN_DESTROY_LOCK)(void **user_lock) {
 1162|       |#ifdef KMP_STUB
 1163|       |  *((kmp_stub_lock_t *)user_lock) = UNINIT;
 1164|       |#else
 1165|  30.8k|  int gtid = __kmp_entry_gtid();
  ------------------
  |  | 3467|  30.8k|#define __kmp_entry_gtid() __kmp_get_global_thread_id_reg()
  ------------------
 1166|  30.8k|#if OMPT_SUPPORT && OMPT_OPTIONAL
 1167|  30.8k|  OMPT_STORE_RETURN_ADDRESS(gtid);
  ------------------
  |  |   92|  30.8k|  OmptReturnAddressGuard ReturnAddressGuard{gtid, __builtin_return_address(0)};
  ------------------
 1168|  30.8k|#endif
 1169|       |  __kmpc_destroy_lock(NULL, gtid, user_lock);
 1170|  30.8k|#endif
 1171|  30.8k|}
omp_set_lock:
 1185|  25.1k|void FTN_STDCALL KMP_EXPAND_NAME(FTN_SET_LOCK)(void **user_lock) {
 1186|       |#ifdef KMP_STUB
 1187|       |  if (*((kmp_stub_lock_t *)user_lock) == UNINIT) {
 1188|       |    // TODO: Issue an error.
 1189|       |  }
 1190|       |  if (*((kmp_stub_lock_t *)user_lock) != UNLOCKED) {
 1191|       |    // TODO: Issue an error.
 1192|       |  }
 1193|       |  *((kmp_stub_lock_t *)user_lock) = LOCKED;
 1194|       |#else
 1195|  25.1k|  int gtid = __kmp_entry_gtid();
  ------------------
  |  | 3467|  25.1k|#define __kmp_entry_gtid() __kmp_get_global_thread_id_reg()
  ------------------
 1196|  25.1k|#if OMPT_SUPPORT && OMPT_OPTIONAL
 1197|  25.1k|  OMPT_STORE_RETURN_ADDRESS(gtid);
  ------------------
  |  |   92|  25.1k|  OmptReturnAddressGuard ReturnAddressGuard{gtid, __builtin_return_address(0)};
  ------------------
 1198|  25.1k|#endif
 1199|       |  __kmpc_set_lock(NULL, gtid, user_lock);
 1200|  25.1k|#endif
 1201|  25.1k|}
omp_unset_lock:
 1218|  25.2k|void FTN_STDCALL KMP_EXPAND_NAME(FTN_UNSET_LOCK)(void **user_lock) {
 1219|       |#ifdef KMP_STUB
 1220|       |  if (*((kmp_stub_lock_t *)user_lock) == UNINIT) {
 1221|       |    // TODO: Issue an error.
 1222|       |  }
 1223|       |  if (*((kmp_stub_lock_t *)user_lock) == UNLOCKED) {
 1224|       |    // TODO: Issue an error.
 1225|       |  }
 1226|       |  *((kmp_stub_lock_t *)user_lock) = UNLOCKED;
 1227|       |#else
 1228|  25.2k|  int gtid = __kmp_entry_gtid();
  ------------------
  |  | 3467|  25.2k|#define __kmp_entry_gtid() __kmp_get_global_thread_id_reg()
  ------------------
 1229|  25.2k|#if OMPT_SUPPORT && OMPT_OPTIONAL
 1230|  25.2k|  OMPT_STORE_RETURN_ADDRESS(gtid);
  ------------------
  |  |   92|  25.2k|  OmptReturnAddressGuard ReturnAddressGuard{gtid, __builtin_return_address(0)};
  ------------------
 1231|  25.2k|#endif
 1232|       |  __kmpc_unset_lock(NULL, gtid, user_lock);
 1233|  25.2k|#endif
 1234|  25.2k|}

__kmp_i18n_catopen:
   62|      1|void __kmp_i18n_catopen() {
   63|      1|  if (status == KMP_I18N_CLOSED) {
  ------------------
  |  Branch (63:7): [True: 1, False: 0]
  ------------------
   64|      1|    __kmp_acquire_bootstrap_lock(&lock);
   65|      1|    if (status == KMP_I18N_CLOSED) {
  ------------------
  |  Branch (65:9): [True: 1, False: 0]
  ------------------
   66|      1|      __kmp_i18n_do_catopen();
   67|      1|    }
   68|      1|    __kmp_release_bootstrap_lock(&lock);
   69|      1|  }
   70|      1|} // func __kmp_i18n_catopen
__kmp_i18n_catclose:
  178|      1|void __kmp_i18n_catclose() {
  179|      1|  if (status == KMP_I18N_OPENED) {
  ------------------
  |  Branch (179:7): [True: 0, False: 1]
  ------------------
  180|      0|    KMP_DEBUG_ASSERT(cat != KMP_I18N_NULLCAT);
  181|      0|    catclose(cat);
  182|      0|    cat = KMP_I18N_NULLCAT;
  ------------------
  |  |   78|      0|#define KMP_I18N_NULLCAT ((nl_catd)(-1))
  ------------------
  183|      0|  }
  184|      1|  status = KMP_I18N_CLOSED;
  185|      1|} // func __kmp_i18n_catclose
__kmp_i18n_catgets:
  187|     10|char const *__kmp_i18n_catgets(kmp_i18n_id_t id) {
  188|       |
  189|     10|  int section = get_section(id);
  ------------------
  |  |   33|     10|#define get_section(id) ((id) >> 16)
  ------------------
  190|     10|  int number = get_number(id);
  ------------------
  |  |   34|     10|#define get_number(id) ((id)&0xFFFF)
  ------------------
  191|     10|  char const *message = NULL;
  192|       |
  193|     10|  if (1 <= section && section <= __kmp_i18n_default_table.size) {
  ------------------
  |  Branch (193:7): [True: 10, False: 0]
  |  Branch (193:23): [True: 10, False: 0]
  ------------------
  194|     10|    if (1 <= number && number <= __kmp_i18n_default_table.sect[section].size) {
  ------------------
  |  Branch (194:9): [True: 10, False: 0]
  |  Branch (194:24): [True: 10, False: 0]
  ------------------
  195|     10|      if (status == KMP_I18N_CLOSED) {
  ------------------
  |  Branch (195:11): [True: 1, False: 9]
  ------------------
  196|      1|        __kmp_i18n_catopen();
  197|      1|      }
  198|     10|      if (status == KMP_I18N_OPENED) {
  ------------------
  |  Branch (198:11): [True: 0, False: 10]
  ------------------
  199|      0|        message = catgets(cat, section, number,
  200|      0|                          __kmp_i18n_default_table.sect[section].str[number]);
  201|      0|      }
  202|     10|      if (message == NULL) {
  ------------------
  |  Branch (202:11): [True: 10, False: 0]
  ------------------
  203|     10|        message = __kmp_i18n_default_table.sect[section].str[number];
  204|     10|      }
  205|     10|    }
  206|     10|  }
  207|     10|  if (message == NULL) {
  ------------------
  |  Branch (207:7): [True: 0, False: 10]
  ------------------
  208|      0|    message = no_message_available;
  209|      0|  }
  210|     10|  return message;
  211|       |
  212|     10|} // func __kmp_i18n_catgets
__kmp_msg_format:
  624|      1|kmp_msg_t __kmp_msg_format(unsigned id_arg, ...) {
  625|       |
  626|      1|  kmp_msg_t msg;
  627|      1|  va_list args;
  628|      1|  kmp_str_buf_t buffer;
  629|      1|  __kmp_str_buf_init(&buffer);
  ------------------
  |  |   41|      1|  {                                                                            \
  |  |   42|      1|    (b)->str = (b)->bulk;                                                      \
  |  |   43|      1|    (b)->size = sizeof((b)->bulk);                                             \
  |  |   44|      1|    (b)->used = 0;                                                             \
  |  |   45|      1|    (b)->bulk[0] = 0;                                                          \
  |  |   46|      1|  }
  ------------------
  630|       |
  631|      1|  va_start(args, id_arg);
  632|       |
  633|       |  // We use unsigned for the ID argument and explicitly cast it here to the
  634|       |  // right enumerator because variadic functions are not compatible with
  635|       |  // default promotions.
  636|      1|  kmp_i18n_id_t id = (kmp_i18n_id_t)id_arg;
  637|       |
  638|      1|#if KMP_OS_UNIX
  639|       |  // On Linux* OS and OS X*, printf() family functions process parameter
  640|       |  // numbers, for example:  "%2$s %1$s".
  641|      1|  __kmp_str_buf_vprint(&buffer, __kmp_i18n_catgets(id), args);
  642|       |#elif KMP_OS_WINDOWS
  643|       |  // On Windows, printf() family functions does not recognize GNU style
  644|       |  // parameter numbers, so we have to use FormatMessage() instead. It recognizes
  645|       |  // parameter numbers, e. g.:  "%2!s! "%1!s!".
  646|       |  {
  647|       |    LPTSTR str = NULL;
  648|       |    int len;
  649|       |    FormatMessage(FORMAT_MESSAGE_FROM_STRING | FORMAT_MESSAGE_ALLOCATE_BUFFER,
  650|       |                  __kmp_i18n_catgets(id), 0, 0, (LPTSTR)(&str), 0, &args);
  651|       |    len = ___strip_crs(str);
  652|       |    __kmp_str_buf_cat(&buffer, str, len);
  653|       |    LocalFree(str);
  654|       |  }
  655|       |#else
  656|       |#error
  657|       |#endif
  658|      1|  va_end(args);
  659|      1|  __kmp_str_buf_detach(&buffer);
  660|       |
  661|      1|  msg.type = (kmp_msg_type_t)(id >> 16);
  662|      1|  msg.num = id & 0xFFFF;
  663|      1|  msg.str = buffer.str;
  664|      1|  msg.len = buffer.used;
  665|       |
  666|      1|  return msg;
  667|       |
  668|      1|} // __kmp_msg_format
kmp_i18n.cpp:_ZL21__kmp_i18n_do_catopenv:
   89|      1|void __kmp_i18n_do_catopen() {
   90|      1|  int english = 0;
   91|      1|  char *lang = __kmp_env_get("LANG");
   92|       |  // TODO: What about LC_ALL or LC_MESSAGES?
   93|       |
   94|      1|  KMP_DEBUG_ASSERT(status == KMP_I18N_CLOSED);
   95|      1|  KMP_DEBUG_ASSERT(cat == KMP_I18N_NULLCAT);
   96|       |
   97|      1|  english = lang == NULL || // In all these cases English language is used.
  ------------------
  |  Branch (97:13): [True: 1, False: 0]
  ------------------
   98|      0|            strcmp(lang, "") == 0 || strcmp(lang, " ") == 0 ||
  ------------------
  |  Branch (98:13): [True: 0, False: 0]
  |  Branch (98:38): [True: 0, False: 0]
  ------------------
   99|       |            // Workaround for Fortran RTL bug DPD200137873 "Fortran runtime
  100|       |            // resets LANG env var to space if it is not set".
  101|      0|            strcmp(lang, "C") == 0 || strcmp(lang, "POSIX") == 0;
  ------------------
  |  Branch (101:13): [True: 0, False: 0]
  |  Branch (101:39): [True: 0, False: 0]
  ------------------
  102|       |
  103|      1|  if (!english) { // English language is not yet detected, let us continue.
  ------------------
  |  Branch (103:7): [True: 0, False: 1]
  ------------------
  104|       |    // Format of LANG is: [language[_territory][.codeset][@modifier]]
  105|       |    // Strip all parts except language.
  106|      0|    char *tail = NULL;
  107|      0|    __kmp_str_split(lang, '@', &lang, &tail);
  108|      0|    __kmp_str_split(lang, '.', &lang, &tail);
  109|      0|    __kmp_str_split(lang, '_', &lang, &tail);
  110|      0|    english = (strcmp(lang, "en") == 0);
  111|      0|  }
  112|       |
  113|      1|  KMP_INTERNAL_FREE(lang);
  ------------------
  |  |  111|      1|#define KMP_INTERNAL_FREE(p) free(p)
  ------------------
  114|       |
  115|       |  // Do not try to open English catalog because internal messages are
  116|       |  // exact copy of messages in English catalog.
  117|      1|  if (english) {
  ------------------
  |  Branch (117:7): [True: 1, False: 0]
  ------------------
  118|      1|    status = KMP_I18N_ABSENT; // mark catalog as absent so it will not
  119|       |    // be re-opened.
  120|      1|    return;
  121|      1|  }
  122|       |
  123|      0|  cat = catopen(name, 0);
  124|       |  // TODO: Why do we pass 0 in flags?
  125|      0|  status = (cat == KMP_I18N_NULLCAT ? KMP_I18N_ABSENT : KMP_I18N_OPENED);
  ------------------
  |  |   78|      0|#define KMP_I18N_NULLCAT ((nl_catd)(-1))
  ------------------
  |  Branch (125:13): [True: 0, False: 0]
  ------------------
  126|       |
  127|      0|  if (status == KMP_I18N_ABSENT) {
  ------------------
  |  Branch (127:7): [True: 0, False: 0]
  ------------------
  128|      0|    if (__kmp_generate_warnings > kmp_warnings_low) {
  ------------------
  |  Branch (128:9): [True: 0, False: 0]
  ------------------
  129|       |      // AC: only issue warning in case explicitly asked to
  130|      0|      int error = errno; // Save errno immediately.
  131|      0|      char *nlspath = __kmp_env_get("NLSPATH");
  132|      0|      char *lang = __kmp_env_get("LANG");
  133|       |
  134|       |      // Infinite recursion will not occur -- status is KMP_I18N_ABSENT now, so
  135|       |      // __kmp_i18n_catgets() will not try to open catalog, but will return
  136|       |      // default message.
  137|      0|      kmp_msg_t err_code = KMP_ERR(error);
  ------------------
  |  |  125|      0|#define KMP_ERR KMP_SYSERRCODE
  |  |  ------------------
  |  |  |  |  123|      0|#define KMP_SYSERRCODE(code) __kmp_msg_error_code(code)
  |  |  ------------------
  ------------------
  138|      0|      __kmp_msg(kmp_ms_warning, KMP_MSG(CantOpenMessageCatalog, name), err_code,
  ------------------
  |  |  121|      0|#define KMP_MSG(...) __kmp_msg_format(kmp_i18n_msg_##__VA_ARGS__)
  ------------------
  139|      0|                KMP_HNT(CheckEnvVar, "NLSPATH", nlspath),
  ------------------
  |  |  122|      0|#define KMP_HNT(...) __kmp_msg_format(kmp_i18n_hnt_##__VA_ARGS__)
  ------------------
  140|      0|                KMP_HNT(CheckEnvVar, "LANG", lang), __kmp_msg_null);
  ------------------
  |  |  122|      0|#define KMP_HNT(...) __kmp_msg_format(kmp_i18n_hnt_##__VA_ARGS__)
  ------------------
  141|      0|      if (__kmp_generate_warnings == kmp_warnings_off) {
  ------------------
  |  Branch (141:11): [True: 0, False: 0]
  ------------------
  142|      0|        __kmp_str_free(&err_code.str);
  143|      0|      }
  144|       |
  145|      0|      KMP_INFORM(WillUseDefaultMessages);
  ------------------
  |  |  143|      0|  __kmp_msg(kmp_ms_inform, KMP_MSG(__VA_ARGS__), __kmp_msg_null)
  |  |  ------------------
  |  |  |  |  121|      0|#define KMP_MSG(...) __kmp_msg_format(kmp_i18n_msg_##__VA_ARGS__)
  |  |  ------------------
  ------------------
  146|      0|      KMP_INTERNAL_FREE(nlspath);
  ------------------
  |  |  111|      0|#define KMP_INTERNAL_FREE(p) free(p)
  ------------------
  147|      0|      KMP_INTERNAL_FREE(lang);
  ------------------
  |  |  111|      0|#define KMP_INTERNAL_FREE(p) free(p)
  ------------------
  148|      0|    }
  149|      0|  } else { // status == KMP_I18N_OPENED
  150|      0|    int section = get_section(kmp_i18n_prp_Version);
  ------------------
  |  |   33|      0|#define get_section(id) ((id) >> 16)
  ------------------
  151|      0|    int number = get_number(kmp_i18n_prp_Version);
  ------------------
  |  |   34|      0|#define get_number(id) ((id)&0xFFFF)
  ------------------
  152|      0|    char const *expected = __kmp_i18n_default_table.sect[section].str[number];
  153|       |    // Expected version of the catalog.
  154|      0|    kmp_str_buf_t version; // Actual version of the catalog.
  155|      0|    __kmp_str_buf_init(&version);
  ------------------
  |  |   41|      0|  {                                                                            \
  |  |   42|      0|    (b)->str = (b)->bulk;                                                      \
  |  |   43|      0|    (b)->size = sizeof((b)->bulk);                                             \
  |  |   44|      0|    (b)->used = 0;                                                             \
  |  |   45|      0|    (b)->bulk[0] = 0;                                                          \
  |  |   46|      0|  }
  ------------------
  156|      0|    __kmp_str_buf_print(&version, "%s", catgets(cat, section, number, NULL));
  157|       |
  158|       |    // String returned by catgets is invalid after closing catalog, so copy it.
  159|      0|    if (strcmp(version.str, expected) != 0) {
  ------------------
  |  Branch (159:9): [True: 0, False: 0]
  ------------------
  160|      0|      __kmp_i18n_catclose(); // Close bad catalog.
  161|      0|      status = KMP_I18N_ABSENT; // And mark it as absent.
  162|      0|      if (__kmp_generate_warnings > kmp_warnings_low) {
  ------------------
  |  Branch (162:11): [True: 0, False: 0]
  ------------------
  163|       |        // AC: only issue warning in case explicitly asked to
  164|       |        // And now print a warning using default messages.
  165|      0|        char const *name = "NLSPATH";
  166|      0|        char const *nlspath = __kmp_env_get(name);
  167|      0|        __kmp_msg(kmp_ms_warning,
  168|      0|                  KMP_MSG(WrongMessageCatalog, name, version.str, expected),
  ------------------
  |  |  121|      0|#define KMP_MSG(...) __kmp_msg_format(kmp_i18n_msg_##__VA_ARGS__)
  ------------------
  169|      0|                  KMP_HNT(CheckEnvVar, name, nlspath), __kmp_msg_null);
  ------------------
  |  |  122|      0|#define KMP_HNT(...) __kmp_msg_format(kmp_i18n_hnt_##__VA_ARGS__)
  ------------------
  170|      0|        KMP_INFORM(WillUseDefaultMessages);
  ------------------
  |  |  143|      0|  __kmp_msg(kmp_ms_inform, KMP_MSG(__VA_ARGS__), __kmp_msg_null)
  |  |  ------------------
  |  |  |  |  121|      0|#define KMP_MSG(...) __kmp_msg_format(kmp_i18n_msg_##__VA_ARGS__)
  |  |  ------------------
  ------------------
  171|      0|        KMP_INTERNAL_FREE(CCAST(char *, nlspath));
  ------------------
  |  |  111|      0|#define KMP_INTERNAL_FREE(p) free(p)
  ------------------
  172|      0|      } // __kmp_generate_warnings
  173|      0|    }
  174|      0|    __kmp_str_buf_free(&version);
  175|      0|  }
  176|      0|} // func __kmp_i18n_do_catopen

__kmp_validate_locks:
   43|      1|void __kmp_validate_locks(void) {
   44|      1|  int i;
   45|      1|  kmp_uint32 x, y;
   46|       |
   47|       |  /* Check to make sure unsigned arithmetic does wraps properly */
   48|      1|  x = ~((kmp_uint32)0) - 2;
   49|      1|  y = x - 2;
   50|       |
   51|      9|  for (i = 0; i < 8; ++i, ++x, ++y) {
  ------------------
  |  Branch (51:15): [True: 8, False: 1]
  ------------------
   52|      8|    kmp_uint32 z = (x - y);
   53|      8|    KMP_ASSERT(z == 2);
  ------------------
  |  |   50|      8|  if (!(cond)) {                                                               \
  |  |  ------------------
  |  |  |  Branch (50:7): [True: 0, False: 8]
  |  |  ------------------
  |  |   51|      0|    __kmp_debug_assert("assertion failure", __FILE__, __LINE__);               \
  |  |   52|      0|  }
  ------------------
   54|      8|  }
   55|       |
   56|      1|  KMP_ASSERT(offsetof(kmp_base_queuing_lock, tail_id) % 8 == 0);
  ------------------
  |  |   50|      1|  if (!(cond)) {                                                               \
  |  |  ------------------
  |  |  |  Branch (50:7): [Folded, False: 1]
  |  |  ------------------
  |  |   51|      0|    __kmp_debug_assert("assertion failure", __FILE__, __LINE__);               \
  |  |   52|      0|  }
  ------------------
   57|      1|}
__kmp_acquire_ticket_lock:
  644|  64.3k|int __kmp_acquire_ticket_lock(kmp_ticket_lock_t *lck, kmp_int32 gtid) {
  645|  64.3k|  int retval = __kmp_acquire_ticket_lock_timed_template(lck, gtid);
  646|  64.3k|  return retval;
  647|  64.3k|}
__kmp_release_ticket_lock:
  714|  64.3k|int __kmp_release_ticket_lock(kmp_ticket_lock_t *lck, kmp_int32 gtid) {
  715|  64.3k|  kmp_uint32 distance = std::atomic_load_explicit(&lck->lk.next_ticket,
  716|  64.3k|                                                  std::memory_order_relaxed) -
  717|  64.3k|                        std::atomic_load_explicit(&lck->lk.now_serving,
  718|  64.3k|                                                  std::memory_order_relaxed);
  719|       |
  720|  64.3k|  std::atomic_fetch_add_explicit(&lck->lk.now_serving, 1U,
  721|  64.3k|                                 std::memory_order_release);
  722|       |
  723|  64.3k|  KMP_YIELD(distance >
  ------------------
  |  | 1529|  64.3k|  {                                                                            \
  |  | 1530|  64.3k|    KMP_CPU_PAUSE();                                                           \
  |  |  ------------------
  |  |  |  | 1498|  64.3k|#define KMP_CPU_PAUSE() __kmp_x86_pause()
  |  |  ------------------
  |  | 1531|   128k|    if ((cond) && (KMP_TRY_YIELD))                                             \
  |  |  ------------------
  |  |  |  | 1523|      1|  ((__kmp_use_yield == 1) || (__kmp_use_yield == 2 && (KMP_OVERSUBSCRIBED)))
  |  |  |  |  ------------------
  |  |  |  |  |  | 1520|      0|  (TCR_4(__kmp_nth) > (__kmp_avail_proc ? __kmp_avail_proc : __kmp_xproc))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 1127|      0|#define TCR_4(a) (a)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1520:24): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1523:4): [True: 1, False: 0]
  |  |  |  |  |  Branch (1523:31): [True: 0, False: 0]
  |  |  |  |  |  Branch (1523:55): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (1531:9): [True: 1, False: 64.3k]
  |  |  |  Branch (1531:10): [True: 58.9k, False: 5.37k]
  |  |  ------------------
  |  | 1532|  64.3k|      __kmp_yield();                                                           \
  |  | 1533|  64.3k|  }
  ------------------
  724|  64.3k|            (kmp_uint32)(__kmp_avail_proc ? __kmp_avail_proc : __kmp_xproc));
  725|  64.3k|  return KMP_LOCK_RELEASED;
  ------------------
  |  |  156|  64.3k|#define KMP_LOCK_RELEASED 1
  ------------------
  726|  64.3k|}
__kmp_init_ticket_lock:
  753|     10|void __kmp_init_ticket_lock(kmp_ticket_lock_t *lck) {
  754|       |  lck->lk.location = NULL;
  755|     10|  lck->lk.self = lck;
  756|     10|  std::atomic_store_explicit(&lck->lk.next_ticket, 0U,
  757|     10|                             std::memory_order_relaxed);
  758|     10|  std::atomic_store_explicit(&lck->lk.now_serving, 0U,
  759|     10|                             std::memory_order_relaxed);
  760|     10|  std::atomic_store_explicit(
  761|     10|      &lck->lk.owner_id, 0,
  762|     10|      std::memory_order_relaxed); // no thread owns the lock.
  763|     10|  std::atomic_store_explicit(
  764|     10|      &lck->lk.depth_locked, -1,
  765|     10|      std::memory_order_relaxed); // -1 => not a nested lock.
  766|     10|  std::atomic_store_explicit(&lck->lk.initialized, true,
  767|     10|                             std::memory_order_release);
  768|     10|}
__kmp_acquire_queuing_lock:
 1277|  25.1k|int __kmp_acquire_queuing_lock(kmp_queuing_lock_t *lck, kmp_int32 gtid) {
 1278|  25.1k|  KMP_DEBUG_ASSERT(gtid >= 0);
 1279|       |
 1280|  25.1k|  int retval = __kmp_acquire_queuing_lock_timed_template<false>(lck, gtid);
 1281|  25.1k|  return retval;
 1282|  25.1k|}
__kmp_release_queuing_lock:
 1353|  25.2k|int __kmp_release_queuing_lock(kmp_queuing_lock_t *lck, kmp_int32 gtid) {
 1354|  25.2k|  volatile kmp_int32 *head_id_p = &lck->lk.head_id;
 1355|  25.2k|  volatile kmp_int32 *tail_id_p = &lck->lk.tail_id;
 1356|       |
 1357|  25.2k|  KA_TRACE(1000,
 1358|  25.2k|           ("__kmp_release_queuing_lock: lck:%p, T#%d entering\n", lck, gtid));
 1359|  25.2k|  KMP_DEBUG_ASSERT(gtid >= 0);
 1360|       |#if KMP_DEBUG || DEBUG_QUEUING_LOCKS
 1361|       |  kmp_info_t *this_thr = __kmp_thread_from_gtid(gtid);
 1362|       |#endif
 1363|  25.2k|  KMP_DEBUG_ASSERT(this_thr != NULL);
 1364|       |#ifdef DEBUG_QUEUING_LOCKS
 1365|       |  TRACE_LOCK(gtid + 1, "rel ent");
 1366|       |
 1367|       |  if (this_thr->th.th_spin_here)
 1368|       |    __kmp_dump_queuing_lock(this_thr, gtid, lck, *head_id_p, *tail_id_p);
 1369|       |  if (this_thr->th.th_next_waiting != 0)
 1370|       |    __kmp_dump_queuing_lock(this_thr, gtid, lck, *head_id_p, *tail_id_p);
 1371|       |#endif
 1372|  25.2k|  KMP_DEBUG_ASSERT(!this_thr->th.th_spin_here);
 1373|  25.2k|  KMP_DEBUG_ASSERT(this_thr->th.th_next_waiting == 0);
 1374|       |
 1375|  25.2k|  KMP_FSYNC_RELEASING(lck);
  ------------------
  |  |  335|  25.2k|#define KMP_FSYNC_RELEASING(obj) ((void)0)
  ------------------
 1376|       |
 1377|  25.2k|  while (1) {
  ------------------
  |  Branch (1377:10): [True: 25.2k, Folded]
  ------------------
 1378|  25.2k|    kmp_int32 dequeued;
 1379|  25.2k|    kmp_int32 head;
 1380|  25.2k|    kmp_int32 tail;
 1381|       |
 1382|  25.2k|    head = *head_id_p;
 1383|       |
 1384|       |#ifdef DEBUG_QUEUING_LOCKS
 1385|       |    tail = *tail_id_p;
 1386|       |    TRACE_LOCK_HT(gtid + 1, "rel read: ", head, tail);
 1387|       |    if (head == 0)
 1388|       |      __kmp_dump_queuing_lock(this_thr, gtid, lck, head, tail);
 1389|       |#endif
 1390|  25.2k|    KMP_DEBUG_ASSERT(head !=
 1391|  25.2k|                     0); /* holding the lock, head must be -1 or queue head */
 1392|       |
 1393|  25.2k|    if (head == -1) { /* nobody on queue */
  ------------------
  |  Branch (1393:9): [True: 23.7k, False: 1.51k]
  ------------------
 1394|       |      /* try (-1,0)->(0,0) */
 1395|  23.7k|      if (KMP_COMPARE_AND_STORE_REL32(head_id_p, -1, 0)) {
  ------------------
  |  |  810|  23.7k|  __sync_bool_compare_and_swap((volatile kmp_uint32 *)(p), (kmp_uint32)(cv),   \
  |  |  ------------------
  |  |  |  Branch (810:3): [True: 23.6k, False: 13]
  |  |  ------------------
  |  |  811|  23.7k|                               (kmp_uint32)(sv))
  ------------------
 1396|  23.6k|        KA_TRACE(
 1397|  23.6k|            1000,
 1398|  23.6k|            ("__kmp_release_queuing_lock: lck:%p, T#%d exiting: queue empty\n",
 1399|  23.6k|             lck, gtid));
 1400|       |#ifdef DEBUG_QUEUING_LOCKS
 1401|       |        TRACE_LOCK_HT(gtid + 1, "rel exit: ", 0, 0);
 1402|       |#endif
 1403|       |
 1404|  23.6k|#if OMPT_SUPPORT
 1405|       |/* nothing to do - no other thread is trying to shift blame */
 1406|  23.6k|#endif
 1407|  23.6k|        return KMP_LOCK_RELEASED;
  ------------------
  |  |  156|  23.6k|#define KMP_LOCK_RELEASED 1
  ------------------
 1408|  23.6k|      }
 1409|     13|      dequeued = FALSE;
  ------------------
  |  | 1279|     13|#define FALSE 0
  ------------------
 1410|  1.51k|    } else {
 1411|  1.51k|      KMP_MB();
 1412|  1.51k|      tail = *tail_id_p;
 1413|  1.51k|      if (head == tail) { /* only one thread on the queue */
  ------------------
  |  Branch (1413:11): [True: 302, False: 1.21k]
  ------------------
 1414|       |#ifdef DEBUG_QUEUING_LOCKS
 1415|       |        if (head <= 0)
 1416|       |          __kmp_dump_queuing_lock(this_thr, gtid, lck, head, tail);
 1417|       |#endif
 1418|    302|        KMP_DEBUG_ASSERT(head > 0);
 1419|       |
 1420|       |        /* try (h,h)->(-1,0) */
 1421|    302|        dequeued = KMP_COMPARE_AND_STORE_REL64(
  ------------------
  |  |  853|    302|  __sync_bool_compare_and_swap((volatile kmp_uint64 *)(p), (kmp_uint64)(cv),   \
  |  |  854|    302|                               (kmp_uint64)(sv))
  ------------------
 1422|    302|            RCAST(volatile kmp_int64 *, tail_id_p), KMP_PACK_64(head, head),
 1423|    302|            KMP_PACK_64(-1, 0));
 1424|       |#ifdef DEBUG_QUEUING_LOCKS
 1425|       |        TRACE_LOCK(gtid + 1, "rel deq: (h,h)->(-1,0)");
 1426|       |#endif
 1427|       |
 1428|  1.21k|      } else {
 1429|  1.21k|        volatile kmp_int32 *waiting_id_p;
 1430|  1.21k|        kmp_info_t *head_thr = __kmp_thread_from_gtid(head - 1);
 1431|  1.21k|        KMP_DEBUG_ASSERT(head_thr != NULL);
 1432|  1.21k|        waiting_id_p = &head_thr->th.th_next_waiting;
 1433|       |
 1434|       |/* Does this require synchronous reads? */
 1435|       |#ifdef DEBUG_QUEUING_LOCKS
 1436|       |        if (head <= 0 || tail <= 0)
 1437|       |          __kmp_dump_queuing_lock(this_thr, gtid, lck, head, tail);
 1438|       |#endif
 1439|  1.21k|        KMP_DEBUG_ASSERT(head > 0 && tail > 0);
 1440|       |
 1441|       |        /* try (h,t)->(h',t) or (t,t) */
 1442|  1.21k|        KMP_MB();
 1443|       |        /* make sure enqueuing thread has time to update next waiting thread
 1444|       |         * field */
 1445|  1.21k|        *head_id_p =
 1446|  1.21k|            KMP_WAIT((volatile kmp_uint32 *)waiting_id_p, 0, KMP_NEQ, NULL);
  ------------------
  |  | 1183|  1.21k|#define KMP_WAIT __kmp_wait_4
  ------------------
                          KMP_WAIT((volatile kmp_uint32 *)waiting_id_p, 0, KMP_NEQ, NULL);
  ------------------
  |  | 1186|  1.21k|#define KMP_NEQ __kmp_neq_4
  ------------------
 1447|       |#ifdef DEBUG_QUEUING_LOCKS
 1448|       |        TRACE_LOCK(gtid + 1, "rel deq: (h,t)->(h',t)");
 1449|       |#endif
 1450|  1.21k|        dequeued = TRUE;
  ------------------
  |  | 1280|  1.21k|#define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  | 1279|  1.21k|#define FALSE 0
  |  |  ------------------
  ------------------
 1451|  1.21k|      }
 1452|  1.51k|    }
 1453|       |
 1454|  1.52k|    if (dequeued) {
  ------------------
  |  Branch (1454:9): [True: 1.51k, False: 13]
  ------------------
 1455|  1.51k|      kmp_info_t *head_thr = __kmp_thread_from_gtid(head - 1);
 1456|  1.51k|      KMP_DEBUG_ASSERT(head_thr != NULL);
 1457|       |
 1458|       |/* Does this require synchronous reads? */
 1459|       |#ifdef DEBUG_QUEUING_LOCKS
 1460|       |      if (head <= 0 || tail <= 0)
 1461|       |        __kmp_dump_queuing_lock(this_thr, gtid, lck, head, tail);
 1462|       |#endif
 1463|  1.51k|      KMP_DEBUG_ASSERT(head > 0 && tail > 0);
 1464|       |
 1465|       |      /* For clean code only. Thread not released until next statement prevents
 1466|       |         race with acquire code. */
 1467|  1.51k|      head_thr->th.th_next_waiting = 0;
 1468|       |#ifdef DEBUG_QUEUING_LOCKS
 1469|       |      TRACE_LOCK_T(gtid + 1, "rel nw=0 for t=", head);
 1470|       |#endif
 1471|       |
 1472|  1.51k|      KMP_MB();
 1473|       |      /* reset spin value */
 1474|  1.51k|      head_thr->th.th_spin_here = FALSE;
  ------------------
  |  | 1279|  1.51k|#define FALSE 0
  ------------------
 1475|       |
 1476|  1.51k|      KA_TRACE(1000, ("__kmp_release_queuing_lock: lck:%p, T#%d exiting: after "
 1477|  1.51k|                      "dequeuing\n",
 1478|  1.51k|                      lck, gtid));
 1479|       |#ifdef DEBUG_QUEUING_LOCKS
 1480|       |      TRACE_LOCK(gtid + 1, "rel exit 2");
 1481|       |#endif
 1482|  1.51k|      return KMP_LOCK_RELEASED;
  ------------------
  |  |  156|  1.51k|#define KMP_LOCK_RELEASED 1
  ------------------
 1483|  1.51k|    }
 1484|       |    /* KMP_CPU_PAUSE(); don't want to make releasing thread hold up acquiring
 1485|       |       threads */
 1486|       |
 1487|       |#ifdef DEBUG_QUEUING_LOCKS
 1488|       |    TRACE_LOCK(gtid + 1, "rel retry");
 1489|       |#endif
 1490|       |
 1491|  1.52k|  } /* while */
 1492|      0|  KMP_ASSERT2(0, "should not get here");
  ------------------
  |  |   53|      0|#define KMP_ASSERT2(cond, msg) KMP_ASSERT(cond)
  |  |  ------------------
  |  |  |  |   50|      0|  if (!(cond)) {                                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (50:7): [True: 0, Folded]
  |  |  |  |  ------------------
  |  |  |  |   51|      0|    __kmp_debug_assert("assertion failure", __FILE__, __LINE__);               \
  |  |  |  |   52|      0|  }
  |  |  ------------------
  ------------------
 1493|      0|  return KMP_LOCK_RELEASED;
  ------------------
  |  |  156|      0|#define KMP_LOCK_RELEASED 1
  ------------------
 1494|  25.2k|}
__kmp_init_queuing_lock:
 1516|  30.8k|void __kmp_init_queuing_lock(kmp_queuing_lock_t *lck) {
 1517|  30.8k|  lck->lk.location = NULL;
 1518|  30.8k|  lck->lk.head_id = 0;
 1519|  30.8k|  lck->lk.tail_id = 0;
 1520|  30.8k|  lck->lk.next_ticket = 0;
 1521|  30.8k|  lck->lk.now_serving = 0;
 1522|  30.8k|  lck->lk.owner_id = 0; // no thread owns the lock.
 1523|  30.8k|  lck->lk.depth_locked = -1; // >= 0 for nestable locks, -1 for simple locks.
 1524|  30.8k|  lck->lk.initialized = lck;
 1525|       |
 1526|  30.8k|  KA_TRACE(1000, ("__kmp_init_queuing_lock: lock %p initialized\n", lck));
 1527|  30.8k|}
__kmp_destroy_queuing_lock:
 1529|  30.8k|void __kmp_destroy_queuing_lock(kmp_queuing_lock_t *lck) {
 1530|  30.8k|  lck->lk.initialized = NULL;
 1531|       |  lck->lk.location = NULL;
 1532|  30.8k|  lck->lk.head_id = 0;
 1533|  30.8k|  lck->lk.tail_id = 0;
 1534|  30.8k|  lck->lk.next_ticket = 0;
 1535|  30.8k|  lck->lk.now_serving = 0;
 1536|  30.8k|  lck->lk.owner_id = 0;
 1537|  30.8k|  lck->lk.depth_locked = -1;
 1538|  30.8k|}
__kmp_allocate_indirect_lock:
 3122|  30.8k|                                                  kmp_indirect_locktag_t tag) {
 3123|  30.8k|  kmp_indirect_lock_t *lck;
 3124|  30.8k|  kmp_lock_index_t idx, table_idx;
 3125|       |
 3126|  30.8k|  __kmp_acquire_lock(&__kmp_global_lock, gtid);
 3127|       |
 3128|  30.8k|  if (__kmp_indirect_lock_pool[tag] != NULL) {
  ------------------
  |  Branch (3128:7): [True: 30.8k, False: 4]
  ------------------
 3129|       |    // Reuse the allocated and destroyed lock object
 3130|  30.8k|    lck = __kmp_indirect_lock_pool[tag];
 3131|  30.8k|    if (OMP_LOCK_T_SIZE < sizeof(void *))
  ------------------
  |  |   54|  30.8k|#define OMP_LOCK_T_SIZE sizeof(int)
  ------------------
  |  Branch (3131:9): [True: 30.8k, Folded]
  ------------------
 3132|  30.8k|      idx = lck->lock->pool.index;
 3133|  30.8k|    __kmp_indirect_lock_pool[tag] = (kmp_indirect_lock_t *)lck->lock->pool.next;
 3134|  30.8k|    KA_TRACE(20, ("__kmp_allocate_indirect_lock: reusing an existing lock %p\n",
 3135|  30.8k|                  lck));
 3136|  30.8k|  } else {
 3137|      4|    kmp_uint32 row, col;
 3138|      4|    kmp_indirect_lock_table_t *lock_table = &__kmp_i_lock_table;
 3139|      4|    idx = 0;
 3140|       |    // Find location in list of lock tables to put new lock
 3141|      4|    while (1) {
  ------------------
  |  Branch (3141:12): [True: 4, Folded]
  ------------------
 3142|      4|      table_idx = lock_table->next; // index within this table
 3143|      4|      idx += lock_table->next; // global index within list of tables
 3144|      4|      if (table_idx < lock_table->nrow_ptrs * KMP_I_LOCK_CHUNK) {
  ------------------
  |  | 1222|      4|#define KMP_I_LOCK_CHUNK 1024
  ------------------
  |  Branch (3144:11): [True: 4, False: 0]
  ------------------
 3145|      4|        row = table_idx / KMP_I_LOCK_CHUNK;
  ------------------
  |  | 1222|      4|#define KMP_I_LOCK_CHUNK 1024
  ------------------
 3146|      4|        col = table_idx % KMP_I_LOCK_CHUNK;
  ------------------
  |  | 1222|      4|#define KMP_I_LOCK_CHUNK 1024
  ------------------
 3147|       |        // Allocate a new row of locks if necessary
 3148|      4|        if (!lock_table->table[row]) {
  ------------------
  |  Branch (3148:13): [True: 0, False: 4]
  ------------------
 3149|      0|          lock_table->table[row] = (kmp_indirect_lock_t *)__kmp_allocate(
  ------------------
  |  | 3617|      0|#define __kmp_allocate(size) ___kmp_allocate((size)KMP_SRC_LOC_CURR)
  ------------------
 3150|      0|              sizeof(kmp_indirect_lock_t) * KMP_I_LOCK_CHUNK);
 3151|      0|        }
 3152|      4|        break;
 3153|      4|      }
 3154|       |      // Allocate a new lock table if necessary with double the capacity
 3155|      0|      if (!lock_table->next_table) {
  ------------------
  |  Branch (3155:11): [True: 0, False: 0]
  ------------------
 3156|      0|        kmp_indirect_lock_table_t *next_table =
 3157|      0|            (kmp_indirect_lock_table_t *)__kmp_allocate(
  ------------------
  |  | 3617|      0|#define __kmp_allocate(size) ___kmp_allocate((size)KMP_SRC_LOC_CURR)
  ------------------
 3158|      0|                sizeof(kmp_indirect_lock_table_t));
 3159|      0|        next_table->table = (kmp_indirect_lock_t **)__kmp_allocate(
  ------------------
  |  | 3617|      0|#define __kmp_allocate(size) ___kmp_allocate((size)KMP_SRC_LOC_CURR)
  ------------------
 3160|      0|            sizeof(kmp_indirect_lock_t *) * 2 * lock_table->nrow_ptrs);
 3161|      0|        next_table->nrow_ptrs = 2 * lock_table->nrow_ptrs;
 3162|      0|        next_table->next = 0;
 3163|      0|        next_table->next_table = nullptr;
 3164|      0|        lock_table->next_table = next_table;
 3165|      0|      }
 3166|      0|      lock_table = lock_table->next_table;
 3167|      0|      KMP_ASSERT(lock_table);
  ------------------
  |  |   50|      0|  if (!(cond)) {                                                               \
  |  |  ------------------
  |  |  |  Branch (50:7): [True: 0, False: 0]
  |  |  ------------------
  |  |   51|      0|    __kmp_debug_assert("assertion failure", __FILE__, __LINE__);               \
  |  |   52|      0|  }
  ------------------
 3168|      0|    }
 3169|      4|    lock_table->next++;
 3170|       |
 3171|      4|    lck = &lock_table->table[row][col];
 3172|       |    // Allocate a new base lock object
 3173|      4|    lck->lock = (kmp_user_lock_p)__kmp_allocate(__kmp_indirect_lock_size[tag]);
  ------------------
  |  | 3617|      4|#define __kmp_allocate(size) ___kmp_allocate((size)KMP_SRC_LOC_CURR)
  ------------------
 3174|      4|    KA_TRACE(20,
 3175|      4|             ("__kmp_allocate_indirect_lock: allocated a new lock %p\n", lck));
 3176|      4|  }
 3177|       |
 3178|  30.8k|  __kmp_release_lock(&__kmp_global_lock, gtid);
 3179|       |
 3180|  30.8k|  lck->type = tag;
 3181|       |
 3182|  30.8k|  if (OMP_LOCK_T_SIZE < sizeof(void *)) {
  ------------------
  |  |   54|  30.8k|#define OMP_LOCK_T_SIZE sizeof(int)
  ------------------
  |  Branch (3182:7): [True: 30.8k, Folded]
  ------------------
 3183|  30.8k|    *((kmp_lock_index_t *)user_lock) = idx
 3184|  30.8k|                                       << 1; // indirect lock word must be even
 3185|  30.8k|  } else {
 3186|      0|    *((kmp_indirect_lock_t **)user_lock) = lck;
 3187|      0|  }
 3188|       |
 3189|  30.8k|  return lck;
 3190|  30.8k|}
__kmp_init_dynamic_user_locks:
 3327|      1|void __kmp_init_dynamic_user_locks() {
 3328|       |  // Initialize jump table for the lock functions
 3329|      1|  if (__kmp_env_consistency_check) {
  ------------------
  |  Branch (3329:7): [True: 0, False: 1]
  ------------------
 3330|      0|    __kmp_direct_set = direct_set_check;
 3331|      0|    __kmp_direct_unset = direct_unset_check;
 3332|      0|    __kmp_direct_test = direct_test_check;
 3333|      0|    __kmp_direct_destroy = direct_destroy_check;
 3334|      0|    __kmp_indirect_set = indirect_set_check;
 3335|      0|    __kmp_indirect_unset = indirect_unset_check;
 3336|      0|    __kmp_indirect_test = indirect_test_check;
 3337|      0|    __kmp_indirect_destroy = indirect_destroy_check;
 3338|      1|  } else {
 3339|      1|    __kmp_direct_set = direct_set;
 3340|      1|    __kmp_direct_unset = direct_unset;
 3341|      1|    __kmp_direct_test = direct_test;
 3342|      1|    __kmp_direct_destroy = direct_destroy;
 3343|      1|    __kmp_indirect_set = indirect_set;
 3344|      1|    __kmp_indirect_unset = indirect_unset;
 3345|      1|    __kmp_indirect_test = indirect_test;
 3346|      1|    __kmp_indirect_destroy = indirect_destroy;
 3347|      1|  }
 3348|       |  // If the user locks have already been initialized, then return. Allow the
 3349|       |  // switch between different KMP_CONSISTENCY_CHECK values, but do not allocate
 3350|       |  // new lock tables if they have already been allocated.
 3351|      1|  if (__kmp_init_user_locks)
  ------------------
  |  Branch (3351:7): [True: 0, False: 1]
  ------------------
 3352|      0|    return;
 3353|       |
 3354|       |  // Initialize lock index table
 3355|      1|  __kmp_i_lock_table.nrow_ptrs = KMP_I_LOCK_TABLE_INIT_NROW_PTRS;
  ------------------
  |  | 1226|      1|#define KMP_I_LOCK_TABLE_INIT_NROW_PTRS 8
  ------------------
 3356|      1|  __kmp_i_lock_table.table = (kmp_indirect_lock_t **)__kmp_allocate(
  ------------------
  |  | 3617|      1|#define __kmp_allocate(size) ___kmp_allocate((size)KMP_SRC_LOC_CURR)
  ------------------
 3357|      1|      sizeof(kmp_indirect_lock_t *) * KMP_I_LOCK_TABLE_INIT_NROW_PTRS);
 3358|      1|  *(__kmp_i_lock_table.table) = (kmp_indirect_lock_t *)__kmp_allocate(
  ------------------
  |  | 3617|      1|#define __kmp_allocate(size) ___kmp_allocate((size)KMP_SRC_LOC_CURR)
  ------------------
 3359|      1|      KMP_I_LOCK_CHUNK * sizeof(kmp_indirect_lock_t));
 3360|      1|  __kmp_i_lock_table.next = 0;
 3361|      1|  __kmp_i_lock_table.next_table = nullptr;
 3362|       |
 3363|       |  // Indirect lock size
 3364|      1|  __kmp_indirect_lock_size[locktag_ticket] = sizeof(kmp_ticket_lock_t);
 3365|      1|  __kmp_indirect_lock_size[locktag_queuing] = sizeof(kmp_queuing_lock_t);
 3366|      1|#if KMP_USE_ADAPTIVE_LOCKS
 3367|      1|  __kmp_indirect_lock_size[locktag_adaptive] = sizeof(kmp_adaptive_lock_t);
 3368|      1|#endif
 3369|      1|  __kmp_indirect_lock_size[locktag_drdpa] = sizeof(kmp_drdpa_lock_t);
 3370|      1|#if KMP_USE_TSX
 3371|      1|  __kmp_indirect_lock_size[locktag_rtm_queuing] = sizeof(kmp_queuing_lock_t);
 3372|      1|#endif
 3373|      1|  __kmp_indirect_lock_size[locktag_nested_tas] = sizeof(kmp_tas_lock_t);
 3374|      1|#if KMP_USE_FUTEX
 3375|      1|  __kmp_indirect_lock_size[locktag_nested_futex] = sizeof(kmp_futex_lock_t);
 3376|      1|#endif
 3377|      1|  __kmp_indirect_lock_size[locktag_nested_ticket] = sizeof(kmp_ticket_lock_t);
 3378|      1|  __kmp_indirect_lock_size[locktag_nested_queuing] = sizeof(kmp_queuing_lock_t);
 3379|      1|  __kmp_indirect_lock_size[locktag_nested_drdpa] = sizeof(kmp_drdpa_lock_t);
 3380|       |
 3381|       |// Initialize lock accessor/modifier
 3382|      1|#define fill_jumps(table, expand, sep)                                         \
 3383|      1|  {                                                                            \
 3384|      1|    table[locktag##sep##ticket] = expand(ticket);                              \
 3385|      1|    table[locktag##sep##queuing] = expand(queuing);                            \
 3386|      1|    table[locktag##sep##drdpa] = expand(drdpa);                                \
 3387|      1|  }
 3388|       |
 3389|      1|#if KMP_USE_ADAPTIVE_LOCKS
 3390|      1|#define fill_table(table, expand)                                              \
 3391|      1|  {                                                                            \
 3392|      1|    fill_jumps(table, expand, _);                                              \
 3393|      1|    table[locktag_adaptive] = expand(queuing);                                 \
 3394|      1|    fill_jumps(table, expand, _nested_);                                       \
 3395|      1|  }
 3396|       |#else
 3397|       |#define fill_table(table, expand)                                              \
 3398|       |  {                                                                            \
 3399|       |    fill_jumps(table, expand, _);                                              \
 3400|       |    fill_jumps(table, expand, _nested_);                                       \
 3401|       |  }
 3402|       |#endif // KMP_USE_ADAPTIVE_LOCKS
 3403|       |
 3404|      1|#define expand(l)                                                              \
 3405|      1|  (void (*)(kmp_user_lock_p, const ident_t *)) __kmp_set_##l##_lock_location
 3406|      1|  fill_table(__kmp_indirect_set_location, expand);
  ------------------
  |  | 3391|      1|  {                                                                            \
  |  | 3392|      1|    fill_jumps(table, expand, _);                                              \
  |  |  ------------------
  |  |  |  | 3383|      1|  {                                                                            \
  |  |  |  | 3384|      1|    table[locktag##sep##ticket] = expand(ticket);                              \
  |  |  |  |  ------------------
  |  |  |  |  |  | 3406|      1|  fill_table(__kmp_indirect_set_location, expand);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 3405|      1|  (void (*)(kmp_user_lock_p, const ident_t *)) __kmp_set_##l##_lock_location
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 3385|      1|    table[locktag##sep##queuing] = expand(queuing);                            \
  |  |  |  |  ------------------
  |  |  |  |  |  | 3406|      1|  fill_table(__kmp_indirect_set_location, expand);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 3405|      1|  (void (*)(kmp_user_lock_p, const ident_t *)) __kmp_set_##l##_lock_location
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 3386|      1|    table[locktag##sep##drdpa] = expand(drdpa);                                \
  |  |  |  |  ------------------
  |  |  |  |  |  | 3406|      1|  fill_table(__kmp_indirect_set_location, expand);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 3405|      1|  (void (*)(kmp_user_lock_p, const ident_t *)) __kmp_set_##l##_lock_location
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 3387|      1|  }
  |  |  ------------------
  |  | 3393|      1|    table[locktag_adaptive] = expand(queuing);                                 \
  |  |  ------------------
  |  |  |  | 3406|      1|  fill_table(__kmp_indirect_set_location, expand);
  |  |  |  |  ------------------
  |  |  |  |  |  | 3405|      1|  (void (*)(kmp_user_lock_p, const ident_t *)) __kmp_set_##l##_lock_location
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 3394|      1|    fill_jumps(table, expand, _nested_);                                       \
  |  |  ------------------
  |  |  |  | 3383|      1|  {                                                                            \
  |  |  |  | 3384|      1|    table[locktag##sep##ticket] = expand(ticket);                              \
  |  |  |  |  ------------------
  |  |  |  |  |  | 3406|      1|  fill_table(__kmp_indirect_set_location, expand);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 3405|      1|  (void (*)(kmp_user_lock_p, const ident_t *)) __kmp_set_##l##_lock_location
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 3385|      1|    table[locktag##sep##queuing] = expand(queuing);                            \
  |  |  |  |  ------------------
  |  |  |  |  |  | 3406|      1|  fill_table(__kmp_indirect_set_location, expand);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 3405|      1|  (void (*)(kmp_user_lock_p, const ident_t *)) __kmp_set_##l##_lock_location
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 3386|      1|    table[locktag##sep##drdpa] = expand(drdpa);                                \
  |  |  |  |  ------------------
  |  |  |  |  |  | 3406|      1|  fill_table(__kmp_indirect_set_location, expand);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 3405|      1|  (void (*)(kmp_user_lock_p, const ident_t *)) __kmp_set_##l##_lock_location
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 3387|      1|  }
  |  |  ------------------
  |  | 3395|      1|  }
  ------------------
 3407|      1|#undef expand
 3408|      1|#define expand(l)                                                              \
 3409|      1|  (void (*)(kmp_user_lock_p, kmp_lock_flags_t)) __kmp_set_##l##_lock_flags
 3410|      1|  fill_table(__kmp_indirect_set_flags, expand);
  ------------------
  |  | 3391|      1|  {                                                                            \
  |  | 3392|      1|    fill_jumps(table, expand, _);                                              \
  |  |  ------------------
  |  |  |  | 3383|      1|  {                                                                            \
  |  |  |  | 3384|      1|    table[locktag##sep##ticket] = expand(ticket);                              \
  |  |  |  |  ------------------
  |  |  |  |  |  | 3410|      1|  fill_table(__kmp_indirect_set_flags, expand);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 3409|      1|  (void (*)(kmp_user_lock_p, kmp_lock_flags_t)) __kmp_set_##l##_lock_flags
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 3385|      1|    table[locktag##sep##queuing] = expand(queuing);                            \
  |  |  |  |  ------------------
  |  |  |  |  |  | 3410|      1|  fill_table(__kmp_indirect_set_flags, expand);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 3409|      1|  (void (*)(kmp_user_lock_p, kmp_lock_flags_t)) __kmp_set_##l##_lock_flags
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 3386|      1|    table[locktag##sep##drdpa] = expand(drdpa);                                \
  |  |  |  |  ------------------
  |  |  |  |  |  | 3410|      1|  fill_table(__kmp_indirect_set_flags, expand);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 3409|      1|  (void (*)(kmp_user_lock_p, kmp_lock_flags_t)) __kmp_set_##l##_lock_flags
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 3387|      1|  }
  |  |  ------------------
  |  | 3393|      1|    table[locktag_adaptive] = expand(queuing);                                 \
  |  |  ------------------
  |  |  |  | 3410|      1|  fill_table(__kmp_indirect_set_flags, expand);
  |  |  |  |  ------------------
  |  |  |  |  |  | 3409|      1|  (void (*)(kmp_user_lock_p, kmp_lock_flags_t)) __kmp_set_##l##_lock_flags
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 3394|      1|    fill_jumps(table, expand, _nested_);                                       \
  |  |  ------------------
  |  |  |  | 3383|      1|  {                                                                            \
  |  |  |  | 3384|      1|    table[locktag##sep##ticket] = expand(ticket);                              \
  |  |  |  |  ------------------
  |  |  |  |  |  | 3410|      1|  fill_table(__kmp_indirect_set_flags, expand);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 3409|      1|  (void (*)(kmp_user_lock_p, kmp_lock_flags_t)) __kmp_set_##l##_lock_flags
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 3385|      1|    table[locktag##sep##queuing] = expand(queuing);                            \
  |  |  |  |  ------------------
  |  |  |  |  |  | 3410|      1|  fill_table(__kmp_indirect_set_flags, expand);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 3409|      1|  (void (*)(kmp_user_lock_p, kmp_lock_flags_t)) __kmp_set_##l##_lock_flags
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 3386|      1|    table[locktag##sep##drdpa] = expand(drdpa);                                \
  |  |  |  |  ------------------
  |  |  |  |  |  | 3410|      1|  fill_table(__kmp_indirect_set_flags, expand);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 3409|      1|  (void (*)(kmp_user_lock_p, kmp_lock_flags_t)) __kmp_set_##l##_lock_flags
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 3387|      1|  }
  |  |  ------------------
  |  | 3395|      1|  }
  ------------------
 3411|      1|#undef expand
 3412|      1|#define expand(l)                                                              \
 3413|      1|  (const ident_t *(*)(kmp_user_lock_p)) __kmp_get_##l##_lock_location
 3414|      1|  fill_table(__kmp_indirect_get_location, expand);
  ------------------
  |  | 3391|      1|  {                                                                            \
  |  | 3392|      1|    fill_jumps(table, expand, _);                                              \
  |  |  ------------------
  |  |  |  | 3383|      1|  {                                                                            \
  |  |  |  | 3384|      1|    table[locktag##sep##ticket] = expand(ticket);                              \
  |  |  |  |  ------------------
  |  |  |  |  |  | 3414|      1|  fill_table(__kmp_indirect_get_location, expand);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 3413|      1|  (const ident_t *(*)(kmp_user_lock_p)) __kmp_get_##l##_lock_location
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 3385|      1|    table[locktag##sep##queuing] = expand(queuing);                            \
  |  |  |  |  ------------------
  |  |  |  |  |  | 3414|      1|  fill_table(__kmp_indirect_get_location, expand);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 3413|      1|  (const ident_t *(*)(kmp_user_lock_p)) __kmp_get_##l##_lock_location
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 3386|      1|    table[locktag##sep##drdpa] = expand(drdpa);                                \
  |  |  |  |  ------------------
  |  |  |  |  |  | 3414|      1|  fill_table(__kmp_indirect_get_location, expand);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 3413|      1|  (const ident_t *(*)(kmp_user_lock_p)) __kmp_get_##l##_lock_location
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 3387|      1|  }
  |  |  ------------------
  |  | 3393|      1|    table[locktag_adaptive] = expand(queuing);                                 \
  |  |  ------------------
  |  |  |  | 3414|      1|  fill_table(__kmp_indirect_get_location, expand);
  |  |  |  |  ------------------
  |  |  |  |  |  | 3413|      1|  (const ident_t *(*)(kmp_user_lock_p)) __kmp_get_##l##_lock_location
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 3394|      1|    fill_jumps(table, expand, _nested_);                                       \
  |  |  ------------------
  |  |  |  | 3383|      1|  {                                                                            \
  |  |  |  | 3384|      1|    table[locktag##sep##ticket] = expand(ticket);                              \
  |  |  |  |  ------------------
  |  |  |  |  |  | 3414|      1|  fill_table(__kmp_indirect_get_location, expand);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 3413|      1|  (const ident_t *(*)(kmp_user_lock_p)) __kmp_get_##l##_lock_location
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 3385|      1|    table[locktag##sep##queuing] = expand(queuing);                            \
  |  |  |  |  ------------------
  |  |  |  |  |  | 3414|      1|  fill_table(__kmp_indirect_get_location, expand);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 3413|      1|  (const ident_t *(*)(kmp_user_lock_p)) __kmp_get_##l##_lock_location
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 3386|      1|    table[locktag##sep##drdpa] = expand(drdpa);                                \
  |  |  |  |  ------------------
  |  |  |  |  |  | 3414|      1|  fill_table(__kmp_indirect_get_location, expand);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 3413|      1|  (const ident_t *(*)(kmp_user_lock_p)) __kmp_get_##l##_lock_location
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 3387|      1|  }
  |  |  ------------------
  |  | 3395|      1|  }
  ------------------
 3415|      1|#undef expand
 3416|      1|#define expand(l)                                                              \
 3417|      1|  (kmp_lock_flags_t(*)(kmp_user_lock_p)) __kmp_get_##l##_lock_flags
 3418|      1|  fill_table(__kmp_indirect_get_flags, expand);
  ------------------
  |  | 3391|      1|  {                                                                            \
  |  | 3392|      1|    fill_jumps(table, expand, _);                                              \
  |  |  ------------------
  |  |  |  | 3383|      1|  {                                                                            \
  |  |  |  | 3384|      1|    table[locktag##sep##ticket] = expand(ticket);                              \
  |  |  |  |  ------------------
  |  |  |  |  |  | 3418|      1|  fill_table(__kmp_indirect_get_flags, expand);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 3417|      1|  (kmp_lock_flags_t(*)(kmp_user_lock_p)) __kmp_get_##l##_lock_flags
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 3385|      1|    table[locktag##sep##queuing] = expand(queuing);                            \
  |  |  |  |  ------------------
  |  |  |  |  |  | 3418|      1|  fill_table(__kmp_indirect_get_flags, expand);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 3417|      1|  (kmp_lock_flags_t(*)(kmp_user_lock_p)) __kmp_get_##l##_lock_flags
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 3386|      1|    table[locktag##sep##drdpa] = expand(drdpa);                                \
  |  |  |  |  ------------------
  |  |  |  |  |  | 3418|      1|  fill_table(__kmp_indirect_get_flags, expand);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 3417|      1|  (kmp_lock_flags_t(*)(kmp_user_lock_p)) __kmp_get_##l##_lock_flags
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 3387|      1|  }
  |  |  ------------------
  |  | 3393|      1|    table[locktag_adaptive] = expand(queuing);                                 \
  |  |  ------------------
  |  |  |  | 3418|      1|  fill_table(__kmp_indirect_get_flags, expand);
  |  |  |  |  ------------------
  |  |  |  |  |  | 3417|      1|  (kmp_lock_flags_t(*)(kmp_user_lock_p)) __kmp_get_##l##_lock_flags
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 3394|      1|    fill_jumps(table, expand, _nested_);                                       \
  |  |  ------------------
  |  |  |  | 3383|      1|  {                                                                            \
  |  |  |  | 3384|      1|    table[locktag##sep##ticket] = expand(ticket);                              \
  |  |  |  |  ------------------
  |  |  |  |  |  | 3418|      1|  fill_table(__kmp_indirect_get_flags, expand);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 3417|      1|  (kmp_lock_flags_t(*)(kmp_user_lock_p)) __kmp_get_##l##_lock_flags
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 3385|      1|    table[locktag##sep##queuing] = expand(queuing);                            \
  |  |  |  |  ------------------
  |  |  |  |  |  | 3418|      1|  fill_table(__kmp_indirect_get_flags, expand);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 3417|      1|  (kmp_lock_flags_t(*)(kmp_user_lock_p)) __kmp_get_##l##_lock_flags
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 3386|      1|    table[locktag##sep##drdpa] = expand(drdpa);                                \
  |  |  |  |  ------------------
  |  |  |  |  |  | 3418|      1|  fill_table(__kmp_indirect_get_flags, expand);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 3417|      1|  (kmp_lock_flags_t(*)(kmp_user_lock_p)) __kmp_get_##l##_lock_flags
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 3387|      1|  }
  |  |  ------------------
  |  | 3395|      1|  }
  ------------------
 3419|      1|#undef expand
 3420|       |
 3421|      1|  __kmp_init_user_locks = TRUE;
  ------------------
  |  | 1280|      1|#define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  | 1279|      1|#define FALSE 0
  |  |  ------------------
  ------------------
 3422|      1|}
__kmp_cleanup_indirect_user_locks:
 3425|      1|void __kmp_cleanup_indirect_user_locks() {
 3426|      1|  int k;
 3427|       |
 3428|       |  // Clean up locks in the pools first (they were already destroyed before going
 3429|       |  // into the pools).
 3430|     11|  for (k = 0; k < KMP_NUM_I_LOCKS; ++k) {
  ------------------
  |  | 1081|     11|  (locktag_nested_drdpa + 1) // number of indirect lock types
  ------------------
  |  Branch (3430:15): [True: 10, False: 1]
  ------------------
 3431|     10|    kmp_indirect_lock_t *l = __kmp_indirect_lock_pool[k];
 3432|     14|    while (l != NULL) {
  ------------------
  |  Branch (3432:12): [True: 4, False: 10]
  ------------------
 3433|      4|      kmp_indirect_lock_t *ll = l;
 3434|      4|      l = (kmp_indirect_lock_t *)l->lock->pool.next;
 3435|      4|      KA_TRACE(20, ("__kmp_cleanup_indirect_user_locks: freeing %p from pool\n",
 3436|      4|                    ll));
 3437|      4|      __kmp_free(ll->lock);
  ------------------
  |  | 3619|      4|#define __kmp_free(ptr) ___kmp_free((ptr)KMP_SRC_LOC_CURR)
  ------------------
 3438|      4|      ll->lock = NULL;
 3439|      4|    }
 3440|     10|    __kmp_indirect_lock_pool[k] = NULL;
 3441|     10|  }
 3442|       |  // Clean up the remaining undestroyed locks.
 3443|      1|  kmp_indirect_lock_table_t *ptr = &__kmp_i_lock_table;
 3444|      2|  while (ptr) {
  ------------------
  |  Branch (3444:10): [True: 1, False: 1]
  ------------------
 3445|      9|    for (kmp_uint32 row = 0; row < ptr->nrow_ptrs; ++row) {
  ------------------
  |  Branch (3445:30): [True: 8, False: 1]
  ------------------
 3446|      8|      if (!ptr->table[row])
  ------------------
  |  Branch (3446:11): [True: 7, False: 1]
  ------------------
 3447|      7|        continue;
 3448|  1.02k|      for (kmp_uint32 col = 0; col < KMP_I_LOCK_CHUNK; ++col) {
  ------------------
  |  | 1222|  1.02k|#define KMP_I_LOCK_CHUNK 1024
  ------------------
  |  Branch (3448:32): [True: 1.02k, False: 1]
  ------------------
 3449|  1.02k|        kmp_indirect_lock_t *l = &ptr->table[row][col];
 3450|  1.02k|        if (l->lock) {
  ------------------
  |  Branch (3450:13): [True: 0, False: 1.02k]
  ------------------
 3451|       |          // Locks not destroyed explicitly need to be destroyed here.
 3452|      0|          KMP_I_LOCK_FUNC(l, destroy)(l->lock);
  ------------------
  |  | 1154|      0|  __kmp_indirect_##op[((kmp_indirect_lock_t *)(l))->type]
  ------------------
 3453|      0|          KA_TRACE(20, ("__kmp_cleanup_indirect_user_locks: destroy/freeing %p "
 3454|      0|                        "from table\n",
 3455|      0|                        l));
 3456|      0|          __kmp_free(l->lock);
  ------------------
  |  | 3619|      0|#define __kmp_free(ptr) ___kmp_free((ptr)KMP_SRC_LOC_CURR)
  ------------------
 3457|      0|        }
 3458|  1.02k|      }
 3459|      1|      __kmp_free(ptr->table[row]);
  ------------------
  |  | 3619|      1|#define __kmp_free(ptr) ___kmp_free((ptr)KMP_SRC_LOC_CURR)
  ------------------
 3460|      1|    }
 3461|      1|    kmp_indirect_lock_table_t *next_table = ptr->next_table;
 3462|      1|    if (ptr != &__kmp_i_lock_table)
  ------------------
  |  Branch (3462:9): [True: 0, False: 1]
  ------------------
 3463|      0|      __kmp_free(ptr);
  ------------------
  |  | 3619|      0|#define __kmp_free(ptr) ___kmp_free((ptr)KMP_SRC_LOC_CURR)
  ------------------
 3464|      1|    ptr = next_table;
 3465|      1|  }
 3466|       |
 3467|      1|  __kmp_init_user_locks = FALSE;
  ------------------
  |  | 1279|      1|#define FALSE 0
  ------------------
 3468|      1|}
kmp_lock.cpp:_ZL40__kmp_acquire_ticket_lock_timed_templateP15kmp_ticket_locki:
  625|  64.3k|                                         kmp_int32 gtid) {
  626|  64.3k|  kmp_uint32 my_ticket = std::atomic_fetch_add_explicit(
  627|  64.3k|      &lck->lk.next_ticket, 1U, std::memory_order_relaxed);
  628|       |
  629|       |#ifdef USE_LOCK_PROFILE
  630|       |  if (std::atomic_load_explicit(&lck->lk.now_serving,
  631|       |                                std::memory_order_relaxed) != my_ticket)
  632|       |    __kmp_printf("LOCK CONTENTION: %p\n", lck);
  633|       |/* else __kmp_printf( "." );*/
  634|       |#endif /* USE_LOCK_PROFILE */
  635|       |
  636|  64.3k|  if (std::atomic_load_explicit(&lck->lk.now_serving,
  ------------------
  |  Branch (636:7): [True: 64.3k, False: 0]
  ------------------
  637|  64.3k|                                std::memory_order_acquire) == my_ticket) {
  638|  64.3k|    return KMP_LOCK_ACQUIRED_FIRST;
  ------------------
  |  |  158|  64.3k|#define KMP_LOCK_ACQUIRED_FIRST 1
  ------------------
  639|  64.3k|  }
  640|      0|  KMP_WAIT_PTR(&lck->lk.now_serving, my_ticket, __kmp_bakery_check, lck);
  ------------------
  |  | 1184|      0|#define KMP_WAIT_PTR __kmp_wait_4_ptr
  ------------------
  641|      0|  return KMP_LOCK_ACQUIRED_FIRST;
  ------------------
  |  |  158|      0|#define KMP_LOCK_ACQUIRED_FIRST 1
  ------------------
  642|  64.3k|}
kmp_lock.cpp:_ZL23__kmp_init_queuing_lockP13kmp_user_lock:
 2953|  30.8k|  static void __kmp_##op##_##lk##_##lock(kmp_user_lock_p lock) {               \
 2954|  30.8k|    __kmp_##op##_##lk##_##lock(&lock->lk);                                     \
 2955|  30.8k|  }
kmp_lock.cpp:_ZL24__kmp_init_indirect_lockPj18kmp_dyna_lockseq_t:
 3220|  30.8k|                                     kmp_dyna_lockseq_t seq) {
 3221|  30.8k|#if KMP_USE_ADAPTIVE_LOCKS
 3222|  30.8k|  if (seq == lockseq_adaptive && !__kmp_cpuinfo.flags.rtm) {
  ------------------
  |  Branch (3222:7): [True: 0, False: 30.8k]
  |  Branch (3222:34): [True: 0, False: 0]
  ------------------
 3223|      0|    KMP_WARNING(AdaptiveNotSupported, "kmp_lockseq_t", "adaptive");
  ------------------
  |  |  145|      0|  __kmp_msg(kmp_ms_warning, KMP_MSG(__VA_ARGS__), __kmp_msg_null)
  |  |  ------------------
  |  |  |  |  121|      0|#define KMP_MSG(...) __kmp_msg_format(kmp_i18n_msg_##__VA_ARGS__)
  |  |  ------------------
  ------------------
 3224|      0|    seq = lockseq_queuing;
 3225|      0|  }
 3226|  30.8k|#endif
 3227|  30.8k|#if KMP_USE_TSX
 3228|  30.8k|  if (seq == lockseq_rtm_queuing && !__kmp_cpuinfo.flags.rtm) {
  ------------------
  |  Branch (3228:7): [True: 0, False: 30.8k]
  |  Branch (3228:37): [True: 0, False: 0]
  ------------------
 3229|      0|    seq = lockseq_queuing;
 3230|      0|  }
 3231|  30.8k|#endif
 3232|  30.8k|  kmp_indirect_locktag_t tag = KMP_GET_I_TAG(seq);
  ------------------
  |  | 1107|  30.8k|#define KMP_GET_I_TAG(seq) (kmp_indirect_locktag_t)((seq)-KMP_FIRST_I_LOCK)
  |  |  ------------------
  |  |  |  | 1078|  30.8k|#define KMP_FIRST_I_LOCK lockseq_ticket
  |  |  ------------------
  ------------------
 3233|  30.8k|  kmp_indirect_lock_t *l =
 3234|  30.8k|      __kmp_allocate_indirect_lock((void **)lock, __kmp_entry_gtid(), tag);
  ------------------
  |  | 3467|  30.8k|#define __kmp_entry_gtid() __kmp_get_global_thread_id_reg()
  ------------------
 3235|  30.8k|  KMP_I_LOCK_FUNC(l, init)(l->lock);
  ------------------
  |  | 1154|  30.8k|  __kmp_indirect_##op[((kmp_indirect_lock_t *)(l))->type]
  ------------------
 3236|  30.8k|  KA_TRACE(
 3237|  30.8k|      20, ("__kmp_init_indirect_lock: initialized indirect lock with type#%d\n",
 3238|  30.8k|           seq));
 3239|  30.8k|}
kmp_lock.cpp:_ZL26__kmp_lookup_indirect_lockPPvPKc:
 3194|  30.8k|__kmp_lookup_indirect_lock(void **user_lock, const char *func) {
 3195|  30.8k|  if (__kmp_env_consistency_check) {
  ------------------
  |  Branch (3195:7): [True: 0, False: 30.8k]
  ------------------
 3196|      0|    kmp_indirect_lock_t *lck = NULL;
 3197|      0|    if (user_lock == NULL) {
  ------------------
  |  Branch (3197:9): [True: 0, False: 0]
  ------------------
 3198|      0|      KMP_FATAL(LockIsUninitialized, func);
  ------------------
  |  |  146|      0|#define KMP_FATAL(...) __kmp_fatal(KMP_MSG(__VA_ARGS__), __kmp_msg_null)
  |  |  ------------------
  |  |  |  |  121|      0|#define KMP_MSG(...) __kmp_msg_format(kmp_i18n_msg_##__VA_ARGS__)
  |  |  ------------------
  ------------------
 3199|      0|    }
 3200|      0|    if (OMP_LOCK_T_SIZE < sizeof(void *)) {
  ------------------
  |  |   54|      0|#define OMP_LOCK_T_SIZE sizeof(int)
  ------------------
  |  Branch (3200:9): [True: 0, Folded]
  ------------------
 3201|      0|      kmp_lock_index_t idx = KMP_EXTRACT_I_INDEX(user_lock);
  ------------------
  |  | 1145|      0|#define KMP_EXTRACT_I_INDEX(l) (*(kmp_lock_index_t *)(l) >> 1)
  ------------------
 3202|      0|      lck = __kmp_get_i_lock(idx);
 3203|      0|    } else {
 3204|      0|      lck = *((kmp_indirect_lock_t **)user_lock);
 3205|      0|    }
 3206|      0|    if (lck == NULL) {
  ------------------
  |  Branch (3206:9): [True: 0, False: 0]
  ------------------
 3207|      0|      KMP_FATAL(LockIsUninitialized, func);
  ------------------
  |  |  146|      0|#define KMP_FATAL(...) __kmp_fatal(KMP_MSG(__VA_ARGS__), __kmp_msg_null)
  |  |  ------------------
  |  |  |  |  121|      0|#define KMP_MSG(...) __kmp_msg_format(kmp_i18n_msg_##__VA_ARGS__)
  |  |  ------------------
  ------------------
 3208|      0|    }
 3209|      0|    return lck;
 3210|  30.8k|  } else {
 3211|  30.8k|    if (OMP_LOCK_T_SIZE < sizeof(void *)) {
  ------------------
  |  |   54|  30.8k|#define OMP_LOCK_T_SIZE sizeof(int)
  ------------------
  |  Branch (3211:9): [True: 30.8k, Folded]
  ------------------
 3212|  30.8k|      return __kmp_get_i_lock(KMP_EXTRACT_I_INDEX(user_lock));
  ------------------
  |  | 1145|  30.8k|#define KMP_EXTRACT_I_INDEX(l) (*(kmp_lock_index_t *)(l) >> 1)
  ------------------
 3213|  30.8k|    } else {
 3214|      0|      return *((kmp_indirect_lock_t **)user_lock);
 3215|      0|    }
 3216|  30.8k|  }
 3217|  30.8k|}
kmp_lock.cpp:_ZL27__kmp_destroy_indirect_lockPj:
 3241|  30.8k|static void __kmp_destroy_indirect_lock(kmp_dyna_lock_t *lock) {
 3242|  30.8k|  kmp_uint32 gtid = __kmp_entry_gtid();
  ------------------
  |  | 3467|  30.8k|#define __kmp_entry_gtid() __kmp_get_global_thread_id_reg()
  ------------------
 3243|  30.8k|  kmp_indirect_lock_t *l =
 3244|  30.8k|      __kmp_lookup_indirect_lock((void **)lock, "omp_destroy_lock");
 3245|  30.8k|  KMP_I_LOCK_FUNC(l, destroy)(l->lock);
  ------------------
  |  | 1154|  30.8k|  __kmp_indirect_##op[((kmp_indirect_lock_t *)(l))->type]
  ------------------
 3246|  30.8k|  kmp_indirect_locktag_t tag = l->type;
 3247|       |
 3248|  30.8k|  __kmp_acquire_lock(&__kmp_global_lock, gtid);
 3249|       |
 3250|       |  // Use the base lock's space to keep the pool chain.
 3251|  30.8k|  l->lock->pool.next = (kmp_user_lock_p)__kmp_indirect_lock_pool[tag];
 3252|  30.8k|  if (OMP_LOCK_T_SIZE < sizeof(void *)) {
  ------------------
  |  |   54|  30.8k|#define OMP_LOCK_T_SIZE sizeof(int)
  ------------------
  |  Branch (3252:7): [True: 30.8k, Folded]
  ------------------
 3253|  30.8k|    l->lock->pool.index = KMP_EXTRACT_I_INDEX(lock);
  ------------------
  |  | 1145|  30.8k|#define KMP_EXTRACT_I_INDEX(l) (*(kmp_lock_index_t *)(l) >> 1)
  ------------------
 3254|  30.8k|  }
 3255|  30.8k|  __kmp_indirect_lock_pool[tag] = l;
 3256|       |
 3257|  30.8k|  __kmp_release_lock(&__kmp_global_lock, gtid);
 3258|  30.8k|}
kmp_lock.cpp:_ZL23__kmp_set_indirect_lockPji:
 3260|  25.1k|static int __kmp_set_indirect_lock(kmp_dyna_lock_t *lock, kmp_int32 gtid) {
 3261|  25.1k|  kmp_indirect_lock_t *l = KMP_LOOKUP_I_LOCK(lock);
  ------------------
  |  | 1264|  25.1k|  ((OMP_LOCK_T_SIZE < sizeof(void *))                                          \
  |  |  ------------------
  |  |  |  |   54|  25.1k|#define OMP_LOCK_T_SIZE sizeof(int)
  |  |  ------------------
  |  |  |  Branch (1264:4): [True: 25.1k, Folded]
  |  |  ------------------
  |  | 1265|  25.1k|       ? __kmp_get_i_lock(KMP_EXTRACT_I_INDEX(l))                              \
  |  |  ------------------
  |  |  |  | 1145|  25.1k|#define KMP_EXTRACT_I_INDEX(l) (*(kmp_lock_index_t *)(l) >> 1)
  |  |  ------------------
  |  | 1266|  25.1k|       : *((kmp_indirect_lock_t **)(l)))
  ------------------
 3262|  25.1k|  return KMP_I_LOCK_FUNC(l, set)(l->lock, gtid);
  ------------------
  |  | 1154|  25.1k|  __kmp_indirect_##op[((kmp_indirect_lock_t *)(l))->type]
  ------------------
 3263|  25.1k|}
kmp_lock.cpp:_ZL25__kmp_unset_indirect_lockPji:
 3265|  25.2k|static int __kmp_unset_indirect_lock(kmp_dyna_lock_t *lock, kmp_int32 gtid) {
 3266|  25.2k|  kmp_indirect_lock_t *l = KMP_LOOKUP_I_LOCK(lock);
  ------------------
  |  | 1264|  25.2k|  ((OMP_LOCK_T_SIZE < sizeof(void *))                                          \
  |  |  ------------------
  |  |  |  |   54|  25.2k|#define OMP_LOCK_T_SIZE sizeof(int)
  |  |  ------------------
  |  |  |  Branch (1264:4): [True: 25.2k, Folded]
  |  |  ------------------
  |  | 1265|  25.2k|       ? __kmp_get_i_lock(KMP_EXTRACT_I_INDEX(l))                              \
  |  |  ------------------
  |  |  |  | 1145|  25.2k|#define KMP_EXTRACT_I_INDEX(l) (*(kmp_lock_index_t *)(l) >> 1)
  |  |  ------------------
  |  | 1266|  25.2k|       : *((kmp_indirect_lock_t **)(l)))
  ------------------
 3267|  25.2k|  return KMP_I_LOCK_FUNC(l, unset)(l->lock, gtid);
  ------------------
  |  | 1154|  25.2k|  __kmp_indirect_##op[((kmp_indirect_lock_t *)(l))->type]
  ------------------
 3268|  25.2k|}
kmp_lock.cpp:_ZL26__kmp_acquire_queuing_lockP13kmp_user_locki:
 2958|  25.1k|                                        kmp_int32 gtid) {                      \
 2959|  25.1k|    return __kmp_##op##_##lk##_##lock(&lock->lk, gtid);                        \
 2960|  25.1k|  }
kmp_lock.cpp:_ZL26__kmp_release_queuing_lockP13kmp_user_locki:
 2958|  25.2k|                                        kmp_int32 gtid) {                      \
 2959|  25.2k|    return __kmp_##op##_##lk##_##lock(&lock->lk, gtid);                        \
 2960|  25.2k|  }
kmp_lock.cpp:_ZL26__kmp_destroy_queuing_lockP13kmp_user_lock:
 2953|  30.8k|  static void __kmp_##op##_##lk##_##lock(kmp_user_lock_p lock) {               \
 2954|  30.8k|    __kmp_##op##_##lk##_##lock(&lock->lk);                                     \
 2955|  30.8k|  }
kmp_lock.cpp:_ZL41__kmp_acquire_queuing_lock_timed_templateILb0EEiP16kmp_queuing_locki:
 1085|  25.1k|                                          kmp_int32 gtid) {
 1086|  25.1k|  kmp_info_t *this_thr = __kmp_thread_from_gtid(gtid);
 1087|  25.1k|  volatile kmp_int32 *head_id_p = &lck->lk.head_id;
 1088|  25.1k|  volatile kmp_int32 *tail_id_p = &lck->lk.tail_id;
 1089|  25.1k|  volatile kmp_uint32 *spin_here_p;
 1090|       |
 1091|  25.1k|#if OMPT_SUPPORT
 1092|  25.1k|  ompt_state_t prev_state = ompt_state_undefined;
 1093|  25.1k|#endif
 1094|       |
 1095|  25.1k|  KA_TRACE(1000,
 1096|  25.1k|           ("__kmp_acquire_queuing_lock: lck:%p, T#%d entering\n", lck, gtid));
 1097|       |
 1098|  25.1k|  KMP_FSYNC_PREPARE(lck);
  ------------------
  |  |  332|  25.1k|#define KMP_FSYNC_PREPARE(obj) ((void)0)
  ------------------
 1099|  25.1k|  KMP_DEBUG_ASSERT(this_thr != NULL);
 1100|  25.1k|  spin_here_p = &this_thr->th.th_spin_here;
 1101|       |
 1102|       |#ifdef DEBUG_QUEUING_LOCKS
 1103|       |  TRACE_LOCK(gtid + 1, "acq ent");
 1104|       |  if (*spin_here_p)
 1105|       |    __kmp_dump_queuing_lock(this_thr, gtid, lck, *head_id_p, *tail_id_p);
 1106|       |  if (this_thr->th.th_next_waiting != 0)
 1107|       |    __kmp_dump_queuing_lock(this_thr, gtid, lck, *head_id_p, *tail_id_p);
 1108|       |#endif
 1109|  25.1k|  KMP_DEBUG_ASSERT(!*spin_here_p);
 1110|  25.1k|  KMP_DEBUG_ASSERT(this_thr->th.th_next_waiting == 0);
 1111|       |
 1112|       |  /* The following st.rel to spin_here_p needs to precede the cmpxchg.acq to
 1113|       |     head_id_p that may follow, not just in execution order, but also in
 1114|       |     visibility order. This way, when a releasing thread observes the changes to
 1115|       |     the queue by this thread, it can rightly assume that spin_here_p has
 1116|       |     already been set to TRUE, so that when it sets spin_here_p to FALSE, it is
 1117|       |     not premature.  If the releasing thread sets spin_here_p to FALSE before
 1118|       |     this thread sets it to TRUE, this thread will hang. */
 1119|  25.1k|  *spin_here_p = TRUE; /* before enqueuing to prevent race */
  ------------------
  |  | 1280|  25.1k|#define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  | 1279|  25.1k|#define FALSE 0
  |  |  ------------------
  ------------------
 1120|       |
 1121|  25.2k|  while (1) {
  ------------------
  |  Branch (1121:10): [True: 25.2k, Folded]
  ------------------
 1122|  25.2k|    kmp_int32 enqueued;
 1123|  25.2k|    kmp_int32 head;
 1124|  25.2k|    kmp_int32 tail;
 1125|       |
 1126|  25.2k|    head = *head_id_p;
 1127|       |
 1128|  25.2k|    switch (head) {
 1129|       |
 1130|    318|    case -1: {
  ------------------
  |  Branch (1130:5): [True: 318, False: 24.9k]
  ------------------
 1131|       |#ifdef DEBUG_QUEUING_LOCKS
 1132|       |      tail = *tail_id_p;
 1133|       |      TRACE_LOCK_HT(gtid + 1, "acq read: ", head, tail);
 1134|       |#endif
 1135|    318|      tail = 0; /* to make sure next link asynchronously read is not set
 1136|       |                accidentally; this assignment prevents us from entering the
 1137|       |                if ( t > 0 ) condition in the enqueued case below, which is not
 1138|       |                necessary for this state transition */
 1139|       |
 1140|       |      /* try (-1,0)->(tid,tid) */
 1141|    318|      enqueued = KMP_COMPARE_AND_STORE_ACQ64((volatile kmp_int64 *)tail_id_p,
  ------------------
  |  |  850|    318|  __sync_bool_compare_and_swap((volatile kmp_uint64 *)(p), (kmp_uint64)(cv),   \
  |  |  851|    318|                               (kmp_uint64)(sv))
  ------------------
 1142|    318|                                             KMP_PACK_64(-1, 0),
 1143|    318|                                             KMP_PACK_64(gtid + 1, gtid + 1));
 1144|       |#ifdef DEBUG_QUEUING_LOCKS
 1145|       |      if (enqueued)
 1146|       |        TRACE_LOCK(gtid + 1, "acq enq: (-1,0)->(tid,tid)");
 1147|       |#endif
 1148|    318|    } break;
 1149|       |
 1150|  1.23k|    default: {
  ------------------
  |  Branch (1150:5): [True: 1.23k, False: 24.0k]
  ------------------
 1151|  1.23k|      tail = *tail_id_p;
 1152|  1.23k|      KMP_DEBUG_ASSERT(tail != gtid + 1);
 1153|       |
 1154|       |#ifdef DEBUG_QUEUING_LOCKS
 1155|       |      TRACE_LOCK_HT(gtid + 1, "acq read: ", head, tail);
 1156|       |#endif
 1157|       |
 1158|  1.23k|      if (tail == 0) {
  ------------------
  |  Branch (1158:11): [True: 0, False: 1.23k]
  ------------------
 1159|      0|        enqueued = FALSE;
  ------------------
  |  | 1279|      0|#define FALSE 0
  ------------------
 1160|  1.23k|      } else {
 1161|       |        /* try (h,t) or (h,h)->(h,tid) */
 1162|  1.23k|        enqueued = KMP_COMPARE_AND_STORE_ACQ32(tail_id_p, tail, gtid + 1);
  ------------------
  |  |  807|  1.23k|  __sync_bool_compare_and_swap((volatile kmp_uint32 *)(p), (kmp_uint32)(cv),   \
  |  |  808|  1.23k|                               (kmp_uint32)(sv))
  ------------------
 1163|       |
 1164|       |#ifdef DEBUG_QUEUING_LOCKS
 1165|       |        if (enqueued)
 1166|       |          TRACE_LOCK(gtid + 1, "acq enq: (h,t)->(h,tid)");
 1167|       |#endif
 1168|  1.23k|      }
 1169|  1.23k|    } break;
 1170|       |
 1171|  23.7k|    case 0: /* empty queue */
  ------------------
  |  Branch (1171:5): [True: 23.7k, False: 1.53k]
  ------------------
 1172|  23.7k|    {
 1173|  23.7k|      kmp_int32 grabbed_lock;
 1174|       |
 1175|       |#ifdef DEBUG_QUEUING_LOCKS
 1176|       |      tail = *tail_id_p;
 1177|       |      TRACE_LOCK_HT(gtid + 1, "acq read: ", head, tail);
 1178|       |#endif
 1179|       |      /* try (0,0)->(-1,0) */
 1180|       |
 1181|       |      /* only legal transition out of head = 0 is head = -1 with no change to
 1182|       |       * tail */
 1183|  23.7k|      grabbed_lock = KMP_COMPARE_AND_STORE_ACQ32(head_id_p, 0, -1);
  ------------------
  |  |  807|  23.7k|  __sync_bool_compare_and_swap((volatile kmp_uint32 *)(p), (kmp_uint32)(cv),   \
  |  |  808|  23.7k|                               (kmp_uint32)(sv))
  ------------------
 1184|       |
 1185|  23.7k|      if (grabbed_lock) {
  ------------------
  |  Branch (1185:11): [True: 23.6k, False: 29]
  ------------------
 1186|       |
 1187|  23.6k|        *spin_here_p = FALSE;
  ------------------
  |  | 1279|  23.6k|#define FALSE 0
  ------------------
 1188|       |
 1189|  23.6k|        KA_TRACE(
 1190|  23.6k|            1000,
 1191|  23.6k|            ("__kmp_acquire_queuing_lock: lck:%p, T#%d exiting: no queuing\n",
 1192|  23.6k|             lck, gtid));
 1193|       |#ifdef DEBUG_QUEUING_LOCKS
 1194|       |        TRACE_LOCK_HT(gtid + 1, "acq exit: ", head, 0);
 1195|       |#endif
 1196|       |
 1197|  23.6k|#if OMPT_SUPPORT
 1198|  23.6k|        if (ompt_enabled.enabled && prev_state != ompt_state_undefined) {
  ------------------
  |  Branch (1198:13): [True: 0, False: 23.6k]
  |  Branch (1198:37): [True: 0, False: 0]
  ------------------
 1199|       |          /* change the state before clearing wait_id */
 1200|      0|          this_thr->th.ompt_thread_info.state = prev_state;
 1201|      0|          this_thr->th.ompt_thread_info.wait_id = 0;
 1202|      0|        }
 1203|  23.6k|#endif
 1204|       |
 1205|  23.6k|        KMP_FSYNC_ACQUIRED(lck);
  ------------------
  |  |  334|  23.6k|#define KMP_FSYNC_ACQUIRED(obj) ((void)0)
  ------------------
 1206|  23.6k|        return KMP_LOCK_ACQUIRED_FIRST; /* lock holder cannot be on queue */
  ------------------
  |  |  158|  23.6k|#define KMP_LOCK_ACQUIRED_FIRST 1
  ------------------
 1207|  23.6k|      }
 1208|     29|      enqueued = FALSE;
  ------------------
  |  | 1279|     29|#define FALSE 0
  ------------------
 1209|     29|    } break;
 1210|  25.2k|    }
 1211|       |
 1212|  1.62k|#if OMPT_SUPPORT
 1213|  1.62k|    if (ompt_enabled.enabled && prev_state == ompt_state_undefined) {
  ------------------
  |  Branch (1213:9): [True: 0, False: 1.62k]
  |  Branch (1213:33): [True: 0, False: 0]
  ------------------
 1214|       |      /* this thread will spin; set wait_id before entering wait state */
 1215|      0|      prev_state = this_thr->th.ompt_thread_info.state;
 1216|      0|      this_thr->th.ompt_thread_info.wait_id = (uint64_t)lck;
 1217|      0|      this_thr->th.ompt_thread_info.state = ompt_state_wait_lock;
 1218|      0|    }
 1219|  1.62k|#endif
 1220|       |
 1221|  1.62k|    if (enqueued) {
  ------------------
  |  Branch (1221:9): [True: 1.51k, False: 113]
  ------------------
 1222|  1.51k|      if (tail > 0) {
  ------------------
  |  Branch (1222:11): [True: 1.20k, False: 304]
  ------------------
 1223|  1.20k|        kmp_info_t *tail_thr = __kmp_thread_from_gtid(tail - 1);
 1224|  1.20k|        KMP_ASSERT(tail_thr != NULL);
  ------------------
  |  |   50|  1.20k|  if (!(cond)) {                                                               \
  |  |  ------------------
  |  |  |  Branch (50:7): [True: 0, False: 1.20k]
  |  |  ------------------
  |  |   51|      0|    __kmp_debug_assert("assertion failure", __FILE__, __LINE__);               \
  |  |   52|      0|  }
  ------------------
 1225|  1.20k|        tail_thr->th.th_next_waiting = gtid + 1;
 1226|       |        /* corresponding wait for this write in release code */
 1227|  1.20k|      }
 1228|  1.51k|      KA_TRACE(1000,
 1229|  1.51k|               ("__kmp_acquire_queuing_lock: lck:%p, T#%d waiting for lock\n",
 1230|  1.51k|                lck, gtid));
 1231|       |
 1232|  1.51k|      KMP_MB();
 1233|       |      // ToDo: Use __kmp_wait_sleep or similar when blocktime != inf
 1234|  1.51k|      KMP_WAIT(spin_here_p, FALSE, KMP_EQ, lck);
  ------------------
  |  | 1183|  1.51k|#define KMP_WAIT __kmp_wait_4
  ------------------
                    KMP_WAIT(spin_here_p, FALSE, KMP_EQ, lck);
  ------------------
  |  | 1279|  1.51k|#define FALSE 0
  ------------------
                    KMP_WAIT(spin_here_p, FALSE, KMP_EQ, lck);
  ------------------
  |  | 1185|  1.51k|#define KMP_EQ __kmp_eq_4
  ------------------
 1235|       |      // Synchronize writes to both runtime thread structures
 1236|       |      // and writes in user code.
 1237|  1.51k|      KMP_MB();
 1238|       |
 1239|       |#ifdef DEBUG_QUEUING_LOCKS
 1240|       |      TRACE_LOCK(gtid + 1, "acq spin");
 1241|       |
 1242|       |      if (this_thr->th.th_next_waiting != 0)
 1243|       |        __kmp_dump_queuing_lock(this_thr, gtid, lck, *head_id_p, *tail_id_p);
 1244|       |#endif
 1245|  1.51k|      KMP_DEBUG_ASSERT(this_thr->th.th_next_waiting == 0);
 1246|  1.51k|      KA_TRACE(1000, ("__kmp_acquire_queuing_lock: lck:%p, T#%d exiting: after "
 1247|  1.51k|                      "waiting on queue\n",
 1248|  1.51k|                      lck, gtid));
 1249|       |
 1250|       |#ifdef DEBUG_QUEUING_LOCKS
 1251|       |      TRACE_LOCK(gtid + 1, "acq exit 2");
 1252|       |#endif
 1253|       |
 1254|  1.51k|#if OMPT_SUPPORT
 1255|       |      /* change the state before clearing wait_id */
 1256|  1.51k|      this_thr->th.ompt_thread_info.state = prev_state;
 1257|  1.51k|      this_thr->th.ompt_thread_info.wait_id = 0;
 1258|  1.51k|#endif
 1259|       |
 1260|       |      /* got lock, we were dequeued by the thread that released lock */
 1261|  1.51k|      return KMP_LOCK_ACQUIRED_FIRST;
  ------------------
  |  |  158|  1.51k|#define KMP_LOCK_ACQUIRED_FIRST 1
  ------------------
 1262|  1.51k|    }
 1263|       |
 1264|       |    /* Yield if number of threads > number of logical processors */
 1265|       |    /* ToDo: Not sure why this should only be in oversubscription case,
 1266|       |       maybe should be traditional YIELD_INIT/YIELD_WHEN loop */
 1267|    113|    KMP_YIELD_OVERSUB();
  ------------------
  |  | 1536|    113|  {                                                                            \
  |  | 1537|    113|    KMP_CPU_PAUSE();                                                           \
  |  |  ------------------
  |  |  |  | 1498|    113|#define KMP_CPU_PAUSE() __kmp_x86_pause()
  |  |  ------------------
  |  | 1538|    113|    if ((KMP_TRY_YIELD_OVERSUB))                                               \
  |  |  ------------------
  |  |  |  | 1526|    113|  ((__kmp_use_yield == 1 || __kmp_use_yield == 2) && (KMP_OVERSUBSCRIBED))
  |  |  |  |  ------------------
  |  |  |  |  |  | 1520|  18.4E|  (TCR_4(__kmp_nth) > (__kmp_avail_proc ? __kmp_avail_proc : __kmp_xproc))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 1127|    109|#define TCR_4(a) (a)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1520:24): [True: 111, False: 18.4E]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1526:5): [True: 113, False: 0]
  |  |  |  |  |  Branch (1526:29): [True: 0, False: 0]
  |  |  |  |  |  Branch (1526:54): [True: 0, False: 109]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1539|    113|      __kmp_yield();                                                           \
  |  | 1540|    113|  }
  ------------------
 1268|       |
 1269|       |#ifdef DEBUG_QUEUING_LOCKS
 1270|       |    TRACE_LOCK(gtid + 1, "acq retry");
 1271|       |#endif
 1272|    113|  }
 1273|      8|  KMP_ASSERT2(0, "should not get here");
  ------------------
  |  |   53|      8|#define KMP_ASSERT2(cond, msg) KMP_ASSERT(cond)
  |  |  ------------------
  |  |  |  |   50|      8|  if (!(cond)) {                                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (50:7): [True: 0, Folded]
  |  |  |  |  ------------------
  |  |  |  |   51|      0|    __kmp_debug_assert("assertion failure", __FILE__, __LINE__);               \
  |  |  |  |   52|      0|  }
  |  |  ------------------
  ------------------
 1274|      8|  return KMP_LOCK_ACQUIRED_FIRST;
  ------------------
  |  |  158|      8|#define KMP_LOCK_ACQUIRED_FIRST 1
  ------------------
 1275|  25.1k|}

kmp_i18n.cpp:_ZL28__kmp_acquire_bootstrap_lockP15kmp_ticket_lock:
  519|      1|static inline int __kmp_acquire_bootstrap_lock(kmp_bootstrap_lock_t *lck) {
  520|      1|  return __kmp_acquire_ticket_lock(lck, KMP_GTID_DNE);
  ------------------
  |  |   34|      1|#define KMP_GTID_DNE (-2)
  ------------------
  521|      1|}
kmp_i18n.cpp:_ZL28__kmp_release_bootstrap_lockP15kmp_ticket_lock:
  527|      1|static inline void __kmp_release_bootstrap_lock(kmp_bootstrap_lock_t *lck) {
  528|      1|  __kmp_release_ticket_lock(lck, KMP_GTID_DNE);
  ------------------
  |  |   34|      1|#define KMP_GTID_DNE (-2)
  ------------------
  529|      1|}
kmp_runtime.cpp:_ZL28__kmp_acquire_bootstrap_lockP15kmp_ticket_lock:
  519|  2.71k|static inline int __kmp_acquire_bootstrap_lock(kmp_bootstrap_lock_t *lck) {
  520|  2.71k|  return __kmp_acquire_ticket_lock(lck, KMP_GTID_DNE);
  ------------------
  |  |   34|  2.71k|#define KMP_GTID_DNE (-2)
  ------------------
  521|  2.71k|}
kmp_runtime.cpp:_ZL28__kmp_release_bootstrap_lockP15kmp_ticket_lock:
  527|  2.71k|static inline void __kmp_release_bootstrap_lock(kmp_bootstrap_lock_t *lck) {
  528|  2.71k|  __kmp_release_ticket_lock(lck, KMP_GTID_DNE);
  ------------------
  |  |   34|  2.71k|#define KMP_GTID_DNE (-2)
  ------------------
  529|  2.71k|}
kmp_runtime.cpp:_ZL15__kmp_init_lockP15kmp_ticket_lock:
  563|      3|static inline void __kmp_init_lock(kmp_lock_t *lck) {
  564|      3|  __kmp_init_ticket_lock(lck);
  565|      3|}
kmp_runtime.cpp:_ZL25__kmp_init_bootstrap_lockP15kmp_ticket_lock:
  531|      3|static inline void __kmp_init_bootstrap_lock(kmp_bootstrap_lock_t *lck) {
  532|      3|  __kmp_init_ticket_lock(lck);
  533|      3|}
kmp_tasking.cpp:_ZL25__kmp_init_bootstrap_lockP15kmp_ticket_lock:
  531|      4|static inline void __kmp_init_bootstrap_lock(kmp_bootstrap_lock_t *lck) {
  532|      4|  __kmp_init_ticket_lock(lck);
  533|      4|}
kmp_tasking.cpp:_ZL28__kmp_acquire_bootstrap_lockP15kmp_ticket_lock:
  519|      3|static inline int __kmp_acquire_bootstrap_lock(kmp_bootstrap_lock_t *lck) {
  520|      3|  return __kmp_acquire_ticket_lock(lck, KMP_GTID_DNE);
  ------------------
  |  |   34|      3|#define KMP_GTID_DNE (-2)
  ------------------
  521|      3|}
kmp_tasking.cpp:_ZL28__kmp_release_bootstrap_lockP15kmp_ticket_lock:
  527|      3|static inline void __kmp_release_bootstrap_lock(kmp_bootstrap_lock_t *lck) {
  528|      3|  __kmp_release_ticket_lock(lck, KMP_GTID_DNE);
  ------------------
  |  |   34|      3|#define KMP_GTID_DNE (-2)
  ------------------
  529|      3|}
kmp_lock.cpp:_ZL18__kmp_acquire_lockP15kmp_ticket_locki:
  551|  61.6k|static inline int __kmp_acquire_lock(kmp_lock_t *lck, kmp_int32 gtid) {
  552|  61.6k|  return __kmp_acquire_ticket_lock(lck, gtid);
  553|  61.6k|}
kmp_lock.cpp:_ZL18__kmp_release_lockP15kmp_ticket_locki:
  559|  61.6k|static inline void __kmp_release_lock(kmp_lock_t *lck, kmp_int32 gtid) {
  560|  61.6k|  __kmp_release_ticket_lock(lck, gtid);
  561|  61.6k|}
kmp_lock.cpp:_ZL16__kmp_get_i_lockj:
 1240|  81.1k|static inline kmp_indirect_lock_t *__kmp_get_i_lock(kmp_lock_index_t idx) {
 1241|  81.1k|  kmp_indirect_lock_table_t *lock_table = &__kmp_i_lock_table;
 1242|  81.1k|  while (lock_table) {
  ------------------
  |  Branch (1242:10): [True: 81.1k, False: 18.4E]
  ------------------
 1243|  81.1k|    kmp_lock_index_t max_locks = lock_table->nrow_ptrs * KMP_I_LOCK_CHUNK;
  ------------------
  |  | 1222|  81.1k|#define KMP_I_LOCK_CHUNK 1024
  ------------------
 1244|  81.1k|    if (idx < max_locks) {
  ------------------
  |  Branch (1244:9): [True: 81.1k, False: 18.4E]
  ------------------
 1245|  81.1k|      kmp_lock_index_t row = idx / KMP_I_LOCK_CHUNK;
  ------------------
  |  | 1222|  81.1k|#define KMP_I_LOCK_CHUNK 1024
  ------------------
 1246|  81.1k|      kmp_lock_index_t col = idx % KMP_I_LOCK_CHUNK;
  ------------------
  |  | 1222|  81.1k|#define KMP_I_LOCK_CHUNK 1024
  ------------------
 1247|  81.1k|      if (!lock_table->table[row] || idx >= lock_table->next)
  ------------------
  |  Branch (1247:11): [True: 0, False: 81.1k]
  |  Branch (1247:38): [True: 18.4E, False: 81.1k]
  ------------------
 1248|      0|        break;
 1249|  81.1k|      return &lock_table->table[row][col];
 1250|  81.1k|    }
 1251|  18.4E|    idx -= max_locks;
 1252|  18.4E|    lock_table = lock_table->next_table;
 1253|  18.4E|  }
 1254|  18.4E|  return nullptr;
 1255|  81.1k|}

_Z26__kmp_atomic_compare_storeIiEbPNSt3__16atomicIT_EES2_S2_:
 1266|     32|bool __kmp_atomic_compare_store(std::atomic<T> *p, T expected, T desired) {
 1267|     32|  return p->compare_exchange_strong(
 1268|     32|      expected, desired, std::memory_order_acq_rel, std::memory_order_relaxed);
 1269|     32|}

__kmp_get_global_thread_id:
  117|      2|int __kmp_get_global_thread_id() {
  118|      2|  int i;
  119|      2|  kmp_info_t **other_threads;
  120|      2|  size_t stack_data;
  121|      2|  char *stack_addr;
  122|      2|  size_t stack_size;
  123|      2|  char *stack_base;
  124|       |
  125|      2|  KA_TRACE(
  126|      2|      1000,
  127|      2|      ("*** __kmp_get_global_thread_id: entering, nproc=%d  all_nproc=%d\n",
  128|      2|       __kmp_nth, __kmp_all_nth));
  129|       |
  130|       |  /* JPH - to handle the case where __kmpc_end(0) is called immediately prior to
  131|       |     a parallel region, made it return KMP_GTID_DNE to force serial_initialize
  132|       |     by caller. Had to handle KMP_GTID_DNE at all call-sites, or else guarantee
  133|       |     __kmp_init_gtid for this to work. */
  134|       |
  135|      2|  if (!TCR_4(__kmp_init_gtid))
  ------------------
  |  | 1127|      2|#define TCR_4(a) (a)
  ------------------
  |  Branch (135:7): [True: 0, False: 2]
  ------------------
  136|      0|    return KMP_GTID_DNE;
  ------------------
  |  | 1000|      0|#define KMP_GTID_DNE (-2) /* Does not exist */
  ------------------
  137|       |
  138|      2|#ifdef KMP_TDATA_GTID
  139|      2|  if (TCR_4(__kmp_gtid_mode) >= 3) {
  ------------------
  |  | 1127|      2|#define TCR_4(a) (a)
  ------------------
  |  Branch (139:7): [True: 2, False: 0]
  ------------------
  140|      2|    KA_TRACE(1000, ("*** __kmp_get_global_thread_id: using TDATA\n"));
  141|      2|    return __kmp_gtid;
  142|      2|  }
  143|      0|#endif
  144|      0|  if (TCR_4(__kmp_gtid_mode) >= 2) {
  ------------------
  |  | 1127|      0|#define TCR_4(a) (a)
  ------------------
  |  Branch (144:7): [True: 0, False: 0]
  ------------------
  145|      0|    KA_TRACE(1000, ("*** __kmp_get_global_thread_id: using keyed TLS\n"));
  146|      0|    return __kmp_gtid_get_specific();
  147|      0|  }
  148|      0|  KA_TRACE(1000, ("*** __kmp_get_global_thread_id: using internal alg.\n"));
  149|       |
  150|      0|  stack_addr = (char *)&stack_data;
  151|      0|  other_threads = __kmp_threads;
  152|       |
  153|       |  /* ATT: The code below is a source of potential bugs due to unsynchronized
  154|       |     access to __kmp_threads array. For example:
  155|       |     1. Current thread loads other_threads[i] to thr and checks it, it is
  156|       |        non-NULL.
  157|       |     2. Current thread is suspended by OS.
  158|       |     3. Another thread unregisters and finishes (debug versions of free()
  159|       |        may fill memory with something like 0xEF).
  160|       |     4. Current thread is resumed.
  161|       |     5. Current thread reads junk from *thr.
  162|       |     TODO: Fix it.  --ln  */
  163|       |
  164|      0|  for (i = 0; i < __kmp_threads_capacity; i++) {
  ------------------
  |  Branch (164:15): [True: 0, False: 0]
  ------------------
  165|       |
  166|      0|    kmp_info_t *thr = (kmp_info_t *)TCR_SYNC_PTR(other_threads[i]);
  ------------------
  |  | 1158|      0|#define TCR_SYNC_PTR(a) ((void *)TCR_SYNC_8(a))
  |  |  ------------------
  |  |  |  | 1140|      0|#define TCR_SYNC_8(a) (a)
  |  |  ------------------
  ------------------
  167|      0|    if (!thr)
  ------------------
  |  Branch (167:9): [True: 0, False: 0]
  ------------------
  168|      0|      continue;
  169|       |
  170|      0|    stack_size = (size_t)TCR_PTR(thr->th.th_info.ds.ds_stacksize);
  ------------------
  |  | 1156|      0|#define TCR_PTR(a) ((void *)TCR_8(a))
  |  |  ------------------
  |  |  |  | 1131|      0|#define TCR_8(a) (a)
  |  |  ------------------
  ------------------
  171|      0|    stack_base = (char *)TCR_PTR(thr->th.th_info.ds.ds_stackbase);
  ------------------
  |  | 1156|      0|#define TCR_PTR(a) ((void *)TCR_8(a))
  |  |  ------------------
  |  |  |  | 1131|      0|#define TCR_8(a) (a)
  |  |  ------------------
  ------------------
  172|       |
  173|       |    /* stack grows down -- search through all of the active threads */
  174|       |
  175|      0|    if (stack_addr <= stack_base) {
  ------------------
  |  Branch (175:9): [True: 0, False: 0]
  ------------------
  176|      0|      size_t stack_diff = stack_base - stack_addr;
  177|       |
  178|      0|      if (stack_diff <= stack_size) {
  ------------------
  |  Branch (178:11): [True: 0, False: 0]
  ------------------
  179|       |        /* The only way we can be closer than the allocated */
  180|       |        /* stack size is if we are running on this thread. */
  181|      0|        KMP_DEBUG_ASSERT(__kmp_gtid_get_specific() == i);
  182|      0|        return i;
  183|      0|      }
  184|      0|    }
  185|      0|  }
  186|       |
  187|       |  /* get specific to try and determine our gtid */
  188|      0|  KA_TRACE(1000,
  189|      0|           ("*** __kmp_get_global_thread_id: internal alg. failed to find "
  190|      0|            "thread, using TLS\n"));
  191|      0|  i = __kmp_gtid_get_specific();
  192|       |
  193|       |  /*fprintf( stderr, "=== %d\n", i );  */ /* GROO */
  194|       |
  195|       |  /* if we havn't been assigned a gtid, then return code */
  196|      0|  if (i < 0)
  ------------------
  |  Branch (196:7): [True: 0, False: 0]
  ------------------
  197|      0|    return i;
  198|       |
  199|       |  /* dynamically updated stack window for uber threads to avoid get_specific
  200|       |     call */
  201|      0|  if (!TCR_4(other_threads[i]->th.th_info.ds.ds_stackgrow)) {
  ------------------
  |  | 1127|      0|#define TCR_4(a) (a)
  ------------------
  |  Branch (201:7): [True: 0, False: 0]
  ------------------
  202|      0|    KMP_FATAL(StackOverflow, i);
  ------------------
  |  |  146|      0|#define KMP_FATAL(...) __kmp_fatal(KMP_MSG(__VA_ARGS__), __kmp_msg_null)
  |  |  ------------------
  |  |  |  |  121|      0|#define KMP_MSG(...) __kmp_msg_format(kmp_i18n_msg_##__VA_ARGS__)
  |  |  ------------------
  ------------------
  203|      0|  }
  204|       |
  205|      0|  stack_base = (char *)other_threads[i]->th.th_info.ds.ds_stackbase;
  206|      0|  if (stack_addr > stack_base) {
  ------------------
  |  Branch (206:7): [True: 0, False: 0]
  ------------------
  207|      0|    TCW_PTR(other_threads[i]->th.th_info.ds.ds_stackbase, stack_addr);
  ------------------
  |  | 1157|      0|#define TCW_PTR(a, b) TCW_8((a), (b))
  |  |  ------------------
  |  |  |  | 1132|      0|#define TCW_8(a, b) (a) = (b)
  |  |  ------------------
  ------------------
  208|      0|    TCW_PTR(other_threads[i]->th.th_info.ds.ds_stacksize,
  ------------------
  |  | 1157|      0|#define TCW_PTR(a, b) TCW_8((a), (b))
  |  |  ------------------
  |  |  |  | 1132|      0|#define TCW_8(a, b) (a) = (b)
  |  |  ------------------
  ------------------
  209|      0|            other_threads[i]->th.th_info.ds.ds_stacksize + stack_addr -
  210|      0|                stack_base);
  211|      0|  } else {
  212|      0|    TCW_PTR(other_threads[i]->th.th_info.ds.ds_stacksize,
  ------------------
  |  | 1157|      0|#define TCW_PTR(a, b) TCW_8((a), (b))
  |  |  ------------------
  |  |  |  | 1132|      0|#define TCW_8(a, b) (a) = (b)
  |  |  ------------------
  ------------------
  213|      0|            stack_base - stack_addr);
  214|      0|  }
  215|       |
  216|       |  /* Reprint stack bounds for ubermaster since they have been refined */
  217|      0|  if (__kmp_storage_map) {
  ------------------
  |  Branch (217:7): [True: 0, False: 0]
  ------------------
  218|      0|    char *stack_end = (char *)other_threads[i]->th.th_info.ds.ds_stackbase;
  219|      0|    char *stack_beg = stack_end - other_threads[i]->th.th_info.ds.ds_stacksize;
  220|      0|    __kmp_print_storage_map_gtid(i, stack_beg, stack_end,
  221|      0|                                 other_threads[i]->th.th_info.ds.ds_stacksize,
  222|      0|                                 "th_%d stack (refinement)", i);
  223|      0|  }
  224|      0|  return i;
  225|      0|}
__kmp_get_global_thread_id_reg:
  227|   225k|int __kmp_get_global_thread_id_reg() {
  228|   225k|  int gtid;
  229|       |
  230|   225k|  if (!__kmp_init_serial) {
  ------------------
  |  Branch (230:7): [True: 1, False: 225k]
  ------------------
  231|      1|    gtid = KMP_GTID_DNE;
  ------------------
  |  | 1000|      1|#define KMP_GTID_DNE (-2) /* Does not exist */
  ------------------
  232|      1|  } else
  233|   225k|#ifdef KMP_TDATA_GTID
  234|   225k|      if (TCR_4(__kmp_gtid_mode) >= 3) {
  ------------------
  |  | 1127|   225k|#define TCR_4(a) (a)
  ------------------
  |  Branch (234:11): [True: 225k, False: 18.4E]
  ------------------
  235|   225k|    KA_TRACE(1000, ("*** __kmp_get_global_thread_id_reg: using TDATA\n"));
  236|   225k|    gtid = __kmp_gtid;
  237|   225k|  } else
  238|  18.4E|#endif
  239|  18.4E|      if (TCR_4(__kmp_gtid_mode) >= 2) {
  ------------------
  |  | 1127|  18.4E|#define TCR_4(a) (a)
  ------------------
  |  Branch (239:11): [True: 0, False: 18.4E]
  ------------------
  240|      0|    KA_TRACE(1000, ("*** __kmp_get_global_thread_id_reg: using keyed TLS\n"));
  241|      0|    gtid = __kmp_gtid_get_specific();
  242|  18.4E|  } else {
  243|  18.4E|    KA_TRACE(1000,
  244|  18.4E|             ("*** __kmp_get_global_thread_id_reg: using internal alg.\n"));
  245|  18.4E|    gtid = __kmp_get_global_thread_id();
  246|  18.4E|  }
  247|       |
  248|       |  /* we must be a new uber master sibling thread */
  249|   225k|  if (gtid == KMP_GTID_DNE) {
  ------------------
  |  | 1000|   225k|#define KMP_GTID_DNE (-2) /* Does not exist */
  ------------------
  |  Branch (249:7): [True: 1, False: 225k]
  ------------------
  250|      1|    KA_TRACE(10,
  251|      1|             ("__kmp_get_global_thread_id_reg: Encountered new root thread. "
  252|      1|              "Registering a new gtid.\n"));
  253|      1|    __kmp_acquire_bootstrap_lock(&__kmp_initz_lock);
  254|      1|    if (!__kmp_init_serial) {
  ------------------
  |  Branch (254:9): [True: 1, False: 0]
  ------------------
  255|      1|      __kmp_do_serial_initialize();
  256|      1|      gtid = __kmp_gtid_get_specific();
  257|      1|    } else {
  258|      0|      gtid = __kmp_register_root(FALSE);
  ------------------
  |  | 1279|      0|#define FALSE 0
  ------------------
  259|      0|    }
  260|      1|    __kmp_release_bootstrap_lock(&__kmp_initz_lock);
  261|       |    /*__kmp_printf( "+++ %d\n", gtid ); */ /* GROO */
  262|      1|  }
  263|       |
  264|   225k|  KMP_DEBUG_ASSERT(gtid >= 0);
  265|       |
  266|   225k|  return gtid;
  267|   225k|}
__kmp_check_stack_overlap:
  270|     32|void __kmp_check_stack_overlap(kmp_info_t *th) {
  271|     32|  int f;
  272|     32|  char *stack_beg = NULL;
  273|     32|  char *stack_end = NULL;
  274|     32|  int gtid;
  275|       |
  276|     32|  KA_TRACE(10, ("__kmp_check_stack_overlap: called\n"));
  277|     32|  if (__kmp_storage_map) {
  ------------------
  |  Branch (277:7): [True: 0, False: 32]
  ------------------
  278|      0|    stack_end = (char *)th->th.th_info.ds.ds_stackbase;
  279|      0|    stack_beg = stack_end - th->th.th_info.ds.ds_stacksize;
  280|       |
  281|      0|    gtid = __kmp_gtid_from_thread(th);
  282|       |
  283|      0|    if (gtid == KMP_GTID_MONITOR) {
  ------------------
  |  | 1002|      0|#define KMP_GTID_MONITOR (-4) /* Monitor thread ID */
  ------------------
  |  Branch (283:9): [True: 0, False: 0]
  ------------------
  284|      0|      __kmp_print_storage_map_gtid(
  285|      0|          gtid, stack_beg, stack_end, th->th.th_info.ds.ds_stacksize,
  286|      0|          "th_%s stack (%s)", "mon",
  287|      0|          (th->th.th_info.ds.ds_stackgrow) ? "initial" : "actual");
  ------------------
  |  Branch (287:11): [True: 0, False: 0]
  ------------------
  288|      0|    } else {
  289|      0|      __kmp_print_storage_map_gtid(
  290|      0|          gtid, stack_beg, stack_end, th->th.th_info.ds.ds_stacksize,
  291|      0|          "th_%d stack (%s)", gtid,
  292|      0|          (th->th.th_info.ds.ds_stackgrow) ? "initial" : "actual");
  ------------------
  |  Branch (292:11): [True: 0, False: 0]
  ------------------
  293|      0|    }
  294|      0|  }
  295|       |
  296|       |  /* No point in checking ubermaster threads since they use refinement and
  297|       |   * cannot overlap */
  298|     32|  gtid = __kmp_gtid_from_thread(th);
  299|     32|  if (__kmp_env_checks == TRUE && !KMP_UBER_GTID(gtid)) {
  ------------------
  |  | 1280|     64|#define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  | 1279|     32|#define FALSE 0
  |  |  ------------------
  ------------------
  |  Branch (299:7): [True: 0, False: 32]
  |  Branch (299:35): [True: 0, False: 0]
  ------------------
  300|      0|    KA_TRACE(10,
  301|      0|             ("__kmp_check_stack_overlap: performing extensive checking\n"));
  302|      0|    if (stack_beg == NULL) {
  ------------------
  |  Branch (302:9): [True: 0, False: 0]
  ------------------
  303|      0|      stack_end = (char *)th->th.th_info.ds.ds_stackbase;
  304|      0|      stack_beg = stack_end - th->th.th_info.ds.ds_stacksize;
  305|      0|    }
  306|       |
  307|      0|    for (f = 0; f < __kmp_threads_capacity; f++) {
  ------------------
  |  Branch (307:17): [True: 0, False: 0]
  ------------------
  308|      0|      kmp_info_t *f_th = (kmp_info_t *)TCR_SYNC_PTR(__kmp_threads[f]);
  ------------------
  |  | 1158|      0|#define TCR_SYNC_PTR(a) ((void *)TCR_SYNC_8(a))
  |  |  ------------------
  |  |  |  | 1140|      0|#define TCR_SYNC_8(a) (a)
  |  |  ------------------
  ------------------
  309|       |
  310|      0|      if (f_th && f_th != th) {
  ------------------
  |  Branch (310:11): [True: 0, False: 0]
  |  Branch (310:19): [True: 0, False: 0]
  ------------------
  311|      0|        char *other_stack_end =
  312|      0|            (char *)TCR_PTR(f_th->th.th_info.ds.ds_stackbase);
  ------------------
  |  | 1156|      0|#define TCR_PTR(a) ((void *)TCR_8(a))
  |  |  ------------------
  |  |  |  | 1131|      0|#define TCR_8(a) (a)
  |  |  ------------------
  ------------------
  313|      0|        char *other_stack_beg =
  314|      0|            other_stack_end - (size_t)TCR_PTR(f_th->th.th_info.ds.ds_stacksize);
  ------------------
  |  | 1156|      0|#define TCR_PTR(a) ((void *)TCR_8(a))
  |  |  ------------------
  |  |  |  | 1131|      0|#define TCR_8(a) (a)
  |  |  ------------------
  ------------------
  315|      0|        if ((stack_beg > other_stack_beg && stack_beg < other_stack_end) ||
  ------------------
  |  Branch (315:14): [True: 0, False: 0]
  |  Branch (315:45): [True: 0, False: 0]
  ------------------
  316|      0|            (stack_end > other_stack_beg && stack_end < other_stack_end)) {
  ------------------
  |  Branch (316:14): [True: 0, False: 0]
  |  Branch (316:45): [True: 0, False: 0]
  ------------------
  317|       |
  318|       |          /* Print the other stack values before the abort */
  319|      0|          if (__kmp_storage_map)
  ------------------
  |  Branch (319:15): [True: 0, False: 0]
  ------------------
  320|      0|            __kmp_print_storage_map_gtid(
  321|      0|                -1, other_stack_beg, other_stack_end,
  322|      0|                (size_t)TCR_PTR(f_th->th.th_info.ds.ds_stacksize),
  ------------------
  |  | 1156|      0|#define TCR_PTR(a) ((void *)TCR_8(a))
  |  |  ------------------
  |  |  |  | 1131|      0|#define TCR_8(a) (a)
  |  |  ------------------
  ------------------
  323|      0|                "th_%d stack (overlapped)", __kmp_gtid_from_thread(f_th));
  324|       |
  325|      0|          __kmp_fatal(KMP_MSG(StackOverlap), KMP_HNT(ChangeStackLimit),
  ------------------
  |  |  121|      0|#define KMP_MSG(...) __kmp_msg_format(kmp_i18n_msg_##__VA_ARGS__)
  ------------------
                        __kmp_fatal(KMP_MSG(StackOverlap), KMP_HNT(ChangeStackLimit),
  ------------------
  |  |  122|      0|#define KMP_HNT(...) __kmp_msg_format(kmp_i18n_hnt_##__VA_ARGS__)
  ------------------
  326|      0|                      __kmp_msg_null);
  327|      0|        }
  328|      0|      }
  329|      0|    }
  330|      0|  }
  331|     32|  KA_TRACE(10, ("__kmp_check_stack_overlap: returning\n"));
  332|     32|}
__kmp_serialized_parallel:
 1113|  3.01k|void __kmp_serialized_parallel(ident_t *loc, kmp_int32 global_tid) {
 1114|  3.01k|  kmp_info_t *this_thr;
 1115|  3.01k|  kmp_team_t *serial_team;
 1116|       |
 1117|  3.01k|  KC_TRACE(10, ("__kmpc_serialized_parallel: called by T#%d\n", global_tid));
 1118|       |
 1119|       |  /* Skip all this code for autopar serialized loops since it results in
 1120|       |     unacceptable overhead */
 1121|  3.01k|  if (loc != NULL && (loc->flags & KMP_IDENT_AUTOPAR))
  ------------------
  |  Branch (1121:7): [True: 3.01k, False: 0]
  |  Branch (1121:22): [True: 0, False: 3.01k]
  ------------------
 1122|      0|    return;
 1123|       |
 1124|  3.01k|  if (!TCR_4(__kmp_init_parallel))
  ------------------
  |  | 1127|  3.01k|#define TCR_4(a) (a)
  ------------------
  |  Branch (1124:7): [True: 0, False: 3.01k]
  ------------------
 1125|      0|    __kmp_parallel_initialize();
 1126|  3.01k|  __kmp_resume_if_soft_paused();
 1127|       |
 1128|  3.01k|  this_thr = __kmp_threads[global_tid];
 1129|  3.01k|  serial_team = this_thr->th.th_serial_team;
 1130|       |
 1131|       |  /* utilize the serialized team held by this thread */
 1132|  3.01k|  KMP_DEBUG_ASSERT(serial_team);
 1133|  3.01k|  KMP_MB();
 1134|       |
 1135|  3.01k|  if (__kmp_tasking_mode != tskm_immediate_exec) {
  ------------------
  |  Branch (1135:7): [True: 3.01k, False: 0]
  ------------------
 1136|  3.01k|    KMP_DEBUG_ASSERT(
 1137|  3.01k|        this_thr->th.th_task_team ==
 1138|  3.01k|        this_thr->th.th_team->t.t_task_team[this_thr->th.th_task_state]);
 1139|  3.01k|    KMP_DEBUG_ASSERT(serial_team->t.t_task_team[this_thr->th.th_task_state] ==
 1140|  3.01k|                     NULL);
 1141|  3.01k|    KA_TRACE(20, ("__kmpc_serialized_parallel: T#%d pushing task_team %p / "
 1142|  3.01k|                  "team %p, new task_team = NULL\n",
 1143|  3.01k|                  global_tid, this_thr->th.th_task_team, this_thr->th.th_team));
 1144|  3.01k|    this_thr->th.th_task_team = NULL;
 1145|  3.01k|  }
 1146|       |
 1147|  3.01k|  kmp_proc_bind_t proc_bind = this_thr->th.th_set_proc_bind;
 1148|  3.01k|  if (this_thr->th.th_current_task->td_icvs.proc_bind == proc_bind_false) {
  ------------------
  |  Branch (1148:7): [True: 3.01k, False: 0]
  ------------------
 1149|  3.01k|    proc_bind = proc_bind_false;
 1150|  3.01k|  } else if (proc_bind == proc_bind_default) {
  ------------------
  |  Branch (1150:14): [True: 0, False: 0]
  ------------------
 1151|       |    // No proc_bind clause was specified, so use the current value
 1152|       |    // of proc-bind-var for this parallel region.
 1153|      0|    proc_bind = this_thr->th.th_current_task->td_icvs.proc_bind;
 1154|      0|  }
 1155|       |  // Reset for next parallel region
 1156|  3.01k|  this_thr->th.th_set_proc_bind = proc_bind_default;
 1157|       |
 1158|       |  // Reset num_threads for next parallel region
 1159|  3.01k|  this_thr->th.th_set_nproc = 0;
 1160|       |
 1161|  3.01k|#if OMPT_SUPPORT
 1162|  3.01k|  ompt_data_t ompt_parallel_data = ompt_data_none;
  ------------------
  |  | 1408|  3.01k|#define ompt_data_none {0}
  ------------------
 1163|  3.01k|  void *codeptr = OMPT_LOAD_RETURN_ADDRESS(global_tid);
  ------------------
  |  |   93|  3.01k|#define OMPT_LOAD_RETURN_ADDRESS(gtid) __ompt_load_return_address(gtid)
  ------------------
 1164|  3.01k|  if (ompt_enabled.enabled &&
  ------------------
  |  Branch (1164:7): [True: 0, False: 3.01k]
  ------------------
 1165|      0|      this_thr->th.ompt_thread_info.state != ompt_state_overhead) {
  ------------------
  |  Branch (1165:7): [True: 0, False: 0]
  ------------------
 1166|       |
 1167|      0|    ompt_task_info_t *parent_task_info;
 1168|      0|    parent_task_info = OMPT_CUR_TASK_INFO(this_thr);
  ------------------
  |  |   68|      0|#define OMPT_CUR_TASK_INFO(thr) (&((thr)->th.th_current_task->ompt_task_info))
  ------------------
 1169|       |
 1170|      0|    parent_task_info->frame.enter_frame.ptr = OMPT_GET_FRAME_ADDRESS(0);
  ------------------
  |  |  109|      0|#define OMPT_GET_FRAME_ADDRESS(level) __builtin_frame_address(level)
  ------------------
 1171|      0|    if (ompt_enabled.ompt_callback_parallel_begin) {
  ------------------
  |  Branch (1171:9): [True: 0, False: 0]
  ------------------
 1172|      0|      int team_size = 1;
 1173|       |
 1174|      0|      ompt_callbacks.ompt_callback(ompt_callback_parallel_begin)(
  ------------------
  |  |   27|      0|#define ompt_callback(e) e##_callback
  ------------------
 1175|      0|          &(parent_task_info->task_data), &(parent_task_info->frame),
 1176|      0|          &ompt_parallel_data, team_size,
 1177|      0|          ompt_parallel_invoker_program | ompt_parallel_team, codeptr);
 1178|      0|    }
 1179|      0|  }
 1180|  3.01k|#endif // OMPT_SUPPORT
 1181|       |
 1182|  3.01k|  if (this_thr->th.th_team != serial_team) {
  ------------------
  |  Branch (1182:7): [True: 3.01k, False: 0]
  ------------------
 1183|       |    // Nested level will be an index in the nested nthreads array
 1184|  3.01k|    int level = this_thr->th.th_team->t.t_level;
 1185|       |
 1186|  3.01k|    if (serial_team->t.t_serialized) {
  ------------------
  |  Branch (1186:9): [True: 0, False: 3.01k]
  ------------------
 1187|       |      /* this serial team was already used
 1188|       |         TODO increase performance by making this locks more specific */
 1189|      0|      kmp_team_t *new_team;
 1190|       |
 1191|      0|      __kmp_acquire_bootstrap_lock(&__kmp_forkjoin_lock);
 1192|       |
 1193|      0|      new_team =
 1194|      0|          __kmp_allocate_team(this_thr->th.th_root, 1, 1,
 1195|      0|#if OMPT_SUPPORT
 1196|      0|                              ompt_parallel_data,
 1197|      0|#endif
 1198|      0|                              proc_bind, &this_thr->th.th_current_task->td_icvs,
 1199|      0|                              0 USE_NESTED_HOT_ARG(NULL));
  ------------------
  |  |  165|      0|#define USE_NESTED_HOT_ARG(x) , x
  ------------------
 1200|      0|      __kmp_release_bootstrap_lock(&__kmp_forkjoin_lock);
 1201|      0|      KMP_ASSERT(new_team);
  ------------------
  |  |   50|      0|  if (!(cond)) {                                                               \
  |  |  ------------------
  |  |  |  Branch (50:7): [True: 0, False: 0]
  |  |  ------------------
  |  |   51|      0|    __kmp_debug_assert("assertion failure", __FILE__, __LINE__);               \
  |  |   52|      0|  }
  ------------------
 1202|       |
 1203|       |      /* setup new serialized team and install it */
 1204|      0|      new_team->t.t_threads[0] = this_thr;
 1205|      0|      new_team->t.t_parent = this_thr->th.th_team;
 1206|      0|      serial_team = new_team;
 1207|      0|      this_thr->th.th_serial_team = serial_team;
 1208|       |
 1209|      0|      KF_TRACE(
 1210|      0|          10,
 1211|      0|          ("__kmpc_serialized_parallel: T#%d allocated new serial team %p\n",
 1212|      0|           global_tid, serial_team));
 1213|       |
 1214|       |      /* TODO the above breaks the requirement that if we run out of resources,
 1215|       |         then we can still guarantee that serialized teams are ok, since we may
 1216|       |         need to allocate a new one */
 1217|  3.01k|    } else {
 1218|  3.01k|      KF_TRACE(
 1219|  3.01k|          10,
 1220|  3.01k|          ("__kmpc_serialized_parallel: T#%d reusing cached serial team %p\n",
 1221|  3.01k|           global_tid, serial_team));
 1222|  3.01k|    }
 1223|       |
 1224|       |    /* we have to initialize this serial team */
 1225|  3.01k|    KMP_DEBUG_ASSERT(serial_team->t.t_threads);
 1226|  3.01k|    KMP_DEBUG_ASSERT(serial_team->t.t_threads[0] == this_thr);
 1227|  3.01k|    KMP_DEBUG_ASSERT(this_thr->th.th_team != serial_team);
 1228|  3.01k|    serial_team->t.t_ident = loc;
 1229|  3.01k|    serial_team->t.t_serialized = 1;
 1230|  3.01k|    serial_team->t.t_nproc = 1;
 1231|  3.01k|    serial_team->t.t_parent = this_thr->th.th_team;
 1232|  3.01k|    serial_team->t.t_sched.sched = this_thr->th.th_team->t.t_sched.sched;
 1233|  3.01k|    this_thr->th.th_team = serial_team;
 1234|  3.01k|    serial_team->t.t_master_tid = this_thr->th.th_info.ds.ds_tid;
 1235|       |
 1236|  3.01k|    KF_TRACE(10, ("__kmpc_serialized_parallel: T#%d curtask=%p\n", global_tid,
 1237|  3.01k|                  this_thr->th.th_current_task));
 1238|  3.01k|    KMP_ASSERT(this_thr->th.th_current_task->td_flags.executing == 1);
  ------------------
  |  |   50|  3.01k|  if (!(cond)) {                                                               \
  |  |  ------------------
  |  |  |  Branch (50:7): [True: 0, False: 3.01k]
  |  |  ------------------
  |  |   51|      0|    __kmp_debug_assert("assertion failure", __FILE__, __LINE__);               \
  |  |   52|      0|  }
  ------------------
 1239|  3.01k|    this_thr->th.th_current_task->td_flags.executing = 0;
 1240|       |
 1241|  3.01k|    __kmp_push_current_task_to_thread(this_thr, serial_team, 0);
 1242|       |
 1243|       |    /* TODO: GEH: do ICVs work for nested serialized teams? Don't we need an
 1244|       |       implicit task for each serialized task represented by
 1245|       |       team->t.t_serialized? */
 1246|  3.01k|    copy_icvs(&this_thr->th.th_current_task->td_icvs,
 1247|  3.01k|              &this_thr->th.th_current_task->td_parent->td_icvs);
 1248|       |
 1249|       |    // Thread value exists in the nested nthreads array for the next nested
 1250|       |    // level
 1251|  3.01k|    if (__kmp_nested_nth.used && (level + 1 < __kmp_nested_nth.used)) {
  ------------------
  |  Branch (1251:9): [True: 0, False: 3.01k]
  |  Branch (1251:34): [True: 0, False: 0]
  ------------------
 1252|      0|      this_thr->th.th_current_task->td_icvs.nproc =
 1253|      0|          __kmp_nested_nth.nth[level + 1];
 1254|      0|    }
 1255|       |
 1256|  3.01k|    if (__kmp_nested_proc_bind.used &&
  ------------------
  |  Branch (1256:9): [True: 3.01k, False: 0]
  ------------------
 1257|  3.01k|        (level + 1 < __kmp_nested_proc_bind.used)) {
  ------------------
  |  Branch (1257:9): [True: 0, False: 3.01k]
  ------------------
 1258|      0|      this_thr->th.th_current_task->td_icvs.proc_bind =
 1259|      0|          __kmp_nested_proc_bind.bind_types[level + 1];
 1260|      0|    }
 1261|       |
 1262|       |#if USE_DEBUGGER
 1263|       |    serial_team->t.t_pkfn = (microtask_t)(~0); // For the debugger.
 1264|       |#endif
 1265|  3.01k|    this_thr->th.th_info.ds.ds_tid = 0;
 1266|       |
 1267|       |    /* set thread cache values */
 1268|  3.01k|    this_thr->th.th_team_nproc = 1;
 1269|  3.01k|    this_thr->th.th_team_master = this_thr;
 1270|  3.01k|    this_thr->th.th_team_serialized = 1;
 1271|       |
 1272|  3.01k|    serial_team->t.t_level = serial_team->t.t_parent->t.t_level + 1;
 1273|  3.01k|    serial_team->t.t_active_level = serial_team->t.t_parent->t.t_active_level;
 1274|  3.01k|    serial_team->t.t_def_allocator = this_thr->th.th_def_allocator; // save
 1275|       |
 1276|  3.01k|    propagateFPControl(serial_team);
 1277|       |
 1278|       |    /* check if we need to allocate dispatch buffers stack */
 1279|  3.01k|    KMP_DEBUG_ASSERT(serial_team->t.t_dispatch);
 1280|  3.01k|    if (!serial_team->t.t_dispatch->th_disp_buffer) {
  ------------------
  |  Branch (1280:9): [True: 3.01k, False: 0]
  ------------------
 1281|  3.01k|      serial_team->t.t_dispatch->th_disp_buffer =
 1282|  3.01k|          (dispatch_private_info_t *)__kmp_allocate(
  ------------------
  |  | 3617|  3.01k|#define __kmp_allocate(size) ___kmp_allocate((size)KMP_SRC_LOC_CURR)
  ------------------
 1283|  3.01k|              sizeof(dispatch_private_info_t));
 1284|  3.01k|    }
 1285|  3.01k|    this_thr->th.th_dispatch = serial_team->t.t_dispatch;
 1286|       |
 1287|  3.01k|    KMP_MB();
 1288|       |
 1289|  3.01k|  } else {
 1290|       |    /* this serialized team is already being used,
 1291|       |     * that's fine, just add another nested level */
 1292|      0|    KMP_DEBUG_ASSERT(this_thr->th.th_team == serial_team);
 1293|      0|    KMP_DEBUG_ASSERT(serial_team->t.t_threads);
 1294|      0|    KMP_DEBUG_ASSERT(serial_team->t.t_threads[0] == this_thr);
 1295|      0|    ++serial_team->t.t_serialized;
 1296|      0|    this_thr->th.th_team_serialized = serial_team->t.t_serialized;
 1297|       |
 1298|       |    // Nested level will be an index in the nested nthreads array
 1299|      0|    int level = this_thr->th.th_team->t.t_level;
 1300|       |    // Thread value exists in the nested nthreads array for the next nested
 1301|       |    // level
 1302|      0|    if (__kmp_nested_nth.used && (level + 1 < __kmp_nested_nth.used)) {
  ------------------
  |  Branch (1302:9): [True: 0, False: 0]
  |  Branch (1302:34): [True: 0, False: 0]
  ------------------
 1303|      0|      this_thr->th.th_current_task->td_icvs.nproc =
 1304|      0|          __kmp_nested_nth.nth[level + 1];
 1305|      0|    }
 1306|      0|    serial_team->t.t_level++;
 1307|      0|    KF_TRACE(10, ("__kmpc_serialized_parallel: T#%d increasing nesting level "
 1308|      0|                  "of serial team %p to %d\n",
 1309|      0|                  global_tid, serial_team, serial_team->t.t_level));
 1310|       |
 1311|       |    /* allocate/push dispatch buffers stack */
 1312|      0|    KMP_DEBUG_ASSERT(serial_team->t.t_dispatch);
 1313|      0|    {
 1314|      0|      dispatch_private_info_t *disp_buffer =
 1315|      0|          (dispatch_private_info_t *)__kmp_allocate(
  ------------------
  |  | 3617|      0|#define __kmp_allocate(size) ___kmp_allocate((size)KMP_SRC_LOC_CURR)
  ------------------
 1316|      0|              sizeof(dispatch_private_info_t));
 1317|      0|      disp_buffer->next = serial_team->t.t_dispatch->th_disp_buffer;
 1318|      0|      serial_team->t.t_dispatch->th_disp_buffer = disp_buffer;
 1319|      0|    }
 1320|      0|    this_thr->th.th_dispatch = serial_team->t.t_dispatch;
 1321|       |
 1322|      0|    KMP_MB();
 1323|      0|  }
 1324|  3.01k|  KMP_CHECK_UPDATE(serial_team->t.t_cancel_request, cancel_noreq);
  ------------------
  |  | 2280|  3.01k|  if ((a) != (b))                                                              \
  |  |  ------------------
  |  |  |  Branch (2280:7): [True: 0, False: 3.01k]
  |  |  ------------------
  |  | 2281|  3.01k|  (a) = (b)
  ------------------
 1325|       |
 1326|       |  // Perform the display affinity functionality for
 1327|       |  // serialized parallel regions
 1328|  3.01k|  if (__kmp_display_affinity) {
  ------------------
  |  Branch (1328:7): [True: 0, False: 3.01k]
  ------------------
 1329|      0|    if (this_thr->th.th_prev_level != serial_team->t.t_level ||
  ------------------
  |  Branch (1329:9): [True: 0, False: 0]
  ------------------
 1330|      0|        this_thr->th.th_prev_num_threads != 1) {
  ------------------
  |  Branch (1330:9): [True: 0, False: 0]
  ------------------
 1331|       |      // NULL means use the affinity-format-var ICV
 1332|      0|      __kmp_aux_display_affinity(global_tid, NULL);
 1333|      0|      this_thr->th.th_prev_level = serial_team->t.t_level;
 1334|      0|      this_thr->th.th_prev_num_threads = 1;
 1335|      0|    }
 1336|      0|  }
 1337|       |
 1338|  3.01k|  if (__kmp_env_consistency_check)
  ------------------
  |  Branch (1338:7): [True: 0, False: 3.01k]
  ------------------
 1339|      0|    __kmp_push_parallel(global_tid, NULL);
 1340|  3.01k|#if OMPT_SUPPORT
 1341|  3.01k|  serial_team->t.ompt_team_info.master_return_address = codeptr;
 1342|  3.01k|  if (ompt_enabled.enabled &&
  ------------------
  |  Branch (1342:7): [True: 0, False: 3.01k]
  ------------------
 1343|      0|      this_thr->th.ompt_thread_info.state != ompt_state_overhead) {
  ------------------
  |  Branch (1343:7): [True: 0, False: 0]
  ------------------
 1344|      0|    OMPT_CUR_TASK_INFO(this_thr)->frame.exit_frame.ptr =
  ------------------
  |  |   68|      0|#define OMPT_CUR_TASK_INFO(thr) (&((thr)->th.th_current_task->ompt_task_info))
  ------------------
 1345|      0|        OMPT_GET_FRAME_ADDRESS(0);
  ------------------
  |  |  109|      0|#define OMPT_GET_FRAME_ADDRESS(level) __builtin_frame_address(level)
  ------------------
 1346|       |
 1347|      0|    ompt_lw_taskteam_t lw_taskteam;
 1348|      0|    __ompt_lw_taskteam_init(&lw_taskteam, this_thr, global_tid,
 1349|      0|                            &ompt_parallel_data, codeptr);
 1350|       |
 1351|      0|    __ompt_lw_taskteam_link(&lw_taskteam, this_thr, 1);
 1352|       |    // don't use lw_taskteam after linking. content was swaped
 1353|       |
 1354|       |    /* OMPT implicit task begin */
 1355|      0|    if (ompt_enabled.ompt_callback_implicit_task) {
  ------------------
  |  Branch (1355:9): [True: 0, False: 0]
  ------------------
 1356|      0|      ompt_callbacks.ompt_callback(ompt_callback_implicit_task)(
  ------------------
  |  |   27|      0|#define ompt_callback(e) e##_callback
  ------------------
 1357|      0|          ompt_scope_begin, OMPT_CUR_TEAM_DATA(this_thr),
  ------------------
  |  |   73|      0|  (&((thr)->th.th_team->t.ompt_team_info.parallel_data))
  ------------------
 1358|      0|          OMPT_CUR_TASK_DATA(this_thr), 1, __kmp_tid_from_gtid(global_tid),
  ------------------
  |  |   70|      0|  (&((thr)->th.th_current_task->ompt_task_info.task_data))
  ------------------
 1359|      0|          ompt_task_implicit); // TODO: Can this be ompt_task_initial?
 1360|      0|      OMPT_CUR_TASK_INFO(this_thr)->thread_num =
  ------------------
  |  |   68|      0|#define OMPT_CUR_TASK_INFO(thr) (&((thr)->th.th_current_task->ompt_task_info))
  ------------------
 1361|      0|          __kmp_tid_from_gtid(global_tid);
 1362|      0|    }
 1363|       |
 1364|       |    /* OMPT state */
 1365|      0|    this_thr->th.ompt_thread_info.state = ompt_state_work_parallel;
 1366|      0|    OMPT_CUR_TASK_INFO(this_thr)->frame.exit_frame.ptr =
  ------------------
  |  |   68|      0|#define OMPT_CUR_TASK_INFO(thr) (&((thr)->th.th_current_task->ompt_task_info))
  ------------------
 1367|      0|        OMPT_GET_FRAME_ADDRESS(0);
  ------------------
  |  |  109|      0|#define OMPT_GET_FRAME_ADDRESS(level) __builtin_frame_address(level)
  ------------------
 1368|      0|  }
 1369|  3.01k|#endif
 1370|  3.01k|}
__kmp_fork_call:
 1863|  1.35k|                    kmp_va_list ap) {
 1864|  1.35k|  void **argv;
 1865|  1.35k|  int i;
 1866|  1.35k|  int master_tid;
 1867|  1.35k|  int master_this_cons;
 1868|  1.35k|  kmp_team_t *team;
 1869|  1.35k|  kmp_team_t *parent_team;
 1870|  1.35k|  kmp_info_t *master_th;
 1871|  1.35k|  kmp_root_t *root;
 1872|  1.35k|  int nthreads;
 1873|  1.35k|  int master_active;
 1874|  1.35k|  int master_set_numthreads;
 1875|  1.35k|  int level;
 1876|  1.35k|  int active_level;
 1877|  1.35k|  int teams_level;
 1878|  1.35k|#if KMP_NESTED_HOT_TEAMS
 1879|  1.35k|  kmp_hot_team_ptr_t **p_hot_teams;
 1880|  1.35k|#endif
 1881|  1.35k|  { // KMP_TIME_BLOCK
 1882|  1.35k|    KMP_TIME_DEVELOPER_PARTITIONED_BLOCK(KMP_fork_call);
  ------------------
  |  | 1008|  1.35k|#define KMP_TIME_DEVELOPER_PARTITIONED_BLOCK(n) ((void)0)
  ------------------
 1883|  1.35k|    KMP_COUNT_VALUE(OMP_PARALLEL_args, argc);
  ------------------
  |  | 1000|  1.35k|#define KMP_COUNT_VALUE(n, v) ((void)0)
  ------------------
 1884|       |
 1885|  1.35k|    KA_TRACE(20, ("__kmp_fork_call: enter T#%d\n", gtid));
 1886|  1.35k|    if (__kmp_stkpadding > 0 && __kmp_root[gtid] != NULL) {
  ------------------
  |  Branch (1886:9): [True: 0, False: 1.35k]
  |  Branch (1886:33): [True: 0, False: 0]
  ------------------
 1887|       |      /* Some systems prefer the stack for the root thread(s) to start with */
 1888|       |      /* some gap from the parent stack to prevent false sharing. */
 1889|      0|      void *dummy = KMP_ALLOCA(__kmp_stkpadding);
  ------------------
  |  |   59|      0|#define KMP_ALLOCA alloca
  ------------------
 1890|       |      /* These 2 lines below are so this does not get optimized out */
 1891|      0|      if (__kmp_stkpadding > KMP_MAX_STKPADDING)
  ------------------
  |  | 1178|      0|#define KMP_MAX_STKPADDING (2 * 1024 * 1024)
  ------------------
  |  Branch (1891:11): [True: 0, False: 0]
  ------------------
 1892|      0|        __kmp_stkpadding += (short)((kmp_int64)dummy);
 1893|      0|    }
 1894|       |
 1895|       |    /* initialize if needed */
 1896|  1.35k|    KMP_DEBUG_ASSERT(
 1897|  1.35k|        __kmp_init_serial); // AC: potentially unsafe, not in sync with shutdown
 1898|  1.35k|    if (!TCR_4(__kmp_init_parallel))
  ------------------
  |  | 1127|  1.35k|#define TCR_4(a) (a)
  ------------------
  |  Branch (1898:9): [True: 1, False: 1.35k]
  ------------------
 1899|      1|      __kmp_parallel_initialize();
 1900|  1.35k|    __kmp_resume_if_soft_paused();
 1901|       |
 1902|       |    /* setup current data */
 1903|       |    // AC: potentially unsafe, not in sync with library shutdown,
 1904|       |    // __kmp_threads can be freed
 1905|  1.35k|    master_th = __kmp_threads[gtid];
 1906|       |
 1907|  1.35k|    parent_team = master_th->th.th_team;
 1908|  1.35k|    master_tid = master_th->th.th_info.ds.ds_tid;
 1909|  1.35k|    master_this_cons = master_th->th.th_local.this_construct;
 1910|  1.35k|    root = master_th->th.th_root;
 1911|  1.35k|    master_active = root->r.r_active;
 1912|  1.35k|    master_set_numthreads = master_th->th.th_set_nproc;
 1913|       |
 1914|  1.35k|#if OMPT_SUPPORT
 1915|  1.35k|    ompt_data_t ompt_parallel_data = ompt_data_none;
  ------------------
  |  | 1408|  1.35k|#define ompt_data_none {0}
  ------------------
 1916|  1.35k|    ompt_data_t *parent_task_data;
 1917|  1.35k|    ompt_frame_t *ompt_frame;
 1918|  1.35k|    void *return_address = NULL;
 1919|       |
 1920|  1.35k|    if (ompt_enabled.enabled) {
  ------------------
  |  Branch (1920:9): [True: 0, False: 1.35k]
  ------------------
 1921|      0|      __ompt_get_task_info_internal(0, NULL, &parent_task_data, &ompt_frame,
 1922|      0|                                    NULL, NULL);
 1923|      0|      return_address = OMPT_LOAD_RETURN_ADDRESS(gtid);
  ------------------
  |  |   93|      0|#define OMPT_LOAD_RETURN_ADDRESS(gtid) __ompt_load_return_address(gtid)
  ------------------
 1924|      0|    }
 1925|  1.35k|#endif
 1926|       |
 1927|       |    // Assign affinity to root thread if it hasn't happened yet
 1928|  1.35k|    __kmp_assign_root_init_mask();
 1929|       |
 1930|       |    // Nested level will be an index in the nested nthreads array
 1931|  1.35k|    level = parent_team->t.t_level;
 1932|       |    // used to launch non-serial teams even if nested is not allowed
 1933|  1.35k|    active_level = parent_team->t.t_active_level;
 1934|       |    // needed to check nesting inside the teams
 1935|  1.35k|    teams_level = master_th->th.th_teams_level;
 1936|  1.35k|#if KMP_NESTED_HOT_TEAMS
 1937|  1.35k|    p_hot_teams = &master_th->th.th_hot_teams;
 1938|  1.35k|    if (*p_hot_teams == NULL && __kmp_hot_teams_max_level > 0) {
  ------------------
  |  Branch (1938:9): [True: 1, False: 1.35k]
  |  Branch (1938:33): [True: 1, False: 0]
  ------------------
 1939|      1|      *p_hot_teams = (kmp_hot_team_ptr_t *)__kmp_allocate(
  ------------------
  |  | 3617|      1|#define __kmp_allocate(size) ___kmp_allocate((size)KMP_SRC_LOC_CURR)
  ------------------
 1940|      1|          sizeof(kmp_hot_team_ptr_t) * __kmp_hot_teams_max_level);
 1941|      1|      (*p_hot_teams)[0].hot_team = root->r.r_hot_team;
 1942|       |      // it is either actual or not needed (when active_level > 0)
 1943|      1|      (*p_hot_teams)[0].hot_team_nth = 1;
 1944|      1|    }
 1945|  1.35k|#endif
 1946|       |
 1947|  1.35k|#if OMPT_SUPPORT
 1948|  1.35k|    if (ompt_enabled.enabled) {
  ------------------
  |  Branch (1948:9): [True: 0, False: 1.35k]
  ------------------
 1949|      0|      if (ompt_enabled.ompt_callback_parallel_begin) {
  ------------------
  |  Branch (1949:11): [True: 0, False: 0]
  ------------------
 1950|      0|        int team_size = master_set_numthreads
  ------------------
  |  Branch (1950:25): [True: 0, False: 0]
  ------------------
 1951|      0|                            ? master_set_numthreads
 1952|      0|                            : get__nproc_2(parent_team, master_tid);
  ------------------
  |  | 2298|      0|  ((xteam)->t.t_threads[(xtid)]->th.th_current_task->td_icvs.nproc)
  ------------------
 1953|      0|        int flags = OMPT_INVOKER(call_context) |
  ------------------
  |  |   24|      0|  ((x == fork_context_gnu) ? ompt_parallel_invoker_program                     \
  |  |  ------------------
  |  |  |  Branch (24:4): [True: 0, False: 0]
  |  |  ------------------
  |  |   25|      0|                           : ompt_parallel_invoker_runtime)
  ------------------
 1954|      0|                    ((microtask == (microtask_t)__kmp_teams_master)
  ------------------
  |  Branch (1954:22): [True: 0, False: 0]
  ------------------
 1955|      0|                         ? ompt_parallel_league
 1956|      0|                         : ompt_parallel_team);
 1957|      0|        ompt_callbacks.ompt_callback(ompt_callback_parallel_begin)(
  ------------------
  |  |   27|      0|#define ompt_callback(e) e##_callback
  ------------------
 1958|      0|            parent_task_data, ompt_frame, &ompt_parallel_data, team_size, flags,
 1959|      0|            return_address);
 1960|      0|      }
 1961|      0|      master_th->th.ompt_thread_info.state = ompt_state_overhead;
 1962|      0|    }
 1963|  1.35k|#endif
 1964|       |
 1965|  1.35k|    master_th->th.th_ident = loc;
 1966|       |
 1967|       |    // Parallel closely nested in teams construct:
 1968|  1.35k|    if (__kmp_is_fork_in_teams(master_th, microtask, level, teams_level, ap)) {
  ------------------
  |  Branch (1968:9): [True: 0, False: 1.35k]
  ------------------
 1969|      0|      return __kmp_fork_in_teams(loc, gtid, parent_team, argc, master_th, root,
 1970|      0|                                 call_context, microtask, invoker,
 1971|      0|                                 master_set_numthreads, level,
 1972|      0|#if OMPT_SUPPORT
 1973|      0|                                 ompt_parallel_data, return_address,
 1974|      0|#endif
 1975|      0|                                 ap);
 1976|      0|    } // End parallel closely nested in teams construct
 1977|       |
 1978|       |#if KMP_DEBUG
 1979|       |    if (__kmp_tasking_mode != tskm_immediate_exec) {
 1980|       |      KMP_DEBUG_ASSERT(master_th->th.th_task_team ==
 1981|       |                       parent_team->t.t_task_team[master_th->th.th_task_state]);
 1982|       |    }
 1983|       |#endif
 1984|       |
 1985|       |    // Need this to happen before we determine the number of threads, not while
 1986|       |    // we are allocating the team
 1987|       |    //__kmp_push_current_task_to_thread(master_th, parent_team, 0);
 1988|       |
 1989|       |    // Determine the number of threads
 1990|  1.35k|    int enter_teams =
 1991|  1.35k|        __kmp_is_entering_teams(active_level, level, teams_level, ap);
 1992|  1.35k|    if ((!enter_teams &&
  ------------------
  |  Branch (1992:10): [True: 1.35k, False: 0]
  ------------------
 1993|  1.35k|         (parent_team->t.t_active_level >=
  ------------------
  |  Branch (1993:10): [True: 0, False: 1.35k]
  ------------------
 1994|  1.35k|          master_th->th.th_current_task->td_icvs.max_active_levels)) ||
 1995|  1.35k|        (__kmp_library == library_serial)) {
  ------------------
  |  Branch (1995:9): [True: 0, False: 1.35k]
  ------------------
 1996|      0|      KC_TRACE(10, ("__kmp_fork_call: T#%d serializing team\n", gtid));
 1997|      0|      nthreads = 1;
 1998|  1.35k|    } else {
 1999|  1.35k|      nthreads = master_set_numthreads
  ------------------
  |  Branch (1999:18): [True: 1.35k, False: 0]
  ------------------
 2000|  1.35k|                     ? master_set_numthreads
 2001|       |                     // TODO: get nproc directly from current task
 2002|  1.35k|                     : get__nproc_2(parent_team, master_tid);
  ------------------
  |  | 2298|  1.35k|  ((xteam)->t.t_threads[(xtid)]->th.th_current_task->td_icvs.nproc)
  ------------------
 2003|       |      // Check if we need to take forkjoin lock? (no need for serialized
 2004|       |      // parallel out of teams construct).
 2005|  1.35k|      if (nthreads > 1) {
  ------------------
  |  Branch (2005:11): [True: 1.35k, False: 0]
  ------------------
 2006|       |        /* determine how many new threads we can use */
 2007|  1.35k|        __kmp_acquire_bootstrap_lock(&__kmp_forkjoin_lock);
 2008|       |        /* AC: If we execute teams from parallel region (on host), then teams
 2009|       |           should be created but each can only have 1 thread if nesting is
 2010|       |           disabled. If teams called from serial region, then teams and their
 2011|       |           threads should be created regardless of the nesting setting. */
 2012|  1.35k|        nthreads = __kmp_reserve_threads(root, parent_team, master_tid,
 2013|  1.35k|                                         nthreads, enter_teams);
 2014|  1.35k|        if (nthreads == 1) {
  ------------------
  |  Branch (2014:13): [True: 0, False: 1.35k]
  ------------------
 2015|       |          // Free lock for single thread execution here; for multi-thread
 2016|       |          // execution it will be freed later after team of threads created
 2017|       |          // and initialized
 2018|      0|          __kmp_release_bootstrap_lock(&__kmp_forkjoin_lock);
 2019|      0|        }
 2020|  1.35k|      }
 2021|  1.35k|    }
 2022|  1.35k|    KMP_DEBUG_ASSERT(nthreads > 0);
 2023|       |
 2024|       |    // If we temporarily changed the set number of threads then restore it now
 2025|  1.35k|    master_th->th.th_set_nproc = 0;
 2026|       |
 2027|  1.35k|    if (nthreads == 1) {
  ------------------
  |  Branch (2027:9): [True: 0, False: 1.35k]
  ------------------
 2028|      0|      return __kmp_serial_fork_call(loc, gtid, call_context, argc, microtask,
 2029|      0|                                    invoker, master_th, parent_team,
 2030|      0|#if OMPT_SUPPORT
 2031|      0|                                    &ompt_parallel_data, &return_address,
 2032|      0|                                    &parent_task_data,
 2033|      0|#endif
 2034|      0|                                    ap);
 2035|      0|    } // if (nthreads == 1)
 2036|       |
 2037|       |    // GEH: only modify the executing flag in the case when not serialized
 2038|       |    //      serialized case is handled in kmpc_serialized_parallel
 2039|  1.35k|    KF_TRACE(10, ("__kmp_fork_call: parent_team_aclevel=%d, master_th=%p, "
 2040|  1.35k|                  "curtask=%p, curtask_max_aclevel=%d\n",
 2041|  1.35k|                  parent_team->t.t_active_level, master_th,
 2042|  1.35k|                  master_th->th.th_current_task,
 2043|  1.35k|                  master_th->th.th_current_task->td_icvs.max_active_levels));
 2044|       |    // TODO: GEH - cannot do this assertion because root thread not set up as
 2045|       |    // executing
 2046|       |    // KMP_ASSERT( master_th->th.th_current_task->td_flags.executing == 1 );
 2047|  1.35k|    master_th->th.th_current_task->td_flags.executing = 0;
 2048|       |
 2049|  1.35k|    if (!master_th->th.th_teams_microtask || level > teams_level) {
  ------------------
  |  Branch (2049:9): [True: 1.35k, False: 0]
  |  Branch (2049:46): [True: 0, False: 0]
  ------------------
 2050|       |      /* Increment our nested depth level */
 2051|  1.35k|      KMP_ATOMIC_INC(&root->r.r_in_parallel);
  ------------------
  |  | 1259|  1.35k|#define KMP_ATOMIC_INC(p) KMP_ATOMIC_OP(fetch_add, p, 1, acq_rel)
  |  |  ------------------
  |  |  |  | 1246|  1.35k|#define KMP_ATOMIC_OP(op, p, v, order) (p)->op(v, std::memory_order_##order)
  |  |  ------------------
  ------------------
 2052|  1.35k|    }
 2053|       |
 2054|       |    // See if we need to make a copy of the ICVs.
 2055|  1.35k|    int nthreads_icv = master_th->th.th_current_task->td_icvs.nproc;
 2056|  1.35k|    if ((level + 1 < __kmp_nested_nth.used) &&
  ------------------
  |  Branch (2056:9): [True: 0, False: 1.35k]
  ------------------
 2057|      0|        (__kmp_nested_nth.nth[level + 1] != nthreads_icv)) {
  ------------------
  |  Branch (2057:9): [True: 0, False: 0]
  ------------------
 2058|      0|      nthreads_icv = __kmp_nested_nth.nth[level + 1];
 2059|  1.35k|    } else {
 2060|  1.35k|      nthreads_icv = 0; // don't update
 2061|  1.35k|    }
 2062|       |
 2063|       |    // Figure out the proc_bind_policy for the new team.
 2064|  1.35k|    kmp_proc_bind_t proc_bind = master_th->th.th_set_proc_bind;
 2065|       |    // proc_bind_default means don't update
 2066|  1.35k|    kmp_proc_bind_t proc_bind_icv = proc_bind_default;
 2067|  1.35k|    if (master_th->th.th_current_task->td_icvs.proc_bind == proc_bind_false) {
  ------------------
  |  Branch (2067:9): [True: 1.35k, False: 0]
  ------------------
 2068|  1.35k|      proc_bind = proc_bind_false;
 2069|  1.35k|    } else {
 2070|       |      // No proc_bind clause specified; use current proc-bind-var for this
 2071|       |      // parallel region
 2072|      0|      if (proc_bind == proc_bind_default) {
  ------------------
  |  Branch (2072:11): [True: 0, False: 0]
  ------------------
 2073|      0|        proc_bind = master_th->th.th_current_task->td_icvs.proc_bind;
 2074|      0|      }
 2075|       |      // Have teams construct take proc_bind value from KMP_TEAMS_PROC_BIND
 2076|      0|      if (master_th->th.th_teams_microtask &&
  ------------------
  |  Branch (2076:11): [True: 0, False: 0]
  ------------------
 2077|      0|          microtask == (microtask_t)__kmp_teams_master) {
  ------------------
  |  Branch (2077:11): [True: 0, False: 0]
  ------------------
 2078|      0|        proc_bind = __kmp_teams_proc_bind;
 2079|      0|      }
 2080|       |      /* else: The proc_bind policy was specified explicitly on parallel clause.
 2081|       |         This overrides proc-bind-var for this parallel region, but does not
 2082|       |         change proc-bind-var. */
 2083|       |      // Figure the value of proc-bind-var for the child threads.
 2084|      0|      if ((level + 1 < __kmp_nested_proc_bind.used) &&
  ------------------
  |  Branch (2084:11): [True: 0, False: 0]
  ------------------
 2085|      0|          (__kmp_nested_proc_bind.bind_types[level + 1] !=
  ------------------
  |  Branch (2085:11): [True: 0, False: 0]
  ------------------
 2086|      0|           master_th->th.th_current_task->td_icvs.proc_bind)) {
 2087|       |        // Do not modify the proc bind icv for the two teams construct forks
 2088|       |        // They just let the proc bind icv pass through
 2089|      0|        if (!master_th->th.th_teams_microtask ||
  ------------------
  |  Branch (2089:13): [True: 0, False: 0]
  ------------------
 2090|      0|            !(microtask == (microtask_t)__kmp_teams_master || ap == NULL))
  ------------------
  |  Branch (2090:15): [True: 0, False: 0]
  |  Branch (2090:63): [True: 0, False: 0]
  ------------------
 2091|      0|          proc_bind_icv = __kmp_nested_proc_bind.bind_types[level + 1];
 2092|      0|      }
 2093|      0|    }
 2094|       |
 2095|       |    // Reset for next parallel region
 2096|  1.35k|    master_th->th.th_set_proc_bind = proc_bind_default;
 2097|       |
 2098|  1.35k|    if ((nthreads_icv > 0) || (proc_bind_icv != proc_bind_default)) {
  ------------------
  |  Branch (2098:9): [True: 0, False: 1.35k]
  |  Branch (2098:31): [True: 0, False: 1.35k]
  ------------------
 2099|      0|      kmp_internal_control_t new_icvs;
 2100|      0|      copy_icvs(&new_icvs, &master_th->th.th_current_task->td_icvs);
 2101|      0|      new_icvs.next = NULL;
 2102|      0|      if (nthreads_icv > 0) {
  ------------------
  |  Branch (2102:11): [True: 0, False: 0]
  ------------------
 2103|      0|        new_icvs.nproc = nthreads_icv;
 2104|      0|      }
 2105|      0|      if (proc_bind_icv != proc_bind_default) {
  ------------------
  |  Branch (2105:11): [True: 0, False: 0]
  ------------------
 2106|      0|        new_icvs.proc_bind = proc_bind_icv;
 2107|      0|      }
 2108|       |
 2109|       |      /* allocate a new parallel team */
 2110|      0|      KF_TRACE(10, ("__kmp_fork_call: before __kmp_allocate_team\n"));
 2111|      0|      team = __kmp_allocate_team(root, nthreads, nthreads,
 2112|      0|#if OMPT_SUPPORT
 2113|      0|                                 ompt_parallel_data,
 2114|      0|#endif
 2115|      0|                                 proc_bind, &new_icvs,
 2116|      0|                                 argc USE_NESTED_HOT_ARG(master_th));
  ------------------
  |  |  165|      0|#define USE_NESTED_HOT_ARG(x) , x
  ------------------
 2117|      0|      if (__kmp_barrier_release_pattern[bs_forkjoin_barrier] == bp_dist_bar)
  ------------------
  |  Branch (2117:11): [True: 0, False: 0]
  ------------------
 2118|      0|        copy_icvs((kmp_internal_control_t *)team->t.b->team_icvs, &new_icvs);
 2119|  1.35k|    } else {
 2120|       |      /* allocate a new parallel team */
 2121|  1.35k|      KF_TRACE(10, ("__kmp_fork_call: before __kmp_allocate_team\n"));
 2122|  1.35k|      team = __kmp_allocate_team(root, nthreads, nthreads,
 2123|  1.35k|#if OMPT_SUPPORT
 2124|  1.35k|                                 ompt_parallel_data,
 2125|  1.35k|#endif
 2126|  1.35k|                                 proc_bind,
 2127|  1.35k|                                 &master_th->th.th_current_task->td_icvs,
 2128|  1.35k|                                 argc USE_NESTED_HOT_ARG(master_th));
  ------------------
  |  |  165|  1.35k|#define USE_NESTED_HOT_ARG(x) , x
  ------------------
 2129|  1.35k|      if (__kmp_barrier_release_pattern[bs_forkjoin_barrier] == bp_dist_bar)
  ------------------
  |  Branch (2129:11): [True: 0, False: 1.35k]
  ------------------
 2130|      0|        copy_icvs((kmp_internal_control_t *)team->t.b->team_icvs,
 2131|      0|                  &master_th->th.th_current_task->td_icvs);
 2132|  1.35k|    }
 2133|  1.35k|    KF_TRACE(
 2134|  1.35k|        10, ("__kmp_fork_call: after __kmp_allocate_team - team = %p\n", team));
 2135|       |
 2136|       |    /* setup the new team */
 2137|  1.35k|    KMP_CHECK_UPDATE(team->t.t_master_tid, master_tid);
  ------------------
  |  | 2280|  1.35k|  if ((a) != (b))                                                              \
  |  |  ------------------
  |  |  |  Branch (2280:7): [True: 0, False: 1.35k]
  |  |  ------------------
  |  | 2281|  1.35k|  (a) = (b)
  ------------------
 2138|  1.35k|    KMP_CHECK_UPDATE(team->t.t_master_this_cons, master_this_cons);
  ------------------
  |  | 2280|  1.35k|  if ((a) != (b))                                                              \
  |  |  ------------------
  |  |  |  Branch (2280:7): [True: 0, False: 1.35k]
  |  |  ------------------
  |  | 2281|  1.35k|  (a) = (b)
  ------------------
 2139|  1.35k|    KMP_CHECK_UPDATE(team->t.t_ident, loc);
  ------------------
  |  | 2280|  1.35k|  if ((a) != (b))                                                              \
  |  |  ------------------
  |  |  |  Branch (2280:7): [True: 0, False: 1.35k]
  |  |  ------------------
  |  | 2281|  1.35k|  (a) = (b)
  ------------------
 2140|  1.35k|    KMP_CHECK_UPDATE(team->t.t_parent, parent_team);
  ------------------
  |  | 2280|  1.35k|  if ((a) != (b))                                                              \
  |  |  ------------------
  |  |  |  Branch (2280:7): [True: 0, False: 1.35k]
  |  |  ------------------
  |  | 2281|  1.35k|  (a) = (b)
  ------------------
 2141|  1.35k|    KMP_CHECK_UPDATE_SYNC(team->t.t_pkfn, microtask);
  ------------------
  |  | 2283|  1.35k|  if ((a) != (b))                                                              \
  |  |  ------------------
  |  |  |  Branch (2283:7): [True: 1.35k, False: 0]
  |  |  ------------------
  |  | 2284|  1.35k|  TCW_SYNC_PTR((a), (b))
  |  |  ------------------
  |  |  |  | 1159|  1.35k|#define TCW_SYNC_PTR(a, b) TCW_SYNC_8((a), (b))
  |  |  |  |  ------------------
  |  |  |  |  |  | 1141|  1.35k|#define TCW_SYNC_8(a, b) (a) = (b)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2142|  1.35k|#if OMPT_SUPPORT
 2143|  1.35k|    KMP_CHECK_UPDATE_SYNC(team->t.ompt_team_info.master_return_address,
  ------------------
  |  | 2283|  1.35k|  if ((a) != (b))                                                              \
  |  |  ------------------
  |  |  |  Branch (2283:7): [True: 0, False: 1.35k]
  |  |  ------------------
  |  | 2284|  1.35k|  TCW_SYNC_PTR((a), (b))
  |  |  ------------------
  |  |  |  | 1159|      0|#define TCW_SYNC_PTR(a, b) TCW_SYNC_8((a), (b))
  |  |  |  |  ------------------
  |  |  |  |  |  | 1141|      0|#define TCW_SYNC_8(a, b) (a) = (b)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2144|  1.35k|                          return_address);
 2145|  1.35k|#endif
 2146|  1.35k|    KMP_CHECK_UPDATE(team->t.t_invoke, invoker); // TODO move to root, maybe
  ------------------
  |  | 2280|  1.35k|  if ((a) != (b))                                                              \
  |  |  ------------------
  |  |  |  Branch (2280:7): [True: 1, False: 1.35k]
  |  |  ------------------
  |  | 2281|  1.35k|  (a) = (b)
  ------------------
 2147|       |    // TODO: parent_team->t.t_level == INT_MAX ???
 2148|  1.35k|    if (!master_th->th.th_teams_microtask || level > teams_level) {
  ------------------
  |  Branch (2148:9): [True: 1.35k, False: 0]
  |  Branch (2148:46): [True: 0, False: 0]
  ------------------
 2149|  1.35k|      int new_level = parent_team->t.t_level + 1;
 2150|  1.35k|      KMP_CHECK_UPDATE(team->t.t_level, new_level);
  ------------------
  |  | 2280|  1.35k|  if ((a) != (b))                                                              \
  |  |  ------------------
  |  |  |  Branch (2280:7): [True: 1, False: 1.35k]
  |  |  ------------------
  |  | 2281|  1.35k|  (a) = (b)
  ------------------
 2151|  1.35k|      new_level = parent_team->t.t_active_level + 1;
 2152|  1.35k|      KMP_CHECK_UPDATE(team->t.t_active_level, new_level);
  ------------------
  |  | 2280|  1.35k|  if ((a) != (b))                                                              \
  |  |  ------------------
  |  |  |  Branch (2280:7): [True: 1, False: 1.35k]
  |  |  ------------------
  |  | 2281|  1.35k|  (a) = (b)
  ------------------
 2153|  1.35k|    } else {
 2154|       |      // AC: Do not increase parallel level at start of the teams construct
 2155|      0|      int new_level = parent_team->t.t_level;
 2156|      0|      KMP_CHECK_UPDATE(team->t.t_level, new_level);
  ------------------
  |  | 2280|      0|  if ((a) != (b))                                                              \
  |  |  ------------------
  |  |  |  Branch (2280:7): [True: 0, False: 0]
  |  |  ------------------
  |  | 2281|      0|  (a) = (b)
  ------------------
 2157|      0|      new_level = parent_team->t.t_active_level;
 2158|      0|      KMP_CHECK_UPDATE(team->t.t_active_level, new_level);
  ------------------
  |  | 2280|      0|  if ((a) != (b))                                                              \
  |  |  ------------------
  |  |  |  Branch (2280:7): [True: 0, False: 0]
  |  |  ------------------
  |  | 2281|      0|  (a) = (b)
  ------------------
 2159|      0|    }
 2160|  1.35k|    kmp_r_sched_t new_sched = get__sched_2(parent_team, master_tid);
  ------------------
  |  | 2300|  1.35k|  ((xteam)->t.t_threads[(xtid)]->th.th_current_task->td_icvs.sched)
  ------------------
 2161|       |    // set primary thread's schedule as new run-time schedule
 2162|  1.35k|    KMP_CHECK_UPDATE(team->t.t_sched.sched, new_sched.sched);
  ------------------
  |  | 2280|  1.35k|  if ((a) != (b))                                                              \
  |  |  ------------------
  |  |  |  Branch (2280:7): [True: 0, False: 1.35k]
  |  |  ------------------
  |  | 2281|  1.35k|  (a) = (b)
  ------------------
 2163|       |
 2164|  1.35k|    KMP_CHECK_UPDATE(team->t.t_cancel_request, cancel_noreq);
  ------------------
  |  | 2280|  1.35k|  if ((a) != (b))                                                              \
  |  |  ------------------
  |  |  |  Branch (2280:7): [True: 0, False: 1.35k]
  |  |  ------------------
  |  | 2281|  1.35k|  (a) = (b)
  ------------------
 2165|  1.35k|    KMP_CHECK_UPDATE(team->t.t_def_allocator, master_th->th.th_def_allocator);
  ------------------
  |  | 2280|  1.35k|  if ((a) != (b))                                                              \
  |  |  ------------------
  |  |  |  Branch (2280:7): [True: 1, False: 1.35k]
  |  |  ------------------
  |  | 2281|  1.35k|  (a) = (b)
  ------------------
 2166|       |
 2167|       |    // Update the floating point rounding in the team if required.
 2168|  1.35k|    propagateFPControl(team);
 2169|  1.35k|#if OMPD_SUPPORT
 2170|  1.35k|    if (ompd_state & OMPD_ENABLE_BP)
  ------------------
  |  |   35|  1.35k|#define OMPD_ENABLE_BP 0x1
  ------------------
  |  Branch (2170:9): [True: 0, False: 1.35k]
  ------------------
 2171|      0|      ompd_bp_parallel_begin();
 2172|  1.35k|#endif
 2173|       |
 2174|  1.35k|    if (__kmp_tasking_mode != tskm_immediate_exec) {
  ------------------
  |  Branch (2174:9): [True: 1.35k, False: 0]
  ------------------
 2175|       |      // Set primary thread's task team to team's task team. Unless this is hot
 2176|       |      // team, it should be NULL.
 2177|  1.35k|      KMP_DEBUG_ASSERT(master_th->th.th_task_team ==
 2178|  1.35k|                       parent_team->t.t_task_team[master_th->th.th_task_state]);
 2179|  1.35k|      KA_TRACE(20, ("__kmp_fork_call: Primary T#%d pushing task_team %p / team "
 2180|  1.35k|                    "%p, new task_team %p / team %p\n",
 2181|  1.35k|                    __kmp_gtid_from_thread(master_th),
 2182|  1.35k|                    master_th->th.th_task_team, parent_team,
 2183|  1.35k|                    team->t.t_task_team[master_th->th.th_task_state], team));
 2184|       |
 2185|  1.35k|      if (active_level || master_th->th.th_task_team) {
  ------------------
  |  Branch (2185:11): [True: 0, False: 1.35k]
  |  Branch (2185:27): [True: 0, False: 1.35k]
  ------------------
 2186|       |        // Take a memo of primary thread's task_state
 2187|      0|        KMP_DEBUG_ASSERT(master_th->th.th_task_state_memo_stack);
 2188|      0|        if (master_th->th.th_task_state_top >=
  ------------------
  |  Branch (2188:13): [True: 0, False: 0]
  ------------------
 2189|      0|            master_th->th.th_task_state_stack_sz) { // increase size
 2190|      0|          kmp_uint32 new_size = 2 * master_th->th.th_task_state_stack_sz;
 2191|      0|          kmp_uint8 *old_stack, *new_stack;
 2192|      0|          kmp_uint32 i;
 2193|      0|          new_stack = (kmp_uint8 *)__kmp_allocate(new_size);
  ------------------
  |  | 3617|      0|#define __kmp_allocate(size) ___kmp_allocate((size)KMP_SRC_LOC_CURR)
  ------------------
 2194|      0|          for (i = 0; i < master_th->th.th_task_state_stack_sz; ++i) {
  ------------------
  |  Branch (2194:23): [True: 0, False: 0]
  ------------------
 2195|      0|            new_stack[i] = master_th->th.th_task_state_memo_stack[i];
 2196|      0|          }
 2197|      0|          for (i = master_th->th.th_task_state_stack_sz; i < new_size;
  ------------------
  |  Branch (2197:58): [True: 0, False: 0]
  ------------------
 2198|      0|               ++i) { // zero-init rest of stack
 2199|      0|            new_stack[i] = 0;
 2200|      0|          }
 2201|      0|          old_stack = master_th->th.th_task_state_memo_stack;
 2202|      0|          master_th->th.th_task_state_memo_stack = new_stack;
 2203|      0|          master_th->th.th_task_state_stack_sz = new_size;
 2204|      0|          __kmp_free(old_stack);
  ------------------
  |  | 3619|      0|#define __kmp_free(ptr) ___kmp_free((ptr)KMP_SRC_LOC_CURR)
  ------------------
 2205|      0|        }
 2206|       |        // Store primary thread's task_state on stack
 2207|      0|        master_th->th
 2208|      0|            .th_task_state_memo_stack[master_th->th.th_task_state_top] =
 2209|      0|            master_th->th.th_task_state;
 2210|      0|        master_th->th.th_task_state_top++;
 2211|      0|#if KMP_NESTED_HOT_TEAMS
 2212|      0|        if (master_th->th.th_hot_teams &&
  ------------------
  |  Branch (2212:13): [True: 0, False: 0]
  ------------------
 2213|      0|            active_level < __kmp_hot_teams_max_level &&
  ------------------
  |  Branch (2213:13): [True: 0, False: 0]
  ------------------
 2214|      0|            team == master_th->th.th_hot_teams[active_level].hot_team) {
  ------------------
  |  Branch (2214:13): [True: 0, False: 0]
  ------------------
 2215|       |          // Restore primary thread's nested state if nested hot team
 2216|      0|          master_th->th.th_task_state =
 2217|      0|              master_th->th
 2218|      0|                  .th_task_state_memo_stack[master_th->th.th_task_state_top];
 2219|      0|        } else {
 2220|      0|#endif
 2221|      0|          master_th->th.th_task_state = 0;
 2222|      0|#if KMP_NESTED_HOT_TEAMS
 2223|      0|        }
 2224|      0|#endif
 2225|      0|      }
 2226|       |#if !KMP_NESTED_HOT_TEAMS
 2227|       |      KMP_DEBUG_ASSERT((master_th->th.th_task_team == NULL) ||
 2228|       |                       (team == root->r.r_hot_team));
 2229|       |#endif
 2230|  1.35k|    }
 2231|       |
 2232|  1.35k|    KA_TRACE(
 2233|  1.35k|        20,
 2234|  1.35k|        ("__kmp_fork_call: T#%d(%d:%d)->(%d:0) created a team of %d threads\n",
 2235|  1.35k|         gtid, parent_team->t.t_id, team->t.t_master_tid, team->t.t_id,
 2236|  1.35k|         team->t.t_nproc));
 2237|  1.35k|    KMP_DEBUG_ASSERT(team != root->r.r_hot_team ||
 2238|  1.35k|                     (team->t.t_master_tid == 0 &&
 2239|  1.35k|                      (team->t.t_parent == root->r.r_root_team ||
 2240|  1.35k|                       team->t.t_parent->t.t_serialized)));
 2241|  1.35k|    KMP_MB();
 2242|       |
 2243|       |    /* now, setup the arguments */
 2244|  1.35k|    argv = (void **)team->t.t_argv;
 2245|  1.35k|    if (ap) {
  ------------------
  |  Branch (2245:9): [True: 1.35k, False: 0]
  ------------------
 2246|  2.97k|      for (i = argc - 1; i >= 0; --i) {
  ------------------
  |  Branch (2246:26): [True: 1.61k, False: 1.35k]
  ------------------
 2247|  1.61k|        void *new_argv = va_arg(kmp_va_deref(ap), void *);
 2248|  1.61k|        KMP_CHECK_UPDATE(*argv, new_argv);
  ------------------
  |  | 2280|  1.61k|  if ((a) != (b))                                                              \
  |  |  ------------------
  |  |  |  Branch (2280:7): [True: 333, False: 1.28k]
  |  |  ------------------
  |  | 2281|  1.61k|  (a) = (b)
  ------------------
 2249|  1.61k|        argv++;
 2250|  1.61k|      }
 2251|  1.35k|    } else {
 2252|      0|      for (i = 0; i < argc; ++i) {
  ------------------
  |  Branch (2252:19): [True: 0, False: 0]
  ------------------
 2253|       |        // Get args from parent team for teams construct
 2254|      0|        KMP_CHECK_UPDATE(argv[i], team->t.t_parent->t.t_argv[i]);
  ------------------
  |  | 2280|      0|  if ((a) != (b))                                                              \
  |  |  ------------------
  |  |  |  Branch (2280:7): [True: 0, False: 0]
  |  |  ------------------
  |  | 2281|      0|  (a) = (b)
  ------------------
 2255|      0|      }
 2256|      0|    }
 2257|       |
 2258|       |    /* now actually fork the threads */
 2259|  1.35k|    KMP_CHECK_UPDATE(team->t.t_master_active, master_active);
  ------------------
  |  | 2280|  1.35k|  if ((a) != (b))                                                              \
  |  |  ------------------
  |  |  |  Branch (2280:7): [True: 0, False: 1.35k]
  |  |  ------------------
  |  | 2281|  1.35k|  (a) = (b)
  ------------------
 2260|  1.35k|    if (!root->r.r_active) // Only do assignment if it prevents cache ping-pong
  ------------------
  |  Branch (2260:9): [True: 1.35k, False: 0]
  ------------------
 2261|  1.35k|      root->r.r_active = TRUE;
  ------------------
  |  | 1280|  1.35k|#define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  | 1279|  1.35k|#define FALSE 0
  |  |  ------------------
  ------------------
 2262|       |
 2263|  1.35k|    __kmp_fork_team_threads(root, team, master_th, gtid, !ap);
 2264|  1.35k|    __kmp_setup_icv_copy(team, nthreads,
 2265|  1.35k|                         &master_th->th.th_current_task->td_icvs, loc);
 2266|       |
 2267|  1.35k|#if OMPT_SUPPORT
 2268|  1.35k|    master_th->th.ompt_thread_info.state = ompt_state_work_parallel;
 2269|  1.35k|#endif
 2270|       |
 2271|  1.35k|    __kmp_release_bootstrap_lock(&__kmp_forkjoin_lock);
 2272|       |
 2273|       |#if USE_ITT_BUILD
 2274|       |    if (team->t.t_active_level == 1 // only report frames at level 1
 2275|       |        && !master_th->th.th_teams_microtask) { // not in teams construct
 2276|       |#if USE_ITT_NOTIFY
 2277|       |      if ((__itt_frame_submit_v3_ptr || KMP_ITT_DEBUG) &&
 2278|       |          (__kmp_forkjoin_frames_mode == 3 ||
 2279|       |           __kmp_forkjoin_frames_mode == 1)) {
 2280|       |        kmp_uint64 tmp_time = 0;
 2281|       |        if (__itt_get_timestamp_ptr)
 2282|       |          tmp_time = __itt_get_timestamp();
 2283|       |        // Internal fork - report frame begin
 2284|       |        master_th->th.th_frame_time = tmp_time;
 2285|       |        if (__kmp_forkjoin_frames_mode == 3)
 2286|       |          team->t.t_region_time = tmp_time;
 2287|       |      } else
 2288|       |// only one notification scheme (either "submit" or "forking/joined", not both)
 2289|       |#endif /* USE_ITT_NOTIFY */
 2290|       |        if ((__itt_frame_begin_v3_ptr || KMP_ITT_DEBUG) &&
 2291|       |            __kmp_forkjoin_frames && !__kmp_forkjoin_frames_mode) {
 2292|       |          // Mark start of "parallel" region for Intel(R) VTune(TM) analyzer.
 2293|       |          __kmp_itt_region_forking(gtid, team->t.t_nproc, 0);
 2294|       |        }
 2295|       |    }
 2296|       |#endif /* USE_ITT_BUILD */
 2297|       |
 2298|       |    /* now go on and do the work */
 2299|  1.35k|    KMP_DEBUG_ASSERT(team == __kmp_threads[gtid]->th.th_team);
 2300|  1.35k|    KMP_MB();
 2301|  1.35k|    KF_TRACE(10,
 2302|  1.35k|             ("__kmp_internal_fork : root=%p, team=%p, master_th=%p, gtid=%d\n",
 2303|  1.35k|              root, team, master_th, gtid));
 2304|       |
 2305|       |#if USE_ITT_BUILD
 2306|       |    if (__itt_stack_caller_create_ptr) {
 2307|       |      // create new stack stitching id before entering fork barrier
 2308|       |      if (!enter_teams) {
 2309|       |        KMP_DEBUG_ASSERT(team->t.t_stack_id == NULL);
 2310|       |        team->t.t_stack_id = __kmp_itt_stack_caller_create();
 2311|       |      } else if (parent_team->t.t_serialized) {
 2312|       |        // keep stack stitching id in the serialized parent_team;
 2313|       |        // current team will be used for parallel inside the teams;
 2314|       |        // if parent_team is active, then it already keeps stack stitching id
 2315|       |        // for the league of teams
 2316|       |        KMP_DEBUG_ASSERT(parent_team->t.t_stack_id == NULL);
 2317|       |        parent_team->t.t_stack_id = __kmp_itt_stack_caller_create();
 2318|       |      }
 2319|       |    }
 2320|       |#endif /* USE_ITT_BUILD */
 2321|       |
 2322|       |    // AC: skip __kmp_internal_fork at teams construct, let only primary
 2323|       |    // threads execute
 2324|  1.35k|    if (ap) {
  ------------------
  |  Branch (2324:9): [True: 1.35k, False: 0]
  ------------------
 2325|  1.35k|      __kmp_internal_fork(loc, gtid, team);
 2326|  1.35k|      KF_TRACE(10, ("__kmp_internal_fork : after : root=%p, team=%p, "
 2327|  1.35k|                    "master_th=%p, gtid=%d\n",
 2328|  1.35k|                    root, team, master_th, gtid));
 2329|  1.35k|    }
 2330|       |
 2331|  1.35k|    if (call_context == fork_context_gnu) {
  ------------------
  |  Branch (2331:9): [True: 0, False: 1.35k]
  ------------------
 2332|      0|      KA_TRACE(20, ("__kmp_fork_call: parallel exit T#%d\n", gtid));
 2333|      0|      return TRUE;
  ------------------
  |  | 1280|      0|#define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  | 1279|      0|#define FALSE 0
  |  |  ------------------
  ------------------
 2334|      0|    }
 2335|       |
 2336|       |    /* Invoke microtask for PRIMARY thread */
 2337|  1.35k|    KA_TRACE(20, ("__kmp_fork_call: T#%d(%d:0) invoke microtask = %p\n", gtid,
 2338|  1.35k|                  team->t.t_id, team->t.t_pkfn));
 2339|  1.35k|  } // END of timer KMP_fork_call block
 2340|       |
 2341|       |#if KMP_STATS_ENABLED
 2342|       |  // If beginning a teams construct, then change thread state
 2343|       |  stats_state_e previous_state = KMP_GET_THREAD_STATE();
 2344|       |  if (!ap) {
 2345|       |    KMP_SET_THREAD_STATE(stats_state_e::TEAMS_REGION);
 2346|       |  }
 2347|       |#endif
 2348|       |
 2349|  1.35k|  if (!team->t.t_invoke(gtid)) {
  ------------------
  |  Branch (2349:7): [True: 0, False: 1.35k]
  ------------------
 2350|      0|    KMP_ASSERT2(0, "cannot invoke microtask for PRIMARY thread");
  ------------------
  |  |   53|      0|#define KMP_ASSERT2(cond, msg) KMP_ASSERT(cond)
  |  |  ------------------
  |  |  |  |   50|      0|  if (!(cond)) {                                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (50:7): [True: 0, Folded]
  |  |  |  |  ------------------
  |  |  |  |   51|      0|    __kmp_debug_assert("assertion failure", __FILE__, __LINE__);               \
  |  |  |  |   52|      0|  }
  |  |  ------------------
  ------------------
 2351|      0|  }
 2352|       |
 2353|       |#if KMP_STATS_ENABLED
 2354|       |  // If was beginning of a teams construct, then reset thread state
 2355|       |  if (!ap) {
 2356|       |    KMP_SET_THREAD_STATE(previous_state);
 2357|       |  }
 2358|       |#endif
 2359|       |
 2360|  1.35k|  KA_TRACE(20, ("__kmp_fork_call: T#%d(%d:0) done microtask = %p\n", gtid,
 2361|  1.35k|                team->t.t_id, team->t.t_pkfn));
 2362|  1.35k|  KMP_MB(); /* Flush all pending memory write invalidates.  */
 2363|       |
 2364|  1.35k|  KA_TRACE(20, ("__kmp_fork_call: parallel exit T#%d\n", gtid));
 2365|  1.35k|#if OMPT_SUPPORT
 2366|  1.35k|  if (ompt_enabled.enabled) {
  ------------------
  |  Branch (2366:7): [True: 0, False: 1.35k]
  ------------------
 2367|      0|    master_th->th.ompt_thread_info.state = ompt_state_overhead;
 2368|      0|  }
 2369|  1.35k|#endif
 2370|       |
 2371|  1.35k|  return TRUE;
  ------------------
  |  | 1280|  1.35k|#define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  | 1279|  1.35k|#define FALSE 0
  |  |  ------------------
  ------------------
 2372|  1.35k|}
__kmp_join_call:
 2403|  1.35k|                     int exit_teams) {
 2404|  1.35k|  KMP_TIME_DEVELOPER_PARTITIONED_BLOCK(KMP_join_call);
  ------------------
  |  | 1008|  1.35k|#define KMP_TIME_DEVELOPER_PARTITIONED_BLOCK(n) ((void)0)
  ------------------
 2405|  1.35k|  kmp_team_t *team;
 2406|  1.35k|  kmp_team_t *parent_team;
 2407|  1.35k|  kmp_info_t *master_th;
 2408|  1.35k|  kmp_root_t *root;
 2409|  1.35k|  int master_active;
 2410|       |
 2411|  1.35k|  KA_TRACE(20, ("__kmp_join_call: enter T#%d\n", gtid));
 2412|       |
 2413|       |  /* setup current data */
 2414|  1.35k|  master_th = __kmp_threads[gtid];
 2415|  1.35k|  root = master_th->th.th_root;
 2416|  1.35k|  team = master_th->th.th_team;
 2417|  1.35k|  parent_team = team->t.t_parent;
 2418|       |
 2419|  1.35k|  master_th->th.th_ident = loc;
 2420|       |
 2421|  1.35k|#if OMPT_SUPPORT
 2422|  1.35k|  void *team_microtask = (void *)team->t.t_pkfn;
 2423|       |  // For GOMP interface with serialized parallel, need the
 2424|       |  // __kmpc_end_serialized_parallel to call hooks for OMPT end-implicit-task
 2425|       |  // and end-parallel events.
 2426|  1.35k|  if (ompt_enabled.enabled &&
  ------------------
  |  Branch (2426:7): [True: 0, False: 1.35k]
  ------------------
 2427|      0|      !(team->t.t_serialized && fork_context == fork_context_gnu)) {
  ------------------
  |  Branch (2427:9): [True: 0, False: 0]
  |  Branch (2427:33): [True: 0, False: 0]
  ------------------
 2428|      0|    master_th->th.ompt_thread_info.state = ompt_state_overhead;
 2429|      0|  }
 2430|  1.35k|#endif
 2431|       |
 2432|       |#if KMP_DEBUG
 2433|       |  if (__kmp_tasking_mode != tskm_immediate_exec && !exit_teams) {
 2434|       |    KA_TRACE(20, ("__kmp_join_call: T#%d, old team = %p old task_team = %p, "
 2435|       |                  "th_task_team = %p\n",
 2436|       |                  __kmp_gtid_from_thread(master_th), team,
 2437|       |                  team->t.t_task_team[master_th->th.th_task_state],
 2438|       |                  master_th->th.th_task_team));
 2439|       |    KMP_DEBUG_ASSERT(master_th->th.th_task_team ==
 2440|       |                     team->t.t_task_team[master_th->th.th_task_state]);
 2441|       |  }
 2442|       |#endif
 2443|       |
 2444|  1.35k|  if (team->t.t_serialized) {
  ------------------
  |  Branch (2444:7): [True: 0, False: 1.35k]
  ------------------
 2445|      0|    if (master_th->th.th_teams_microtask) {
  ------------------
  |  Branch (2445:9): [True: 0, False: 0]
  ------------------
 2446|       |      // We are in teams construct
 2447|      0|      int level = team->t.t_level;
 2448|      0|      int tlevel = master_th->th.th_teams_level;
 2449|      0|      if (level == tlevel) {
  ------------------
  |  Branch (2449:11): [True: 0, False: 0]
  ------------------
 2450|       |        // AC: we haven't incremented it earlier at start of teams construct,
 2451|       |        //     so do it here - at the end of teams construct
 2452|      0|        team->t.t_level++;
 2453|      0|      } else if (level == tlevel + 1) {
  ------------------
  |  Branch (2453:18): [True: 0, False: 0]
  ------------------
 2454|       |        // AC: we are exiting parallel inside teams, need to increment
 2455|       |        // serialization in order to restore it in the next call to
 2456|       |        // __kmpc_end_serialized_parallel
 2457|      0|        team->t.t_serialized++;
 2458|      0|      }
 2459|      0|    }
 2460|      0|    __kmpc_end_serialized_parallel(loc, gtid);
 2461|       |
 2462|      0|#if OMPT_SUPPORT
 2463|      0|    if (ompt_enabled.enabled) {
  ------------------
  |  Branch (2463:9): [True: 0, False: 0]
  ------------------
 2464|      0|      if (fork_context == fork_context_gnu) {
  ------------------
  |  Branch (2464:11): [True: 0, False: 0]
  ------------------
 2465|      0|        __ompt_lw_taskteam_unlink(master_th);
 2466|      0|      }
 2467|      0|      __kmp_join_restore_state(master_th, parent_team);
 2468|      0|    }
 2469|      0|#endif
 2470|       |
 2471|      0|    return;
 2472|      0|  }
 2473|       |
 2474|  1.35k|  master_active = team->t.t_master_active;
 2475|       |
 2476|  1.35k|  if (!exit_teams) {
  ------------------
  |  Branch (2476:7): [True: 1.35k, False: 0]
  ------------------
 2477|       |    // AC: No barrier for internal teams at exit from teams construct.
 2478|       |    //     But there is barrier for external team (league).
 2479|  1.35k|    __kmp_internal_join(loc, gtid, team);
 2480|       |#if USE_ITT_BUILD
 2481|       |    if (__itt_stack_caller_create_ptr) {
 2482|       |      KMP_DEBUG_ASSERT(team->t.t_stack_id != NULL);
 2483|       |      // destroy the stack stitching id after join barrier
 2484|       |      __kmp_itt_stack_caller_destroy((__itt_caller)team->t.t_stack_id);
 2485|       |      team->t.t_stack_id = NULL;
 2486|       |    }
 2487|       |#endif
 2488|  1.35k|  } else {
 2489|      0|    master_th->th.th_task_state =
 2490|      0|        0; // AC: no tasking in teams (out of any parallel)
 2491|       |#if USE_ITT_BUILD
 2492|       |    if (__itt_stack_caller_create_ptr && parent_team->t.t_serialized) {
 2493|       |      KMP_DEBUG_ASSERT(parent_team->t.t_stack_id != NULL);
 2494|       |      // destroy the stack stitching id on exit from the teams construct
 2495|       |      // if parent_team is active, then the id will be destroyed later on
 2496|       |      // by master of the league of teams
 2497|       |      __kmp_itt_stack_caller_destroy((__itt_caller)parent_team->t.t_stack_id);
 2498|       |      parent_team->t.t_stack_id = NULL;
 2499|       |    }
 2500|       |#endif
 2501|      0|  }
 2502|       |
 2503|  1.35k|  KMP_MB();
 2504|       |
 2505|  1.35k|#if OMPT_SUPPORT
 2506|  1.35k|  ompt_data_t *parallel_data = &(team->t.ompt_team_info.parallel_data);
 2507|  1.35k|  void *codeptr = team->t.ompt_team_info.master_return_address;
 2508|  1.35k|#endif
 2509|       |
 2510|       |#if USE_ITT_BUILD
 2511|       |  // Mark end of "parallel" region for Intel(R) VTune(TM) analyzer.
 2512|       |  if (team->t.t_active_level == 1 &&
 2513|       |      (!master_th->th.th_teams_microtask || /* not in teams construct */
 2514|       |       master_th->th.th_teams_size.nteams == 1)) {
 2515|       |    master_th->th.th_ident = loc;
 2516|       |    // only one notification scheme (either "submit" or "forking/joined", not
 2517|       |    // both)
 2518|       |    if ((__itt_frame_submit_v3_ptr || KMP_ITT_DEBUG) &&
 2519|       |        __kmp_forkjoin_frames_mode == 3)
 2520|       |      __kmp_itt_frame_submit(gtid, team->t.t_region_time,
 2521|       |                             master_th->th.th_frame_time, 0, loc,
 2522|       |                             master_th->th.th_team_nproc, 1);
 2523|       |    else if ((__itt_frame_end_v3_ptr || KMP_ITT_DEBUG) &&
 2524|       |             !__kmp_forkjoin_frames_mode && __kmp_forkjoin_frames)
 2525|       |      __kmp_itt_region_joined(gtid);
 2526|       |  } // active_level == 1
 2527|       |#endif /* USE_ITT_BUILD */
 2528|       |
 2529|  1.35k|#if KMP_AFFINITY_SUPPORTED
 2530|  1.35k|  if (!exit_teams) {
  ------------------
  |  Branch (2530:7): [True: 1.35k, False: 0]
  ------------------
 2531|       |    // Restore master thread's partition.
 2532|  1.35k|    master_th->th.th_first_place = team->t.t_first_place;
 2533|  1.35k|    master_th->th.th_last_place = team->t.t_last_place;
 2534|  1.35k|  }
 2535|  1.35k|#endif // KMP_AFFINITY_SUPPORTED
 2536|       |
 2537|  1.35k|  if (master_th->th.th_teams_microtask && !exit_teams &&
  ------------------
  |  Branch (2537:7): [True: 0, False: 1.35k]
  |  Branch (2537:43): [True: 0, False: 0]
  ------------------
 2538|      0|      team->t.t_pkfn != (microtask_t)__kmp_teams_master &&
  ------------------
  |  Branch (2538:7): [True: 0, False: 0]
  ------------------
 2539|      0|      team->t.t_level == master_th->th.th_teams_level + 1) {
  ------------------
  |  Branch (2539:7): [True: 0, False: 0]
  ------------------
 2540|       |// AC: We need to leave the team structure intact at the end of parallel
 2541|       |// inside the teams construct, so that at the next parallel same (hot) team
 2542|       |// works, only adjust nesting levels
 2543|      0|#if OMPT_SUPPORT
 2544|      0|    ompt_data_t ompt_parallel_data = ompt_data_none;
  ------------------
  |  | 1408|      0|#define ompt_data_none {0}
  ------------------
 2545|      0|    if (ompt_enabled.enabled) {
  ------------------
  |  Branch (2545:9): [True: 0, False: 0]
  ------------------
 2546|      0|      ompt_task_info_t *task_info = __ompt_get_task_info_object(0);
 2547|      0|      if (ompt_enabled.ompt_callback_implicit_task) {
  ------------------
  |  Branch (2547:11): [True: 0, False: 0]
  ------------------
 2548|      0|        int ompt_team_size = team->t.t_nproc;
 2549|      0|        ompt_callbacks.ompt_callback(ompt_callback_implicit_task)(
  ------------------
  |  |   27|      0|#define ompt_callback(e) e##_callback
  ------------------
 2550|      0|            ompt_scope_end, NULL, &(task_info->task_data), ompt_team_size,
 2551|      0|            OMPT_CUR_TASK_INFO(master_th)->thread_num, ompt_task_implicit);
  ------------------
  |  |   68|      0|#define OMPT_CUR_TASK_INFO(thr) (&((thr)->th.th_current_task->ompt_task_info))
  ------------------
 2552|      0|      }
 2553|      0|      task_info->frame.exit_frame = ompt_data_none;
  ------------------
  |  | 1408|      0|#define ompt_data_none {0}
  ------------------
 2554|      0|      task_info->task_data = ompt_data_none;
  ------------------
  |  | 1408|      0|#define ompt_data_none {0}
  ------------------
 2555|      0|      ompt_parallel_data = *OMPT_CUR_TEAM_DATA(master_th);
  ------------------
  |  |   73|      0|  (&((thr)->th.th_team->t.ompt_team_info.parallel_data))
  ------------------
 2556|      0|      __ompt_lw_taskteam_unlink(master_th);
 2557|      0|    }
 2558|      0|#endif
 2559|       |    /* Decrement our nested depth level */
 2560|      0|    team->t.t_level--;
 2561|      0|    team->t.t_active_level--;
 2562|      0|    KMP_ATOMIC_DEC(&root->r.r_in_parallel);
  ------------------
  |  | 1260|      0|#define KMP_ATOMIC_DEC(p) KMP_ATOMIC_OP(fetch_sub, p, 1, acq_rel)
  |  |  ------------------
  |  |  |  | 1246|      0|#define KMP_ATOMIC_OP(op, p, v, order) (p)->op(v, std::memory_order_##order)
  |  |  ------------------
  ------------------
 2563|       |
 2564|       |    // Restore number of threads in the team if needed. This code relies on
 2565|       |    // the proper adjustment of th_teams_size.nth after the fork in
 2566|       |    // __kmp_teams_master on each teams primary thread in the case that
 2567|       |    // __kmp_reserve_threads reduced it.
 2568|      0|    if (master_th->th.th_team_nproc < master_th->th.th_teams_size.nth) {
  ------------------
  |  Branch (2568:9): [True: 0, False: 0]
  ------------------
 2569|      0|      int old_num = master_th->th.th_team_nproc;
 2570|      0|      int new_num = master_th->th.th_teams_size.nth;
 2571|      0|      kmp_info_t **other_threads = team->t.t_threads;
 2572|      0|      team->t.t_nproc = new_num;
 2573|      0|      for (int i = 0; i < old_num; ++i) {
  ------------------
  |  Branch (2573:23): [True: 0, False: 0]
  ------------------
 2574|      0|        other_threads[i]->th.th_team_nproc = new_num;
 2575|      0|      }
 2576|       |      // Adjust states of non-used threads of the team
 2577|      0|      for (int i = old_num; i < new_num; ++i) {
  ------------------
  |  Branch (2577:29): [True: 0, False: 0]
  ------------------
 2578|       |        // Re-initialize thread's barrier data.
 2579|      0|        KMP_DEBUG_ASSERT(other_threads[i]);
 2580|      0|        kmp_balign_t *balign = other_threads[i]->th.th_bar;
 2581|      0|        for (int b = 0; b < bs_last_barrier; ++b) {
  ------------------
  |  Branch (2581:25): [True: 0, False: 0]
  ------------------
 2582|      0|          balign[b].bb.b_arrived = team->t.t_bar[b].b_arrived;
 2583|      0|          KMP_DEBUG_ASSERT(balign[b].bb.wait_flag != KMP_BARRIER_PARENT_FLAG);
 2584|       |#if USE_DEBUGGER
 2585|       |          balign[b].bb.b_worker_arrived = team->t.t_bar[b].b_team_arrived;
 2586|       |#endif
 2587|      0|        }
 2588|      0|        if (__kmp_tasking_mode != tskm_immediate_exec) {
  ------------------
  |  Branch (2588:13): [True: 0, False: 0]
  ------------------
 2589|       |          // Synchronize thread's task state
 2590|      0|          other_threads[i]->th.th_task_state = master_th->th.th_task_state;
 2591|      0|        }
 2592|      0|      }
 2593|      0|    }
 2594|       |
 2595|      0|#if OMPT_SUPPORT
 2596|      0|    if (ompt_enabled.enabled) {
  ------------------
  |  Branch (2596:9): [True: 0, False: 0]
  ------------------
 2597|      0|      __kmp_join_ompt(gtid, master_th, parent_team, &ompt_parallel_data,
 2598|      0|                      OMPT_INVOKER(fork_context) | ompt_parallel_team, codeptr);
  ------------------
  |  |   24|      0|  ((x == fork_context_gnu) ? ompt_parallel_invoker_program                     \
  |  |  ------------------
  |  |  |  Branch (24:4): [True: 0, False: 0]
  |  |  ------------------
  |  |   25|      0|                           : ompt_parallel_invoker_runtime)
  ------------------
 2599|      0|    }
 2600|      0|#endif
 2601|       |
 2602|      0|    return;
 2603|      0|  }
 2604|       |
 2605|       |  /* do cleanup and restore the parent team */
 2606|  1.35k|  master_th->th.th_info.ds.ds_tid = team->t.t_master_tid;
 2607|  1.35k|  master_th->th.th_local.this_construct = team->t.t_master_this_cons;
 2608|       |
 2609|  1.35k|  master_th->th.th_dispatch = &parent_team->t.t_dispatch[team->t.t_master_tid];
 2610|       |
 2611|       |  /* jc: The following lock has instructions with REL and ACQ semantics,
 2612|       |     separating the parallel user code called in this parallel region
 2613|       |     from the serial user code called after this function returns. */
 2614|  1.35k|  __kmp_acquire_bootstrap_lock(&__kmp_forkjoin_lock);
 2615|       |
 2616|  1.35k|  if (!master_th->th.th_teams_microtask ||
  ------------------
  |  Branch (2616:7): [True: 1.35k, False: 0]
  ------------------
 2617|  1.35k|      team->t.t_level > master_th->th.th_teams_level) {
  ------------------
  |  Branch (2617:7): [True: 0, False: 0]
  ------------------
 2618|       |    /* Decrement our nested depth level */
 2619|  1.35k|    KMP_ATOMIC_DEC(&root->r.r_in_parallel);
  ------------------
  |  | 1260|  1.35k|#define KMP_ATOMIC_DEC(p) KMP_ATOMIC_OP(fetch_sub, p, 1, acq_rel)
  |  |  ------------------
  |  |  |  | 1246|  1.35k|#define KMP_ATOMIC_OP(op, p, v, order) (p)->op(v, std::memory_order_##order)
  |  |  ------------------
  ------------------
 2620|  1.35k|  }
 2621|  1.35k|  KMP_DEBUG_ASSERT(root->r.r_in_parallel >= 0);
 2622|       |
 2623|  1.35k|#if OMPT_SUPPORT
 2624|  1.35k|  if (ompt_enabled.enabled) {
  ------------------
  |  Branch (2624:7): [True: 0, False: 1.35k]
  ------------------
 2625|      0|    ompt_task_info_t *task_info = __ompt_get_task_info_object(0);
 2626|      0|    if (ompt_enabled.ompt_callback_implicit_task) {
  ------------------
  |  Branch (2626:9): [True: 0, False: 0]
  ------------------
 2627|      0|      int flags = (team_microtask == (void *)__kmp_teams_master)
  ------------------
  |  Branch (2627:19): [True: 0, False: 0]
  ------------------
 2628|      0|                      ? ompt_task_initial
 2629|      0|                      : ompt_task_implicit;
 2630|      0|      int ompt_team_size = (flags == ompt_task_initial) ? 0 : team->t.t_nproc;
  ------------------
  |  Branch (2630:28): [True: 0, False: 0]
  ------------------
 2631|      0|      ompt_callbacks.ompt_callback(ompt_callback_implicit_task)(
  ------------------
  |  |   27|      0|#define ompt_callback(e) e##_callback
  ------------------
 2632|      0|          ompt_scope_end, NULL, &(task_info->task_data), ompt_team_size,
 2633|      0|          OMPT_CUR_TASK_INFO(master_th)->thread_num, flags);
  ------------------
  |  |   68|      0|#define OMPT_CUR_TASK_INFO(thr) (&((thr)->th.th_current_task->ompt_task_info))
  ------------------
 2634|      0|    }
 2635|      0|    task_info->frame.exit_frame = ompt_data_none;
  ------------------
  |  | 1408|      0|#define ompt_data_none {0}
  ------------------
 2636|      0|    task_info->task_data = ompt_data_none;
  ------------------
  |  | 1408|      0|#define ompt_data_none {0}
  ------------------
 2637|      0|  }
 2638|  1.35k|#endif
 2639|       |
 2640|  1.35k|  KF_TRACE(10, ("__kmp_join_call1: T#%d, this_thread=%p team=%p\n", 0,
 2641|  1.35k|                master_th, team));
 2642|  1.35k|  __kmp_pop_current_task_from_thread(master_th);
 2643|       |
 2644|  1.35k|  master_th->th.th_def_allocator = team->t.t_def_allocator;
 2645|       |
 2646|  1.35k|#if OMPD_SUPPORT
 2647|  1.35k|  if (ompd_state & OMPD_ENABLE_BP)
  ------------------
  |  |   35|  1.35k|#define OMPD_ENABLE_BP 0x1
  ------------------
  |  Branch (2647:7): [True: 0, False: 1.35k]
  ------------------
 2648|      0|    ompd_bp_parallel_end();
 2649|  1.35k|#endif
 2650|  1.35k|  updateHWFPControl(team);
 2651|       |
 2652|  1.35k|  if (root->r.r_active != master_active)
  ------------------
  |  Branch (2652:7): [True: 1.35k, False: 0]
  ------------------
 2653|  1.35k|    root->r.r_active = master_active;
 2654|       |
 2655|  1.35k|  __kmp_free_team(root, team USE_NESTED_HOT_ARG(
  ------------------
  |  |  165|  1.35k|#define USE_NESTED_HOT_ARG(x) , x
  ------------------
 2656|  1.35k|                            master_th)); // this will free worker threads
 2657|       |
 2658|       |  /* this race was fun to find. make sure the following is in the critical
 2659|       |     region otherwise assertions may fail occasionally since the old team may be
 2660|       |     reallocated and the hierarchy appears inconsistent. it is actually safe to
 2661|       |     run and won't cause any bugs, but will cause those assertion failures. it's
 2662|       |     only one deref&assign so might as well put this in the critical region */
 2663|  1.35k|  master_th->th.th_team = parent_team;
 2664|  1.35k|  master_th->th.th_team_nproc = parent_team->t.t_nproc;
 2665|  1.35k|  master_th->th.th_team_master = parent_team->t.t_threads[0];
 2666|  1.35k|  master_th->th.th_team_serialized = parent_team->t.t_serialized;
 2667|       |
 2668|       |  /* restore serialized team, if need be */
 2669|  1.35k|  if (parent_team->t.t_serialized &&
  ------------------
  |  Branch (2669:7): [True: 1.35k, False: 0]
  ------------------
 2670|  1.35k|      parent_team != master_th->th.th_serial_team &&
  ------------------
  |  Branch (2670:7): [True: 1.35k, False: 0]
  ------------------
 2671|  1.35k|      parent_team != root->r.r_root_team) {
  ------------------
  |  Branch (2671:7): [True: 0, False: 1.35k]
  ------------------
 2672|      0|    __kmp_free_team(root,
 2673|      0|                    master_th->th.th_serial_team USE_NESTED_HOT_ARG(NULL));
  ------------------
  |  |  165|      0|#define USE_NESTED_HOT_ARG(x) , x
  ------------------
 2674|      0|    master_th->th.th_serial_team = parent_team;
 2675|      0|  }
 2676|       |
 2677|  1.35k|  if (__kmp_tasking_mode != tskm_immediate_exec) {
  ------------------
  |  Branch (2677:7): [True: 1.35k, False: 0]
  ------------------
 2678|  1.35k|    if (master_th->th.th_task_state_top >
  ------------------
  |  Branch (2678:9): [True: 0, False: 1.35k]
  ------------------
 2679|  1.35k|        0) { // Restore task state from memo stack
 2680|      0|      KMP_DEBUG_ASSERT(master_th->th.th_task_state_memo_stack);
 2681|       |      // Remember primary thread's state if we re-use this nested hot team
 2682|      0|      master_th->th.th_task_state_memo_stack[master_th->th.th_task_state_top] =
 2683|      0|          master_th->th.th_task_state;
 2684|      0|      --master_th->th.th_task_state_top; // pop
 2685|       |      // Now restore state at this level
 2686|      0|      master_th->th.th_task_state =
 2687|      0|          master_th->th
 2688|      0|              .th_task_state_memo_stack[master_th->th.th_task_state_top];
 2689|  1.35k|    } else if (team != root->r.r_hot_team) {
  ------------------
  |  Branch (2689:16): [True: 0, False: 1.35k]
  ------------------
 2690|       |      // Reset the task state of primary thread if we are not hot team because
 2691|       |      // in this case all the worker threads will be free, and their task state
 2692|       |      // will be reset. If not reset the primary's, the task state will be
 2693|       |      // inconsistent.
 2694|      0|      master_th->th.th_task_state = 0;
 2695|      0|    }
 2696|       |    // Copy the task team from the parent team to the primary thread
 2697|  1.35k|    master_th->th.th_task_team =
 2698|  1.35k|        parent_team->t.t_task_team[master_th->th.th_task_state];
 2699|  1.35k|    KA_TRACE(20,
 2700|  1.35k|             ("__kmp_join_call: Primary T#%d restoring task_team %p, team %p\n",
 2701|  1.35k|              __kmp_gtid_from_thread(master_th), master_th->th.th_task_team,
 2702|  1.35k|              parent_team));
 2703|  1.35k|  }
 2704|       |
 2705|       |  // TODO: GEH - cannot do this assertion because root thread not set up as
 2706|       |  // executing
 2707|       |  // KMP_ASSERT( master_th->th.th_current_task->td_flags.executing == 0 );
 2708|  1.35k|  master_th->th.th_current_task->td_flags.executing = 1;
 2709|       |
 2710|  1.35k|  __kmp_release_bootstrap_lock(&__kmp_forkjoin_lock);
 2711|       |
 2712|  1.35k|#if KMP_AFFINITY_SUPPORTED
 2713|  1.35k|  if (master_th->th.th_team->t.t_level == 0 && __kmp_affinity.flags.reset) {
  ------------------
  |  Branch (2713:7): [True: 1.35k, False: 0]
  |  Branch (2713:48): [True: 0, False: 1.35k]
  ------------------
 2714|      0|    __kmp_reset_root_init_mask(gtid);
 2715|      0|  }
 2716|  1.35k|#endif
 2717|  1.35k|#if OMPT_SUPPORT
 2718|  1.35k|  int flags =
 2719|  1.35k|      OMPT_INVOKER(fork_context) |
  ------------------
  |  |   24|  1.35k|  ((x == fork_context_gnu) ? ompt_parallel_invoker_program                     \
  |  |  ------------------
  |  |  |  Branch (24:4): [True: 0, False: 1.35k]
  |  |  ------------------
  |  |   25|  1.35k|                           : ompt_parallel_invoker_runtime)
  ------------------
 2720|  1.35k|      ((team_microtask == (void *)__kmp_teams_master) ? ompt_parallel_league
  ------------------
  |  Branch (2720:8): [True: 0, False: 1.35k]
  ------------------
 2721|  1.35k|                                                      : ompt_parallel_team);
 2722|  1.35k|  if (ompt_enabled.enabled) {
  ------------------
  |  Branch (2722:7): [True: 0, False: 1.35k]
  ------------------
 2723|      0|    __kmp_join_ompt(gtid, master_th, parent_team, parallel_data, flags,
 2724|      0|                    codeptr);
 2725|      0|  }
 2726|  1.35k|#endif
 2727|       |
 2728|  1.35k|  KMP_MB();
 2729|  1.35k|  KA_TRACE(20, ("__kmp_join_call: exit T#%d\n", gtid));
 2730|  1.35k|}
__kmp_get_schedule_global:
 3134|      3|kmp_r_sched_t __kmp_get_schedule_global() {
 3135|       |  // This routine created because pairs (__kmp_sched, __kmp_chunk) and
 3136|       |  // (__kmp_static, __kmp_guided) may be changed by kmp_set_defaults
 3137|       |  // independently. So one can get the updated schedule here.
 3138|       |
 3139|      3|  kmp_r_sched_t r_sched;
 3140|       |
 3141|       |  // create schedule from 4 globals: __kmp_sched, __kmp_chunk, __kmp_static,
 3142|       |  // __kmp_guided. __kmp_sched should keep original value, so that user can set
 3143|       |  // KMP_SCHEDULE multiple times, and thus have different run-time schedules in
 3144|       |  // different roots (even in OMP 2.5)
 3145|      3|  enum sched_type s = SCHEDULE_WITHOUT_MODIFIERS(__kmp_sched);
  ------------------
  |  |  451|      3|  (enum sched_type)(                                                           \
  |  |  452|      3|      (s) & ~(kmp_sch_modifier_nonmonotonic | kmp_sch_modifier_monotonic))
  ------------------
 3146|      3|  enum sched_type sched_modifiers = SCHEDULE_GET_MODIFIERS(__kmp_sched);
  ------------------
  |  |  458|      3|  ((enum sched_type)(                                                          \
  |  |  459|      3|      (s) & (kmp_sch_modifier_nonmonotonic | kmp_sch_modifier_monotonic)))
  ------------------
 3147|      3|  if (s == kmp_sch_static) {
  ------------------
  |  Branch (3147:7): [True: 3, False: 0]
  ------------------
 3148|       |    // replace STATIC with more detailed schedule (balanced or greedy)
 3149|      3|    r_sched.r_sched_type = __kmp_static;
 3150|      3|  } else if (s == kmp_sch_guided_chunked) {
  ------------------
  |  Branch (3150:14): [True: 0, False: 0]
  ------------------
 3151|       |    // replace GUIDED with more detailed schedule (iterative or analytical)
 3152|      0|    r_sched.r_sched_type = __kmp_guided;
 3153|      0|  } else { // (STATIC_CHUNKED), or (DYNAMIC_CHUNKED), or other
 3154|      0|    r_sched.r_sched_type = __kmp_sched;
 3155|      0|  }
 3156|      3|  SCHEDULE_SET_MODIFIERS(r_sched.r_sched_type, sched_modifiers);
  ------------------
  |  |  461|      3|  (s = (enum sched_type)((kmp_int32)s | (kmp_int32)m))
  ------------------
 3157|       |
 3158|      3|  if (__kmp_chunk < KMP_DEFAULT_CHUNK) {
  ------------------
  |  | 1244|      3|#define KMP_DEFAULT_CHUNK 1
  ------------------
  |  Branch (3158:7): [True: 3, False: 0]
  ------------------
 3159|       |    // __kmp_chunk may be wrong here (if it was not ever set)
 3160|      3|    r_sched.chunk = KMP_DEFAULT_CHUNK;
  ------------------
  |  | 1244|      3|#define KMP_DEFAULT_CHUNK 1
  ------------------
 3161|      3|  } else {
 3162|      0|    r_sched.chunk = __kmp_chunk;
 3163|      0|  }
 3164|       |
 3165|      3|  return r_sched;
 3166|      3|}
__kmp_init_random:
 3634|     32|void __kmp_init_random(kmp_info_t *thread) {
 3635|     32|  unsigned seed = thread->th.th_info.ds.ds_tid;
 3636|       |
 3637|     32|  thread->th.th_a =
 3638|     32|      __kmp_primes[seed % (sizeof(__kmp_primes) / sizeof(__kmp_primes[0]))];
 3639|     32|  thread->th.th_x = (seed + 1) * thread->th.th_a + 1;
 3640|     32|  KA_TRACE(30,
 3641|     32|           ("__kmp_init_random: THREAD: %u; A: %u\n", seed, thread->th.th_a));
 3642|     32|}
__kmp_register_root:
 3774|      1|int __kmp_register_root(int initial_thread) {
 3775|      1|  kmp_info_t *root_thread;
 3776|      1|  kmp_root_t *root;
 3777|      1|  int gtid;
 3778|      1|  int capacity;
 3779|      1|  __kmp_acquire_bootstrap_lock(&__kmp_forkjoin_lock);
 3780|      1|  KA_TRACE(20, ("__kmp_register_root: entered\n"));
 3781|      1|  KMP_MB();
 3782|       |
 3783|       |  /* 2007-03-02:
 3784|       |     If initial thread did not invoke OpenMP RTL yet, and this thread is not an
 3785|       |     initial one, "__kmp_all_nth >= __kmp_threads_capacity" condition does not
 3786|       |     work as expected -- it may return false (that means there is at least one
 3787|       |     empty slot in __kmp_threads array), but it is possible the only free slot
 3788|       |     is #0, which is reserved for initial thread and so cannot be used for this
 3789|       |     one. Following code workarounds this bug.
 3790|       |
 3791|       |     However, right solution seems to be not reserving slot #0 for initial
 3792|       |     thread because:
 3793|       |     (1) there is no magic in slot #0,
 3794|       |     (2) we cannot detect initial thread reliably (the first thread which does
 3795|       |        serial initialization may be not a real initial thread).
 3796|       |  */
 3797|      1|  capacity = __kmp_threads_capacity;
 3798|      1|  if (!initial_thread && TCR_PTR(__kmp_threads[0]) == NULL) {
  ------------------
  |  | 1156|      0|#define TCR_PTR(a) ((void *)TCR_8(a))
  |  |  ------------------
  |  |  |  | 1131|      0|#define TCR_8(a) (a)
  |  |  ------------------
  ------------------
  |  Branch (3798:7): [True: 0, False: 1]
  |  Branch (3798:26): [True: 0, False: 0]
  ------------------
 3799|      0|    --capacity;
 3800|      0|  }
 3801|       |
 3802|       |  // If it is not for initializing the hidden helper team, we need to take
 3803|       |  // __kmp_hidden_helper_threads_num out of the capacity because it is included
 3804|       |  // in __kmp_threads_capacity.
 3805|      1|  if (__kmp_enable_hidden_helper && !TCR_4(__kmp_init_hidden_helper_threads)) {
  ------------------
  |  | 1127|      1|#define TCR_4(a) (a)
  ------------------
  |  Branch (3805:7): [True: 1, False: 0]
  |  Branch (3805:37): [True: 1, False: 0]
  ------------------
 3806|      1|    capacity -= __kmp_hidden_helper_threads_num;
 3807|      1|  }
 3808|       |
 3809|       |  /* see if there are too many threads */
 3810|      1|  if (__kmp_all_nth >= capacity && !__kmp_expand_threads(1)) {
  ------------------
  |  Branch (3810:7): [True: 0, False: 1]
  |  Branch (3810:36): [True: 0, False: 0]
  ------------------
 3811|      0|    if (__kmp_tp_cached) {
  ------------------
  |  Branch (3811:9): [True: 0, False: 0]
  ------------------
 3812|      0|      __kmp_fatal(KMP_MSG(CantRegisterNewThread),
  ------------------
  |  |  121|      0|#define KMP_MSG(...) __kmp_msg_format(kmp_i18n_msg_##__VA_ARGS__)
  ------------------
 3813|      0|                  KMP_HNT(Set_ALL_THREADPRIVATE, __kmp_tp_capacity),
  ------------------
  |  |  122|      0|#define KMP_HNT(...) __kmp_msg_format(kmp_i18n_hnt_##__VA_ARGS__)
  ------------------
 3814|      0|                  KMP_HNT(PossibleSystemLimitOnThreads), __kmp_msg_null);
  ------------------
  |  |  122|      0|#define KMP_HNT(...) __kmp_msg_format(kmp_i18n_hnt_##__VA_ARGS__)
  ------------------
 3815|      0|    } else {
 3816|      0|      __kmp_fatal(KMP_MSG(CantRegisterNewThread), KMP_HNT(SystemLimitOnThreads),
  ------------------
  |  |  121|      0|#define KMP_MSG(...) __kmp_msg_format(kmp_i18n_msg_##__VA_ARGS__)
  ------------------
                    __kmp_fatal(KMP_MSG(CantRegisterNewThread), KMP_HNT(SystemLimitOnThreads),
  ------------------
  |  |  122|      0|#define KMP_HNT(...) __kmp_msg_format(kmp_i18n_hnt_##__VA_ARGS__)
  ------------------
 3817|      0|                  __kmp_msg_null);
 3818|      0|    }
 3819|      0|  }
 3820|       |
 3821|       |  // When hidden helper task is enabled, __kmp_threads is organized as follows:
 3822|       |  // 0: initial thread, also a regular OpenMP thread.
 3823|       |  // [1, __kmp_hidden_helper_threads_num]: slots for hidden helper threads.
 3824|       |  // [__kmp_hidden_helper_threads_num + 1, __kmp_threads_capacity): slots for
 3825|       |  // regular OpenMP threads.
 3826|      1|  if (TCR_4(__kmp_init_hidden_helper_threads)) {
  ------------------
  |  | 1127|      1|#define TCR_4(a) (a)
  |  |  ------------------
  |  |  |  Branch (1127:18): [True: 0, False: 1]
  |  |  ------------------
  ------------------
 3827|       |    // Find an available thread slot for hidden helper thread. Slots for hidden
 3828|       |    // helper threads start from 1 to __kmp_hidden_helper_threads_num.
 3829|      0|    for (gtid = 1; TCR_PTR(__kmp_threads[gtid]) != NULL &&
  ------------------
  |  | 1156|      0|#define TCR_PTR(a) ((void *)TCR_8(a))
  |  |  ------------------
  |  |  |  | 1131|      0|#define TCR_8(a) (a)
  |  |  ------------------
  ------------------
  |  Branch (3829:20): [True: 0, False: 0]
  ------------------
 3830|      0|                   gtid <= __kmp_hidden_helper_threads_num;
  ------------------
  |  Branch (3830:20): [True: 0, False: 0]
  ------------------
 3831|      0|         gtid++)
 3832|      0|      ;
 3833|      0|    KMP_ASSERT(gtid <= __kmp_hidden_helper_threads_num);
  ------------------
  |  |   50|      0|  if (!(cond)) {                                                               \
  |  |  ------------------
  |  |  |  Branch (50:7): [True: 0, False: 0]
  |  |  ------------------
  |  |   51|      0|    __kmp_debug_assert("assertion failure", __FILE__, __LINE__);               \
  |  |   52|      0|  }
  ------------------
 3834|      0|    KA_TRACE(1, ("__kmp_register_root: found slot in threads array for "
 3835|      0|                 "hidden helper thread: T#%d\n",
 3836|      0|                 gtid));
 3837|      1|  } else {
 3838|       |    /* find an available thread slot */
 3839|       |    // Don't reassign the zero slot since we need that to only be used by
 3840|       |    // initial thread. Slots for hidden helper threads should also be skipped.
 3841|      1|    if (initial_thread && TCR_PTR(__kmp_threads[0]) == NULL) {
  ------------------
  |  | 1156|      1|#define TCR_PTR(a) ((void *)TCR_8(a))
  |  |  ------------------
  |  |  |  | 1131|      1|#define TCR_8(a) (a)
  |  |  ------------------
  ------------------
  |  Branch (3841:9): [True: 1, False: 0]
  |  Branch (3841:27): [True: 1, False: 0]
  ------------------
 3842|      1|      gtid = 0;
 3843|      1|    } else {
 3844|      0|      for (gtid = __kmp_hidden_helper_threads_num + 1;
 3845|      0|           TCR_PTR(__kmp_threads[gtid]) != NULL; gtid++)
  ------------------
  |  | 1156|      0|#define TCR_PTR(a) ((void *)TCR_8(a))
  |  |  ------------------
  |  |  |  | 1131|      0|#define TCR_8(a) (a)
  |  |  ------------------
  ------------------
  |  Branch (3845:12): [True: 0, False: 0]
  ------------------
 3846|      0|        ;
 3847|      0|    }
 3848|      1|    KA_TRACE(
 3849|      1|        1, ("__kmp_register_root: found slot in threads array: T#%d\n", gtid));
 3850|      1|    KMP_ASSERT(gtid < __kmp_threads_capacity);
  ------------------
  |  |   50|      1|  if (!(cond)) {                                                               \
  |  |  ------------------
  |  |  |  Branch (50:7): [True: 0, False: 1]
  |  |  ------------------
  |  |   51|      0|    __kmp_debug_assert("assertion failure", __FILE__, __LINE__);               \
  |  |   52|      0|  }
  ------------------
 3851|      1|  }
 3852|       |
 3853|       |  /* update global accounting */
 3854|      1|  __kmp_all_nth++;
 3855|      1|  TCW_4(__kmp_nth, __kmp_nth + 1);
  ------------------
  |  | 1128|      1|#define TCW_4(a, b) (a) = (b)
  ------------------
 3856|       |
 3857|       |  // if __kmp_adjust_gtid_mode is set, then we use method #1 (sp search) for low
 3858|       |  // numbers of procs, and method #2 (keyed API call) for higher numbers.
 3859|      1|  if (__kmp_adjust_gtid_mode) {
  ------------------
  |  Branch (3859:7): [True: 0, False: 1]
  ------------------
 3860|      0|    if (__kmp_all_nth >= __kmp_tls_gtid_min) {
  ------------------
  |  Branch (3860:9): [True: 0, False: 0]
  ------------------
 3861|      0|      if (TCR_4(__kmp_gtid_mode) != 2) {
  ------------------
  |  | 1127|      0|#define TCR_4(a) (a)
  ------------------
  |  Branch (3861:11): [True: 0, False: 0]
  ------------------
 3862|      0|        TCW_4(__kmp_gtid_mode, 2);
  ------------------
  |  | 1128|      0|#define TCW_4(a, b) (a) = (b)
  ------------------
 3863|      0|      }
 3864|      0|    } else {
 3865|      0|      if (TCR_4(__kmp_gtid_mode) != 1) {
  ------------------
  |  | 1127|      0|#define TCR_4(a) (a)
  ------------------
  |  Branch (3865:11): [True: 0, False: 0]
  ------------------
 3866|      0|        TCW_4(__kmp_gtid_mode, 1);
  ------------------
  |  | 1128|      0|#define TCW_4(a, b) (a) = (b)
  ------------------
 3867|      0|      }
 3868|      0|    }
 3869|      0|  }
 3870|       |
 3871|      1|#ifdef KMP_ADJUST_BLOCKTIME
 3872|       |  /* Adjust blocktime to zero if necessary            */
 3873|       |  /* Middle initialization might not have occurred yet */
 3874|      1|  if (!__kmp_env_blocktime && (__kmp_avail_proc > 0)) {
  ------------------
  |  Branch (3874:7): [True: 1, False: 0]
  |  Branch (3874:31): [True: 0, False: 1]
  ------------------
 3875|      0|    if (__kmp_nth > __kmp_avail_proc) {
  ------------------
  |  Branch (3875:9): [True: 0, False: 0]
  ------------------
 3876|      0|      __kmp_zero_bt = TRUE;
  ------------------
  |  | 1280|      0|#define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  | 1279|      0|#define FALSE 0
  |  |  ------------------
  ------------------
 3877|      0|    }
 3878|      0|  }
 3879|      1|#endif /* KMP_ADJUST_BLOCKTIME */
 3880|       |
 3881|       |  /* setup this new hierarchy */
 3882|      1|  if (!(root = __kmp_root[gtid])) {
  ------------------
  |  Branch (3882:7): [True: 1, False: 0]
  ------------------
 3883|      1|    root = __kmp_root[gtid] = (kmp_root_t *)__kmp_allocate(sizeof(kmp_root_t));
  ------------------
  |  | 3617|      1|#define __kmp_allocate(size) ___kmp_allocate((size)KMP_SRC_LOC_CURR)
  ------------------
 3884|      1|    KMP_DEBUG_ASSERT(!root->r.r_root_team);
 3885|      1|  }
 3886|       |
 3887|       |#if KMP_STATS_ENABLED
 3888|       |  // Initialize stats as soon as possible (right after gtid assignment).
 3889|       |  __kmp_stats_thread_ptr = __kmp_stats_list->push_back(gtid);
 3890|       |  __kmp_stats_thread_ptr->startLife();
 3891|       |  KMP_SET_THREAD_STATE(SERIAL_REGION);
 3892|       |  KMP_INIT_PARTITIONED_TIMERS(OMP_serial);
 3893|       |#endif
 3894|      1|  __kmp_initialize_root(root);
 3895|       |
 3896|       |  /* setup new root thread structure */
 3897|      1|  if (root->r.r_uber_thread) {
  ------------------
  |  Branch (3897:7): [True: 0, False: 1]
  ------------------
 3898|      0|    root_thread = root->r.r_uber_thread;
 3899|      1|  } else {
 3900|      1|    root_thread = (kmp_info_t *)__kmp_allocate(sizeof(kmp_info_t));
  ------------------
  |  | 3617|      1|#define __kmp_allocate(size) ___kmp_allocate((size)KMP_SRC_LOC_CURR)
  ------------------
 3901|      1|    if (__kmp_storage_map) {
  ------------------
  |  Branch (3901:9): [True: 0, False: 1]
  ------------------
 3902|      0|      __kmp_print_thread_storage_map(root_thread, gtid);
 3903|      0|    }
 3904|      1|    root_thread->th.th_info.ds.ds_gtid = gtid;
 3905|      1|#if OMPT_SUPPORT
 3906|      1|    root_thread->th.ompt_thread_info.thread_data = ompt_data_none;
  ------------------
  |  | 1408|      1|#define ompt_data_none {0}
  ------------------
 3907|      1|#endif
 3908|      1|    root_thread->th.th_root = root;
 3909|      1|    if (__kmp_env_consistency_check) {
  ------------------
  |  Branch (3909:9): [True: 0, False: 1]
  ------------------
 3910|      0|      root_thread->th.th_cons = __kmp_allocate_cons_stack(gtid);
 3911|      0|    }
 3912|      1|#if USE_FAST_MEMORY
 3913|      1|    __kmp_initialize_fast_memory(root_thread);
 3914|      1|#endif /* USE_FAST_MEMORY */
 3915|       |
 3916|      1|#if KMP_USE_BGET
 3917|      1|    KMP_DEBUG_ASSERT(root_thread->th.th_local.bget_data == NULL);
 3918|      1|    __kmp_initialize_bget(root_thread);
 3919|      1|#endif
 3920|      1|    __kmp_init_random(root_thread); // Initialize random number generator
 3921|      1|  }
 3922|       |
 3923|       |  /* setup the serial team held in reserve by the root thread */
 3924|      1|  if (!root_thread->th.th_serial_team) {
  ------------------
  |  Branch (3924:7): [True: 1, False: 0]
  ------------------
 3925|      1|    kmp_internal_control_t r_icvs = __kmp_get_global_icvs();
 3926|      1|    KF_TRACE(10, ("__kmp_register_root: before serial_team\n"));
 3927|      1|    root_thread->th.th_serial_team = __kmp_allocate_team(
 3928|      1|        root, 1, 1,
 3929|      1|#if OMPT_SUPPORT
 3930|      1|        ompt_data_none, // root parallel id
  ------------------
  |  | 1408|      1|#define ompt_data_none {0}
  ------------------
 3931|      1|#endif
 3932|      1|        proc_bind_default, &r_icvs, 0 USE_NESTED_HOT_ARG(NULL));
  ------------------
  |  |  165|      1|#define USE_NESTED_HOT_ARG(x) , x
  ------------------
 3933|      1|  }
 3934|      1|  KMP_ASSERT(root_thread->th.th_serial_team);
  ------------------
  |  |   50|      1|  if (!(cond)) {                                                               \
  |  |  ------------------
  |  |  |  Branch (50:7): [True: 0, False: 1]
  |  |  ------------------
  |  |   51|      0|    __kmp_debug_assert("assertion failure", __FILE__, __LINE__);               \
  |  |   52|      0|  }
  ------------------
 3935|      1|  KF_TRACE(10, ("__kmp_register_root: after serial_team = %p\n",
 3936|      1|                root_thread->th.th_serial_team));
 3937|       |
 3938|       |  /* drop root_thread into place */
 3939|      1|  TCW_SYNC_PTR(__kmp_threads[gtid], root_thread);
  ------------------
  |  | 1159|      1|#define TCW_SYNC_PTR(a, b) TCW_SYNC_8((a), (b))
  |  |  ------------------
  |  |  |  | 1141|      1|#define TCW_SYNC_8(a, b) (a) = (b)
  |  |  ------------------
  ------------------
 3940|       |
 3941|      1|  root->r.r_root_team->t.t_threads[0] = root_thread;
 3942|      1|  root->r.r_hot_team->t.t_threads[0] = root_thread;
 3943|      1|  root_thread->th.th_serial_team->t.t_threads[0] = root_thread;
 3944|       |  // AC: the team created in reserve, not for execution (it is unused for now).
 3945|      1|  root_thread->th.th_serial_team->t.t_serialized = 0;
 3946|      1|  root->r.r_uber_thread = root_thread;
 3947|       |
 3948|       |  /* initialize the thread, get it ready to go */
 3949|      1|  __kmp_initialize_info(root_thread, root->r.r_root_team, 0, gtid);
 3950|      1|  TCW_4(__kmp_init_gtid, TRUE);
  ------------------
  |  | 1128|      1|#define TCW_4(a, b) (a) = (b)
  ------------------
 3951|       |
 3952|       |  /* prepare the primary thread for get_gtid() */
 3953|      1|  __kmp_gtid_set_specific(gtid);
 3954|       |
 3955|       |#if USE_ITT_BUILD
 3956|       |  __kmp_itt_thread_name(gtid);
 3957|       |#endif /* USE_ITT_BUILD */
 3958|       |
 3959|      1|#ifdef KMP_TDATA_GTID
 3960|      1|  __kmp_gtid = gtid;
 3961|      1|#endif
 3962|      1|  __kmp_create_worker(gtid, root_thread, __kmp_stksize);
 3963|      1|  KMP_DEBUG_ASSERT(__kmp_gtid_get_specific() == gtid);
 3964|       |
 3965|      1|  KA_TRACE(20, ("__kmp_register_root: T#%d init T#%d(%d:%d) arrived: join=%u, "
 3966|      1|                "plain=%u\n",
 3967|      1|                gtid, __kmp_gtid_from_tid(0, root->r.r_hot_team),
 3968|      1|                root->r.r_hot_team->t.t_id, 0, KMP_INIT_BARRIER_STATE,
 3969|      1|                KMP_INIT_BARRIER_STATE));
 3970|      1|  { // Initialize barrier data.
 3971|      1|    int b;
 3972|      4|    for (b = 0; b < bs_last_barrier; ++b) {
  ------------------
  |  Branch (3972:17): [True: 3, False: 1]
  ------------------
 3973|      3|      root_thread->th.th_bar[b].bb.b_arrived = KMP_INIT_BARRIER_STATE;
  ------------------
  |  | 2018|      3|#define KMP_INIT_BARRIER_STATE 0 /* should probably start from zero */
  ------------------
 3974|       |#if USE_DEBUGGER
 3975|       |      root_thread->th.th_bar[b].bb.b_worker_arrived = 0;
 3976|       |#endif
 3977|      3|    }
 3978|      1|  }
 3979|      1|  KMP_DEBUG_ASSERT(root->r.r_hot_team->t.t_bar[bs_forkjoin_barrier].b_arrived ==
 3980|      1|                   KMP_INIT_BARRIER_STATE);
 3981|       |
 3982|      1|#if KMP_AFFINITY_SUPPORTED
 3983|      1|  root_thread->th.th_current_place = KMP_PLACE_UNDEFINED;
  ------------------
  |  |  960|      1|#define KMP_PLACE_UNDEFINED (-2)
  ------------------
 3984|      1|  root_thread->th.th_new_place = KMP_PLACE_UNDEFINED;
  ------------------
  |  |  960|      1|#define KMP_PLACE_UNDEFINED (-2)
  ------------------
 3985|      1|  root_thread->th.th_first_place = KMP_PLACE_UNDEFINED;
  ------------------
  |  |  960|      1|#define KMP_PLACE_UNDEFINED (-2)
  ------------------
 3986|      1|  root_thread->th.th_last_place = KMP_PLACE_UNDEFINED;
  ------------------
  |  |  960|      1|#define KMP_PLACE_UNDEFINED (-2)
  ------------------
 3987|      1|#endif /* KMP_AFFINITY_SUPPORTED */
 3988|      1|  root_thread->th.th_def_allocator = __kmp_def_allocator;
 3989|      1|  root_thread->th.th_prev_level = 0;
 3990|      1|  root_thread->th.th_prev_num_threads = 1;
 3991|       |
 3992|      1|  kmp_cg_root_t *tmp = (kmp_cg_root_t *)__kmp_allocate(sizeof(kmp_cg_root_t));
  ------------------
  |  | 3617|      1|#define __kmp_allocate(size) ___kmp_allocate((size)KMP_SRC_LOC_CURR)
  ------------------
 3993|      1|  tmp->cg_root = root_thread;
 3994|      1|  tmp->cg_thread_limit = __kmp_cg_max_nth;
 3995|      1|  tmp->cg_nthreads = 1;
 3996|      1|  KA_TRACE(100, ("__kmp_register_root: Thread %p created node %p with"
 3997|      1|                 " cg_nthreads init to 1\n",
 3998|      1|                 root_thread, tmp));
 3999|      1|  tmp->up = NULL;
 4000|      1|  root_thread->th.th_cg_roots = tmp;
 4001|       |
 4002|      1|  __kmp_root_counter++;
 4003|       |
 4004|      1|#if OMPT_SUPPORT
 4005|      1|  if (!initial_thread && ompt_enabled.enabled) {
  ------------------
  |  Branch (4005:7): [True: 0, False: 1]
  |  Branch (4005:26): [True: 0, False: 0]
  ------------------
 4006|       |
 4007|      0|    kmp_info_t *root_thread = ompt_get_thread();
 4008|       |
 4009|      0|    ompt_set_thread_state(root_thread, ompt_state_overhead);
 4010|       |
 4011|      0|    if (ompt_enabled.ompt_callback_thread_begin) {
  ------------------
  |  Branch (4011:9): [True: 0, False: 0]
  ------------------
 4012|      0|      ompt_callbacks.ompt_callback(ompt_callback_thread_begin)(
  ------------------
  |  |   27|      0|#define ompt_callback(e) e##_callback
  ------------------
 4013|      0|          ompt_thread_initial, __ompt_get_thread_data_internal());
 4014|      0|    }
 4015|      0|    ompt_data_t *task_data;
 4016|      0|    ompt_data_t *parallel_data;
 4017|      0|    __ompt_get_task_info_internal(0, NULL, &task_data, NULL, &parallel_data,
 4018|      0|                                  NULL);
 4019|      0|    if (ompt_enabled.ompt_callback_implicit_task) {
  ------------------
  |  Branch (4019:9): [True: 0, False: 0]
  ------------------
 4020|      0|      ompt_callbacks.ompt_callback(ompt_callback_implicit_task)(
  ------------------
  |  |   27|      0|#define ompt_callback(e) e##_callback
  ------------------
 4021|      0|          ompt_scope_begin, parallel_data, task_data, 1, 1, ompt_task_initial);
 4022|      0|    }
 4023|       |
 4024|      0|    ompt_set_thread_state(root_thread, ompt_state_work_serial);
 4025|      0|  }
 4026|      1|#endif
 4027|      1|#if OMPD_SUPPORT
 4028|      1|  if (ompd_state & OMPD_ENABLE_BP)
  ------------------
  |  |   35|      1|#define OMPD_ENABLE_BP 0x1
  ------------------
  |  Branch (4028:7): [True: 0, False: 1]
  ------------------
 4029|      0|    ompd_bp_thread_begin();
 4030|      1|#endif
 4031|       |
 4032|      1|  KMP_MB();
 4033|      1|  __kmp_release_bootstrap_lock(&__kmp_forkjoin_lock);
 4034|       |
 4035|      1|  return gtid;
 4036|      1|}
_Z36__kmp_unregister_root_current_threadi:
 4160|      1|void __kmp_unregister_root_current_thread(int gtid) {
 4161|      1|  KA_TRACE(1, ("__kmp_unregister_root_current_thread: enter T#%d\n", gtid));
 4162|       |  /* this lock should be ok, since unregister_root_current_thread is never
 4163|       |     called during an abort, only during a normal close. furthermore, if you
 4164|       |     have the forkjoin lock, you should never try to get the initz lock */
 4165|      1|  __kmp_acquire_bootstrap_lock(&__kmp_forkjoin_lock);
 4166|      1|  if (TCR_4(__kmp_global.g.g_done) || !__kmp_init_serial) {
  ------------------
  |  | 1127|      2|#define TCR_4(a) (a)
  |  |  ------------------
  |  |  |  Branch (1127:18): [True: 0, False: 1]
  |  |  ------------------
  ------------------
  |  Branch (4166:39): [True: 0, False: 1]
  ------------------
 4167|      0|    KC_TRACE(10, ("__kmp_unregister_root_current_thread: already finished, "
 4168|      0|                  "exiting T#%d\n",
 4169|      0|                  gtid));
 4170|      0|    __kmp_release_bootstrap_lock(&__kmp_forkjoin_lock);
 4171|      0|    return;
 4172|      0|  }
 4173|      1|  kmp_root_t *root = __kmp_root[gtid];
 4174|       |
 4175|      1|  KMP_DEBUG_ASSERT(__kmp_threads && __kmp_threads[gtid]);
 4176|      1|  KMP_ASSERT(KMP_UBER_GTID(gtid));
  ------------------
  |  |   50|      1|  if (!(cond)) {                                                               \
  |  |  ------------------
  |  |  |  Branch (50:7): [True: 0, False: 1]
  |  |  ------------------
  |  |   51|      0|    __kmp_debug_assert("assertion failure", __FILE__, __LINE__);               \
  |  |   52|      0|  }
  ------------------
 4177|      1|  KMP_ASSERT(root == __kmp_threads[gtid]->th.th_root);
  ------------------
  |  |   50|      1|  if (!(cond)) {                                                               \
  |  |  ------------------
  |  |  |  Branch (50:7): [True: 0, False: 1]
  |  |  ------------------
  |  |   51|      0|    __kmp_debug_assert("assertion failure", __FILE__, __LINE__);               \
  |  |   52|      0|  }
  ------------------
 4178|      1|  KMP_ASSERT(root->r.r_active == FALSE);
  ------------------
  |  |   50|      1|  if (!(cond)) {                                                               \
  |  |  ------------------
  |  |  |  Branch (50:7): [True: 0, False: 1]
  |  |  ------------------
  |  |   51|      0|    __kmp_debug_assert("assertion failure", __FILE__, __LINE__);               \
  |  |   52|      0|  }
  ------------------
 4179|       |
 4180|      1|  KMP_MB();
 4181|       |
 4182|      1|  kmp_info_t *thread = __kmp_threads[gtid];
 4183|      1|  kmp_team_t *team = thread->th.th_team;
 4184|      1|  kmp_task_team_t *task_team = thread->th.th_task_team;
 4185|       |
 4186|       |  // we need to wait for the proxy tasks before finishing the thread
 4187|      1|  if (task_team != NULL && (task_team->tt.tt_found_proxy_tasks ||
  ------------------
  |  Branch (4187:7): [True: 0, False: 1]
  |  Branch (4187:29): [True: 0, False: 0]
  ------------------
 4188|      0|                            task_team->tt.tt_hidden_helper_task_encountered)) {
  ------------------
  |  Branch (4188:29): [True: 0, False: 0]
  ------------------
 4189|      0|#if OMPT_SUPPORT
 4190|       |    // the runtime is shutting down so we won't report any events
 4191|      0|    thread->th.ompt_thread_info.state = ompt_state_undefined;
 4192|      0|#endif
 4193|      0|    __kmp_task_team_wait(thread, team USE_ITT_BUILD_ARG(NULL));
 4194|      0|  }
 4195|       |
 4196|      1|  __kmp_reset_root(gtid, root);
 4197|       |
 4198|      1|  KMP_MB();
 4199|      1|  KC_TRACE(10,
 4200|      1|           ("__kmp_unregister_root_current_thread: T#%d unregistered\n", gtid));
 4201|       |
 4202|      1|  __kmp_release_bootstrap_lock(&__kmp_forkjoin_lock);
 4203|      1|}
__kmp_allocate_thread:
 4405|     31|                                  int new_tid) {
 4406|     31|  kmp_team_t *serial_team;
 4407|     31|  kmp_info_t *new_thr;
 4408|     31|  int new_gtid;
 4409|       |
 4410|     31|  KA_TRACE(20, ("__kmp_allocate_thread: T#%d\n", __kmp_get_gtid()));
 4411|     31|  KMP_DEBUG_ASSERT(root && team);
 4412|       |#if !KMP_NESTED_HOT_TEAMS
 4413|       |  KMP_DEBUG_ASSERT(KMP_MASTER_GTID(__kmp_get_gtid()));
 4414|       |#endif
 4415|     31|  KMP_MB();
 4416|       |
 4417|       |  /* first, try to get one from the thread pool */
 4418|     31|  if (__kmp_thread_pool) {
  ------------------
  |  Branch (4418:7): [True: 0, False: 31]
  ------------------
 4419|      0|    new_thr = CCAST(kmp_info_t *, __kmp_thread_pool);
  ------------------
  |  |  229|      0|#define CCAST(type, var) const_cast<type>(var)
  ------------------
 4420|      0|    __kmp_thread_pool = (volatile kmp_info_t *)new_thr->th.th_next_pool;
 4421|      0|    if (new_thr == __kmp_thread_pool_insert_pt) {
  ------------------
  |  Branch (4421:9): [True: 0, False: 0]
  ------------------
 4422|      0|      __kmp_thread_pool_insert_pt = NULL;
 4423|      0|    }
 4424|      0|    TCW_4(new_thr->th.th_in_pool, FALSE);
  ------------------
  |  | 1128|      0|#define TCW_4(a, b) (a) = (b)
  ------------------
 4425|      0|    __kmp_suspend_initialize_thread(new_thr);
 4426|      0|    __kmp_lock_suspend_mx(new_thr);
 4427|      0|    if (new_thr->th.th_active_in_pool == TRUE) {
  ------------------
  |  | 1280|      0|#define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  | 1279|      0|#define FALSE 0
  |  |  ------------------
  ------------------
  |  Branch (4427:9): [True: 0, False: 0]
  ------------------
 4428|      0|      KMP_DEBUG_ASSERT(new_thr->th.th_active == TRUE);
 4429|      0|      KMP_ATOMIC_DEC(&__kmp_thread_pool_active_nth);
  ------------------
  |  | 1260|      0|#define KMP_ATOMIC_DEC(p) KMP_ATOMIC_OP(fetch_sub, p, 1, acq_rel)
  |  |  ------------------
  |  |  |  | 1246|      0|#define KMP_ATOMIC_OP(op, p, v, order) (p)->op(v, std::memory_order_##order)
  |  |  ------------------
  ------------------
 4430|      0|      new_thr->th.th_active_in_pool = FALSE;
  ------------------
  |  | 1279|      0|#define FALSE 0
  ------------------
 4431|      0|    }
 4432|      0|    __kmp_unlock_suspend_mx(new_thr);
 4433|       |
 4434|      0|    KA_TRACE(20, ("__kmp_allocate_thread: T#%d using thread T#%d\n",
 4435|      0|                  __kmp_get_gtid(), new_thr->th.th_info.ds.ds_gtid));
 4436|      0|    KMP_ASSERT(!new_thr->th.th_team);
  ------------------
  |  |   50|      0|  if (!(cond)) {                                                               \
  |  |  ------------------
  |  |  |  Branch (50:7): [True: 0, False: 0]
  |  |  ------------------
  |  |   51|      0|    __kmp_debug_assert("assertion failure", __FILE__, __LINE__);               \
  |  |   52|      0|  }
  ------------------
 4437|      0|    KMP_DEBUG_ASSERT(__kmp_nth < __kmp_threads_capacity);
 4438|       |
 4439|       |    /* setup the thread structure */
 4440|      0|    __kmp_initialize_info(new_thr, team, new_tid,
 4441|      0|                          new_thr->th.th_info.ds.ds_gtid);
 4442|      0|    KMP_DEBUG_ASSERT(new_thr->th.th_serial_team);
 4443|       |
 4444|      0|    TCW_4(__kmp_nth, __kmp_nth + 1);
  ------------------
  |  | 1128|      0|#define TCW_4(a, b) (a) = (b)
  ------------------
 4445|       |
 4446|      0|    new_thr->th.th_task_state = 0;
 4447|      0|    new_thr->th.th_task_state_top = 0;
 4448|      0|    new_thr->th.th_task_state_stack_sz = 4;
 4449|       |
 4450|      0|    if (__kmp_barrier_gather_pattern[bs_forkjoin_barrier] == bp_dist_bar) {
  ------------------
  |  Branch (4450:9): [True: 0, False: 0]
  ------------------
 4451|       |      // Make sure pool thread has transitioned to waiting on own thread struct
 4452|      0|      KMP_DEBUG_ASSERT(new_thr->th.th_used_in_team.load() == 0);
 4453|       |      // Thread activated in __kmp_allocate_team when increasing team size
 4454|      0|    }
 4455|       |
 4456|      0|#ifdef KMP_ADJUST_BLOCKTIME
 4457|       |    /* Adjust blocktime back to zero if necessary */
 4458|       |    /* Middle initialization might not have occurred yet */
 4459|      0|    if (!__kmp_env_blocktime && (__kmp_avail_proc > 0)) {
  ------------------
  |  Branch (4459:9): [True: 0, False: 0]
  |  Branch (4459:33): [True: 0, False: 0]
  ------------------
 4460|      0|      if (__kmp_nth > __kmp_avail_proc) {
  ------------------
  |  Branch (4460:11): [True: 0, False: 0]
  ------------------
 4461|      0|        __kmp_zero_bt = TRUE;
  ------------------
  |  | 1280|      0|#define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  | 1279|      0|#define FALSE 0
  |  |  ------------------
  ------------------
 4462|      0|      }
 4463|      0|    }
 4464|      0|#endif /* KMP_ADJUST_BLOCKTIME */
 4465|       |
 4466|       |#if KMP_DEBUG
 4467|       |    // If thread entered pool via __kmp_free_thread, wait_flag should !=
 4468|       |    // KMP_BARRIER_PARENT_FLAG.
 4469|       |    int b;
 4470|       |    kmp_balign_t *balign = new_thr->th.th_bar;
 4471|       |    for (b = 0; b < bs_last_barrier; ++b)
 4472|       |      KMP_DEBUG_ASSERT(balign[b].bb.wait_flag != KMP_BARRIER_PARENT_FLAG);
 4473|       |#endif
 4474|       |
 4475|      0|    KF_TRACE(10, ("__kmp_allocate_thread: T#%d using thread %p T#%d\n",
 4476|      0|                  __kmp_get_gtid(), new_thr, new_thr->th.th_info.ds.ds_gtid));
 4477|       |
 4478|      0|    KMP_MB();
 4479|      0|    return new_thr;
 4480|      0|  }
 4481|       |
 4482|       |  /* no, well fork a new one */
 4483|     31|  KMP_ASSERT(__kmp_nth == __kmp_all_nth);
  ------------------
  |  |   50|     31|  if (!(cond)) {                                                               \
  |  |  ------------------
  |  |  |  Branch (50:7): [True: 0, False: 31]
  |  |  ------------------
  |  |   51|      0|    __kmp_debug_assert("assertion failure", __FILE__, __LINE__);               \
  |  |   52|      0|  }
  ------------------
 4484|     31|  KMP_ASSERT(__kmp_all_nth < __kmp_threads_capacity);
  ------------------
  |  |   50|     31|  if (!(cond)) {                                                               \
  |  |  ------------------
  |  |  |  Branch (50:7): [True: 0, False: 31]
  |  |  ------------------
  |  |   51|      0|    __kmp_debug_assert("assertion failure", __FILE__, __LINE__);               \
  |  |   52|      0|  }
  ------------------
 4485|       |
 4486|       |#if KMP_USE_MONITOR
 4487|       |  // If this is the first worker thread the RTL is creating, then also
 4488|       |  // launch the monitor thread.  We try to do this as early as possible.
 4489|       |  if (!TCR_4(__kmp_init_monitor)) {
 4490|       |    __kmp_acquire_bootstrap_lock(&__kmp_monitor_lock);
 4491|       |    if (!TCR_4(__kmp_init_monitor)) {
 4492|       |      KF_TRACE(10, ("before __kmp_create_monitor\n"));
 4493|       |      TCW_4(__kmp_init_monitor, 1);
 4494|       |      __kmp_create_monitor(&__kmp_monitor);
 4495|       |      KF_TRACE(10, ("after __kmp_create_monitor\n"));
 4496|       |#if KMP_OS_WINDOWS
 4497|       |      // AC: wait until monitor has started. This is a fix for CQ232808.
 4498|       |      // The reason is that if the library is loaded/unloaded in a loop with
 4499|       |      // small (parallel) work in between, then there is high probability that
 4500|       |      // monitor thread started after the library shutdown. At shutdown it is
 4501|       |      // too late to cope with the problem, because when the primary thread is
 4502|       |      // in DllMain (process detach) the monitor has no chances to start (it is
 4503|       |      // blocked), and primary thread has no means to inform the monitor that
 4504|       |      // the library has gone, because all the memory which the monitor can
 4505|       |      // access is going to be released/reset.
 4506|       |      while (TCR_4(__kmp_init_monitor) < 2) {
 4507|       |        KMP_YIELD(TRUE);
 4508|       |      }
 4509|       |      KF_TRACE(10, ("after monitor thread has started\n"));
 4510|       |#endif
 4511|       |    }
 4512|       |    __kmp_release_bootstrap_lock(&__kmp_monitor_lock);
 4513|       |  }
 4514|       |#endif
 4515|       |
 4516|     31|  KMP_MB();
 4517|       |
 4518|     31|  {
 4519|     31|    int new_start_gtid = TCR_4(__kmp_init_hidden_helper_threads)
  ------------------
  |  | 1127|     31|#define TCR_4(a) (a)
  |  |  ------------------
  |  |  |  Branch (1127:18): [True: 0, False: 31]
  |  |  ------------------
  ------------------
 4520|     31|                             ? 1
 4521|     31|                             : __kmp_hidden_helper_threads_num + 1;
 4522|       |
 4523|    496|    for (new_gtid = new_start_gtid; TCR_PTR(__kmp_threads[new_gtid]) != NULL;
  ------------------
  |  | 1156|    496|#define TCR_PTR(a) ((void *)TCR_8(a))
  |  |  ------------------
  |  |  |  | 1131|    496|#define TCR_8(a) (a)
  |  |  ------------------
  ------------------
  |  Branch (4523:37): [True: 465, False: 31]
  ------------------
 4524|    465|         ++new_gtid) {
 4525|    465|      KMP_DEBUG_ASSERT(new_gtid < __kmp_threads_capacity);
 4526|    465|    }
 4527|       |
 4528|     31|    if (TCR_4(__kmp_init_hidden_helper_threads)) {
  ------------------
  |  | 1127|     31|#define TCR_4(a) (a)
  |  |  ------------------
  |  |  |  Branch (1127:18): [True: 0, False: 31]
  |  |  ------------------
  ------------------
 4529|      0|      KMP_DEBUG_ASSERT(new_gtid <= __kmp_hidden_helper_threads_num);
 4530|      0|    }
 4531|     31|  }
 4532|       |
 4533|       |  /* allocate space for it. */
 4534|     31|  new_thr = (kmp_info_t *)__kmp_allocate(sizeof(kmp_info_t));
  ------------------
  |  | 3617|     31|#define __kmp_allocate(size) ___kmp_allocate((size)KMP_SRC_LOC_CURR)
  ------------------
 4535|       |
 4536|     31|  TCW_SYNC_PTR(__kmp_threads[new_gtid], new_thr);
  ------------------
  |  | 1159|     31|#define TCW_SYNC_PTR(a, b) TCW_SYNC_8((a), (b))
  |  |  ------------------
  |  |  |  | 1141|     31|#define TCW_SYNC_8(a, b) (a) = (b)
  |  |  ------------------
  ------------------
 4537|       |
 4538|       |#if USE_ITT_BUILD && USE_ITT_NOTIFY && KMP_DEBUG
 4539|       |  // suppress race conditions detection on synchronization flags in debug mode
 4540|       |  // this helps to analyze library internals eliminating false positives
 4541|       |  __itt_suppress_mark_range(
 4542|       |      __itt_suppress_range, __itt_suppress_threading_errors,
 4543|       |      &new_thr->th.th_sleep_loc, sizeof(new_thr->th.th_sleep_loc));
 4544|       |  __itt_suppress_mark_range(
 4545|       |      __itt_suppress_range, __itt_suppress_threading_errors,
 4546|       |      &new_thr->th.th_reap_state, sizeof(new_thr->th.th_reap_state));
 4547|       |#if KMP_OS_WINDOWS
 4548|       |  __itt_suppress_mark_range(
 4549|       |      __itt_suppress_range, __itt_suppress_threading_errors,
 4550|       |      &new_thr->th.th_suspend_init, sizeof(new_thr->th.th_suspend_init));
 4551|       |#else
 4552|       |  __itt_suppress_mark_range(__itt_suppress_range,
 4553|       |                            __itt_suppress_threading_errors,
 4554|       |                            &new_thr->th.th_suspend_init_count,
 4555|       |                            sizeof(new_thr->th.th_suspend_init_count));
 4556|       |#endif
 4557|       |  // TODO: check if we need to also suppress b_arrived flags
 4558|       |  __itt_suppress_mark_range(__itt_suppress_range,
 4559|       |                            __itt_suppress_threading_errors,
 4560|       |                            CCAST(kmp_uint64 *, &new_thr->th.th_bar[0].bb.b_go),
 4561|       |                            sizeof(new_thr->th.th_bar[0].bb.b_go));
 4562|       |  __itt_suppress_mark_range(__itt_suppress_range,
 4563|       |                            __itt_suppress_threading_errors,
 4564|       |                            CCAST(kmp_uint64 *, &new_thr->th.th_bar[1].bb.b_go),
 4565|       |                            sizeof(new_thr->th.th_bar[1].bb.b_go));
 4566|       |  __itt_suppress_mark_range(__itt_suppress_range,
 4567|       |                            __itt_suppress_threading_errors,
 4568|       |                            CCAST(kmp_uint64 *, &new_thr->th.th_bar[2].bb.b_go),
 4569|       |                            sizeof(new_thr->th.th_bar[2].bb.b_go));
 4570|       |#endif /* USE_ITT_BUILD && USE_ITT_NOTIFY && KMP_DEBUG */
 4571|     31|  if (__kmp_storage_map) {
  ------------------
  |  Branch (4571:7): [True: 0, False: 31]
  ------------------
 4572|      0|    __kmp_print_thread_storage_map(new_thr, new_gtid);
 4573|      0|  }
 4574|       |
 4575|       |  // add the reserve serialized team, initialized from the team's primary thread
 4576|     31|  {
 4577|     31|    kmp_internal_control_t r_icvs = __kmp_get_x_global_icvs(team);
 4578|     31|    KF_TRACE(10, ("__kmp_allocate_thread: before th_serial/serial_team\n"));
 4579|     31|    new_thr->th.th_serial_team = serial_team =
 4580|     31|        (kmp_team_t *)__kmp_allocate_team(root, 1, 1,
 4581|     31|#if OMPT_SUPPORT
 4582|     31|                                          ompt_data_none, // root parallel id
  ------------------
  |  | 1408|     31|#define ompt_data_none {0}
  ------------------
 4583|     31|#endif
 4584|     31|                                          proc_bind_default, &r_icvs,
 4585|     31|                                          0 USE_NESTED_HOT_ARG(NULL));
  ------------------
  |  |  165|     31|#define USE_NESTED_HOT_ARG(x) , x
  ------------------
 4586|     31|  }
 4587|     31|  KMP_ASSERT(serial_team);
  ------------------
  |  |   50|     31|  if (!(cond)) {                                                               \
  |  |  ------------------
  |  |  |  Branch (50:7): [True: 0, False: 31]
  |  |  ------------------
  |  |   51|      0|    __kmp_debug_assert("assertion failure", __FILE__, __LINE__);               \
  |  |   52|      0|  }
  ------------------
 4588|     31|  serial_team->t.t_serialized = 0; // AC: the team created in reserve, not for
 4589|       |  // execution (it is unused for now).
 4590|     31|  serial_team->t.t_threads[0] = new_thr;
 4591|     31|  KF_TRACE(10,
 4592|     31|           ("__kmp_allocate_thread: after th_serial/serial_team : new_thr=%p\n",
 4593|     31|            new_thr));
 4594|       |
 4595|       |  /* setup the thread structures */
 4596|     31|  __kmp_initialize_info(new_thr, team, new_tid, new_gtid);
 4597|       |
 4598|     31|#if USE_FAST_MEMORY
 4599|     31|  __kmp_initialize_fast_memory(new_thr);
 4600|     31|#endif /* USE_FAST_MEMORY */
 4601|       |
 4602|     31|#if KMP_USE_BGET
 4603|     31|  KMP_DEBUG_ASSERT(new_thr->th.th_local.bget_data == NULL);
 4604|     31|  __kmp_initialize_bget(new_thr);
 4605|     31|#endif
 4606|       |
 4607|     31|  __kmp_init_random(new_thr); // Initialize random number generator
 4608|       |
 4609|       |  /* Initialize these only once when thread is grabbed for a team allocation */
 4610|     31|  KA_TRACE(20,
 4611|     31|           ("__kmp_allocate_thread: T#%d init go fork=%u, plain=%u\n",
 4612|     31|            __kmp_get_gtid(), KMP_INIT_BARRIER_STATE, KMP_INIT_BARRIER_STATE));
 4613|       |
 4614|     31|  int b;
 4615|     31|  kmp_balign_t *balign = new_thr->th.th_bar;
 4616|    124|  for (b = 0; b < bs_last_barrier; ++b) {
  ------------------
  |  Branch (4616:15): [True: 93, False: 31]
  ------------------
 4617|     93|    balign[b].bb.b_go = KMP_INIT_BARRIER_STATE;
  ------------------
  |  | 2018|     93|#define KMP_INIT_BARRIER_STATE 0 /* should probably start from zero */
  ------------------
 4618|     93|    balign[b].bb.team = NULL;
 4619|     93|    balign[b].bb.wait_flag = KMP_BARRIER_NOT_WAITING;
  ------------------
  |  | 2035|     93|#define KMP_BARRIER_NOT_WAITING 0 // Normal state; worker not in wait_sleep
  ------------------
 4620|     93|    balign[b].bb.use_oncore_barrier = 0;
 4621|     93|  }
 4622|       |
 4623|     31|  TCW_PTR(new_thr->th.th_sleep_loc, NULL);
  ------------------
  |  | 1157|     31|#define TCW_PTR(a, b) TCW_8((a), (b))
  |  |  ------------------
  |  |  |  | 1132|     31|#define TCW_8(a, b) (a) = (b)
  |  |  ------------------
  ------------------
 4624|     31|  new_thr->th.th_sleep_loc_type = flag_unset;
 4625|       |
 4626|     31|  new_thr->th.th_spin_here = FALSE;
  ------------------
  |  | 1279|     31|#define FALSE 0
  ------------------
 4627|     31|  new_thr->th.th_next_waiting = 0;
 4628|     31|#if KMP_OS_UNIX
 4629|     31|  new_thr->th.th_blocking = false;
 4630|     31|#endif
 4631|       |
 4632|     31|#if KMP_AFFINITY_SUPPORTED
 4633|     31|  new_thr->th.th_current_place = KMP_PLACE_UNDEFINED;
  ------------------
  |  |  960|     31|#define KMP_PLACE_UNDEFINED (-2)
  ------------------
 4634|     31|  new_thr->th.th_new_place = KMP_PLACE_UNDEFINED;
  ------------------
  |  |  960|     31|#define KMP_PLACE_UNDEFINED (-2)
  ------------------
 4635|     31|  new_thr->th.th_first_place = KMP_PLACE_UNDEFINED;
  ------------------
  |  |  960|     31|#define KMP_PLACE_UNDEFINED (-2)
  ------------------
 4636|     31|  new_thr->th.th_last_place = KMP_PLACE_UNDEFINED;
  ------------------
  |  |  960|     31|#define KMP_PLACE_UNDEFINED (-2)
  ------------------
 4637|     31|#endif
 4638|     31|  new_thr->th.th_def_allocator = __kmp_def_allocator;
 4639|     31|  new_thr->th.th_prev_level = 0;
 4640|     31|  new_thr->th.th_prev_num_threads = 1;
 4641|       |
 4642|     31|  TCW_4(new_thr->th.th_in_pool, FALSE);
  ------------------
  |  | 1128|     31|#define TCW_4(a, b) (a) = (b)
  ------------------
 4643|     31|  new_thr->th.th_active_in_pool = FALSE;
  ------------------
  |  | 1279|     31|#define FALSE 0
  ------------------
 4644|     31|  TCW_4(new_thr->th.th_active, TRUE);
  ------------------
  |  | 1128|     31|#define TCW_4(a, b) (a) = (b)
  ------------------
 4645|       |
 4646|       |  /* adjust the global counters */
 4647|     31|  __kmp_all_nth++;
 4648|     31|  __kmp_nth++;
 4649|       |
 4650|       |  // if __kmp_adjust_gtid_mode is set, then we use method #1 (sp search) for low
 4651|       |  // numbers of procs, and method #2 (keyed API call) for higher numbers.
 4652|     31|  if (__kmp_adjust_gtid_mode) {
  ------------------
  |  Branch (4652:7): [True: 0, False: 31]
  ------------------
 4653|      0|    if (__kmp_all_nth >= __kmp_tls_gtid_min) {
  ------------------
  |  Branch (4653:9): [True: 0, False: 0]
  ------------------
 4654|      0|      if (TCR_4(__kmp_gtid_mode) != 2) {
  ------------------
  |  | 1127|      0|#define TCR_4(a) (a)
  ------------------
  |  Branch (4654:11): [True: 0, False: 0]
  ------------------
 4655|      0|        TCW_4(__kmp_gtid_mode, 2);
  ------------------
  |  | 1128|      0|#define TCW_4(a, b) (a) = (b)
  ------------------
 4656|      0|      }
 4657|      0|    } else {
 4658|      0|      if (TCR_4(__kmp_gtid_mode) != 1) {
  ------------------
  |  | 1127|      0|#define TCR_4(a) (a)
  ------------------
  |  Branch (4658:11): [True: 0, False: 0]
  ------------------
 4659|      0|        TCW_4(__kmp_gtid_mode, 1);
  ------------------
  |  | 1128|      0|#define TCW_4(a, b) (a) = (b)
  ------------------
 4660|      0|      }
 4661|      0|    }
 4662|      0|  }
 4663|       |
 4664|     31|#ifdef KMP_ADJUST_BLOCKTIME
 4665|       |  /* Adjust blocktime back to zero if necessary       */
 4666|       |  /* Middle initialization might not have occurred yet */
 4667|     31|  if (!__kmp_env_blocktime && (__kmp_avail_proc > 0)) {
  ------------------
  |  Branch (4667:7): [True: 31, False: 0]
  |  Branch (4667:31): [True: 31, False: 0]
  ------------------
 4668|     31|    if (__kmp_nth > __kmp_avail_proc) {
  ------------------
  |  Branch (4668:9): [True: 0, False: 31]
  ------------------
 4669|      0|      __kmp_zero_bt = TRUE;
  ------------------
  |  | 1280|      0|#define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  | 1279|      0|#define FALSE 0
  |  |  ------------------
  ------------------
 4670|      0|    }
 4671|     31|  }
 4672|     31|#endif /* KMP_ADJUST_BLOCKTIME */
 4673|       |
 4674|       |  /* actually fork it and create the new worker thread */
 4675|     31|  KF_TRACE(
 4676|     31|      10, ("__kmp_allocate_thread: before __kmp_create_worker: %p\n", new_thr));
 4677|     31|  __kmp_create_worker(new_gtid, new_thr, __kmp_stksize);
 4678|     31|  KF_TRACE(10,
 4679|     31|           ("__kmp_allocate_thread: after __kmp_create_worker: %p\n", new_thr));
 4680|       |
 4681|     31|  KA_TRACE(20, ("__kmp_allocate_thread: T#%d forked T#%d\n", __kmp_get_gtid(),
 4682|     31|                new_gtid));
 4683|     31|  KMP_MB();
 4684|     31|  return new_thr;
 4685|     31|}
__kmp_allocate_team:
 5130|  1.38k|                    int argc USE_NESTED_HOT_ARG(kmp_info_t *master)) {
 5131|  1.38k|  KMP_TIME_DEVELOPER_PARTITIONED_BLOCK(KMP_allocate_team);
  ------------------
  |  | 1008|  1.38k|#define KMP_TIME_DEVELOPER_PARTITIONED_BLOCK(n) ((void)0)
  ------------------
 5132|  1.38k|  int f;
 5133|  1.38k|  kmp_team_t *team;
 5134|  1.38k|  int use_hot_team = !root->r.r_active;
 5135|  1.38k|  int level = 0;
 5136|  1.38k|  int do_place_partition = 1;
 5137|       |
 5138|  1.38k|  KA_TRACE(20, ("__kmp_allocate_team: called\n"));
 5139|  1.38k|  KMP_DEBUG_ASSERT(new_nproc >= 1 && argc >= 0);
 5140|  1.38k|  KMP_DEBUG_ASSERT(max_nproc >= new_nproc);
 5141|  1.38k|  KMP_MB();
 5142|       |
 5143|  1.38k|#if KMP_NESTED_HOT_TEAMS
 5144|  1.38k|  kmp_hot_team_ptr_t *hot_teams;
 5145|  1.38k|  if (master) {
  ------------------
  |  Branch (5145:7): [True: 1.35k, False: 34]
  ------------------
 5146|  1.35k|    team = master->th.th_team;
 5147|  1.35k|    level = team->t.t_active_level;
 5148|  1.35k|    if (master->th.th_teams_microtask) { // in teams construct?
  ------------------
  |  Branch (5148:9): [True: 0, False: 1.35k]
  ------------------
 5149|      0|      if (master->th.th_teams_size.nteams > 1 &&
  ------------------
  |  Branch (5149:11): [True: 0, False: 0]
  ------------------
 5150|      0|          ( // #teams > 1
 5151|      0|              team->t.t_pkfn ==
  ------------------
  |  Branch (5151:15): [True: 0, False: 0]
  ------------------
 5152|      0|                  (microtask_t)__kmp_teams_master || // inner fork of the teams
 5153|      0|              master->th.th_teams_level <
  ------------------
  |  Branch (5153:15): [True: 0, False: 0]
  ------------------
 5154|      0|                  team->t.t_level)) { // or nested parallel inside the teams
 5155|      0|        ++level; // not increment if #teams==1, or for outer fork of the teams;
 5156|       |        // increment otherwise
 5157|      0|      }
 5158|       |      // Do not perform the place partition if inner fork of the teams
 5159|       |      // Wait until nested parallel region encountered inside teams construct
 5160|      0|      if ((master->th.th_teams_size.nteams == 1 &&
  ------------------
  |  Branch (5160:12): [True: 0, False: 0]
  ------------------
 5161|      0|           master->th.th_teams_level >= team->t.t_level) ||
  ------------------
  |  Branch (5161:12): [True: 0, False: 0]
  ------------------
 5162|      0|          (team->t.t_pkfn == (microtask_t)__kmp_teams_master))
  ------------------
  |  Branch (5162:11): [True: 0, False: 0]
  ------------------
 5163|      0|        do_place_partition = 0;
 5164|      0|    }
 5165|  1.35k|    hot_teams = master->th.th_hot_teams;
 5166|  1.35k|    if (level < __kmp_hot_teams_max_level && hot_teams &&
  ------------------
  |  Branch (5166:9): [True: 1.35k, False: 0]
  |  Branch (5166:46): [True: 1.35k, False: 0]
  ------------------
 5167|  1.35k|        hot_teams[level].hot_team) {
  ------------------
  |  Branch (5167:9): [True: 1.35k, False: 0]
  ------------------
 5168|       |      // hot team has already been allocated for given level
 5169|  1.35k|      use_hot_team = 1;
 5170|  1.35k|    } else {
 5171|      0|      use_hot_team = 0;
 5172|      0|    }
 5173|  1.35k|  } else {
 5174|       |    // check we won't access uninitialized hot_teams, just in case
 5175|     34|    KMP_DEBUG_ASSERT(new_nproc == 1);
 5176|     34|  }
 5177|  1.38k|#endif
 5178|       |  // Optimization to use a "hot" team
 5179|  1.38k|  if (use_hot_team && new_nproc > 1) {
  ------------------
  |  Branch (5179:7): [True: 1.38k, False: 0]
  |  Branch (5179:23): [True: 1.35k, False: 34]
  ------------------
 5180|  1.35k|    KMP_DEBUG_ASSERT(new_nproc <= max_nproc);
 5181|  1.35k|#if KMP_NESTED_HOT_TEAMS
 5182|  1.35k|    team = hot_teams[level].hot_team;
 5183|       |#else
 5184|       |    team = root->r.r_hot_team;
 5185|       |#endif
 5186|       |#if KMP_DEBUG
 5187|       |    if (__kmp_tasking_mode != tskm_immediate_exec) {
 5188|       |      KA_TRACE(20, ("__kmp_allocate_team: hot team task_team[0] = %p "
 5189|       |                    "task_team[1] = %p before reinit\n",
 5190|       |                    team->t.t_task_team[0], team->t.t_task_team[1]));
 5191|       |    }
 5192|       |#endif
 5193|       |
 5194|  1.35k|    if (team->t.t_nproc != new_nproc &&
  ------------------
  |  Branch (5194:9): [True: 1, False: 1.35k]
  ------------------
 5195|      1|        __kmp_barrier_release_pattern[bs_forkjoin_barrier] == bp_dist_bar) {
  ------------------
  |  Branch (5195:9): [True: 0, False: 1]
  ------------------
 5196|       |      // Distributed barrier may need a resize
 5197|      0|      int old_nthr = team->t.t_nproc;
 5198|      0|      __kmp_resize_dist_barrier(team, old_nthr, new_nproc);
 5199|      0|    }
 5200|       |
 5201|       |    // If not doing the place partition, then reset the team's proc bind
 5202|       |    // to indicate that partitioning of all threads still needs to take place
 5203|  1.35k|    if (do_place_partition == 0)
  ------------------
  |  Branch (5203:9): [True: 0, False: 1.35k]
  ------------------
 5204|      0|      team->t.t_proc_bind = proc_bind_default;
 5205|       |    // Has the number of threads changed?
 5206|       |    /* Let's assume the most common case is that the number of threads is
 5207|       |       unchanged, and put that case first. */
 5208|  1.35k|    if (team->t.t_nproc == new_nproc) { // Check changes in number of threads
  ------------------
  |  Branch (5208:9): [True: 1.35k, False: 1]
  ------------------
 5209|  1.35k|      KA_TRACE(20, ("__kmp_allocate_team: reusing hot team\n"));
 5210|       |      // This case can mean that omp_set_num_threads() was called and the hot
 5211|       |      // team size was already reduced, so we check the special flag
 5212|  1.35k|      if (team->t.t_size_changed == -1) {
  ------------------
  |  Branch (5212:11): [True: 0, False: 1.35k]
  ------------------
 5213|      0|        team->t.t_size_changed = 1;
 5214|  1.35k|      } else {
 5215|  1.35k|        KMP_CHECK_UPDATE(team->t.t_size_changed, 0);
  ------------------
  |  | 2280|  1.35k|  if ((a) != (b))                                                              \
  |  |  ------------------
  |  |  |  Branch (2280:7): [True: 1, False: 1.35k]
  |  |  ------------------
  |  | 2281|  1.35k|  (a) = (b)
  ------------------
 5216|  1.35k|      }
 5217|       |
 5218|       |      // TODO???: team->t.t_max_active_levels = new_max_active_levels;
 5219|  1.35k|      kmp_r_sched_t new_sched = new_icvs->sched;
 5220|       |      // set primary thread's schedule as new run-time schedule
 5221|  1.35k|      KMP_CHECK_UPDATE(team->t.t_sched.sched, new_sched.sched);
  ------------------
  |  | 2280|  1.35k|  if ((a) != (b))                                                              \
  |  |  ------------------
  |  |  |  Branch (2280:7): [True: 0, False: 1.35k]
  |  |  ------------------
  |  | 2281|  1.35k|  (a) = (b)
  ------------------
 5222|       |
 5223|  1.35k|      __kmp_reinitialize_team(team, new_icvs,
 5224|  1.35k|                              root->r.r_uber_thread->th.th_ident);
 5225|       |
 5226|  1.35k|      KF_TRACE(10, ("__kmp_allocate_team2: T#%d, this_thread=%p team=%p\n", 0,
 5227|  1.35k|                    team->t.t_threads[0], team));
 5228|  1.35k|      __kmp_push_current_task_to_thread(team->t.t_threads[0], team, 0);
 5229|       |
 5230|  1.35k|#if KMP_AFFINITY_SUPPORTED
 5231|  1.35k|      if ((team->t.t_size_changed == 0) &&
  ------------------
  |  Branch (5231:11): [True: 1.35k, False: 0]
  ------------------
 5232|  1.35k|          (team->t.t_proc_bind == new_proc_bind)) {
  ------------------
  |  Branch (5232:11): [True: 1.35k, False: 0]
  ------------------
 5233|  1.35k|        if (new_proc_bind == proc_bind_spread) {
  ------------------
  |  Branch (5233:13): [True: 0, False: 1.35k]
  ------------------
 5234|      0|          if (do_place_partition) {
  ------------------
  |  Branch (5234:15): [True: 0, False: 0]
  ------------------
 5235|       |            // add flag to update only master for spread
 5236|      0|            __kmp_partition_places(team, 1);
 5237|      0|          }
 5238|      0|        }
 5239|  1.35k|        KA_TRACE(200, ("__kmp_allocate_team: reusing hot team #%d bindings: "
 5240|  1.35k|                       "proc_bind = %d, partition = [%d,%d]\n",
 5241|  1.35k|                       team->t.t_id, new_proc_bind, team->t.t_first_place,
 5242|  1.35k|                       team->t.t_last_place));
 5243|  1.35k|      } else {
 5244|      0|        if (do_place_partition) {
  ------------------
  |  Branch (5244:13): [True: 0, False: 0]
  ------------------
 5245|      0|          KMP_CHECK_UPDATE(team->t.t_proc_bind, new_proc_bind);
  ------------------
  |  | 2280|      0|  if ((a) != (b))                                                              \
  |  |  ------------------
  |  |  |  Branch (2280:7): [True: 0, False: 0]
  |  |  ------------------
  |  | 2281|      0|  (a) = (b)
  ------------------
 5246|      0|          __kmp_partition_places(team);
 5247|      0|        }
 5248|      0|      }
 5249|       |#else
 5250|       |      KMP_CHECK_UPDATE(team->t.t_proc_bind, new_proc_bind);
 5251|       |#endif /* KMP_AFFINITY_SUPPORTED */
 5252|  1.35k|    } else if (team->t.t_nproc > new_nproc) {
  ------------------
  |  Branch (5252:16): [True: 0, False: 1]
  ------------------
 5253|      0|      KA_TRACE(20,
 5254|      0|               ("__kmp_allocate_team: decreasing hot team thread count to %d\n",
 5255|      0|                new_nproc));
 5256|       |
 5257|      0|      team->t.t_size_changed = 1;
 5258|      0|      if (__kmp_barrier_release_pattern[bs_forkjoin_barrier] == bp_dist_bar) {
  ------------------
  |  Branch (5258:11): [True: 0, False: 0]
  ------------------
 5259|       |        // Barrier size already reduced earlier in this function
 5260|       |        // Activate team threads via th_used_in_team
 5261|      0|        __kmp_add_threads_to_team(team, new_nproc);
 5262|      0|      }
 5263|      0|#if KMP_NESTED_HOT_TEAMS
 5264|      0|      if (__kmp_hot_teams_mode == 0) {
  ------------------
  |  Branch (5264:11): [True: 0, False: 0]
  ------------------
 5265|       |        // AC: saved number of threads should correspond to team's value in this
 5266|       |        // mode, can be bigger in mode 1, when hot team has threads in reserve
 5267|      0|        KMP_DEBUG_ASSERT(hot_teams[level].hot_team_nth == team->t.t_nproc);
 5268|      0|        hot_teams[level].hot_team_nth = new_nproc;
 5269|      0|#endif // KMP_NESTED_HOT_TEAMS
 5270|       |        /* release the extra threads we don't need any more */
 5271|      0|        for (f = new_nproc; f < team->t.t_nproc; f++) {
  ------------------
  |  Branch (5271:29): [True: 0, False: 0]
  ------------------
 5272|      0|          KMP_DEBUG_ASSERT(team->t.t_threads[f]);
 5273|      0|          if (__kmp_tasking_mode != tskm_immediate_exec) {
  ------------------
  |  Branch (5273:15): [True: 0, False: 0]
  ------------------
 5274|       |            // When decreasing team size, threads no longer in the team should
 5275|       |            // unref task team.
 5276|      0|            team->t.t_threads[f]->th.th_task_team = NULL;
 5277|      0|          }
 5278|      0|          __kmp_free_thread(team->t.t_threads[f]);
 5279|      0|          team->t.t_threads[f] = NULL;
 5280|      0|        }
 5281|      0|#if KMP_NESTED_HOT_TEAMS
 5282|      0|      } // (__kmp_hot_teams_mode == 0)
 5283|      0|      else {
 5284|       |        // When keeping extra threads in team, switch threads to wait on own
 5285|       |        // b_go flag
 5286|      0|        for (f = new_nproc; f < team->t.t_nproc; ++f) {
  ------------------
  |  Branch (5286:29): [True: 0, False: 0]
  ------------------
 5287|      0|          KMP_DEBUG_ASSERT(team->t.t_threads[f]);
 5288|      0|          kmp_balign_t *balign = team->t.t_threads[f]->th.th_bar;
 5289|      0|          for (int b = 0; b < bs_last_barrier; ++b) {
  ------------------
  |  Branch (5289:27): [True: 0, False: 0]
  ------------------
 5290|      0|            if (balign[b].bb.wait_flag == KMP_BARRIER_PARENT_FLAG) {
  ------------------
  |  | 2039|      0|  2 // Special state; worker waiting on parent's b_go flag in release
  ------------------
  |  Branch (5290:17): [True: 0, False: 0]
  ------------------
 5291|      0|              balign[b].bb.wait_flag = KMP_BARRIER_SWITCH_TO_OWN_FLAG;
  ------------------
  |  | 2041|      0|  3 // Special state; tells worker to shift from parent to own b_go
  ------------------
 5292|      0|            }
 5293|      0|            KMP_CHECK_UPDATE(balign[b].bb.leaf_kids, 0);
  ------------------
  |  | 2280|      0|  if ((a) != (b))                                                              \
  |  |  ------------------
  |  |  |  Branch (2280:7): [True: 0, False: 0]
  |  |  ------------------
  |  | 2281|      0|  (a) = (b)
  ------------------
 5294|      0|          }
 5295|      0|        }
 5296|      0|      }
 5297|      0|#endif // KMP_NESTED_HOT_TEAMS
 5298|      0|      team->t.t_nproc = new_nproc;
 5299|       |      // TODO???: team->t.t_max_active_levels = new_max_active_levels;
 5300|      0|      KMP_CHECK_UPDATE(team->t.t_sched.sched, new_icvs->sched.sched);
  ------------------
  |  | 2280|      0|  if ((a) != (b))                                                              \
  |  |  ------------------
  |  |  |  Branch (2280:7): [True: 0, False: 0]
  |  |  ------------------
  |  | 2281|      0|  (a) = (b)
  ------------------
 5301|      0|      __kmp_reinitialize_team(team, new_icvs,
 5302|      0|                              root->r.r_uber_thread->th.th_ident);
 5303|       |
 5304|       |      // Update remaining threads
 5305|      0|      for (f = 0; f < new_nproc; ++f) {
  ------------------
  |  Branch (5305:19): [True: 0, False: 0]
  ------------------
 5306|      0|        team->t.t_threads[f]->th.th_team_nproc = new_nproc;
 5307|      0|      }
 5308|       |
 5309|       |      // restore the current task state of the primary thread: should be the
 5310|       |      // implicit task
 5311|      0|      KF_TRACE(10, ("__kmp_allocate_team: T#%d, this_thread=%p team=%p\n", 0,
 5312|      0|                    team->t.t_threads[0], team));
 5313|       |
 5314|      0|      __kmp_push_current_task_to_thread(team->t.t_threads[0], team, 0);
 5315|       |
 5316|       |#ifdef KMP_DEBUG
 5317|       |      for (f = 0; f < team->t.t_nproc; f++) {
 5318|       |        KMP_DEBUG_ASSERT(team->t.t_threads[f] &&
 5319|       |                         team->t.t_threads[f]->th.th_team_nproc ==
 5320|       |                             team->t.t_nproc);
 5321|       |      }
 5322|       |#endif
 5323|       |
 5324|      0|      if (do_place_partition) {
  ------------------
  |  Branch (5324:11): [True: 0, False: 0]
  ------------------
 5325|      0|        KMP_CHECK_UPDATE(team->t.t_proc_bind, new_proc_bind);
  ------------------
  |  | 2280|      0|  if ((a) != (b))                                                              \
  |  |  ------------------
  |  |  |  Branch (2280:7): [True: 0, False: 0]
  |  |  ------------------
  |  | 2281|      0|  (a) = (b)
  ------------------
 5326|      0|#if KMP_AFFINITY_SUPPORTED
 5327|      0|        __kmp_partition_places(team);
 5328|      0|#endif
 5329|      0|      }
 5330|      1|    } else { // team->t.t_nproc < new_nproc
 5331|       |
 5332|      1|      KA_TRACE(20,
 5333|      1|               ("__kmp_allocate_team: increasing hot team thread count to %d\n",
 5334|      1|                new_nproc));
 5335|      1|      int old_nproc = team->t.t_nproc; // save old value and use to update only
 5336|      1|      team->t.t_size_changed = 1;
 5337|       |
 5338|      1|#if KMP_NESTED_HOT_TEAMS
 5339|      1|      int avail_threads = hot_teams[level].hot_team_nth;
 5340|      1|      if (new_nproc < avail_threads)
  ------------------
  |  Branch (5340:11): [True: 0, False: 1]
  ------------------
 5341|      0|        avail_threads = new_nproc;
 5342|      1|      kmp_info_t **other_threads = team->t.t_threads;
 5343|      1|      for (f = team->t.t_nproc; f < avail_threads; ++f) {
  ------------------
  |  Branch (5343:33): [True: 0, False: 1]
  ------------------
 5344|       |        // Adjust barrier data of reserved threads (if any) of the team
 5345|       |        // Other data will be set in __kmp_initialize_info() below.
 5346|      0|        int b;
 5347|      0|        kmp_balign_t *balign = other_threads[f]->th.th_bar;
 5348|      0|        for (b = 0; b < bs_last_barrier; ++b) {
  ------------------
  |  Branch (5348:21): [True: 0, False: 0]
  ------------------
 5349|      0|          balign[b].bb.b_arrived = team->t.t_bar[b].b_arrived;
 5350|      0|          KMP_DEBUG_ASSERT(balign[b].bb.wait_flag != KMP_BARRIER_PARENT_FLAG);
 5351|       |#if USE_DEBUGGER
 5352|       |          balign[b].bb.b_worker_arrived = team->t.t_bar[b].b_team_arrived;
 5353|       |#endif
 5354|      0|        }
 5355|      0|      }
 5356|      1|      if (hot_teams[level].hot_team_nth >= new_nproc) {
  ------------------
  |  Branch (5356:11): [True: 0, False: 1]
  ------------------
 5357|       |        // we have all needed threads in reserve, no need to allocate any
 5358|       |        // this only possible in mode 1, cannot have reserved threads in mode 0
 5359|      0|        KMP_DEBUG_ASSERT(__kmp_hot_teams_mode == 1);
 5360|      0|        team->t.t_nproc = new_nproc; // just get reserved threads involved
 5361|      1|      } else {
 5362|       |        // We may have some threads in reserve, but not enough;
 5363|       |        // get reserved threads involved if any.
 5364|      1|        team->t.t_nproc = hot_teams[level].hot_team_nth;
 5365|      1|        hot_teams[level].hot_team_nth = new_nproc; // adjust hot team max size
 5366|      1|#endif // KMP_NESTED_HOT_TEAMS
 5367|      1|        if (team->t.t_max_nproc < new_nproc) {
  ------------------
  |  Branch (5367:13): [True: 0, False: 1]
  ------------------
 5368|       |          /* reallocate larger arrays */
 5369|      0|          __kmp_reallocate_team_arrays(team, new_nproc);
 5370|      0|          __kmp_reinitialize_team(team, new_icvs, NULL);
 5371|      0|        }
 5372|       |
 5373|      1|#if (KMP_OS_LINUX || KMP_OS_FREEBSD) && KMP_AFFINITY_SUPPORTED
 5374|       |        /* Temporarily set full mask for primary thread before creation of
 5375|       |           workers. The reason is that workers inherit the affinity from the
 5376|       |           primary thread, so if a lot of workers are created on the single
 5377|       |           core quickly, they don't get a chance to set their own affinity for
 5378|       |           a long time. */
 5379|      1|        kmp_affinity_raii_t new_temp_affinity{__kmp_affin_fullMask};
 5380|      1|#endif
 5381|       |
 5382|       |        /* allocate new threads for the hot team */
 5383|     32|        for (f = team->t.t_nproc; f < new_nproc; f++) {
  ------------------
  |  Branch (5383:35): [True: 31, False: 1]
  ------------------
 5384|     31|          kmp_info_t *new_worker = __kmp_allocate_thread(root, team, f);
 5385|     31|          KMP_DEBUG_ASSERT(new_worker);
 5386|     31|          team->t.t_threads[f] = new_worker;
 5387|       |
 5388|     31|          KA_TRACE(20,
 5389|     31|                   ("__kmp_allocate_team: team %d init T#%d arrived: "
 5390|     31|                    "join=%llu, plain=%llu\n",
 5391|     31|                    team->t.t_id, __kmp_gtid_from_tid(f, team), team->t.t_id, f,
 5392|     31|                    team->t.t_bar[bs_forkjoin_barrier].b_arrived,
 5393|     31|                    team->t.t_bar[bs_plain_barrier].b_arrived));
 5394|       |
 5395|     31|          { // Initialize barrier data for new threads.
 5396|     31|            int b;
 5397|     31|            kmp_balign_t *balign = new_worker->th.th_bar;
 5398|    124|            for (b = 0; b < bs_last_barrier; ++b) {
  ------------------
  |  Branch (5398:25): [True: 93, False: 31]
  ------------------
 5399|     93|              balign[b].bb.b_arrived = team->t.t_bar[b].b_arrived;
 5400|     93|              KMP_DEBUG_ASSERT(balign[b].bb.wait_flag !=
 5401|     93|                               KMP_BARRIER_PARENT_FLAG);
 5402|       |#if USE_DEBUGGER
 5403|       |              balign[b].bb.b_worker_arrived = team->t.t_bar[b].b_team_arrived;
 5404|       |#endif
 5405|     93|            }
 5406|     31|          }
 5407|     31|        }
 5408|       |
 5409|      1|#if (KMP_OS_LINUX || KMP_OS_FREEBSD) && KMP_AFFINITY_SUPPORTED
 5410|       |        /* Restore initial primary thread's affinity mask */
 5411|      1|        new_temp_affinity.restore();
 5412|      1|#endif
 5413|      1|#if KMP_NESTED_HOT_TEAMS
 5414|      1|      } // end of check of t_nproc vs. new_nproc vs. hot_team_nth
 5415|      1|#endif // KMP_NESTED_HOT_TEAMS
 5416|      1|      if (__kmp_barrier_release_pattern[bs_forkjoin_barrier] == bp_dist_bar) {
  ------------------
  |  Branch (5416:11): [True: 0, False: 1]
  ------------------
 5417|       |        // Barrier size already increased earlier in this function
 5418|       |        // Activate team threads via th_used_in_team
 5419|      0|        __kmp_add_threads_to_team(team, new_nproc);
 5420|      0|      }
 5421|       |      /* make sure everyone is syncronized */
 5422|       |      // new threads below
 5423|      1|      __kmp_initialize_team(team, new_nproc, new_icvs,
 5424|      1|                            root->r.r_uber_thread->th.th_ident);
 5425|       |
 5426|       |      /* reinitialize the threads */
 5427|      1|      KMP_DEBUG_ASSERT(team->t.t_nproc == new_nproc);
 5428|     33|      for (f = 0; f < team->t.t_nproc; ++f)
  ------------------
  |  Branch (5428:19): [True: 32, False: 1]
  ------------------
 5429|     32|        __kmp_initialize_info(team->t.t_threads[f], team, f,
 5430|     32|                              __kmp_gtid_from_tid(f, team));
 5431|       |
 5432|       |      // set th_task_state for new threads in hot team with older thread's state
 5433|      1|      kmp_uint8 old_state = team->t.t_threads[old_nproc - 1]->th.th_task_state;
 5434|     32|      for (f = old_nproc; f < team->t.t_nproc; ++f)
  ------------------
  |  Branch (5434:27): [True: 31, False: 1]
  ------------------
 5435|     31|        team->t.t_threads[f]->th.th_task_state = old_state;
 5436|       |
 5437|       |#ifdef KMP_DEBUG
 5438|       |      for (f = 0; f < team->t.t_nproc; ++f) {
 5439|       |        KMP_DEBUG_ASSERT(team->t.t_threads[f] &&
 5440|       |                         team->t.t_threads[f]->th.th_team_nproc ==
 5441|       |                             team->t.t_nproc);
 5442|       |      }
 5443|       |#endif
 5444|       |
 5445|      1|      if (do_place_partition) {
  ------------------
  |  Branch (5445:11): [True: 1, False: 0]
  ------------------
 5446|      1|        KMP_CHECK_UPDATE(team->t.t_proc_bind, new_proc_bind);
  ------------------
  |  | 2280|      1|  if ((a) != (b))                                                              \
  |  |  ------------------
  |  |  |  Branch (2280:7): [True: 0, False: 1]
  |  |  ------------------
  |  | 2281|      1|  (a) = (b)
  ------------------
 5447|      1|#if KMP_AFFINITY_SUPPORTED
 5448|      1|        __kmp_partition_places(team);
 5449|      1|#endif
 5450|      1|      }
 5451|      1|    } // Check changes in number of threads
 5452|       |
 5453|  1.35k|    kmp_info_t *master = team->t.t_threads[0];
 5454|  1.35k|    if (master->th.th_teams_microtask) {
  ------------------
  |  Branch (5454:9): [True: 0, False: 1.35k]
  ------------------
 5455|      0|      for (f = 1; f < new_nproc; ++f) {
  ------------------
  |  Branch (5455:19): [True: 0, False: 0]
  ------------------
 5456|       |        // propagate teams construct specific info to workers
 5457|      0|        kmp_info_t *thr = team->t.t_threads[f];
 5458|      0|        thr->th.th_teams_microtask = master->th.th_teams_microtask;
 5459|      0|        thr->th.th_teams_level = master->th.th_teams_level;
 5460|      0|        thr->th.th_teams_size = master->th.th_teams_size;
 5461|      0|      }
 5462|      0|    }
 5463|  1.35k|#if KMP_NESTED_HOT_TEAMS
 5464|  1.35k|    if (level) {
  ------------------
  |  Branch (5464:9): [True: 0, False: 1.35k]
  ------------------
 5465|       |      // Sync barrier state for nested hot teams, not needed for outermost hot
 5466|       |      // team.
 5467|      0|      for (f = 1; f < new_nproc; ++f) {
  ------------------
  |  Branch (5467:19): [True: 0, False: 0]
  ------------------
 5468|      0|        kmp_info_t *thr = team->t.t_threads[f];
 5469|      0|        int b;
 5470|      0|        kmp_balign_t *balign = thr->th.th_bar;
 5471|      0|        for (b = 0; b < bs_last_barrier; ++b) {
  ------------------
  |  Branch (5471:21): [True: 0, False: 0]
  ------------------
 5472|      0|          balign[b].bb.b_arrived = team->t.t_bar[b].b_arrived;
 5473|      0|          KMP_DEBUG_ASSERT(balign[b].bb.wait_flag != KMP_BARRIER_PARENT_FLAG);
 5474|       |#if USE_DEBUGGER
 5475|       |          balign[b].bb.b_worker_arrived = team->t.t_bar[b].b_team_arrived;
 5476|       |#endif
 5477|      0|        }
 5478|      0|      }
 5479|      0|    }
 5480|  1.35k|#endif // KMP_NESTED_HOT_TEAMS
 5481|       |
 5482|       |    /* reallocate space for arguments if necessary */
 5483|  1.35k|    __kmp_alloc_argv_entries(argc, team, TRUE);
  ------------------
  |  | 1280|  1.35k|#define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  | 1279|  1.35k|#define FALSE 0
  |  |  ------------------
  ------------------
 5484|  1.35k|    KMP_CHECK_UPDATE(team->t.t_argc, argc);
  ------------------
  |  | 2280|  1.35k|  if ((a) != (b))                                                              \
  |  |  ------------------
  |  |  |  Branch (2280:7): [True: 69, False: 1.28k]
  |  |  ------------------
  |  | 2281|  1.35k|  (a) = (b)
  ------------------
 5485|       |    // The hot team re-uses the previous task team,
 5486|       |    // if untouched during the previous release->gather phase.
 5487|       |
 5488|  1.35k|    KF_TRACE(10, (" hot_team = %p\n", team));
 5489|       |
 5490|       |#if KMP_DEBUG
 5491|       |    if (__kmp_tasking_mode != tskm_immediate_exec) {
 5492|       |      KA_TRACE(20, ("__kmp_allocate_team: hot team task_team[0] = %p "
 5493|       |                    "task_team[1] = %p after reinit\n",
 5494|       |                    team->t.t_task_team[0], team->t.t_task_team[1]));
 5495|       |    }
 5496|       |#endif
 5497|       |
 5498|  1.35k|#if OMPT_SUPPORT
 5499|  1.35k|    __ompt_team_assign_id(team, ompt_parallel_data);
 5500|  1.35k|#endif
 5501|       |
 5502|  1.35k|    KMP_MB();
 5503|       |
 5504|  1.35k|    return team;
 5505|  1.35k|  }
 5506|       |
 5507|       |  /* next, let's try to take one from the team pool */
 5508|     34|  KMP_MB();
 5509|     34|  for (team = CCAST(kmp_team_t *, __kmp_team_pool); (team);) {
  ------------------
  |  |  229|     34|#define CCAST(type, var) const_cast<type>(var)
  ------------------
  |  Branch (5509:53): [True: 0, False: 34]
  ------------------
 5510|       |    /* TODO: consider resizing undersized teams instead of reaping them, now
 5511|       |       that we have a resizing mechanism */
 5512|      0|    if (team->t.t_max_nproc >= max_nproc) {
  ------------------
  |  Branch (5512:9): [True: 0, False: 0]
  ------------------
 5513|       |      /* take this team from the team pool */
 5514|      0|      __kmp_team_pool = team->t.t_next_pool;
 5515|       |
 5516|      0|      if (max_nproc > 1 &&
  ------------------
  |  Branch (5516:11): [True: 0, False: 0]
  ------------------
 5517|      0|          __kmp_barrier_gather_pattern[bs_forkjoin_barrier] == bp_dist_bar) {
  ------------------
  |  Branch (5517:11): [True: 0, False: 0]
  ------------------
 5518|      0|        if (!team->t.b) { // Allocate barrier structure
  ------------------
  |  Branch (5518:13): [True: 0, False: 0]
  ------------------
 5519|      0|          team->t.b = distributedBarrier::allocate(__kmp_dflt_team_nth_ub);
 5520|      0|        }
 5521|      0|      }
 5522|       |
 5523|       |      /* setup the team for fresh use */
 5524|      0|      __kmp_initialize_team(team, new_nproc, new_icvs, NULL);
 5525|       |
 5526|      0|      KA_TRACE(20, ("__kmp_allocate_team: setting task_team[0] %p and "
 5527|      0|                    "task_team[1] %p to NULL\n",
 5528|      0|                    &team->t.t_task_team[0], &team->t.t_task_team[1]));
 5529|      0|      team->t.t_task_team[0] = NULL;
 5530|      0|      team->t.t_task_team[1] = NULL;
 5531|       |
 5532|       |      /* reallocate space for arguments if necessary */
 5533|      0|      __kmp_alloc_argv_entries(argc, team, TRUE);
  ------------------
  |  | 1280|      0|#define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  | 1279|      0|#define FALSE 0
  |  |  ------------------
  ------------------
 5534|      0|      KMP_CHECK_UPDATE(team->t.t_argc, argc);
  ------------------
  |  | 2280|      0|  if ((a) != (b))                                                              \
  |  |  ------------------
  |  |  |  Branch (2280:7): [True: 0, False: 0]
  |  |  ------------------
  |  | 2281|      0|  (a) = (b)
  ------------------
 5535|       |
 5536|      0|      KA_TRACE(
 5537|      0|          20, ("__kmp_allocate_team: team %d init arrived: join=%u, plain=%u\n",
 5538|      0|               team->t.t_id, KMP_INIT_BARRIER_STATE, KMP_INIT_BARRIER_STATE));
 5539|      0|      { // Initialize barrier data.
 5540|      0|        int b;
 5541|      0|        for (b = 0; b < bs_last_barrier; ++b) {
  ------------------
  |  Branch (5541:21): [True: 0, False: 0]
  ------------------
 5542|      0|          team->t.t_bar[b].b_arrived = KMP_INIT_BARRIER_STATE;
  ------------------
  |  | 2018|      0|#define KMP_INIT_BARRIER_STATE 0 /* should probably start from zero */
  ------------------
 5543|       |#if USE_DEBUGGER
 5544|       |          team->t.t_bar[b].b_master_arrived = 0;
 5545|       |          team->t.t_bar[b].b_team_arrived = 0;
 5546|       |#endif
 5547|      0|        }
 5548|      0|      }
 5549|       |
 5550|      0|      team->t.t_proc_bind = new_proc_bind;
 5551|       |
 5552|      0|      KA_TRACE(20, ("__kmp_allocate_team: using team from pool %d.\n",
 5553|      0|                    team->t.t_id));
 5554|       |
 5555|      0|#if OMPT_SUPPORT
 5556|      0|      __ompt_team_assign_id(team, ompt_parallel_data);
 5557|      0|#endif
 5558|       |
 5559|      0|      KMP_MB();
 5560|       |
 5561|      0|      return team;
 5562|      0|    }
 5563|       |
 5564|       |    /* reap team if it is too small, then loop back and check the next one */
 5565|       |    // not sure if this is wise, but, will be redone during the hot-teams
 5566|       |    // rewrite.
 5567|       |    /* TODO: Use technique to find the right size hot-team, don't reap them */
 5568|      0|    team = __kmp_reap_team(team);
 5569|      0|    __kmp_team_pool = team;
 5570|      0|  }
 5571|       |
 5572|       |  /* nothing available in the pool, no matter, make a new team! */
 5573|     34|  KMP_MB();
 5574|     34|  team = (kmp_team_t *)__kmp_allocate(sizeof(kmp_team_t));
  ------------------
  |  | 3617|     34|#define __kmp_allocate(size) ___kmp_allocate((size)KMP_SRC_LOC_CURR)
  ------------------
 5575|       |
 5576|       |  /* and set it up */
 5577|     34|  team->t.t_max_nproc = max_nproc;
 5578|     34|  if (max_nproc > 1 &&
  ------------------
  |  Branch (5578:7): [True: 1, False: 33]
  ------------------
 5579|      1|      __kmp_barrier_gather_pattern[bs_forkjoin_barrier] == bp_dist_bar) {
  ------------------
  |  Branch (5579:7): [True: 0, False: 1]
  ------------------
 5580|       |    // Allocate barrier structure
 5581|      0|    team->t.b = distributedBarrier::allocate(__kmp_dflt_team_nth_ub);
 5582|      0|  }
 5583|       |
 5584|       |  /* NOTE well, for some reason allocating one big buffer and dividing it up
 5585|       |     seems to really hurt performance a lot on the P4, so, let's not use this */
 5586|     34|  __kmp_allocate_team_arrays(team, max_nproc);
 5587|       |
 5588|     34|  KA_TRACE(20, ("__kmp_allocate_team: making a new team\n"));
 5589|     34|  __kmp_initialize_team(team, new_nproc, new_icvs, NULL);
 5590|       |
 5591|     34|  KA_TRACE(20, ("__kmp_allocate_team: setting task_team[0] %p and task_team[1] "
 5592|     34|                "%p to NULL\n",
 5593|     34|                &team->t.t_task_team[0], &team->t.t_task_team[1]));
 5594|     34|  team->t.t_task_team[0] = NULL; // to be removed, as __kmp_allocate zeroes
 5595|       |  // memory, no need to duplicate
 5596|     34|  team->t.t_task_team[1] = NULL; // to be removed, as __kmp_allocate zeroes
 5597|       |  // memory, no need to duplicate
 5598|       |
 5599|     34|  if (__kmp_storage_map) {
  ------------------
  |  Branch (5599:7): [True: 0, False: 34]
  ------------------
 5600|      0|    __kmp_print_team_storage_map("team", team, team->t.t_id, new_nproc);
 5601|      0|  }
 5602|       |
 5603|       |  /* allocate space for arguments */
 5604|     34|  __kmp_alloc_argv_entries(argc, team, FALSE);
  ------------------
  |  | 1279|     34|#define FALSE 0
  ------------------
 5605|     34|  team->t.t_argc = argc;
 5606|       |
 5607|     34|  KA_TRACE(20,
 5608|     34|           ("__kmp_allocate_team: team %d init arrived: join=%u, plain=%u\n",
 5609|     34|            team->t.t_id, KMP_INIT_BARRIER_STATE, KMP_INIT_BARRIER_STATE));
 5610|     34|  { // Initialize barrier data.
 5611|     34|    int b;
 5612|    136|    for (b = 0; b < bs_last_barrier; ++b) {
  ------------------
  |  Branch (5612:17): [True: 102, False: 34]
  ------------------
 5613|    102|      team->t.t_bar[b].b_arrived = KMP_INIT_BARRIER_STATE;
  ------------------
  |  | 2018|    102|#define KMP_INIT_BARRIER_STATE 0 /* should probably start from zero */
  ------------------
 5614|       |#if USE_DEBUGGER
 5615|       |      team->t.t_bar[b].b_master_arrived = 0;
 5616|       |      team->t.t_bar[b].b_team_arrived = 0;
 5617|       |#endif
 5618|    102|    }
 5619|     34|  }
 5620|       |
 5621|     34|  team->t.t_proc_bind = new_proc_bind;
 5622|       |
 5623|     34|#if OMPT_SUPPORT
 5624|     34|  __ompt_team_assign_id(team, ompt_parallel_data);
 5625|     34|  team->t.ompt_serialized_team_info = NULL;
 5626|     34|#endif
 5627|       |
 5628|     34|  KMP_MB();
 5629|       |
 5630|     34|  KA_TRACE(20, ("__kmp_allocate_team: done creating a new team %d.\n",
 5631|     34|                team->t.t_id));
 5632|       |
 5633|     34|  return team;
 5634|     34|}
__kmp_free_team:
 5642|  1.35k|                     kmp_team_t *team USE_NESTED_HOT_ARG(kmp_info_t *master)) {
 5643|  1.35k|  int f;
 5644|  1.35k|  KA_TRACE(20, ("__kmp_free_team: T#%d freeing team %d\n", __kmp_get_gtid(),
 5645|  1.35k|                team->t.t_id));
 5646|       |
 5647|       |  /* verify state */
 5648|  1.35k|  KMP_DEBUG_ASSERT(root);
 5649|  1.35k|  KMP_DEBUG_ASSERT(team);
 5650|  1.35k|  KMP_DEBUG_ASSERT(team->t.t_nproc <= team->t.t_max_nproc);
 5651|  1.35k|  KMP_DEBUG_ASSERT(team->t.t_threads);
 5652|       |
 5653|  1.35k|  int use_hot_team = team == root->r.r_hot_team;
 5654|  1.35k|#if KMP_NESTED_HOT_TEAMS
 5655|  1.35k|  int level;
 5656|  1.35k|  if (master) {
  ------------------
  |  Branch (5656:7): [True: 1.35k, False: 2]
  ------------------
 5657|  1.35k|    level = team->t.t_active_level - 1;
 5658|  1.35k|    if (master->th.th_teams_microtask) { // in teams construct?
  ------------------
  |  Branch (5658:9): [True: 0, False: 1.35k]
  ------------------
 5659|      0|      if (master->th.th_teams_size.nteams > 1) {
  ------------------
  |  Branch (5659:11): [True: 0, False: 0]
  ------------------
 5660|      0|        ++level; // level was not increased in teams construct for
 5661|       |        // team_of_masters
 5662|      0|      }
 5663|      0|      if (team->t.t_pkfn != (microtask_t)__kmp_teams_master &&
  ------------------
  |  Branch (5663:11): [True: 0, False: 0]
  ------------------
 5664|      0|          master->th.th_teams_level == team->t.t_level) {
  ------------------
  |  Branch (5664:11): [True: 0, False: 0]
  ------------------
 5665|      0|        ++level; // level was not increased in teams construct for
 5666|       |        // team_of_workers before the parallel
 5667|      0|      } // team->t.t_level will be increased inside parallel
 5668|      0|    }
 5669|       |#if KMP_DEBUG
 5670|       |    kmp_hot_team_ptr_t *hot_teams = master->th.th_hot_teams;
 5671|       |#endif
 5672|  1.35k|    if (level < __kmp_hot_teams_max_level) {
  ------------------
  |  Branch (5672:9): [True: 1.35k, False: 0]
  ------------------
 5673|  1.35k|      KMP_DEBUG_ASSERT(team == hot_teams[level].hot_team);
 5674|  1.35k|      use_hot_team = 1;
 5675|  1.35k|    }
 5676|  1.35k|  }
 5677|  1.35k|#endif // KMP_NESTED_HOT_TEAMS
 5678|       |
 5679|       |  /* team is done working */
 5680|  1.35k|  TCW_SYNC_PTR(team->t.t_pkfn,
  ------------------
  |  | 1159|  1.35k|#define TCW_SYNC_PTR(a, b) TCW_SYNC_8((a), (b))
  |  |  ------------------
  |  |  |  | 1141|  1.35k|#define TCW_SYNC_8(a, b) (a) = (b)
  |  |  ------------------
  ------------------
 5681|  1.35k|               NULL); // Important for Debugging Support Library.
 5682|       |#if KMP_OS_WINDOWS
 5683|       |  team->t.t_copyin_counter = 0; // init counter for possible reuse
 5684|       |#endif
 5685|       |  // Do not reset pointer to parent team to NULL for hot teams.
 5686|       |
 5687|       |  /* if we are non-hot team, release our threads */
 5688|  1.35k|  if (!use_hot_team) {
  ------------------
  |  Branch (5688:7): [True: 2, False: 1.35k]
  ------------------
 5689|      2|    if (__kmp_tasking_mode != tskm_immediate_exec) {
  ------------------
  |  Branch (5689:9): [True: 2, False: 0]
  ------------------
 5690|       |      // Wait for threads to reach reapable state
 5691|     33|      for (f = 1; f < team->t.t_nproc; ++f) {
  ------------------
  |  Branch (5691:19): [True: 31, False: 2]
  ------------------
 5692|     31|        KMP_DEBUG_ASSERT(team->t.t_threads[f]);
 5693|     31|        kmp_info_t *th = team->t.t_threads[f];
 5694|     31|        volatile kmp_uint32 *state = &th->th.th_reap_state;
 5695|     31|        while (*state != KMP_SAFE_TO_REAP) {
  ------------------
  |  | 2047|     31|#define KMP_SAFE_TO_REAP 1 // Thread th_reap_state: safe to reap (not tasking)
  ------------------
  |  Branch (5695:16): [True: 0, False: 31]
  ------------------
 5696|       |#if KMP_OS_WINDOWS
 5697|       |          // On Windows a thread can be killed at any time, check this
 5698|       |          DWORD ecode;
 5699|       |          if (!__kmp_is_thread_alive(th, &ecode)) {
 5700|       |            *state = KMP_SAFE_TO_REAP; // reset the flag for dead thread
 5701|       |            break;
 5702|       |          }
 5703|       |#endif
 5704|       |          // first check if thread is sleeping
 5705|      0|          kmp_flag_64<> fl(&th->th.th_bar[bs_forkjoin_barrier].bb.b_go, th);
 5706|      0|          if (fl.is_sleeping())
  ------------------
  |  Branch (5706:15): [True: 0, False: 0]
  ------------------
 5707|      0|            fl.resume(__kmp_gtid_from_thread(th));
 5708|      0|          KMP_CPU_PAUSE();
  ------------------
  |  | 1498|      0|#define KMP_CPU_PAUSE() __kmp_x86_pause()
  ------------------
 5709|      0|        }
 5710|     31|      }
 5711|       |
 5712|       |      // Delete task teams
 5713|      2|      int tt_idx;
 5714|      6|      for (tt_idx = 0; tt_idx < 2; ++tt_idx) {
  ------------------
  |  Branch (5714:24): [True: 4, False: 2]
  ------------------
 5715|      4|        kmp_task_team_t *task_team = team->t.t_task_team[tt_idx];
 5716|      4|        if (task_team != NULL) {
  ------------------
  |  Branch (5716:13): [True: 2, False: 2]
  ------------------
 5717|     66|          for (f = 0; f < team->t.t_nproc; ++f) { // threads unref task teams
  ------------------
  |  Branch (5717:23): [True: 64, False: 2]
  ------------------
 5718|     64|            KMP_DEBUG_ASSERT(team->t.t_threads[f]);
 5719|     64|            team->t.t_threads[f]->th.th_task_team = NULL;
 5720|     64|          }
 5721|      2|          KA_TRACE(
 5722|      2|              20,
 5723|      2|              ("__kmp_free_team: T#%d deactivating task_team %p on team %d\n",
 5724|      2|               __kmp_get_gtid(), task_team, team->t.t_id));
 5725|      2|#if KMP_NESTED_HOT_TEAMS
 5726|      2|          __kmp_free_task_team(master, task_team);
 5727|      2|#endif
 5728|      2|          team->t.t_task_team[tt_idx] = NULL;
 5729|      2|        }
 5730|      4|      }
 5731|      2|    }
 5732|       |
 5733|       |    // Reset pointer to parent team only for non-hot teams.
 5734|      2|    team->t.t_parent = NULL;
 5735|      2|    team->t.t_level = 0;
 5736|      2|    team->t.t_active_level = 0;
 5737|       |
 5738|       |    /* free the worker threads */
 5739|     33|    for (f = 1; f < team->t.t_nproc; ++f) {
  ------------------
  |  Branch (5739:17): [True: 31, False: 2]
  ------------------
 5740|     31|      KMP_DEBUG_ASSERT(team->t.t_threads[f]);
 5741|     31|      if (__kmp_barrier_gather_pattern[bs_forkjoin_barrier] == bp_dist_bar) {
  ------------------
  |  Branch (5741:11): [True: 0, False: 31]
  ------------------
 5742|      0|        KMP_COMPARE_AND_STORE_ACQ32(&(team->t.t_threads[f]->th.th_used_in_team),
  ------------------
  |  |  807|      0|  __sync_bool_compare_and_swap((volatile kmp_uint32 *)(p), (kmp_uint32)(cv),   \
  |  |  808|      0|                               (kmp_uint32)(sv))
  ------------------
 5743|      0|                                    1, 2);
 5744|      0|      }
 5745|     31|      __kmp_free_thread(team->t.t_threads[f]);
 5746|     31|    }
 5747|       |
 5748|      2|    if (__kmp_barrier_gather_pattern[bs_forkjoin_barrier] == bp_dist_bar) {
  ------------------
  |  Branch (5748:9): [True: 0, False: 2]
  ------------------
 5749|      0|      if (team->t.b) {
  ------------------
  |  Branch (5749:11): [True: 0, False: 0]
  ------------------
 5750|       |        // wake up thread at old location
 5751|      0|        team->t.b->go_release();
 5752|      0|        if (__kmp_dflt_blocktime != KMP_MAX_BLOCKTIME) {
  ------------------
  |  | 1184|      0|  (INT_MAX) /* Must be this for "infinite" setting the work */
  ------------------
  |  Branch (5752:13): [True: 0, False: 0]
  ------------------
 5753|      0|          for (f = 1; f < team->t.t_nproc; ++f) {
  ------------------
  |  Branch (5753:23): [True: 0, False: 0]
  ------------------
 5754|      0|            if (team->t.b->sleep[f].sleep) {
  ------------------
  |  Branch (5754:17): [True: 0, False: 0]
  ------------------
 5755|      0|              __kmp_atomic_resume_64(
 5756|      0|                  team->t.t_threads[f]->th.th_info.ds.ds_gtid,
 5757|      0|                  (kmp_atomic_flag_64<> *)NULL);
 5758|      0|            }
 5759|      0|          }
 5760|      0|        }
 5761|       |        // Wait for threads to be removed from team
 5762|      0|        for (int f = 1; f < team->t.t_nproc; ++f) {
  ------------------
  |  Branch (5762:25): [True: 0, False: 0]
  ------------------
 5763|      0|          while (team->t.t_threads[f]->th.th_used_in_team.load() != 0)
  ------------------
  |  Branch (5763:18): [True: 0, False: 0]
  ------------------
 5764|      0|            KMP_CPU_PAUSE();
  ------------------
  |  | 1498|      0|#define KMP_CPU_PAUSE() __kmp_x86_pause()
  ------------------
 5765|      0|        }
 5766|      0|      }
 5767|      0|    }
 5768|       |
 5769|     33|    for (f = 1; f < team->t.t_nproc; ++f) {
  ------------------
  |  Branch (5769:17): [True: 31, False: 2]
  ------------------
 5770|     31|      team->t.t_threads[f] = NULL;
 5771|     31|    }
 5772|       |
 5773|      2|    if (team->t.t_max_nproc > 1 &&
  ------------------
  |  Branch (5773:9): [True: 1, False: 1]
  ------------------
 5774|      1|        __kmp_barrier_gather_pattern[bs_forkjoin_barrier] == bp_dist_bar) {
  ------------------
  |  Branch (5774:9): [True: 0, False: 1]
  ------------------
 5775|      0|      distributedBarrier::deallocate(team->t.b);
 5776|      0|      team->t.b = NULL;
 5777|      0|    }
 5778|       |    /* put the team back in the team pool */
 5779|       |    /* TODO limit size of team pool, call reap_team if pool too large */
 5780|      2|    team->t.t_next_pool = CCAST(kmp_team_t *, __kmp_team_pool);
  ------------------
  |  |  229|      2|#define CCAST(type, var) const_cast<type>(var)
  ------------------
 5781|      2|    __kmp_team_pool = (volatile kmp_team_t *)team;
 5782|  1.35k|  } else { // Check if team was created for primary threads in teams construct
 5783|       |    // See if first worker is a CG root
 5784|  1.35k|    KMP_DEBUG_ASSERT(team->t.t_threads[1] &&
 5785|  1.35k|                     team->t.t_threads[1]->th.th_cg_roots);
 5786|  1.35k|    if (team->t.t_threads[1]->th.th_cg_roots->cg_root == team->t.t_threads[1]) {
  ------------------
  |  Branch (5786:9): [True: 0, False: 1.35k]
  ------------------
 5787|       |      // Clean up the CG root nodes on workers so that this team can be re-used
 5788|      0|      for (f = 1; f < team->t.t_nproc; ++f) {
  ------------------
  |  Branch (5788:19): [True: 0, False: 0]
  ------------------
 5789|      0|        kmp_info_t *thr = team->t.t_threads[f];
 5790|      0|        KMP_DEBUG_ASSERT(thr && thr->th.th_cg_roots &&
 5791|      0|                         thr->th.th_cg_roots->cg_root == thr);
 5792|       |        // Pop current CG root off list
 5793|      0|        kmp_cg_root_t *tmp = thr->th.th_cg_roots;
 5794|      0|        thr->th.th_cg_roots = tmp->up;
 5795|      0|        KA_TRACE(100, ("__kmp_free_team: Thread %p popping node %p and moving"
 5796|      0|                       " up to node %p. cg_nthreads was %d\n",
 5797|      0|                       thr, tmp, thr->th.th_cg_roots, tmp->cg_nthreads));
 5798|      0|        int i = tmp->cg_nthreads--;
 5799|      0|        if (i == 1) {
  ------------------
  |  Branch (5799:13): [True: 0, False: 0]
  ------------------
 5800|      0|          __kmp_free(tmp); // free CG if we are the last thread in it
  ------------------
  |  | 3619|      0|#define __kmp_free(ptr) ___kmp_free((ptr)KMP_SRC_LOC_CURR)
  ------------------
 5801|      0|        }
 5802|       |        // Restore current task's thread_limit from CG root
 5803|      0|        if (thr->th.th_cg_roots)
  ------------------
  |  Branch (5803:13): [True: 0, False: 0]
  ------------------
 5804|      0|          thr->th.th_current_task->td_icvs.thread_limit =
 5805|      0|              thr->th.th_cg_roots->cg_thread_limit;
 5806|      0|      }
 5807|      0|    }
 5808|  1.35k|  }
 5809|       |
 5810|  1.35k|  KMP_MB();
 5811|  1.35k|}
__kmp_reap_team:
 5814|     34|kmp_team_t *__kmp_reap_team(kmp_team_t *team) {
 5815|     34|  kmp_team_t *next_pool = team->t.t_next_pool;
 5816|       |
 5817|     34|  KMP_DEBUG_ASSERT(team);
 5818|     34|  KMP_DEBUG_ASSERT(team->t.t_dispatch);
 5819|     34|  KMP_DEBUG_ASSERT(team->t.t_disp_buffer);
 5820|     34|  KMP_DEBUG_ASSERT(team->t.t_threads);
 5821|     34|  KMP_DEBUG_ASSERT(team->t.t_argv);
 5822|       |
 5823|       |  /* TODO clean the threads that are a part of this? */
 5824|       |
 5825|       |  /* free stuff */
 5826|     34|  __kmp_free_team_arrays(team);
 5827|     34|  if (team->t.t_argv != &team->t.t_inline_argv[0])
  ------------------
  |  Branch (5827:7): [True: 0, False: 34]
  ------------------
 5828|      0|    __kmp_free((void *)team->t.t_argv);
  ------------------
  |  | 3619|      0|#define __kmp_free(ptr) ___kmp_free((ptr)KMP_SRC_LOC_CURR)
  ------------------
 5829|     34|  __kmp_free(team);
  ------------------
  |  | 3619|     34|#define __kmp_free(ptr) ___kmp_free((ptr)KMP_SRC_LOC_CURR)
  ------------------
 5830|       |
 5831|     34|  KMP_MB();
 5832|     34|  return next_pool;
 5833|     34|}
__kmp_free_thread:
 5860|     31|void __kmp_free_thread(kmp_info_t *this_th) {
 5861|     31|  int gtid;
 5862|     31|  kmp_info_t **scan;
 5863|       |
 5864|     31|  KA_TRACE(20, ("__kmp_free_thread: T#%d putting T#%d back on free pool.\n",
 5865|     31|                __kmp_get_gtid(), this_th->th.th_info.ds.ds_gtid));
 5866|       |
 5867|     31|  KMP_DEBUG_ASSERT(this_th);
 5868|       |
 5869|       |  // When moving thread to pool, switch thread to wait on own b_go flag, and
 5870|       |  // uninitialized (NULL team).
 5871|     31|  int b;
 5872|     31|  kmp_balign_t *balign = this_th->th.th_bar;
 5873|    124|  for (b = 0; b < bs_last_barrier; ++b) {
  ------------------
  |  Branch (5873:15): [True: 93, False: 31]
  ------------------
 5874|     93|    if (balign[b].bb.wait_flag == KMP_BARRIER_PARENT_FLAG)
  ------------------
  |  | 2039|     93|  2 // Special state; worker waiting on parent's b_go flag in release
  ------------------
  |  Branch (5874:9): [True: 0, False: 93]
  ------------------
 5875|      0|      balign[b].bb.wait_flag = KMP_BARRIER_SWITCH_TO_OWN_FLAG;
  ------------------
  |  | 2041|      0|  3 // Special state; tells worker to shift from parent to own b_go
  ------------------
 5876|     93|    balign[b].bb.team = NULL;
 5877|     93|    balign[b].bb.leaf_kids = 0;
 5878|     93|  }
 5879|     31|  this_th->th.th_task_state = 0;
 5880|     31|  this_th->th.th_reap_state = KMP_SAFE_TO_REAP;
  ------------------
  |  | 2047|     31|#define KMP_SAFE_TO_REAP 1 // Thread th_reap_state: safe to reap (not tasking)
  ------------------
 5881|       |
 5882|       |  /* put thread back on the free pool */
 5883|     31|  TCW_PTR(this_th->th.th_team, NULL);
  ------------------
  |  | 1157|     31|#define TCW_PTR(a, b) TCW_8((a), (b))
  |  |  ------------------
  |  |  |  | 1132|     31|#define TCW_8(a, b) (a) = (b)
  |  |  ------------------
  ------------------
 5884|     31|  TCW_PTR(this_th->th.th_root, NULL);
  ------------------
  |  | 1157|     31|#define TCW_PTR(a, b) TCW_8((a), (b))
  |  |  ------------------
  |  |  |  | 1132|     31|#define TCW_8(a, b) (a) = (b)
  |  |  ------------------
  ------------------
 5885|     31|  TCW_PTR(this_th->th.th_dispatch, NULL); /* NOT NEEDED */
  ------------------
  |  | 1157|     31|#define TCW_PTR(a, b) TCW_8((a), (b))
  |  |  ------------------
  |  |  |  | 1132|     31|#define TCW_8(a, b) (a) = (b)
  |  |  ------------------
  ------------------
 5886|       |
 5887|     31|  while (this_th->th.th_cg_roots) {
  ------------------
  |  Branch (5887:10): [True: 31, False: 0]
  ------------------
 5888|     31|    this_th->th.th_cg_roots->cg_nthreads--;
 5889|     31|    KA_TRACE(100, ("__kmp_free_thread: Thread %p decrement cg_nthreads on node"
 5890|     31|                   " %p of thread  %p to %d\n",
 5891|     31|                   this_th, this_th->th.th_cg_roots,
 5892|     31|                   this_th->th.th_cg_roots->cg_root,
 5893|     31|                   this_th->th.th_cg_roots->cg_nthreads));
 5894|     31|    kmp_cg_root_t *tmp = this_th->th.th_cg_roots;
 5895|     31|    if (tmp->cg_root == this_th) { // Thread is a cg_root
  ------------------
  |  Branch (5895:9): [True: 0, False: 31]
  ------------------
 5896|      0|      KMP_DEBUG_ASSERT(tmp->cg_nthreads == 0);
 5897|      0|      KA_TRACE(
 5898|      0|          5, ("__kmp_free_thread: Thread %p freeing node %p\n", this_th, tmp));
 5899|      0|      this_th->th.th_cg_roots = tmp->up;
 5900|      0|      __kmp_free(tmp);
  ------------------
  |  | 3619|      0|#define __kmp_free(ptr) ___kmp_free((ptr)KMP_SRC_LOC_CURR)
  ------------------
 5901|     31|    } else { // Worker thread
 5902|     31|      if (tmp->cg_nthreads == 0) { // last thread leaves contention group
  ------------------
  |  Branch (5902:11): [True: 0, False: 31]
  ------------------
 5903|      0|        __kmp_free(tmp);
  ------------------
  |  | 3619|      0|#define __kmp_free(ptr) ___kmp_free((ptr)KMP_SRC_LOC_CURR)
  ------------------
 5904|      0|      }
 5905|     31|      this_th->th.th_cg_roots = NULL;
 5906|     31|      break;
 5907|     31|    }
 5908|     31|  }
 5909|       |
 5910|       |  /* If the implicit task assigned to this thread can be used by other threads
 5911|       |   * -> multiple threads can share the data and try to free the task at
 5912|       |   * __kmp_reap_thread at exit. This duplicate use of the task data can happen
 5913|       |   * with higher probability when hot team is disabled but can occurs even when
 5914|       |   * the hot team is enabled */
 5915|     31|  __kmp_free_implicit_task(this_th);
 5916|     31|  this_th->th.th_current_task = NULL;
 5917|       |
 5918|       |  // If the __kmp_thread_pool_insert_pt is already past the new insert
 5919|       |  // point, then we need to re-scan the entire list.
 5920|     31|  gtid = this_th->th.th_info.ds.ds_gtid;
 5921|     31|  if (__kmp_thread_pool_insert_pt != NULL) {
  ------------------
  |  Branch (5921:7): [True: 30, False: 1]
  ------------------
 5922|     30|    KMP_DEBUG_ASSERT(__kmp_thread_pool != NULL);
 5923|     30|    if (__kmp_thread_pool_insert_pt->th.th_info.ds.ds_gtid > gtid) {
  ------------------
  |  Branch (5923:9): [True: 0, False: 30]
  ------------------
 5924|      0|      __kmp_thread_pool_insert_pt = NULL;
 5925|      0|    }
 5926|     30|  }
 5927|       |
 5928|       |  // Scan down the list to find the place to insert the thread.
 5929|       |  // scan is the address of a link in the list, possibly the address of
 5930|       |  // __kmp_thread_pool itself.
 5931|       |  //
 5932|       |  // In the absence of nested parallelism, the for loop will have 0 iterations.
 5933|     31|  if (__kmp_thread_pool_insert_pt != NULL) {
  ------------------
  |  Branch (5933:7): [True: 30, False: 1]
  ------------------
 5934|     30|    scan = &(__kmp_thread_pool_insert_pt->th.th_next_pool);
 5935|     30|  } else {
 5936|      1|    scan = CCAST(kmp_info_t **, &__kmp_thread_pool);
  ------------------
  |  |  229|      1|#define CCAST(type, var) const_cast<type>(var)
  ------------------
 5937|      1|  }
 5938|     31|  for (; (*scan != NULL) && ((*scan)->th.th_info.ds.ds_gtid < gtid);
  ------------------
  |  Branch (5938:10): [True: 0, False: 31]
  |  Branch (5938:29): [True: 0, False: 0]
  ------------------
 5939|     31|       scan = &((*scan)->th.th_next_pool))
 5940|      0|    ;
 5941|       |
 5942|       |  // Insert the new element on the list, and set __kmp_thread_pool_insert_pt
 5943|       |  // to its address.
 5944|     31|  TCW_PTR(this_th->th.th_next_pool, *scan);
  ------------------
  |  | 1157|     31|#define TCW_PTR(a, b) TCW_8((a), (b))
  |  |  ------------------
  |  |  |  | 1132|     31|#define TCW_8(a, b) (a) = (b)
  |  |  ------------------
  ------------------
 5945|     31|  __kmp_thread_pool_insert_pt = *scan = this_th;
 5946|     31|  KMP_DEBUG_ASSERT((this_th->th.th_next_pool == NULL) ||
 5947|     31|                   (this_th->th.th_info.ds.ds_gtid <
 5948|     31|                    this_th->th.th_next_pool->th.th_info.ds.ds_gtid));
 5949|     31|  TCW_4(this_th->th.th_in_pool, TRUE);
  ------------------
  |  | 1128|     31|#define TCW_4(a, b) (a) = (b)
  ------------------
 5950|     31|  __kmp_suspend_initialize_thread(this_th);
 5951|     31|  __kmp_lock_suspend_mx(this_th);
 5952|     31|  if (this_th->th.th_active == TRUE) {
  ------------------
  |  | 1280|     31|#define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  | 1279|     31|#define FALSE 0
  |  |  ------------------
  ------------------
  |  Branch (5952:7): [True: 0, False: 31]
  ------------------
 5953|      0|    KMP_ATOMIC_INC(&__kmp_thread_pool_active_nth);
  ------------------
  |  | 1259|      0|#define KMP_ATOMIC_INC(p) KMP_ATOMIC_OP(fetch_add, p, 1, acq_rel)
  |  |  ------------------
  |  |  |  | 1246|      0|#define KMP_ATOMIC_OP(op, p, v, order) (p)->op(v, std::memory_order_##order)
  |  |  ------------------
  ------------------
 5954|      0|    this_th->th.th_active_in_pool = TRUE;
  ------------------
  |  | 1280|      0|#define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  | 1279|      0|#define FALSE 0
  |  |  ------------------
  ------------------
 5955|      0|  }
 5956|       |#if KMP_DEBUG
 5957|       |  else {
 5958|       |    KMP_DEBUG_ASSERT(this_th->th.th_active_in_pool == FALSE);
 5959|       |  }
 5960|       |#endif
 5961|     31|  __kmp_unlock_suspend_mx(this_th);
 5962|       |
 5963|     31|  TCW_4(__kmp_nth, __kmp_nth - 1);
  ------------------
  |  | 1128|     31|#define TCW_4(a, b) (a) = (b)
  ------------------
 5964|       |
 5965|     31|#ifdef KMP_ADJUST_BLOCKTIME
 5966|       |  /* Adjust blocktime back to user setting or default if necessary */
 5967|       |  /* Middle initialization might never have occurred                */
 5968|     31|  if (!__kmp_env_blocktime && (__kmp_avail_proc > 0)) {
  ------------------
  |  Branch (5968:7): [True: 31, False: 0]
  |  Branch (5968:31): [True: 31, False: 0]
  ------------------
 5969|     31|    KMP_DEBUG_ASSERT(__kmp_avail_proc > 0);
 5970|     31|    if (__kmp_nth <= __kmp_avail_proc) {
  ------------------
  |  Branch (5970:9): [True: 31, False: 0]
  ------------------
 5971|     31|      __kmp_zero_bt = FALSE;
  ------------------
  |  | 1279|     31|#define FALSE 0
  ------------------
 5972|     31|    }
 5973|     31|  }
 5974|     31|#endif /* KMP_ADJUST_BLOCKTIME */
 5975|       |
 5976|     31|  KMP_MB();
 5977|     31|}
__kmp_launch_thread:
 5981|     31|void *__kmp_launch_thread(kmp_info_t *this_thr) {
 5982|       |#if OMP_PROFILING_SUPPORT
 5983|       |  ProfileTraceFile = getenv("LIBOMPTARGET_PROFILE");
 5984|       |  // TODO: add a configuration option for time granularity
 5985|       |  if (ProfileTraceFile)
 5986|       |    llvm::timeTraceProfilerInitialize(500 /* us */, "libomptarget");
 5987|       |#endif
 5988|       |
 5989|     31|  int gtid = this_thr->th.th_info.ds.ds_gtid;
 5990|       |  /*    void                 *stack_data;*/
 5991|     31|  kmp_team_t **volatile pteam;
 5992|       |
 5993|     31|  KMP_MB();
 5994|     31|  KA_TRACE(10, ("__kmp_launch_thread: T#%d start\n", gtid));
 5995|       |
 5996|     31|  if (__kmp_env_consistency_check) {
  ------------------
  |  Branch (5996:7): [True: 0, False: 31]
  ------------------
 5997|      0|    this_thr->th.th_cons = __kmp_allocate_cons_stack(gtid); // ATT: Memory leak?
 5998|      0|  }
 5999|       |
 6000|     31|#if OMPD_SUPPORT
 6001|     31|  if (ompd_state & OMPD_ENABLE_BP)
  ------------------
  |  |   35|     31|#define OMPD_ENABLE_BP 0x1
  ------------------
  |  Branch (6001:7): [True: 0, False: 31]
  ------------------
 6002|      0|    ompd_bp_thread_begin();
 6003|     31|#endif
 6004|       |
 6005|     31|#if OMPT_SUPPORT
 6006|     31|  ompt_data_t *thread_data = nullptr;
 6007|     31|  if (ompt_enabled.enabled) {
  ------------------
  |  Branch (6007:7): [True: 0, False: 31]
  ------------------
 6008|      0|    thread_data = &(this_thr->th.ompt_thread_info.thread_data);
 6009|      0|    *thread_data = ompt_data_none;
  ------------------
  |  | 1408|      0|#define ompt_data_none {0}
  ------------------
 6010|       |
 6011|      0|    this_thr->th.ompt_thread_info.state = ompt_state_overhead;
 6012|      0|    this_thr->th.ompt_thread_info.wait_id = 0;
 6013|      0|    this_thr->th.ompt_thread_info.idle_frame = OMPT_GET_FRAME_ADDRESS(0);
  ------------------
  |  |  109|      0|#define OMPT_GET_FRAME_ADDRESS(level) __builtin_frame_address(level)
  ------------------
 6014|      0|    this_thr->th.ompt_thread_info.parallel_flags = 0;
 6015|      0|    if (ompt_enabled.ompt_callback_thread_begin) {
  ------------------
  |  Branch (6015:9): [True: 0, False: 0]
  ------------------
 6016|      0|      ompt_callbacks.ompt_callback(ompt_callback_thread_begin)(
  ------------------
  |  |   27|      0|#define ompt_callback(e) e##_callback
  ------------------
 6017|      0|          ompt_thread_worker, thread_data);
 6018|      0|    }
 6019|      0|    this_thr->th.ompt_thread_info.state = ompt_state_idle;
 6020|      0|  }
 6021|     31|#endif
 6022|       |
 6023|       |  /* This is the place where threads wait for work */
 6024|  41.9k|  while (!TCR_4(__kmp_global.g.g_done)) {
  ------------------
  |  | 1127|  41.9k|#define TCR_4(a) (a)
  ------------------
  |  Branch (6024:10): [True: 41.8k, False: 31]
  ------------------
 6025|  41.8k|    KMP_DEBUG_ASSERT(this_thr == __kmp_threads[gtid]);
 6026|  41.8k|    KMP_MB();
 6027|       |
 6028|       |    /* wait for work to do */
 6029|  41.8k|    KA_TRACE(20, ("__kmp_launch_thread: T#%d waiting for work\n", gtid));
 6030|       |
 6031|       |    /* No tid yet since not part of a team */
 6032|  41.8k|    __kmp_fork_barrier(gtid, KMP_GTID_DNE);
  ------------------
  |  | 1000|  41.8k|#define KMP_GTID_DNE (-2) /* Does not exist */
  ------------------
 6033|       |
 6034|  41.8k|#if OMPT_SUPPORT
 6035|  41.8k|    if (ompt_enabled.enabled) {
  ------------------
  |  Branch (6035:9): [True: 0, False: 41.8k]
  ------------------
 6036|      0|      this_thr->th.ompt_thread_info.state = ompt_state_overhead;
 6037|      0|    }
 6038|  41.8k|#endif
 6039|       |
 6040|  41.8k|    pteam = &this_thr->th.th_team;
 6041|       |
 6042|       |    /* have we been allocated? */
 6043|  41.8k|    if (TCR_SYNC_PTR(*pteam) && !TCR_4(__kmp_global.g.g_done)) {
  ------------------
  |  | 1158|  83.7k|#define TCR_SYNC_PTR(a) ((void *)TCR_SYNC_8(a))
  |  |  ------------------
  |  |  |  | 1140|  41.8k|#define TCR_SYNC_8(a) (a)
  |  |  ------------------
  |  |  |  Branch (1158:25): [True: 41.2k, False: 604]
  |  |  ------------------
  ------------------
                  if (TCR_SYNC_PTR(*pteam) && !TCR_4(__kmp_global.g.g_done)) {
  ------------------
  |  | 1127|  41.2k|#define TCR_4(a) (a)
  ------------------
  |  Branch (6043:33): [True: 41.2k, False: 12]
  ------------------
 6044|       |      /* we were just woken up, so run our new task */
 6045|  41.2k|      if (TCR_SYNC_PTR((*pteam)->t.t_pkfn) != NULL) {
  ------------------
  |  | 1158|  41.2k|#define TCR_SYNC_PTR(a) ((void *)TCR_SYNC_8(a))
  |  |  ------------------
  |  |  |  | 1140|  41.2k|#define TCR_SYNC_8(a) (a)
  |  |  ------------------
  ------------------
  |  Branch (6045:11): [True: 41.2k, False: 18.4E]
  ------------------
 6046|  41.2k|        int rc;
 6047|  41.2k|        KA_TRACE(20,
 6048|  41.2k|                 ("__kmp_launch_thread: T#%d(%d:%d) invoke microtask = %p\n",
 6049|  41.2k|                  gtid, (*pteam)->t.t_id, __kmp_tid_from_gtid(gtid),
 6050|  41.2k|                  (*pteam)->t.t_pkfn));
 6051|       |
 6052|  41.2k|        updateHWFPControl(*pteam);
 6053|       |
 6054|  41.2k|#if OMPT_SUPPORT
 6055|  41.2k|        if (ompt_enabled.enabled) {
  ------------------
  |  Branch (6055:13): [True: 0, False: 41.2k]
  ------------------
 6056|      0|          this_thr->th.ompt_thread_info.state = ompt_state_work_parallel;
 6057|      0|        }
 6058|  41.2k|#endif
 6059|       |
 6060|  41.2k|        rc = (*pteam)->t.t_invoke(gtid);
 6061|  41.2k|        KMP_ASSERT(rc);
  ------------------
  |  |   50|  41.2k|  if (!(cond)) {                                                               \
  |  |  ------------------
  |  |  |  Branch (50:7): [True: 0, False: 41.2k]
  |  |  ------------------
  |  |   51|      0|    __kmp_debug_assert("assertion failure", __FILE__, __LINE__);               \
  |  |   52|      0|  }
  ------------------
 6062|       |
 6063|  41.2k|        KMP_MB();
 6064|  41.2k|        KA_TRACE(20, ("__kmp_launch_thread: T#%d(%d:%d) done microtask = %p\n",
 6065|  41.2k|                      gtid, (*pteam)->t.t_id, __kmp_tid_from_gtid(gtid),
 6066|  41.2k|                      (*pteam)->t.t_pkfn));
 6067|  41.2k|      }
 6068|  41.2k|#if OMPT_SUPPORT
 6069|  41.2k|      if (ompt_enabled.enabled) {
  ------------------
  |  Branch (6069:11): [True: 0, False: 41.2k]
  ------------------
 6070|       |        /* no frame set while outside task */
 6071|      0|        __ompt_get_task_info_object(0)->frame.exit_frame = ompt_data_none;
  ------------------
  |  | 1408|      0|#define ompt_data_none {0}
  ------------------
 6072|       |
 6073|      0|        this_thr->th.ompt_thread_info.state = ompt_state_overhead;
 6074|      0|      }
 6075|  41.2k|#endif
 6076|       |      /* join barrier after parallel region */
 6077|  41.2k|      __kmp_join_barrier(gtid);
 6078|  41.2k|    }
 6079|  41.8k|  }
 6080|       |
 6081|     31|#if OMPD_SUPPORT
 6082|     31|  if (ompd_state & OMPD_ENABLE_BP)
  ------------------
  |  |   35|     31|#define OMPD_ENABLE_BP 0x1
  ------------------
  |  Branch (6082:7): [True: 0, False: 31]
  ------------------
 6083|      0|    ompd_bp_thread_end();
 6084|     31|#endif
 6085|       |
 6086|     31|#if OMPT_SUPPORT
 6087|     31|  if (ompt_enabled.ompt_callback_thread_end) {
  ------------------
  |  Branch (6087:7): [True: 0, False: 31]
  ------------------
 6088|      0|    ompt_callbacks.ompt_callback(ompt_callback_thread_end)(thread_data);
  ------------------
  |  |   27|      0|#define ompt_callback(e) e##_callback
  ------------------
 6089|      0|  }
 6090|     31|#endif
 6091|       |
 6092|     31|  this_thr->th.th_task_team = NULL;
 6093|       |  /* run the destructors for the threadprivate data for this thread */
 6094|     31|  __kmp_common_destroy_gtid(gtid);
 6095|       |
 6096|     31|  KA_TRACE(10, ("__kmp_launch_thread: T#%d done\n", gtid));
 6097|     31|  KMP_MB();
 6098|       |
 6099|       |#if OMP_PROFILING_SUPPORT
 6100|       |  llvm::timeTraceProfilerFinishThread();
 6101|       |#endif
 6102|     31|  return this_thr;
 6103|     31|}
__kmp_internal_end_dest:
 6107|     31|void __kmp_internal_end_dest(void *specific_gtid) {
 6108|       |  // Make sure no significant bits are lost
 6109|     31|  int gtid;
 6110|     31|  __kmp_type_convert((kmp_intptr_t)specific_gtid - 1, &gtid);
 6111|       |
 6112|     31|  KA_TRACE(30, ("__kmp_internal_end_dest: T#%d\n", gtid));
 6113|       |  /* NOTE: the gtid is stored as gitd+1 in the thread-local-storage
 6114|       |   * this is because 0 is reserved for the nothing-stored case */
 6115|       |
 6116|     31|  __kmp_internal_end_thread(gtid);
 6117|     31|}
__kmp_internal_end_atexit:
 6129|      1|void __kmp_internal_end_atexit(void) {
 6130|      1|  KA_TRACE(30, ("__kmp_internal_end_atexit\n"));
 6131|       |  /* [Windows]
 6132|       |     josh: ideally, we want to completely shutdown the library in this atexit
 6133|       |     handler, but stat code that depends on thread specific data for gtid fails
 6134|       |     because that data becomes unavailable at some point during the shutdown, so
 6135|       |     we call __kmp_internal_end_thread instead. We should eventually remove the
 6136|       |     dependency on __kmp_get_specific_gtid in the stat code and use
 6137|       |     __kmp_internal_end_library to cleanly shutdown the library.
 6138|       |
 6139|       |     // TODO: Can some of this comment about GVS be removed?
 6140|       |     I suspect that the offending stat code is executed when the calling thread
 6141|       |     tries to clean up a dead root thread's data structures, resulting in GVS
 6142|       |     code trying to close the GVS structures for that thread, but since the stat
 6143|       |     code uses __kmp_get_specific_gtid to get the gtid with the assumption that
 6144|       |     the calling thread is cleaning up itself instead of another thread, it get
 6145|       |     confused. This happens because allowing a thread to unregister and cleanup
 6146|       |     another thread is a recent modification for addressing an issue.
 6147|       |     Based on the current design (20050722), a thread may end up
 6148|       |     trying to unregister another thread only if thread death does not trigger
 6149|       |     the calling of __kmp_internal_end_thread.  For Linux* OS, there is the
 6150|       |     thread specific data destructor function to detect thread death. For
 6151|       |     Windows dynamic, there is DllMain(THREAD_DETACH). For Windows static, there
 6152|       |     is nothing.  Thus, the workaround is applicable only for Windows static
 6153|       |     stat library. */
 6154|      1|  __kmp_internal_end_library(-1);
 6155|       |#if KMP_OS_WINDOWS
 6156|       |  __kmp_close_console();
 6157|       |#endif
 6158|      1|}
__kmp_internal_end_library:
 6436|      1|void __kmp_internal_end_library(int gtid_req) {
 6437|       |  /* if we have already cleaned up, don't try again, it wouldn't be pretty */
 6438|       |  /* this shouldn't be a race condition because __kmp_internal_end() is the
 6439|       |     only place to clear __kmp_serial_init */
 6440|       |  /* we'll check this later too, after we get the lock */
 6441|       |  // 2009-09-06: We do not set g_abort without setting g_done. This check looks
 6442|       |  // redundant, because the next check will work in any case.
 6443|      1|  if (__kmp_global.g.g_abort) {
  ------------------
  |  Branch (6443:7): [True: 0, False: 1]
  ------------------
 6444|      0|    KA_TRACE(11, ("__kmp_internal_end_library: abort, exiting\n"));
 6445|       |    /* TODO abort? */
 6446|      0|    return;
 6447|      0|  }
 6448|      1|  if (TCR_4(__kmp_global.g.g_done) || !__kmp_init_serial) {
  ------------------
  |  | 1127|      2|#define TCR_4(a) (a)
  |  |  ------------------
  |  |  |  Branch (1127:18): [True: 0, False: 1]
  |  |  ------------------
  ------------------
  |  Branch (6448:39): [True: 0, False: 1]
  ------------------
 6449|      0|    KA_TRACE(10, ("__kmp_internal_end_library: already finished\n"));
 6450|      0|    return;
 6451|      0|  }
 6452|       |
 6453|       |  // If hidden helper team has been initialized, we need to deinit it
 6454|      1|  if (TCR_4(__kmp_init_hidden_helper) &&
  ------------------
  |  | 1127|      2|#define TCR_4(a) (a)
  |  |  ------------------
  |  |  |  Branch (1127:18): [True: 0, False: 1]
  |  |  ------------------
  ------------------
 6455|      0|      !TCR_4(__kmp_hidden_helper_team_done)) {
  ------------------
  |  | 1127|      0|#define TCR_4(a) (a)
  ------------------
  |  Branch (6455:7): [True: 0, False: 0]
  ------------------
 6456|      0|    TCW_SYNC_4(__kmp_hidden_helper_team_done, TRUE);
  ------------------
  |  | 1136|      0|#define TCW_SYNC_4(a, b) (a) = (b)
  ------------------
 6457|       |    // First release the main thread to let it continue its work
 6458|      0|    __kmp_hidden_helper_main_thread_release();
 6459|       |    // Wait until the hidden helper team has been destroyed
 6460|      0|    __kmp_hidden_helper_threads_deinitz_wait();
 6461|      0|  }
 6462|       |
 6463|      1|  KMP_MB(); /* Flush all pending memory write invalidates.  */
 6464|       |  /* find out who we are and what we should do */
 6465|      1|  {
 6466|      1|    int gtid = (gtid_req >= 0) ? gtid_req : __kmp_gtid_get_specific();
  ------------------
  |  Branch (6466:16): [True: 0, False: 1]
  ------------------
 6467|      1|    KA_TRACE(
 6468|      1|        10, ("__kmp_internal_end_library: enter T#%d  (%d)\n", gtid, gtid_req));
 6469|      1|    if (gtid == KMP_GTID_SHUTDOWN) {
  ------------------
  |  | 1001|      1|#define KMP_GTID_SHUTDOWN (-3) /* Library is shutting down */
  ------------------
  |  Branch (6469:9): [True: 0, False: 1]
  ------------------
 6470|      0|      KA_TRACE(10, ("__kmp_internal_end_library: !__kmp_init_runtime, system "
 6471|      0|                    "already shutdown\n"));
 6472|      0|      return;
 6473|      1|    } else if (gtid == KMP_GTID_MONITOR) {
  ------------------
  |  | 1002|      1|#define KMP_GTID_MONITOR (-4) /* Monitor thread ID */
  ------------------
  |  Branch (6473:16): [True: 0, False: 1]
  ------------------
 6474|      0|      KA_TRACE(10, ("__kmp_internal_end_library: monitor thread, gtid not "
 6475|      0|                    "registered, or system shutdown\n"));
 6476|      0|      return;
 6477|      1|    } else if (gtid == KMP_GTID_DNE) {
  ------------------
  |  | 1000|      1|#define KMP_GTID_DNE (-2) /* Does not exist */
  ------------------
  |  Branch (6477:16): [True: 0, False: 1]
  ------------------
 6478|      0|      KA_TRACE(10, ("__kmp_internal_end_library: gtid not registered or system "
 6479|      0|                    "shutdown\n"));
 6480|       |      /* we don't know who we are, but we may still shutdown the library */
 6481|      1|    } else if (KMP_UBER_GTID(gtid)) {
  ------------------
  |  Branch (6481:16): [True: 1, False: 0]
  ------------------
 6482|       |      /* unregister ourselves as an uber thread.  gtid is no longer valid */
 6483|      1|      if (__kmp_root[gtid]->r.r_active) {
  ------------------
  |  Branch (6483:11): [True: 0, False: 1]
  ------------------
 6484|      0|        __kmp_global.g.g_abort = -1;
 6485|      0|        TCW_SYNC_4(__kmp_global.g.g_done, TRUE);
  ------------------
  |  | 1136|      0|#define TCW_SYNC_4(a, b) (a) = (b)
  ------------------
 6486|      0|        __kmp_unregister_library();
 6487|      0|        KA_TRACE(10,
 6488|      0|                 ("__kmp_internal_end_library: root still active, abort T#%d\n",
 6489|      0|                  gtid));
 6490|      0|        return;
 6491|      1|      } else {
 6492|      1|        __kmp_itthash_clean(__kmp_threads[gtid]);
 6493|      1|        KA_TRACE(
 6494|      1|            10,
 6495|      1|            ("__kmp_internal_end_library: unregistering sibling T#%d\n", gtid));
 6496|      1|        __kmp_unregister_root_current_thread(gtid);
 6497|      1|      }
 6498|      1|    } else {
 6499|       |/* worker threads may call this function through the atexit handler, if they
 6500|       | * call exit() */
 6501|       |/* For now, skip the usual subsequent processing and just dump the debug buffer.
 6502|       |   TODO: do a thorough shutdown instead */
 6503|       |#ifdef DUMP_DEBUG_ON_EXIT
 6504|       |      if (__kmp_debug_buf)
 6505|       |        __kmp_dump_debug_buffer();
 6506|       |#endif
 6507|       |      // added unregister library call here when we switch to shm linux
 6508|       |      // if we don't, it will leave lots of files in /dev/shm
 6509|       |      // cleanup shared memory file before exiting.
 6510|      0|      __kmp_unregister_library();
 6511|      0|      return;
 6512|      0|    }
 6513|      1|  }
 6514|       |  /* synchronize the termination process */
 6515|      1|  __kmp_acquire_bootstrap_lock(&__kmp_initz_lock);
 6516|       |
 6517|       |  /* have we already finished */
 6518|      1|  if (__kmp_global.g.g_abort) {
  ------------------
  |  Branch (6518:7): [True: 0, False: 1]
  ------------------
 6519|      0|    KA_TRACE(10, ("__kmp_internal_end_library: abort, exiting\n"));
 6520|       |    /* TODO abort? */
 6521|      0|    __kmp_release_bootstrap_lock(&__kmp_initz_lock);
 6522|      0|    return;
 6523|      0|  }
 6524|      1|  if (TCR_4(__kmp_global.g.g_done) || !__kmp_init_serial) {
  ------------------
  |  | 1127|      2|#define TCR_4(a) (a)
  |  |  ------------------
  |  |  |  Branch (1127:18): [True: 0, False: 1]
  |  |  ------------------
  ------------------
  |  Branch (6524:39): [True: 0, False: 1]
  ------------------
 6525|      0|    __kmp_release_bootstrap_lock(&__kmp_initz_lock);
 6526|      0|    return;
 6527|      0|  }
 6528|       |
 6529|       |  /* We need this lock to enforce mutex between this reading of
 6530|       |     __kmp_threads_capacity and the writing by __kmp_register_root.
 6531|       |     Alternatively, we can use a counter of roots that is atomically updated by
 6532|       |     __kmp_get_global_thread_id_reg, __kmp_do_serial_initialize and
 6533|       |     __kmp_internal_end_*.  */
 6534|      1|  __kmp_acquire_bootstrap_lock(&__kmp_forkjoin_lock);
 6535|       |
 6536|       |  /* now we can safely conduct the actual termination */
 6537|      1|  __kmp_internal_end();
 6538|       |
 6539|      1|  __kmp_release_bootstrap_lock(&__kmp_forkjoin_lock);
 6540|      1|  __kmp_release_bootstrap_lock(&__kmp_initz_lock);
 6541|       |
 6542|      1|  KA_TRACE(10, ("__kmp_internal_end_library: exit\n"));
 6543|       |
 6544|       |#ifdef DUMP_DEBUG_ON_EXIT
 6545|       |  if (__kmp_debug_buf)
 6546|       |    __kmp_dump_debug_buffer();
 6547|       |#endif
 6548|       |
 6549|       |#if KMP_OS_WINDOWS
 6550|       |  __kmp_close_console();
 6551|       |#endif
 6552|       |
 6553|      1|  __kmp_fini_allocator();
 6554|       |
 6555|      1|} // __kmp_internal_end_library
__kmp_internal_end_thread:
 6557|     31|void __kmp_internal_end_thread(int gtid_req) {
 6558|     31|  int i;
 6559|       |
 6560|       |  /* if we have already cleaned up, don't try again, it wouldn't be pretty */
 6561|       |  /* this shouldn't be a race condition because __kmp_internal_end() is the
 6562|       |   * only place to clear __kmp_serial_init */
 6563|       |  /* we'll check this later too, after we get the lock */
 6564|       |  // 2009-09-06: We do not set g_abort without setting g_done. This check looks
 6565|       |  // redundant, because the next check will work in any case.
 6566|     31|  if (__kmp_global.g.g_abort) {
  ------------------
  |  Branch (6566:7): [True: 0, False: 31]
  ------------------
 6567|      0|    KA_TRACE(11, ("__kmp_internal_end_thread: abort, exiting\n"));
 6568|       |    /* TODO abort? */
 6569|      0|    return;
 6570|      0|  }
 6571|     31|  if (TCR_4(__kmp_global.g.g_done) || !__kmp_init_serial) {
  ------------------
  |  | 1127|     62|#define TCR_4(a) (a)
  |  |  ------------------
  |  |  |  Branch (1127:18): [True: 31, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (6571:39): [True: 0, False: 0]
  ------------------
 6572|     31|    KA_TRACE(10, ("__kmp_internal_end_thread: already finished\n"));
 6573|     31|    return;
 6574|     31|  }
 6575|       |
 6576|       |  // If hidden helper team has been initialized, we need to deinit it
 6577|      0|  if (TCR_4(__kmp_init_hidden_helper) &&
  ------------------
  |  | 1127|      0|#define TCR_4(a) (a)
  |  |  ------------------
  |  |  |  Branch (1127:18): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 6578|      0|      !TCR_4(__kmp_hidden_helper_team_done)) {
  ------------------
  |  | 1127|      0|#define TCR_4(a) (a)
  ------------------
  |  Branch (6578:7): [True: 0, False: 0]
  ------------------
 6579|      0|    TCW_SYNC_4(__kmp_hidden_helper_team_done, TRUE);
  ------------------
  |  | 1136|      0|#define TCW_SYNC_4(a, b) (a) = (b)
  ------------------
 6580|       |    // First release the main thread to let it continue its work
 6581|      0|    __kmp_hidden_helper_main_thread_release();
 6582|       |    // Wait until the hidden helper team has been destroyed
 6583|      0|    __kmp_hidden_helper_threads_deinitz_wait();
 6584|      0|  }
 6585|       |
 6586|      0|  KMP_MB(); /* Flush all pending memory write invalidates.  */
 6587|       |
 6588|       |  /* find out who we are and what we should do */
 6589|      0|  {
 6590|      0|    int gtid = (gtid_req >= 0) ? gtid_req : __kmp_gtid_get_specific();
  ------------------
  |  Branch (6590:16): [True: 0, False: 0]
  ------------------
 6591|      0|    KA_TRACE(10,
 6592|      0|             ("__kmp_internal_end_thread: enter T#%d  (%d)\n", gtid, gtid_req));
 6593|      0|    if (gtid == KMP_GTID_SHUTDOWN) {
  ------------------
  |  | 1001|      0|#define KMP_GTID_SHUTDOWN (-3) /* Library is shutting down */
  ------------------
  |  Branch (6593:9): [True: 0, False: 0]
  ------------------
 6594|      0|      KA_TRACE(10, ("__kmp_internal_end_thread: !__kmp_init_runtime, system "
 6595|      0|                    "already shutdown\n"));
 6596|      0|      return;
 6597|      0|    } else if (gtid == KMP_GTID_MONITOR) {
  ------------------
  |  | 1002|      0|#define KMP_GTID_MONITOR (-4) /* Monitor thread ID */
  ------------------
  |  Branch (6597:16): [True: 0, False: 0]
  ------------------
 6598|      0|      KA_TRACE(10, ("__kmp_internal_end_thread: monitor thread, gtid not "
 6599|      0|                    "registered, or system shutdown\n"));
 6600|      0|      return;
 6601|      0|    } else if (gtid == KMP_GTID_DNE) {
  ------------------
  |  | 1000|      0|#define KMP_GTID_DNE (-2) /* Does not exist */
  ------------------
  |  Branch (6601:16): [True: 0, False: 0]
  ------------------
 6602|      0|      KA_TRACE(10, ("__kmp_internal_end_thread: gtid not registered or system "
 6603|      0|                    "shutdown\n"));
 6604|      0|      return;
 6605|       |      /* we don't know who we are */
 6606|      0|    } else if (KMP_UBER_GTID(gtid)) {
  ------------------
  |  Branch (6606:16): [True: 0, False: 0]
  ------------------
 6607|       |      /* unregister ourselves as an uber thread.  gtid is no longer valid */
 6608|      0|      if (__kmp_root[gtid]->r.r_active) {
  ------------------
  |  Branch (6608:11): [True: 0, False: 0]
  ------------------
 6609|      0|        __kmp_global.g.g_abort = -1;
 6610|      0|        TCW_SYNC_4(__kmp_global.g.g_done, TRUE);
  ------------------
  |  | 1136|      0|#define TCW_SYNC_4(a, b) (a) = (b)
  ------------------
 6611|      0|        KA_TRACE(10,
 6612|      0|                 ("__kmp_internal_end_thread: root still active, abort T#%d\n",
 6613|      0|                  gtid));
 6614|      0|        return;
 6615|      0|      } else {
 6616|      0|        KA_TRACE(10, ("__kmp_internal_end_thread: unregistering sibling T#%d\n",
 6617|      0|                      gtid));
 6618|      0|        __kmp_unregister_root_current_thread(gtid);
 6619|      0|      }
 6620|      0|    } else {
 6621|       |      /* just a worker thread, let's leave */
 6622|      0|      KA_TRACE(10, ("__kmp_internal_end_thread: worker thread T#%d\n", gtid));
 6623|       |
 6624|      0|      if (gtid >= 0) {
  ------------------
  |  Branch (6624:11): [True: 0, False: 0]
  ------------------
 6625|      0|        __kmp_threads[gtid]->th.th_task_team = NULL;
 6626|      0|      }
 6627|       |
 6628|      0|      KA_TRACE(10,
 6629|      0|               ("__kmp_internal_end_thread: worker thread done, exiting T#%d\n",
 6630|      0|                gtid));
 6631|      0|      return;
 6632|      0|    }
 6633|      0|  }
 6634|       |#if KMP_DYNAMIC_LIB
 6635|       |  if (__kmp_pause_status != kmp_hard_paused)
 6636|       |  // AC: lets not shutdown the dynamic library at the exit of uber thread,
 6637|       |  // because we will better shutdown later in the library destructor.
 6638|       |  {
 6639|       |    KA_TRACE(10, ("__kmp_internal_end_thread: exiting T#%d\n", gtid_req));
 6640|       |    return;
 6641|       |  }
 6642|       |#endif
 6643|       |  /* synchronize the termination process */
 6644|      0|  __kmp_acquire_bootstrap_lock(&__kmp_initz_lock);
 6645|       |
 6646|       |  /* have we already finished */
 6647|      0|  if (__kmp_global.g.g_abort) {
  ------------------
  |  Branch (6647:7): [True: 0, False: 0]
  ------------------
 6648|      0|    KA_TRACE(10, ("__kmp_internal_end_thread: abort, exiting\n"));
 6649|       |    /* TODO abort? */
 6650|      0|    __kmp_release_bootstrap_lock(&__kmp_initz_lock);
 6651|      0|    return;
 6652|      0|  }
 6653|      0|  if (TCR_4(__kmp_global.g.g_done) || !__kmp_init_serial) {
  ------------------
  |  | 1127|      0|#define TCR_4(a) (a)
  |  |  ------------------
  |  |  |  Branch (1127:18): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (6653:39): [True: 0, False: 0]
  ------------------
 6654|      0|    __kmp_release_bootstrap_lock(&__kmp_initz_lock);
 6655|      0|    return;
 6656|      0|  }
 6657|       |
 6658|       |  /* We need this lock to enforce mutex between this reading of
 6659|       |     __kmp_threads_capacity and the writing by __kmp_register_root.
 6660|       |     Alternatively, we can use a counter of roots that is atomically updated by
 6661|       |     __kmp_get_global_thread_id_reg, __kmp_do_serial_initialize and
 6662|       |     __kmp_internal_end_*.  */
 6663|       |
 6664|       |  /* should we finish the run-time?  are all siblings done? */
 6665|      0|  __kmp_acquire_bootstrap_lock(&__kmp_forkjoin_lock);
 6666|       |
 6667|      0|  for (i = 0; i < __kmp_threads_capacity; ++i) {
  ------------------
  |  Branch (6667:15): [True: 0, False: 0]
  ------------------
 6668|      0|    if (KMP_UBER_GTID(i)) {
  ------------------
  |  Branch (6668:9): [True: 0, False: 0]
  ------------------
 6669|      0|      KA_TRACE(
 6670|      0|          10,
 6671|      0|          ("__kmp_internal_end_thread: remaining sibling task: gtid==%d\n", i));
 6672|      0|      __kmp_release_bootstrap_lock(&__kmp_forkjoin_lock);
 6673|      0|      __kmp_release_bootstrap_lock(&__kmp_initz_lock);
 6674|      0|      return;
 6675|      0|    }
 6676|      0|  }
 6677|       |
 6678|       |  /* now we can safely conduct the actual termination */
 6679|       |
 6680|      0|  __kmp_internal_end();
 6681|       |
 6682|      0|  __kmp_release_bootstrap_lock(&__kmp_forkjoin_lock);
 6683|      0|  __kmp_release_bootstrap_lock(&__kmp_initz_lock);
 6684|       |
 6685|      0|  KA_TRACE(10, ("__kmp_internal_end_thread: exit T#%d\n", gtid_req));
 6686|       |
 6687|       |#ifdef DUMP_DEBUG_ON_EXIT
 6688|       |  if (__kmp_debug_buf)
 6689|       |    __kmp_dump_debug_buffer();
 6690|       |#endif
 6691|      0|} // __kmp_internal_end_thread
_Z30__kmp_register_library_startupv:
 6720|      1|void __kmp_register_library_startup(void) {
 6721|       |
 6722|      1|  char *name = __kmp_reg_status_name(); // Name of the environment variable.
 6723|      1|  int done = 0;
 6724|      1|  union {
 6725|      1|    double dtime;
 6726|      1|    long ltime;
 6727|      1|  } time;
 6728|      1|#if KMP_ARCH_X86 || KMP_ARCH_X86_64
 6729|      1|  __kmp_initialize_system_tick();
 6730|      1|#endif
 6731|      1|  __kmp_read_system_time(&time.dtime);
 6732|      1|  __kmp_registration_flag = 0xCAFE0000L | (time.ltime & 0x0000FFFFL);
 6733|      1|  __kmp_registration_str =
 6734|      1|      __kmp_str_format("%p-%lx-%s", &__kmp_registration_flag,
 6735|      1|                       __kmp_registration_flag, KMP_LIBRARY_FILE);
  ------------------
  |  |   70|      1|#define KMP_LIBRARY_FILE "libomp.a"
  ------------------
 6736|       |
 6737|      1|  KA_TRACE(50, ("__kmp_register_library_startup: %s=\"%s\"\n", name,
 6738|      1|                __kmp_registration_str));
 6739|       |
 6740|      2|  while (!done) {
  ------------------
  |  Branch (6740:10): [True: 1, False: 1]
  ------------------
 6741|       |
 6742|      1|    char *value = NULL; // Actual value of the environment variable.
 6743|       |
 6744|       |#if defined(KMP_USE_SHM)
 6745|       |    char *shm_name = __kmp_str_format("/%s", name);
 6746|       |    int shm_preexist = 0;
 6747|       |    char *data1;
 6748|       |    int fd1 = shm_open(shm_name, O_CREAT | O_EXCL | O_RDWR, 0666);
 6749|       |    if ((fd1 == -1) && (errno == EEXIST)) {
 6750|       |      // file didn't open because it already exists.
 6751|       |      // try opening existing file
 6752|       |      fd1 = shm_open(shm_name, O_RDWR, 0666);
 6753|       |      if (fd1 == -1) { // file didn't open
 6754|       |        // error out here
 6755|       |        __kmp_fatal(KMP_MSG(FunctionError, "Can't open SHM"), KMP_ERR(0),
 6756|       |                    __kmp_msg_null);
 6757|       |      } else {
 6758|       |        // able to open existing file
 6759|       |        shm_preexist = 1;
 6760|       |      }
 6761|       |    } else if (fd1 == -1) {
 6762|       |      // SHM didn't open; it was due to error other than already exists. Try to
 6763|       |      // create a temp file under /tmp.
 6764|       |      // TODO: /tmp might not always be the temporary directory. For now we will
 6765|       |      // not consider TMPDIR. If /tmp is not accessible, we simply error out.
 6766|       |      char *temp_file_name = __kmp_str_format("/tmp/%sXXXXXX", name);
 6767|       |      fd1 = mkstemp(temp_file_name);
 6768|       |      if (fd1 == -1) {
 6769|       |        // error out here.
 6770|       |        __kmp_fatal(KMP_MSG(FunctionError, "Can't open TEMP"), KMP_ERR(errno),
 6771|       |                    __kmp_msg_null);
 6772|       |      }
 6773|       |      temp_reg_status_file_name = temp_file_name;
 6774|       |    }
 6775|       |    if (shm_preexist == 0) {
 6776|       |      // we created SHM now set size
 6777|       |      if (ftruncate(fd1, SHM_SIZE) == -1) {
 6778|       |        // error occured setting size;
 6779|       |        __kmp_fatal(KMP_MSG(FunctionError, "Can't set size of SHM"),
 6780|       |                    KMP_ERR(errno), __kmp_msg_null);
 6781|       |      }
 6782|       |    }
 6783|       |    data1 =
 6784|       |        (char *)mmap(0, SHM_SIZE, PROT_READ | PROT_WRITE, MAP_SHARED, fd1, 0);
 6785|       |    if (data1 == MAP_FAILED) {
 6786|       |      // failed to map shared memory
 6787|       |      __kmp_fatal(KMP_MSG(FunctionError, "Can't map SHM"), KMP_ERR(errno),
 6788|       |                  __kmp_msg_null);
 6789|       |    }
 6790|       |    if (shm_preexist == 0) { // set data to SHM, set value
 6791|       |      KMP_STRCPY_S(data1, SHM_SIZE, __kmp_registration_str);
 6792|       |    }
 6793|       |    // Read value from either what we just wrote or existing file.
 6794|       |    value = __kmp_str_format("%s", data1); // read value from SHM
 6795|       |    munmap(data1, SHM_SIZE);
 6796|       |    close(fd1);
 6797|       |#else // Windows and unix with static library
 6798|       |    // Set environment variable, but do not overwrite if it is exist.
 6799|      1|    __kmp_env_set(name, __kmp_registration_str, 0);
 6800|       |    // read value to see if it got set
 6801|      1|    value = __kmp_env_get(name);
 6802|      1|#endif
 6803|       |
 6804|      1|    if (value != NULL && strcmp(value, __kmp_registration_str) == 0) {
  ------------------
  |  Branch (6804:9): [True: 1, False: 0]
  |  Branch (6804:26): [True: 1, False: 0]
  ------------------
 6805|      1|      done = 1; // Ok, environment variable set successfully, exit the loop.
 6806|      1|    } else {
 6807|       |      // Oops. Write failed. Another copy of OpenMP RTL is in memory.
 6808|       |      // Check whether it alive or dead.
 6809|      0|      int neighbor = 0; // 0 -- unknown status, 1 -- alive, 2 -- dead.
 6810|      0|      char *tail = value;
 6811|      0|      char *flag_addr_str = NULL;
 6812|      0|      char *flag_val_str = NULL;
 6813|      0|      char const *file_name = NULL;
 6814|      0|      __kmp_str_split(tail, '-', &flag_addr_str, &tail);
 6815|      0|      __kmp_str_split(tail, '-', &flag_val_str, &tail);
 6816|      0|      file_name = tail;
 6817|      0|      if (tail != NULL) {
  ------------------
  |  Branch (6817:11): [True: 0, False: 0]
  ------------------
 6818|      0|        unsigned long *flag_addr = 0;
 6819|      0|        unsigned long flag_val = 0;
 6820|      0|        KMP_SSCANF(flag_addr_str, "%p", RCAST(void **, &flag_addr));
  ------------------
  |  |   62|      0|#define KMP_SSCANF sscanf
  ------------------
                      KMP_SSCANF(flag_addr_str, "%p", RCAST(void **, &flag_addr));
  ------------------
  |  |  230|      0|#define RCAST(type, var) reinterpret_cast<type>(var)
  ------------------
 6821|      0|        KMP_SSCANF(flag_val_str, "%lx", &flag_val);
  ------------------
  |  |   62|      0|#define KMP_SSCANF sscanf
  ------------------
 6822|      0|        if (flag_addr != 0 && flag_val != 0 && strcmp(file_name, "") != 0) {
  ------------------
  |  Branch (6822:13): [True: 0, False: 0]
  |  Branch (6822:31): [True: 0, False: 0]
  |  Branch (6822:48): [True: 0, False: 0]
  ------------------
 6823|       |          // First, check whether environment-encoded address is mapped into
 6824|       |          // addr space.
 6825|       |          // If so, dereference it to see if it still has the right value.
 6826|      0|          if (__kmp_is_address_mapped(flag_addr) && *flag_addr == flag_val) {
  ------------------
  |  Branch (6826:15): [True: 0, False: 0]
  |  Branch (6826:53): [True: 0, False: 0]
  ------------------
 6827|      0|            neighbor = 1;
 6828|      0|          } else {
 6829|       |            // If not, then we know the other copy of the library is no longer
 6830|       |            // running.
 6831|      0|            neighbor = 2;
 6832|      0|          }
 6833|      0|        }
 6834|      0|      }
 6835|      0|      switch (neighbor) {
 6836|      0|      case 0: // Cannot parse environment variable -- neighbor status unknown.
  ------------------
  |  Branch (6836:7): [True: 0, False: 0]
  ------------------
 6837|       |        // Assume it is the incompatible format of future version of the
 6838|       |        // library. Assume the other library is alive.
 6839|       |        // WARN( ... ); // TODO: Issue a warning.
 6840|      0|        file_name = "unknown library";
 6841|      0|        KMP_FALLTHROUGH();
  ------------------
  |  |  347|      0|#define KMP_FALLTHROUGH() [[fallthrough]]
  ------------------
 6842|       |      // Attention! Falling to the next case. That's intentional.
 6843|      0|      case 1: { // Neighbor is alive.
  ------------------
  |  Branch (6843:7): [True: 0, False: 0]
  ------------------
 6844|       |        // Check it is allowed.
 6845|      0|        char *duplicate_ok = __kmp_env_get("KMP_DUPLICATE_LIB_OK");
 6846|      0|        if (!__kmp_str_match_true(duplicate_ok)) {
  ------------------
  |  Branch (6846:13): [True: 0, False: 0]
  ------------------
 6847|       |          // That's not allowed. Issue fatal error.
 6848|      0|          __kmp_fatal(KMP_MSG(DuplicateLibrary, KMP_LIBRARY_FILE, file_name),
  ------------------
  |  |  121|      0|#define KMP_MSG(...) __kmp_msg_format(kmp_i18n_msg_##__VA_ARGS__)
  |  |  ------------------
  |  |  |  | 6848|      0|          __kmp_fatal(KMP_MSG(DuplicateLibrary, KMP_LIBRARY_FILE, file_name),
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define KMP_LIBRARY_FILE "libomp.a"
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6849|      0|                      KMP_HNT(DuplicateLibrary), __kmp_msg_null);
  ------------------
  |  |  122|      0|#define KMP_HNT(...) __kmp_msg_format(kmp_i18n_hnt_##__VA_ARGS__)
  ------------------
 6850|      0|        }
 6851|      0|        KMP_INTERNAL_FREE(duplicate_ok);
  ------------------
  |  |  111|      0|#define KMP_INTERNAL_FREE(p) free(p)
  ------------------
 6852|      0|        __kmp_duplicate_library_ok = 1;
 6853|      0|        done = 1; // Exit the loop.
 6854|      0|      } break;
 6855|      0|      case 2: { // Neighbor is dead.
  ------------------
  |  Branch (6855:7): [True: 0, False: 0]
  ------------------
 6856|       |
 6857|       |#if defined(KMP_USE_SHM)
 6858|       |        // close shared memory.
 6859|       |        shm_unlink(shm_name); // this removes file in /dev/shm
 6860|       |#else
 6861|       |        // Clear the variable and try to register library again.
 6862|      0|        __kmp_env_unset(name);
 6863|      0|#endif
 6864|      0|      } break;
 6865|      0|      default: {
  ------------------
  |  Branch (6865:7): [True: 0, False: 0]
  ------------------
 6866|      0|        KMP_DEBUG_ASSERT(0);
 6867|      0|      } break;
 6868|      0|      }
 6869|      0|    }
 6870|      1|    KMP_INTERNAL_FREE((void *)value);
  ------------------
  |  |  111|      1|#define KMP_INTERNAL_FREE(p) free(p)
  ------------------
 6871|       |#if defined(KMP_USE_SHM)
 6872|       |    KMP_INTERNAL_FREE((void *)shm_name);
 6873|       |#endif
 6874|      1|  } // while
 6875|      1|  KMP_INTERNAL_FREE((void *)name);
  ------------------
  |  |  111|      1|#define KMP_INTERNAL_FREE(p) free(p)
  ------------------
 6876|       |
 6877|      1|} // func __kmp_register_library_startup
__kmp_unregister_library:
 6879|      1|void __kmp_unregister_library(void) {
 6880|       |
 6881|      1|  char *name = __kmp_reg_status_name();
 6882|      1|  char *value = NULL;
 6883|       |
 6884|       |#if defined(KMP_USE_SHM)
 6885|       |  bool use_shm = true;
 6886|       |  char *shm_name = __kmp_str_format("/%s", name);
 6887|       |  int fd1 = shm_open(shm_name, O_RDONLY, 0666);
 6888|       |  if (fd1 == -1) {
 6889|       |    // File did not open. Try the temporary file.
 6890|       |    use_shm = false;
 6891|       |    KMP_DEBUG_ASSERT(temp_reg_status_file_name);
 6892|       |    fd1 = open(temp_reg_status_file_name, O_RDONLY);
 6893|       |    if (fd1 == -1) {
 6894|       |      // give it up now.
 6895|       |      return;
 6896|       |    }
 6897|       |  }
 6898|       |  char *data1 = (char *)mmap(0, SHM_SIZE, PROT_READ, MAP_SHARED, fd1, 0);
 6899|       |  if (data1 != MAP_FAILED) {
 6900|       |    value = __kmp_str_format("%s", data1); // read value from SHM
 6901|       |    munmap(data1, SHM_SIZE);
 6902|       |  }
 6903|       |  close(fd1);
 6904|       |#else
 6905|      1|  value = __kmp_env_get(name);
 6906|      1|#endif
 6907|       |
 6908|      1|  KMP_DEBUG_ASSERT(__kmp_registration_flag != 0);
 6909|      1|  KMP_DEBUG_ASSERT(__kmp_registration_str != NULL);
 6910|      1|  if (value != NULL && strcmp(value, __kmp_registration_str) == 0) {
  ------------------
  |  Branch (6910:7): [True: 1, False: 0]
  |  Branch (6910:24): [True: 1, False: 0]
  ------------------
 6911|       |//  Ok, this is our variable. Delete it.
 6912|       |#if defined(KMP_USE_SHM)
 6913|       |    if (use_shm) {
 6914|       |      shm_unlink(shm_name); // this removes file in /dev/shm
 6915|       |    } else {
 6916|       |      KMP_DEBUG_ASSERT(temp_reg_status_file_name);
 6917|       |      unlink(temp_reg_status_file_name); // this removes the temp file
 6918|       |    }
 6919|       |#else
 6920|      1|    __kmp_env_unset(name);
 6921|      1|#endif
 6922|      1|  }
 6923|       |
 6924|       |#if defined(KMP_USE_SHM)
 6925|       |  KMP_INTERNAL_FREE(shm_name);
 6926|       |  if (!use_shm) {
 6927|       |    KMP_DEBUG_ASSERT(temp_reg_status_file_name);
 6928|       |    KMP_INTERNAL_FREE(temp_reg_status_file_name);
 6929|       |  }
 6930|       |#endif
 6931|       |
 6932|      1|  KMP_INTERNAL_FREE(__kmp_registration_str);
  ------------------
  |  |  111|      1|#define KMP_INTERNAL_FREE(p) free(p)
  ------------------
 6933|      1|  KMP_INTERNAL_FREE(value);
  ------------------
  |  |  111|      1|#define KMP_INTERNAL_FREE(p) free(p)
  ------------------
 6934|      1|  KMP_INTERNAL_FREE(name);
  ------------------
  |  |  111|      1|#define KMP_INTERNAL_FREE(p) free(p)
  ------------------
 6935|       |
 6936|      1|  __kmp_registration_flag = 0;
 6937|      1|  __kmp_registration_str = NULL;
 6938|       |
 6939|      1|} // __kmp_unregister_library
__kmp_middle_initialize:
 7431|      1|void __kmp_middle_initialize(void) {
 7432|      1|  if (__kmp_init_middle) {
  ------------------
  |  Branch (7432:7): [True: 0, False: 1]
  ------------------
 7433|      0|    return;
 7434|      0|  }
 7435|      1|  __kmp_acquire_bootstrap_lock(&__kmp_initz_lock);
 7436|      1|  if (__kmp_init_middle) {
  ------------------
  |  Branch (7436:7): [True: 0, False: 1]
  ------------------
 7437|      0|    __kmp_release_bootstrap_lock(&__kmp_initz_lock);
 7438|      0|    return;
 7439|      0|  }
 7440|      1|  __kmp_do_middle_initialize();
 7441|      1|  __kmp_release_bootstrap_lock(&__kmp_initz_lock);
 7442|      1|}
__kmp_parallel_initialize:
 7444|      1|void __kmp_parallel_initialize(void) {
 7445|      1|  int gtid = __kmp_entry_gtid(); // this might be a new root
  ------------------
  |  | 3467|      1|#define __kmp_entry_gtid() __kmp_get_global_thread_id_reg()
  ------------------
 7446|       |
 7447|       |  /* synchronize parallel initialization (for sibling) */
 7448|      1|  if (TCR_4(__kmp_init_parallel))
  ------------------
  |  | 1127|      1|#define TCR_4(a) (a)
  |  |  ------------------
  |  |  |  Branch (1127:18): [True: 0, False: 1]
  |  |  ------------------
  ------------------
 7449|      0|    return;
 7450|      1|  __kmp_acquire_bootstrap_lock(&__kmp_initz_lock);
 7451|      1|  if (TCR_4(__kmp_init_parallel)) {
  ------------------
  |  | 1127|      1|#define TCR_4(a) (a)
  |  |  ------------------
  |  |  |  Branch (1127:18): [True: 0, False: 1]
  |  |  ------------------
  ------------------
 7452|      0|    __kmp_release_bootstrap_lock(&__kmp_initz_lock);
 7453|      0|    return;
 7454|      0|  }
 7455|       |
 7456|       |  /* TODO reinitialization after we have already shut down */
 7457|      1|  if (TCR_4(__kmp_global.g.g_done)) {
  ------------------
  |  | 1127|      1|#define TCR_4(a) (a)
  |  |  ------------------
  |  |  |  Branch (1127:18): [True: 0, False: 1]
  |  |  ------------------
  ------------------
 7458|      0|    KA_TRACE(
 7459|      0|        10,
 7460|      0|        ("__kmp_parallel_initialize: attempt to init while shutting down\n"));
 7461|      0|    __kmp_infinite_loop();
 7462|      0|  }
 7463|       |
 7464|       |  /* jc: The lock __kmp_initz_lock is already held, so calling
 7465|       |     __kmp_serial_initialize would cause a deadlock.  So we call
 7466|       |     __kmp_do_serial_initialize directly. */
 7467|      1|  if (!__kmp_init_middle) {
  ------------------
  |  Branch (7467:7): [True: 0, False: 1]
  ------------------
 7468|      0|    __kmp_do_middle_initialize();
 7469|      0|  }
 7470|      1|  __kmp_assign_root_init_mask();
 7471|      1|  __kmp_resume_if_hard_paused();
 7472|       |
 7473|       |  /* begin initialization */
 7474|      1|  KA_TRACE(10, ("__kmp_parallel_initialize: enter\n"));
 7475|      1|  KMP_ASSERT(KMP_UBER_GTID(gtid));
  ------------------
  |  |   50|      1|  if (!(cond)) {                                                               \
  |  |  ------------------
  |  |  |  Branch (50:7): [True: 0, False: 1]
  |  |  ------------------
  |  |   51|      0|    __kmp_debug_assert("assertion failure", __FILE__, __LINE__);               \
  |  |   52|      0|  }
  ------------------
 7476|       |
 7477|      1|#if KMP_ARCH_X86 || KMP_ARCH_X86_64
 7478|       |  // Save the FP control regs.
 7479|       |  // Worker threads will set theirs to these values at thread startup.
 7480|      1|  __kmp_store_x87_fpu_control_word(&__kmp_init_x87_fpu_control_word);
 7481|      1|  __kmp_store_mxcsr(&__kmp_init_mxcsr);
 7482|      1|  __kmp_init_mxcsr &= KMP_X86_MXCSR_MASK;
  ------------------
  |  | 1403|      1|#define KMP_X86_MXCSR_MASK 0xffffffc0 /* ignore status flags (6 lsb) */
  ------------------
 7483|      1|#endif /* KMP_ARCH_X86 || KMP_ARCH_X86_64 */
 7484|       |
 7485|      1|#if KMP_OS_UNIX
 7486|      1|#if KMP_HANDLE_SIGNALS
 7487|       |  /*  must be after __kmp_serial_initialize  */
 7488|      1|  __kmp_install_signals(TRUE);
  ------------------
  |  | 1280|      1|#define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  | 1279|      1|#define FALSE 0
  |  |  ------------------
  ------------------
 7489|      1|#endif
 7490|      1|#endif
 7491|       |
 7492|      1|  __kmp_suspend_initialize();
 7493|       |
 7494|      1|#if defined(USE_LOAD_BALANCE)
 7495|      1|  if (__kmp_global.g.g_dynamic_mode == dynamic_default) {
  ------------------
  |  Branch (7495:7): [True: 1, False: 0]
  ------------------
 7496|      1|    __kmp_global.g.g_dynamic_mode = dynamic_load_balance;
 7497|      1|  }
 7498|       |#else
 7499|       |  if (__kmp_global.g.g_dynamic_mode == dynamic_default) {
 7500|       |    __kmp_global.g.g_dynamic_mode = dynamic_thread_limit;
 7501|       |  }
 7502|       |#endif
 7503|       |
 7504|      1|  if (__kmp_version) {
  ------------------
  |  Branch (7504:7): [True: 0, False: 1]
  ------------------
 7505|      0|    __kmp_print_version_2();
 7506|      0|  }
 7507|       |
 7508|       |  /* we have finished parallel initialization */
 7509|      1|  TCW_SYNC_4(__kmp_init_parallel, TRUE);
  ------------------
  |  | 1136|      1|#define TCW_SYNC_4(a, b) (a) = (b)
  ------------------
 7510|       |
 7511|      1|  KMP_MB();
 7512|      1|  KA_TRACE(10, ("__kmp_parallel_initialize: exit\n"));
 7513|       |
 7514|      1|  __kmp_release_bootstrap_lock(&__kmp_initz_lock);
 7515|      1|}
__kmp_run_before_invoked_task:
 7563|  42.4k|                                   kmp_team_t *team) {
 7564|  42.4k|  kmp_disp_t *dispatch;
 7565|       |
 7566|  42.4k|  KMP_MB();
 7567|       |
 7568|       |  /* none of the threads have encountered any constructs, yet. */
 7569|  42.4k|  this_thr->th.th_local.this_construct = 0;
 7570|       |#if KMP_CACHE_MANAGE
 7571|       |  KMP_CACHE_PREFETCH(&this_thr->th.th_bar[bs_forkjoin_barrier].bb.b_arrived);
 7572|       |#endif /* KMP_CACHE_MANAGE */
 7573|  42.4k|  dispatch = (kmp_disp_t *)TCR_PTR(this_thr->th.th_dispatch);
  ------------------
  |  | 1156|  42.4k|#define TCR_PTR(a) ((void *)TCR_8(a))
  |  |  ------------------
  |  |  |  | 1131|  42.4k|#define TCR_8(a) (a)
  |  |  ------------------
  ------------------
 7574|  42.4k|  KMP_DEBUG_ASSERT(dispatch);
 7575|  42.4k|  KMP_DEBUG_ASSERT(team->t.t_dispatch);
 7576|       |  // KMP_DEBUG_ASSERT( this_thr->th.th_dispatch == &team->t.t_dispatch[
 7577|       |  // this_thr->th.th_info.ds.ds_tid ] );
 7578|       |
 7579|  42.4k|  dispatch->th_disp_index = 0; /* reset the dispatch buffer counter */
 7580|  42.4k|  dispatch->th_doacross_buf_idx = 0; // reset doacross dispatch buffer counter
 7581|  42.4k|  if (__kmp_env_consistency_check)
  ------------------
  |  Branch (7581:7): [True: 0, False: 42.4k]
  ------------------
 7582|      0|    __kmp_push_parallel(gtid, team->t.t_ident);
 7583|       |
 7584|  42.4k|  KMP_MB(); /* Flush all pending memory write invalidates.  */
 7585|  42.4k|}
__kmp_run_after_invoked_task:
 7588|  42.2k|                                  kmp_team_t *team) {
 7589|  42.2k|  if (__kmp_env_consistency_check)
  ------------------
  |  Branch (7589:7): [True: 0, False: 42.2k]
  ------------------
 7590|      0|    __kmp_pop_parallel(gtid, team->t.t_ident);
 7591|       |
 7592|  42.2k|  __kmp_finish_implicit_task(this_thr);
 7593|  42.2k|}
__kmp_invoke_task_func:
 7595|  42.5k|int __kmp_invoke_task_func(int gtid) {
 7596|  42.5k|  int rc;
 7597|  42.5k|  int tid = __kmp_tid_from_gtid(gtid);
 7598|  42.5k|  kmp_info_t *this_thr = __kmp_threads[gtid];
 7599|  42.5k|  kmp_team_t *team = this_thr->th.th_team;
 7600|       |
 7601|  42.5k|  __kmp_run_before_invoked_task(gtid, tid, this_thr, team);
 7602|       |#if USE_ITT_BUILD
 7603|       |  if (__itt_stack_caller_create_ptr) {
 7604|       |    // inform ittnotify about entering user's code
 7605|       |    if (team->t.t_stack_id != NULL) {
 7606|       |      __kmp_itt_stack_callee_enter((__itt_caller)team->t.t_stack_id);
 7607|       |    } else {
 7608|       |      KMP_DEBUG_ASSERT(team->t.t_parent->t.t_stack_id != NULL);
 7609|       |      __kmp_itt_stack_callee_enter(
 7610|       |          (__itt_caller)team->t.t_parent->t.t_stack_id);
 7611|       |    }
 7612|       |  }
 7613|       |#endif /* USE_ITT_BUILD */
 7614|       |#if INCLUDE_SSC_MARKS
 7615|       |  SSC_MARK_INVOKING();
 7616|       |#endif
 7617|       |
 7618|  42.5k|#if OMPT_SUPPORT
 7619|  42.5k|  void *dummy;
 7620|  42.5k|  void **exit_frame_p;
 7621|  42.5k|  ompt_data_t *my_task_data;
 7622|  42.5k|  ompt_data_t *my_parallel_data;
 7623|  42.5k|  int ompt_team_size;
 7624|       |
 7625|  42.5k|  if (ompt_enabled.enabled) {
  ------------------
  |  Branch (7625:7): [True: 0, False: 42.5k]
  ------------------
 7626|      0|    exit_frame_p = &(team->t.t_implicit_task_taskdata[tid]
 7627|      0|                         .ompt_task_info.frame.exit_frame.ptr);
 7628|  42.5k|  } else {
 7629|  42.5k|    exit_frame_p = &dummy;
 7630|  42.5k|  }
 7631|       |
 7632|  42.5k|  my_task_data =
 7633|  42.5k|      &(team->t.t_implicit_task_taskdata[tid].ompt_task_info.task_data);
 7634|  42.5k|  my_parallel_data = &(team->t.ompt_team_info.parallel_data);
 7635|  42.5k|  if (ompt_enabled.ompt_callback_implicit_task) {
  ------------------
  |  Branch (7635:7): [True: 0, False: 42.5k]
  ------------------
 7636|      0|    ompt_team_size = team->t.t_nproc;
 7637|      0|    ompt_callbacks.ompt_callback(ompt_callback_implicit_task)(
  ------------------
  |  |   27|      0|#define ompt_callback(e) e##_callback
  ------------------
 7638|      0|        ompt_scope_begin, my_parallel_data, my_task_data, ompt_team_size,
 7639|      0|        __kmp_tid_from_gtid(gtid), ompt_task_implicit);
 7640|      0|    OMPT_CUR_TASK_INFO(this_thr)->thread_num = __kmp_tid_from_gtid(gtid);
  ------------------
  |  |   68|      0|#define OMPT_CUR_TASK_INFO(thr) (&((thr)->th.th_current_task->ompt_task_info))
  ------------------
 7641|      0|  }
 7642|  42.5k|#endif
 7643|       |
 7644|       |#if KMP_STATS_ENABLED
 7645|       |  stats_state_e previous_state = KMP_GET_THREAD_STATE();
 7646|       |  if (previous_state == stats_state_e::TEAMS_REGION) {
 7647|       |    KMP_PUSH_PARTITIONED_TIMER(OMP_teams);
 7648|       |  } else {
 7649|       |    KMP_PUSH_PARTITIONED_TIMER(OMP_parallel);
 7650|       |  }
 7651|       |  KMP_SET_THREAD_STATE(IMPLICIT_TASK);
 7652|       |#endif
 7653|       |
 7654|  42.5k|  rc = __kmp_invoke_microtask((microtask_t)TCR_SYNC_PTR(team->t.t_pkfn), gtid,
  ------------------
  |  | 1158|  42.5k|#define TCR_SYNC_PTR(a) ((void *)TCR_SYNC_8(a))
  |  |  ------------------
  |  |  |  | 1140|  42.5k|#define TCR_SYNC_8(a) (a)
  |  |  ------------------
  ------------------
 7655|  42.5k|                              tid, (int)team->t.t_argc, (void **)team->t.t_argv
 7656|  42.5k|#if OMPT_SUPPORT
 7657|  42.5k|                              ,
 7658|  42.5k|                              exit_frame_p
 7659|  42.5k|#endif
 7660|  42.5k|  );
 7661|  42.5k|#if OMPT_SUPPORT
 7662|  42.5k|  *exit_frame_p = NULL;
 7663|  42.5k|  this_thr->th.ompt_thread_info.parallel_flags |= ompt_parallel_team;
 7664|  42.5k|#endif
 7665|       |
 7666|       |#if KMP_STATS_ENABLED
 7667|       |  if (previous_state == stats_state_e::TEAMS_REGION) {
 7668|       |    KMP_SET_THREAD_STATE(previous_state);
 7669|       |  }
 7670|       |  KMP_POP_PARTITIONED_TIMER();
 7671|       |#endif
 7672|       |
 7673|       |#if USE_ITT_BUILD
 7674|       |  if (__itt_stack_caller_create_ptr) {
 7675|       |    // inform ittnotify about leaving user's code
 7676|       |    if (team->t.t_stack_id != NULL) {
 7677|       |      __kmp_itt_stack_callee_leave((__itt_caller)team->t.t_stack_id);
 7678|       |    } else {
 7679|       |      KMP_DEBUG_ASSERT(team->t.t_parent->t.t_stack_id != NULL);
 7680|       |      __kmp_itt_stack_callee_leave(
 7681|       |          (__itt_caller)team->t.t_parent->t.t_stack_id);
 7682|       |    }
 7683|       |  }
 7684|       |#endif /* USE_ITT_BUILD */
 7685|  42.5k|  __kmp_run_after_invoked_task(gtid, tid, this_thr, team);
 7686|       |
 7687|  42.5k|  return rc;
 7688|  42.5k|}
__kmp_push_num_threads:
 7772|  4.36k|void __kmp_push_num_threads(ident_t *id, int gtid, int num_threads) {
 7773|  4.36k|  kmp_info_t *thr = __kmp_threads[gtid];
 7774|       |
 7775|  4.36k|  if (num_threads > 0)
  ------------------
  |  Branch (7775:7): [True: 4.36k, False: 0]
  ------------------
 7776|  4.36k|    thr->th.th_set_nproc = num_threads;
 7777|  4.36k|}
__kmp_internal_fork:
 7942|  1.35k|void __kmp_internal_fork(ident_t *id, int gtid, kmp_team_t *team) {
 7943|  1.35k|  kmp_info_t *this_thr = __kmp_threads[gtid];
 7944|       |
 7945|       |#ifdef KMP_DEBUG
 7946|       |  int f;
 7947|       |#endif /* KMP_DEBUG */
 7948|       |
 7949|  1.35k|  KMP_DEBUG_ASSERT(team);
 7950|  1.35k|  KMP_DEBUG_ASSERT(this_thr->th.th_team == team);
 7951|  1.35k|  KMP_ASSERT(KMP_MASTER_GTID(gtid));
  ------------------
  |  |   50|  1.35k|  if (!(cond)) {                                                               \
  |  |  ------------------
  |  |  |  Branch (50:7): [True: 0, False: 1.35k]
  |  |  ------------------
  |  |   51|      0|    __kmp_debug_assert("assertion failure", __FILE__, __LINE__);               \
  |  |   52|      0|  }
  ------------------
 7952|  1.35k|  KMP_MB(); /* Flush all pending memory write invalidates.  */
 7953|       |
 7954|  1.35k|  team->t.t_construct = 0; /* no single directives seen yet */
 7955|  1.35k|  team->t.t_ordered.dt.t_value =
 7956|  1.35k|      0; /* thread 0 enters the ordered section first */
 7957|       |
 7958|       |  /* Reset the identifiers on the dispatch buffer */
 7959|  1.35k|  KMP_DEBUG_ASSERT(team->t.t_disp_buffer);
 7960|  1.35k|  if (team->t.t_max_nproc > 1) {
  ------------------
  |  Branch (7960:7): [True: 1.35k, False: 0]
  ------------------
 7961|  1.35k|    int i;
 7962|  10.8k|    for (i = 0; i < __kmp_dispatch_num_buffers; ++i) {
  ------------------
  |  Branch (7962:17): [True: 9.47k, False: 1.35k]
  ------------------
 7963|  9.47k|      team->t.t_disp_buffer[i].buffer_index = i;
 7964|  9.47k|      team->t.t_disp_buffer[i].doacross_buf_idx = i;
 7965|  9.47k|    }
 7966|  1.35k|  } else {
 7967|      0|    team->t.t_disp_buffer[0].buffer_index = 0;
 7968|      0|    team->t.t_disp_buffer[0].doacross_buf_idx = 0;
 7969|      0|  }
 7970|       |
 7971|  1.35k|  KMP_MB(); /* Flush all pending memory write invalidates.  */
 7972|  1.35k|  KMP_ASSERT(this_thr->th.th_team == team);
  ------------------
  |  |   50|  1.35k|  if (!(cond)) {                                                               \
  |  |  ------------------
  |  |  |  Branch (50:7): [True: 0, False: 1.35k]
  |  |  ------------------
  |  |   51|      0|    __kmp_debug_assert("assertion failure", __FILE__, __LINE__);               \
  |  |   52|      0|  }
  ------------------
 7973|       |
 7974|       |#ifdef KMP_DEBUG
 7975|       |  for (f = 0; f < team->t.t_nproc; f++) {
 7976|       |    KMP_DEBUG_ASSERT(team->t.t_threads[f] &&
 7977|       |                     team->t.t_threads[f]->th.th_team_nproc == team->t.t_nproc);
 7978|       |  }
 7979|       |#endif /* KMP_DEBUG */
 7980|       |
 7981|       |  /* release the worker threads so they may begin working */
 7982|  1.35k|  __kmp_fork_barrier(gtid, 0);
 7983|  1.35k|}
__kmp_internal_join:
 7985|  1.35k|void __kmp_internal_join(ident_t *id, int gtid, kmp_team_t *team) {
 7986|  1.35k|  kmp_info_t *this_thr = __kmp_threads[gtid];
 7987|       |
 7988|  1.35k|  KMP_DEBUG_ASSERT(team);
 7989|  1.35k|  KMP_DEBUG_ASSERT(this_thr->th.th_team == team);
 7990|  1.35k|  KMP_ASSERT(KMP_MASTER_GTID(gtid));
  ------------------
  |  |   50|  1.35k|  if (!(cond)) {                                                               \
  |  |  ------------------
  |  |  |  Branch (50:7): [True: 0, False: 1.35k]
  |  |  ------------------
  |  |   51|      0|    __kmp_debug_assert("assertion failure", __FILE__, __LINE__);               \
  |  |   52|      0|  }
  ------------------
 7991|  1.35k|  KMP_MB(); /* Flush all pending memory write invalidates.  */
 7992|       |
 7993|       |  /* Join barrier after fork */
 7994|       |
 7995|       |#ifdef KMP_DEBUG
 7996|       |  if (__kmp_threads[gtid] &&
 7997|       |      __kmp_threads[gtid]->th.th_team_nproc != team->t.t_nproc) {
 7998|       |    __kmp_printf("GTID: %d, __kmp_threads[%d]=%p\n", gtid, gtid,
 7999|       |                 __kmp_threads[gtid]);
 8000|       |    __kmp_printf("__kmp_threads[%d]->th.th_team_nproc=%d, TEAM: %p, "
 8001|       |                 "team->t.t_nproc=%d\n",
 8002|       |                 gtid, __kmp_threads[gtid]->th.th_team_nproc, team,
 8003|       |                 team->t.t_nproc);
 8004|       |    __kmp_print_structure();
 8005|       |  }
 8006|       |  KMP_DEBUG_ASSERT(__kmp_threads[gtid] &&
 8007|       |                   __kmp_threads[gtid]->th.th_team_nproc == team->t.t_nproc);
 8008|       |#endif /* KMP_DEBUG */
 8009|       |
 8010|  1.35k|  __kmp_join_barrier(gtid); /* wait for everyone */
 8011|  1.35k|#if OMPT_SUPPORT
 8012|  1.35k|  if (ompt_enabled.enabled &&
  ------------------
  |  Branch (8012:7): [True: 0, False: 1.35k]
  ------------------
 8013|      0|      this_thr->th.ompt_thread_info.state == ompt_state_wait_barrier_implicit) {
  ------------------
  |  Branch (8013:7): [True: 0, False: 0]
  ------------------
 8014|      0|    int ds_tid = this_thr->th.th_info.ds.ds_tid;
 8015|      0|    ompt_data_t *task_data = OMPT_CUR_TASK_DATA(this_thr);
  ------------------
  |  |   70|      0|  (&((thr)->th.th_current_task->ompt_task_info.task_data))
  ------------------
 8016|      0|    this_thr->th.ompt_thread_info.state = ompt_state_overhead;
 8017|      0|#if OMPT_OPTIONAL
 8018|      0|    void *codeptr = NULL;
 8019|      0|    if (KMP_MASTER_TID(ds_tid) &&
  ------------------
  |  | 1271|      0|#define KMP_MASTER_TID(tid) (0 == (tid))
  |  |  ------------------
  |  |  |  Branch (1271:29): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 8020|      0|        (ompt_callbacks.ompt_callback(ompt_callback_sync_region_wait) ||
  ------------------
  |  |   27|      0|#define ompt_callback(e) e##_callback
  ------------------
  |  Branch (8020:10): [True: 0, False: 0]
  ------------------
 8021|      0|         ompt_callbacks.ompt_callback(ompt_callback_sync_region)))
  ------------------
  |  |   27|      0|#define ompt_callback(e) e##_callback
  ------------------
  |  Branch (8021:10): [True: 0, False: 0]
  ------------------
 8022|      0|      codeptr = OMPT_CUR_TEAM_INFO(this_thr)->master_return_address;
  ------------------
  |  |   71|      0|#define OMPT_CUR_TEAM_INFO(thr) (&((thr)->th.th_team->t.ompt_team_info))
  ------------------
 8023|       |
 8024|      0|    if (ompt_enabled.ompt_callback_sync_region_wait) {
  ------------------
  |  Branch (8024:9): [True: 0, False: 0]
  ------------------
 8025|      0|      ompt_callbacks.ompt_callback(ompt_callback_sync_region_wait)(
  ------------------
  |  |   27|      0|#define ompt_callback(e) e##_callback
  ------------------
 8026|      0|          ompt_sync_region_barrier_implicit, ompt_scope_end, NULL, task_data,
 8027|      0|          codeptr);
 8028|      0|    }
 8029|      0|    if (ompt_enabled.ompt_callback_sync_region) {
  ------------------
  |  Branch (8029:9): [True: 0, False: 0]
  ------------------
 8030|      0|      ompt_callbacks.ompt_callback(ompt_callback_sync_region)(
  ------------------
  |  |   27|      0|#define ompt_callback(e) e##_callback
  ------------------
 8031|      0|          ompt_sync_region_barrier_implicit, ompt_scope_end, NULL, task_data,
 8032|      0|          codeptr);
 8033|      0|    }
 8034|      0|#endif
 8035|      0|    if (!KMP_MASTER_TID(ds_tid) && ompt_enabled.ompt_callback_implicit_task) {
  ------------------
  |  | 1271|      0|#define KMP_MASTER_TID(tid) (0 == (tid))
  ------------------
  |  Branch (8035:9): [True: 0, False: 0]
  |  Branch (8035:36): [True: 0, False: 0]
  ------------------
 8036|      0|      ompt_callbacks.ompt_callback(ompt_callback_implicit_task)(
  ------------------
  |  |   27|      0|#define ompt_callback(e) e##_callback
  ------------------
 8037|      0|          ompt_scope_end, NULL, task_data, 0, ds_tid,
 8038|      0|          ompt_task_implicit); // TODO: Can this be ompt_task_initial?
 8039|      0|    }
 8040|      0|  }
 8041|  1.35k|#endif
 8042|       |
 8043|  1.35k|  KMP_MB(); /* Flush all pending memory write invalidates.  */
 8044|  1.35k|  KMP_ASSERT(this_thr->th.th_team == team);
  ------------------
  |  |   50|  1.35k|  if (!(cond)) {                                                               \
  |  |  ------------------
  |  |  |  Branch (50:7): [True: 0, False: 1.35k]
  |  |  ------------------
  |  |   51|      0|    __kmp_debug_assert("assertion failure", __FILE__, __LINE__);               \
  |  |   52|      0|  }
  ------------------
 8045|  1.35k|}
__kmp_cleanup:
 8157|      1|void __kmp_cleanup(void) {
 8158|      1|  int f;
 8159|       |
 8160|      1|  KA_TRACE(10, ("__kmp_cleanup: enter\n"));
 8161|       |
 8162|      1|  if (TCR_4(__kmp_init_parallel)) {
  ------------------
  |  | 1127|      1|#define TCR_4(a) (a)
  |  |  ------------------
  |  |  |  Branch (1127:18): [True: 1, False: 0]
  |  |  ------------------
  ------------------
 8163|      1|#if KMP_HANDLE_SIGNALS
 8164|      1|    __kmp_remove_signals();
 8165|      1|#endif
 8166|      1|    TCW_4(__kmp_init_parallel, FALSE);
  ------------------
  |  | 1128|      1|#define TCW_4(a, b) (a) = (b)
  ------------------
 8167|      1|  }
 8168|       |
 8169|      1|  if (TCR_4(__kmp_init_middle)) {
  ------------------
  |  | 1127|      1|#define TCR_4(a) (a)
  |  |  ------------------
  |  |  |  Branch (1127:18): [True: 1, False: 0]
  |  |  ------------------
  ------------------
 8170|      1|#if KMP_AFFINITY_SUPPORTED
 8171|      1|    __kmp_affinity_uninitialize();
 8172|      1|#endif /* KMP_AFFINITY_SUPPORTED */
 8173|      1|    __kmp_cleanup_hierarchy();
 8174|      1|    TCW_4(__kmp_init_middle, FALSE);
  ------------------
  |  | 1128|      1|#define TCW_4(a, b) (a) = (b)
  ------------------
 8175|      1|  }
 8176|       |
 8177|      1|  KA_TRACE(10, ("__kmp_cleanup: go serial cleanup\n"));
 8178|       |
 8179|      1|  if (__kmp_init_serial) {
  ------------------
  |  Branch (8179:7): [True: 1, False: 0]
  ------------------
 8180|      1|    __kmp_runtime_destroy();
 8181|      1|    __kmp_init_serial = FALSE;
  ------------------
  |  | 1279|      1|#define FALSE 0
  ------------------
 8182|      1|  }
 8183|       |
 8184|      1|  __kmp_cleanup_threadprivate_caches();
 8185|       |
 8186|    137|  for (f = 0; f < __kmp_threads_capacity; f++) {
  ------------------
  |  Branch (8186:15): [True: 136, False: 1]
  ------------------
 8187|    136|    if (__kmp_root[f] != NULL) {
  ------------------
  |  Branch (8187:9): [True: 1, False: 135]
  ------------------
 8188|      1|      __kmp_free(__kmp_root[f]);
  ------------------
  |  | 3619|      1|#define __kmp_free(ptr) ___kmp_free((ptr)KMP_SRC_LOC_CURR)
  ------------------
 8189|      1|      __kmp_root[f] = NULL;
 8190|      1|    }
 8191|    136|  }
 8192|      1|  __kmp_free(__kmp_threads);
  ------------------
  |  | 3619|      1|#define __kmp_free(ptr) ___kmp_free((ptr)KMP_SRC_LOC_CURR)
  ------------------
 8193|       |  // __kmp_threads and __kmp_root were allocated at once, as single block, so
 8194|       |  // there is no need in freeing __kmp_root.
 8195|      1|  __kmp_threads = NULL;
 8196|      1|  __kmp_root = NULL;
 8197|      1|  __kmp_threads_capacity = 0;
 8198|       |
 8199|       |  // Free old __kmp_threads arrays if they exist.
 8200|      1|  kmp_old_threads_list_t *ptr = __kmp_old_threads_list;
 8201|      1|  while (ptr) {
  ------------------
  |  Branch (8201:10): [True: 0, False: 1]
  ------------------
 8202|      0|    kmp_old_threads_list_t *next = ptr->next;
 8203|      0|    __kmp_free(ptr->threads);
  ------------------
  |  | 3619|      0|#define __kmp_free(ptr) ___kmp_free((ptr)KMP_SRC_LOC_CURR)
  ------------------
 8204|      0|    __kmp_free(ptr);
  ------------------
  |  | 3619|      0|#define __kmp_free(ptr) ___kmp_free((ptr)KMP_SRC_LOC_CURR)
  ------------------
 8205|      0|    ptr = next;
 8206|      0|  }
 8207|       |
 8208|      1|#if KMP_USE_DYNAMIC_LOCK
 8209|      1|  __kmp_cleanup_indirect_user_locks();
 8210|       |#else
 8211|       |  __kmp_cleanup_user_locks();
 8212|       |#endif
 8213|      1|#if OMPD_SUPPORT
 8214|      1|  if (ompd_state) {
  ------------------
  |  Branch (8214:7): [True: 0, False: 1]
  ------------------
 8215|      0|    __kmp_free(ompd_env_block);
  ------------------
  |  | 3619|      0|#define __kmp_free(ptr) ___kmp_free((ptr)KMP_SRC_LOC_CURR)
  ------------------
 8216|      0|    ompd_env_block = NULL;
 8217|      0|    ompd_env_block_size = 0;
 8218|      0|  }
 8219|      1|#endif
 8220|       |
 8221|      1|#if KMP_AFFINITY_SUPPORTED
 8222|      1|  KMP_INTERNAL_FREE(CCAST(char *, __kmp_cpuinfo_file));
  ------------------
  |  |  111|      1|#define KMP_INTERNAL_FREE(p) free(p)
  ------------------
 8223|      1|  __kmp_cpuinfo_file = NULL;
 8224|      1|#endif /* KMP_AFFINITY_SUPPORTED */
 8225|       |
 8226|      1|#if KMP_USE_ADAPTIVE_LOCKS
 8227|       |#if KMP_DEBUG_ADAPTIVE_LOCKS
 8228|       |  __kmp_print_speculative_stats();
 8229|       |#endif
 8230|      1|#endif
 8231|      1|  KMP_INTERNAL_FREE(__kmp_nested_nth.nth);
  ------------------
  |  |  111|      1|#define KMP_INTERNAL_FREE(p) free(p)
  ------------------
 8232|      1|  __kmp_nested_nth.nth = NULL;
 8233|      1|  __kmp_nested_nth.size = 0;
 8234|      1|  __kmp_nested_nth.used = 0;
 8235|      1|  KMP_INTERNAL_FREE(__kmp_nested_proc_bind.bind_types);
  ------------------
  |  |  111|      1|#define KMP_INTERNAL_FREE(p) free(p)
  ------------------
 8236|      1|  __kmp_nested_proc_bind.bind_types = NULL;
 8237|      1|  __kmp_nested_proc_bind.size = 0;
 8238|      1|  __kmp_nested_proc_bind.used = 0;
 8239|      1|  if (__kmp_affinity_format) {
  ------------------
  |  Branch (8239:7): [True: 1, False: 0]
  ------------------
 8240|      1|    KMP_INTERNAL_FREE(__kmp_affinity_format);
  ------------------
  |  |  111|      1|#define KMP_INTERNAL_FREE(p) free(p)
  ------------------
 8241|      1|    __kmp_affinity_format = NULL;
 8242|      1|  }
 8243|       |
 8244|      1|  __kmp_i18n_catclose();
 8245|       |
 8246|       |#if KMP_USE_HIER_SCHED
 8247|       |  __kmp_hier_scheds.deallocate();
 8248|       |#endif
 8249|       |
 8250|       |#if KMP_STATS_ENABLED
 8251|       |  __kmp_stats_fini();
 8252|       |#endif
 8253|       |
 8254|      1|  KA_TRACE(10, ("__kmp_cleanup: exit\n"));
 8255|      1|}
__kmp_resume_if_soft_paused:
 8960|  44.4k|void __kmp_resume_if_soft_paused() {
 8961|  44.4k|  if (__kmp_pause_status == kmp_soft_paused) {
  ------------------
  |  Branch (8961:7): [True: 0, False: 44.4k]
  ------------------
 8962|      0|    __kmp_pause_status = kmp_not_paused;
 8963|       |
 8964|      0|    for (int gtid = 1; gtid < __kmp_threads_capacity; ++gtid) {
  ------------------
  |  Branch (8964:24): [True: 0, False: 0]
  ------------------
 8965|      0|      kmp_info_t *thread = __kmp_threads[gtid];
 8966|      0|      if (thread) { // Wake it if sleeping
  ------------------
  |  Branch (8966:11): [True: 0, False: 0]
  ------------------
 8967|      0|        kmp_flag_64<> fl(&thread->th.th_bar[bs_forkjoin_barrier].bb.b_go,
 8968|      0|                         thread);
 8969|      0|        if (fl.is_sleeping())
  ------------------
  |  Branch (8969:13): [True: 0, False: 0]
  ------------------
 8970|      0|          fl.resume(gtid);
 8971|      0|        else if (__kmp_try_suspend_mx(thread)) { // got suspend lock
  ------------------
  |  Branch (8971:18): [True: 0, False: 0]
  ------------------
 8972|      0|          __kmp_unlock_suspend_mx(thread); // unlock it; it won't sleep
 8973|      0|        } else { // thread holds the lock and may sleep soon
 8974|      0|          do { // until either the thread sleeps, or we can get the lock
 8975|      0|            if (fl.is_sleeping()) {
  ------------------
  |  Branch (8975:17): [True: 0, False: 0]
  ------------------
 8976|      0|              fl.resume(gtid);
 8977|      0|              break;
 8978|      0|            } else if (__kmp_try_suspend_mx(thread)) {
  ------------------
  |  Branch (8978:24): [True: 0, False: 0]
  ------------------
 8979|      0|              __kmp_unlock_suspend_mx(thread);
 8980|      0|              break;
 8981|      0|            }
 8982|      0|          } while (1);
  ------------------
  |  Branch (8982:20): [True: 0, Folded]
  ------------------
 8983|      0|        }
 8984|      0|      }
 8985|      0|    }
 8986|      0|  }
 8987|  44.4k|}
_Z23__kmp_init_nesting_modev:
 9193|      1|void __kmp_init_nesting_mode() {
 9194|      1|  int levels = KMP_HW_LAST;
 9195|      1|  __kmp_nesting_mode_nlevels = levels;
 9196|      1|  __kmp_nesting_nth_level = (int *)KMP_INTERNAL_MALLOC(levels * sizeof(int));
  ------------------
  |  |  110|      1|#define KMP_INTERNAL_MALLOC(sz) malloc(sz)
  ------------------
 9197|     13|  for (int i = 0; i < levels; ++i)
  ------------------
  |  Branch (9197:19): [True: 12, False: 1]
  ------------------
 9198|     12|    __kmp_nesting_nth_level[i] = 0;
 9199|      1|  if (__kmp_nested_nth.size < levels) {
  ------------------
  |  Branch (9199:7): [True: 1, False: 0]
  ------------------
 9200|      1|    __kmp_nested_nth.nth =
 9201|      1|        (int *)KMP_INTERNAL_REALLOC(__kmp_nested_nth.nth, levels * sizeof(int));
  ------------------
  |  |  112|      1|#define KMP_INTERNAL_REALLOC(p, sz) realloc((p), (sz))
  ------------------
 9202|      1|    __kmp_nested_nth.size = levels;
 9203|      1|  }
 9204|      1|}
kmp_runtime.cpp:_ZL18propagateFPControlP8kmp_team:
 1050|  4.36k|inline static void propagateFPControl(kmp_team_t *team) {
 1051|  4.36k|  if (__kmp_inherit_fp_control) {
  ------------------
  |  Branch (1051:7): [True: 4.36k, False: 0]
  ------------------
 1052|  4.36k|    kmp_int16 x87_fpu_control_word;
 1053|  4.36k|    kmp_uint32 mxcsr;
 1054|       |
 1055|       |    // Get primary thread's values of FPU control flags (both X87 and vector)
 1056|  4.36k|    __kmp_store_x87_fpu_control_word(&x87_fpu_control_word);
 1057|  4.36k|    __kmp_store_mxcsr(&mxcsr);
 1058|  4.36k|    mxcsr &= KMP_X86_MXCSR_MASK;
  ------------------
  |  | 1403|  4.36k|#define KMP_X86_MXCSR_MASK 0xffffffc0 /* ignore status flags (6 lsb) */
  ------------------
 1059|       |
 1060|       |    // There is no point looking at t_fp_control_saved here.
 1061|       |    // If it is TRUE, we still have to update the values if they are different
 1062|       |    // from those we now have. If it is FALSE we didn't save anything yet, but
 1063|       |    // our objective is the same. We have to ensure that the values in the team
 1064|       |    // are the same as those we have.
 1065|       |    // So, this code achieves what we need whether or not t_fp_control_saved is
 1066|       |    // true. By checking whether the value needs updating we avoid unnecessary
 1067|       |    // writes that would put the cache-line into a written state, causing all
 1068|       |    // threads in the team to have to read it again.
 1069|  4.36k|    KMP_CHECK_UPDATE(team->t.t_x87_fpu_control_word, x87_fpu_control_word);
  ------------------
  |  | 2280|  4.36k|  if ((a) != (b))                                                              \
  |  |  ------------------
  |  |  |  Branch (2280:7): [True: 2, False: 4.36k]
  |  |  ------------------
  |  | 2281|  4.36k|  (a) = (b)
  ------------------
 1070|  4.36k|    KMP_CHECK_UPDATE(team->t.t_mxcsr, mxcsr);
  ------------------
  |  | 2280|  4.36k|  if ((a) != (b))                                                              \
  |  |  ------------------
  |  |  |  Branch (2280:7): [True: 2, False: 4.36k]
  |  |  ------------------
  |  | 2281|  4.36k|  (a) = (b)
  ------------------
 1071|       |    // Although we don't use this value, other code in the runtime wants to know
 1072|       |    // whether it should restore them. So we must ensure it is correct.
 1073|  4.36k|    KMP_CHECK_UPDATE(team->t.t_fp_control_saved, TRUE);
  ------------------
  |  | 2280|  4.36k|  if ((a) != (b))                                                              \
  |  |  ------------------
  |  |  |  Branch (2280:7): [True: 2, False: 4.36k]
  |  |  ------------------
  |  | 2281|  4.36k|  (a) = (b)
  ------------------
 1074|  4.36k|  } else {
 1075|       |    // Similarly here. Don't write to this cache-line in the team structure
 1076|       |    // unless we have to.
 1077|      0|    KMP_CHECK_UPDATE(team->t.t_fp_control_saved, FALSE);
  ------------------
  |  | 2280|      0|  if ((a) != (b))                                                              \
  |  |  ------------------
  |  |  |  Branch (2280:7): [True: 0, False: 0]
  |  |  ------------------
  |  | 2281|      0|  (a) = (b)
  ------------------
 1078|      0|  }
 1079|  4.36k|}
kmp_runtime.cpp:_ZL22__kmp_is_fork_in_teamsP8kmp_infoPFvPiS1_zEiiPA1_13__va_list_tag:
 1375|  1.35k|                                          int teams_level, kmp_va_list ap) {
 1376|  1.35k|  return (master_th->th.th_teams_microtask && ap &&
  ------------------
  |  Branch (1376:11): [True: 0, False: 1.35k]
  |  Branch (1376:47): [True: 0, False: 0]
  ------------------
 1377|      0|          microtask != (microtask_t)__kmp_teams_master && level == teams_level);
  ------------------
  |  Branch (1377:11): [True: 0, False: 0]
  |  Branch (1377:59): [True: 0, False: 0]
  ------------------
 1378|  1.35k|}
kmp_runtime.cpp:_ZL23__kmp_is_entering_teamsiiiPA1_13__va_list_tag:
 1383|  1.35k|                                           int teams_level, kmp_va_list ap) {
 1384|  1.35k|  return ((ap == NULL && active_level == 0) ||
  ------------------
  |  Branch (1384:12): [True: 0, False: 1.35k]
  |  Branch (1384:26): [True: 0, False: 0]
  ------------------
 1385|  1.35k|          (ap && teams_level > 0 && teams_level == level));
  ------------------
  |  Branch (1385:12): [True: 1.35k, False: 0]
  |  Branch (1385:18): [True: 0, False: 1.35k]
  |  Branch (1385:37): [True: 0, False: 0]
  ------------------
 1386|  1.35k|}
kmp_runtime.cpp:_ZL21__kmp_reserve_threadsP8kmp_rootP8kmp_teamiii:
  740|  1.35k|                                 int enter_teams) {
  741|  1.35k|  int capacity;
  742|  1.35k|  int new_nthreads;
  743|  1.35k|  KMP_DEBUG_ASSERT(__kmp_init_serial);
  744|  1.35k|  KMP_DEBUG_ASSERT(root && parent_team);
  745|  1.35k|  kmp_info_t *this_thr = parent_team->t.t_threads[master_tid];
  746|       |
  747|       |  // If dyn-var is set, dynamically adjust the number of desired threads,
  748|       |  // according to the method specified by dynamic_mode.
  749|  1.35k|  new_nthreads = set_nthreads;
  750|  1.35k|  if (!get__dynamic_2(parent_team, master_tid)) {
  ------------------
  |  | 2296|  1.35k|  ((xteam)->t.t_threads[(xtid)]->th.th_current_task->td_icvs.dynamic)
  ------------------
  |  Branch (750:7): [True: 1.35k, False: 0]
  ------------------
  751|  1.35k|    ;
  752|  1.35k|  }
  753|      0|#ifdef USE_LOAD_BALANCE
  754|      0|  else if (__kmp_global.g.g_dynamic_mode == dynamic_load_balance) {
  ------------------
  |  Branch (754:12): [True: 0, False: 0]
  ------------------
  755|      0|    new_nthreads = __kmp_load_balance_nproc(root, set_nthreads);
  756|      0|    if (new_nthreads == 1) {
  ------------------
  |  Branch (756:9): [True: 0, False: 0]
  ------------------
  757|      0|      KC_TRACE(10, ("__kmp_reserve_threads: T#%d load balance reduced "
  758|      0|                    "reservation to 1 thread\n",
  759|      0|                    master_tid));
  760|      0|      return 1;
  761|      0|    }
  762|      0|    if (new_nthreads < set_nthreads) {
  ------------------
  |  Branch (762:9): [True: 0, False: 0]
  ------------------
  763|      0|      KC_TRACE(10, ("__kmp_reserve_threads: T#%d load balance reduced "
  764|      0|                    "reservation to %d threads\n",
  765|      0|                    master_tid, new_nthreads));
  766|      0|    }
  767|      0|  }
  768|      0|#endif /* USE_LOAD_BALANCE */
  769|      0|  else if (__kmp_global.g.g_dynamic_mode == dynamic_thread_limit) {
  ------------------
  |  Branch (769:12): [True: 0, False: 0]
  ------------------
  770|      0|    new_nthreads = __kmp_avail_proc - __kmp_nth +
  771|      0|                   (root->r.r_active ? 1 : root->r.r_hot_team->t.t_nproc);
  ------------------
  |  Branch (771:21): [True: 0, False: 0]
  ------------------
  772|      0|    if (new_nthreads <= 1) {
  ------------------
  |  Branch (772:9): [True: 0, False: 0]
  ------------------
  773|      0|      KC_TRACE(10, ("__kmp_reserve_threads: T#%d thread limit reduced "
  774|      0|                    "reservation to 1 thread\n",
  775|      0|                    master_tid));
  776|      0|      return 1;
  777|      0|    }
  778|      0|    if (new_nthreads < set_nthreads) {
  ------------------
  |  Branch (778:9): [True: 0, False: 0]
  ------------------
  779|      0|      KC_TRACE(10, ("__kmp_reserve_threads: T#%d thread limit reduced "
  780|      0|                    "reservation to %d threads\n",
  781|      0|                    master_tid, new_nthreads));
  782|      0|    } else {
  783|      0|      new_nthreads = set_nthreads;
  784|      0|    }
  785|      0|  } else if (__kmp_global.g.g_dynamic_mode == dynamic_random) {
  ------------------
  |  Branch (785:14): [True: 0, False: 0]
  ------------------
  786|      0|    if (set_nthreads > 2) {
  ------------------
  |  Branch (786:9): [True: 0, False: 0]
  ------------------
  787|      0|      new_nthreads = __kmp_get_random(parent_team->t.t_threads[master_tid]);
  788|      0|      new_nthreads = (new_nthreads % set_nthreads) + 1;
  789|      0|      if (new_nthreads == 1) {
  ------------------
  |  Branch (789:11): [True: 0, False: 0]
  ------------------
  790|      0|        KC_TRACE(10, ("__kmp_reserve_threads: T#%d dynamic random reduced "
  791|      0|                      "reservation to 1 thread\n",
  792|      0|                      master_tid));
  793|      0|        return 1;
  794|      0|      }
  795|      0|      if (new_nthreads < set_nthreads) {
  ------------------
  |  Branch (795:11): [True: 0, False: 0]
  ------------------
  796|      0|        KC_TRACE(10, ("__kmp_reserve_threads: T#%d dynamic random reduced "
  797|      0|                      "reservation to %d threads\n",
  798|      0|                      master_tid, new_nthreads));
  799|      0|      }
  800|      0|    }
  801|      0|  } else {
  802|      0|    KMP_ASSERT(0);
  ------------------
  |  |   50|      0|  if (!(cond)) {                                                               \
  |  |  ------------------
  |  |  |  Branch (50:7): [True: 0, Folded]
  |  |  ------------------
  |  |   51|      0|    __kmp_debug_assert("assertion failure", __FILE__, __LINE__);               \
  |  |   52|      0|  }
  ------------------
  803|      0|  }
  804|       |
  805|       |  // Respect KMP_ALL_THREADS/KMP_DEVICE_THREAD_LIMIT.
  806|  1.35k|  if (__kmp_nth + new_nthreads -
  ------------------
  |  Branch (806:7): [True: 0, False: 1.35k]
  ------------------
  807|  1.35k|          (root->r.r_active ? 1 : root->r.r_hot_team->t.t_nproc) >
  ------------------
  |  Branch (807:12): [True: 0, False: 1.35k]
  ------------------
  808|  1.35k|      __kmp_max_nth) {
  809|      0|    int tl_nthreads = __kmp_max_nth - __kmp_nth +
  810|      0|                      (root->r.r_active ? 1 : root->r.r_hot_team->t.t_nproc);
  ------------------
  |  Branch (810:24): [True: 0, False: 0]
  ------------------
  811|      0|    if (tl_nthreads <= 0) {
  ------------------
  |  Branch (811:9): [True: 0, False: 0]
  ------------------
  812|      0|      tl_nthreads = 1;
  813|      0|    }
  814|       |
  815|       |    // If dyn-var is false, emit a 1-time warning.
  816|      0|    if (!get__dynamic_2(parent_team, master_tid) && (!__kmp_reserve_warn)) {
  ------------------
  |  | 2296|      0|  ((xteam)->t.t_threads[(xtid)]->th.th_current_task->td_icvs.dynamic)
  ------------------
  |  Branch (816:9): [True: 0, False: 0]
  |  Branch (816:53): [True: 0, False: 0]
  ------------------
  817|      0|      __kmp_reserve_warn = 1;
  818|      0|      __kmp_msg(kmp_ms_warning,
  819|      0|                KMP_MSG(CantFormThrTeam, set_nthreads, tl_nthreads),
  ------------------
  |  |  121|      0|#define KMP_MSG(...) __kmp_msg_format(kmp_i18n_msg_##__VA_ARGS__)
  ------------------
  820|      0|                KMP_HNT(Unset_ALL_THREADS), __kmp_msg_null);
  ------------------
  |  |  122|      0|#define KMP_HNT(...) __kmp_msg_format(kmp_i18n_hnt_##__VA_ARGS__)
  ------------------
  821|      0|    }
  822|      0|    if (tl_nthreads == 1) {
  ------------------
  |  Branch (822:9): [True: 0, False: 0]
  ------------------
  823|      0|      KC_TRACE(10, ("__kmp_reserve_threads: T#%d KMP_DEVICE_THREAD_LIMIT "
  824|      0|                    "reduced reservation to 1 thread\n",
  825|      0|                    master_tid));
  826|      0|      return 1;
  827|      0|    }
  828|      0|    KC_TRACE(10, ("__kmp_reserve_threads: T#%d KMP_DEVICE_THREAD_LIMIT reduced "
  829|      0|                  "reservation to %d threads\n",
  830|      0|                  master_tid, tl_nthreads));
  831|      0|    new_nthreads = tl_nthreads;
  832|      0|  }
  833|       |
  834|       |  // Respect OMP_THREAD_LIMIT
  835|  1.35k|  int cg_nthreads = this_thr->th.th_cg_roots->cg_nthreads;
  836|  1.35k|  int max_cg_threads = this_thr->th.th_cg_roots->cg_thread_limit;
  837|  1.35k|  if (cg_nthreads + new_nthreads -
  ------------------
  |  Branch (837:7): [True: 0, False: 1.35k]
  ------------------
  838|  1.35k|          (root->r.r_active ? 1 : root->r.r_hot_team->t.t_nproc) >
  ------------------
  |  Branch (838:12): [True: 0, False: 1.35k]
  ------------------
  839|  1.35k|      max_cg_threads) {
  840|      0|    int tl_nthreads = max_cg_threads - cg_nthreads +
  841|      0|                      (root->r.r_active ? 1 : root->r.r_hot_team->t.t_nproc);
  ------------------
  |  Branch (841:24): [True: 0, False: 0]
  ------------------
  842|      0|    if (tl_nthreads <= 0) {
  ------------------
  |  Branch (842:9): [True: 0, False: 0]
  ------------------
  843|      0|      tl_nthreads = 1;
  844|      0|    }
  845|       |
  846|       |    // If dyn-var is false, emit a 1-time warning.
  847|      0|    if (!get__dynamic_2(parent_team, master_tid) && (!__kmp_reserve_warn)) {
  ------------------
  |  | 2296|      0|  ((xteam)->t.t_threads[(xtid)]->th.th_current_task->td_icvs.dynamic)
  ------------------
  |  Branch (847:9): [True: 0, False: 0]
  |  Branch (847:53): [True: 0, False: 0]
  ------------------
  848|      0|      __kmp_reserve_warn = 1;
  849|      0|      __kmp_msg(kmp_ms_warning,
  850|      0|                KMP_MSG(CantFormThrTeam, set_nthreads, tl_nthreads),
  ------------------
  |  |  121|      0|#define KMP_MSG(...) __kmp_msg_format(kmp_i18n_msg_##__VA_ARGS__)
  ------------------
  851|      0|                KMP_HNT(Unset_ALL_THREADS), __kmp_msg_null);
  ------------------
  |  |  122|      0|#define KMP_HNT(...) __kmp_msg_format(kmp_i18n_hnt_##__VA_ARGS__)
  ------------------
  852|      0|    }
  853|      0|    if (tl_nthreads == 1) {
  ------------------
  |  Branch (853:9): [True: 0, False: 0]
  ------------------
  854|      0|      KC_TRACE(10, ("__kmp_reserve_threads: T#%d OMP_THREAD_LIMIT "
  855|      0|                    "reduced reservation to 1 thread\n",
  856|      0|                    master_tid));
  857|      0|      return 1;
  858|      0|    }
  859|      0|    KC_TRACE(10, ("__kmp_reserve_threads: T#%d OMP_THREAD_LIMIT reduced "
  860|      0|                  "reservation to %d threads\n",
  861|      0|                  master_tid, tl_nthreads));
  862|      0|    new_nthreads = tl_nthreads;
  863|      0|  }
  864|       |
  865|       |  // Check if the threads array is large enough, or needs expanding.
  866|       |  // See comment in __kmp_register_root() about the adjustment if
  867|       |  // __kmp_threads[0] == NULL.
  868|  1.35k|  capacity = __kmp_threads_capacity;
  869|  1.35k|  if (TCR_PTR(__kmp_threads[0]) == NULL) {
  ------------------
  |  | 1156|  1.35k|#define TCR_PTR(a) ((void *)TCR_8(a))
  |  |  ------------------
  |  |  |  | 1131|  1.35k|#define TCR_8(a) (a)
  |  |  ------------------
  ------------------
  |  Branch (869:7): [True: 0, False: 1.35k]
  ------------------
  870|      0|    --capacity;
  871|      0|  }
  872|       |  // If it is not for initializing the hidden helper team, we need to take
  873|       |  // __kmp_hidden_helper_threads_num out of the capacity because it is included
  874|       |  // in __kmp_threads_capacity.
  875|  1.35k|  if (__kmp_enable_hidden_helper && !TCR_4(__kmp_init_hidden_helper_threads)) {
  ------------------
  |  | 1127|  1.35k|#define TCR_4(a) (a)
  ------------------
  |  Branch (875:7): [True: 1.35k, False: 0]
  |  Branch (875:37): [True: 1.35k, False: 0]
  ------------------
  876|  1.35k|    capacity -= __kmp_hidden_helper_threads_num;
  877|  1.35k|  }
  878|  1.35k|  if (__kmp_nth + new_nthreads -
  ------------------
  |  Branch (878:7): [True: 0, False: 1.35k]
  ------------------
  879|  1.35k|          (root->r.r_active ? 1 : root->r.r_hot_team->t.t_nproc) >
  ------------------
  |  Branch (879:12): [True: 0, False: 1.35k]
  ------------------
  880|  1.35k|      capacity) {
  881|       |    // Expand the threads array.
  882|      0|    int slotsRequired = __kmp_nth + new_nthreads -
  883|      0|                        (root->r.r_active ? 1 : root->r.r_hot_team->t.t_nproc) -
  ------------------
  |  Branch (883:26): [True: 0, False: 0]
  ------------------
  884|      0|                        capacity;
  885|      0|    int slotsAdded = __kmp_expand_threads(slotsRequired);
  886|      0|    if (slotsAdded < slotsRequired) {
  ------------------
  |  Branch (886:9): [True: 0, False: 0]
  ------------------
  887|       |      // The threads array was not expanded enough.
  888|      0|      new_nthreads -= (slotsRequired - slotsAdded);
  889|      0|      KMP_ASSERT(new_nthreads >= 1);
  ------------------
  |  |   50|      0|  if (!(cond)) {                                                               \
  |  |  ------------------
  |  |  |  Branch (50:7): [True: 0, False: 0]
  |  |  ------------------
  |  |   51|      0|    __kmp_debug_assert("assertion failure", __FILE__, __LINE__);               \
  |  |   52|      0|  }
  ------------------
  890|       |
  891|       |      // If dyn-var is false, emit a 1-time warning.
  892|      0|      if (!get__dynamic_2(parent_team, master_tid) && (!__kmp_reserve_warn)) {
  ------------------
  |  | 2296|      0|  ((xteam)->t.t_threads[(xtid)]->th.th_current_task->td_icvs.dynamic)
  ------------------
  |  Branch (892:11): [True: 0, False: 0]
  |  Branch (892:55): [True: 0, False: 0]
  ------------------
  893|      0|        __kmp_reserve_warn = 1;
  894|      0|        if (__kmp_tp_cached) {
  ------------------
  |  Branch (894:13): [True: 0, False: 0]
  ------------------
  895|      0|          __kmp_msg(kmp_ms_warning,
  896|      0|                    KMP_MSG(CantFormThrTeam, set_nthreads, new_nthreads),
  ------------------
  |  |  121|      0|#define KMP_MSG(...) __kmp_msg_format(kmp_i18n_msg_##__VA_ARGS__)
  ------------------
  897|      0|                    KMP_HNT(Set_ALL_THREADPRIVATE, __kmp_tp_capacity),
  ------------------
  |  |  122|      0|#define KMP_HNT(...) __kmp_msg_format(kmp_i18n_hnt_##__VA_ARGS__)
  ------------------
  898|      0|                    KMP_HNT(PossibleSystemLimitOnThreads), __kmp_msg_null);
  ------------------
  |  |  122|      0|#define KMP_HNT(...) __kmp_msg_format(kmp_i18n_hnt_##__VA_ARGS__)
  ------------------
  899|      0|        } else {
  900|      0|          __kmp_msg(kmp_ms_warning,
  901|      0|                    KMP_MSG(CantFormThrTeam, set_nthreads, new_nthreads),
  ------------------
  |  |  121|      0|#define KMP_MSG(...) __kmp_msg_format(kmp_i18n_msg_##__VA_ARGS__)
  ------------------
  902|      0|                    KMP_HNT(SystemLimitOnThreads), __kmp_msg_null);
  ------------------
  |  |  122|      0|#define KMP_HNT(...) __kmp_msg_format(kmp_i18n_hnt_##__VA_ARGS__)
  ------------------
  903|      0|        }
  904|      0|      }
  905|      0|    }
  906|      0|  }
  907|       |
  908|       |#ifdef KMP_DEBUG
  909|       |  if (new_nthreads == 1) {
  910|       |    KC_TRACE(10,
  911|       |             ("__kmp_reserve_threads: T#%d serializing team after reclaiming "
  912|       |              "dead roots and rechecking; requested %d threads\n",
  913|       |              __kmp_get_gtid(), set_nthreads));
  914|       |  } else {
  915|       |    KC_TRACE(10, ("__kmp_reserve_threads: T#%d allocating %d threads; requested"
  916|       |                  " %d threads\n",
  917|       |                  __kmp_get_gtid(), new_nthreads, set_nthreads));
  918|       |  }
  919|       |#endif // KMP_DEBUG
  920|  1.35k|  return new_nthreads;
  921|  1.35k|}
kmp_runtime.cpp:_ZL23__kmp_fork_team_threadsP8kmp_rootP8kmp_teamP8kmp_infoii:
  928|  1.35k|                                    int fork_teams_workers) {
  929|  1.35k|  int i;
  930|  1.35k|  int use_hot_team;
  931|       |
  932|  1.35k|  KA_TRACE(10, ("__kmp_fork_team_threads: new_nprocs = %d\n", team->t.t_nproc));
  933|  1.35k|  KMP_DEBUG_ASSERT(master_gtid == __kmp_get_gtid());
  934|  1.35k|  KMP_MB();
  935|       |
  936|       |  /* first, let's setup the primary thread */
  937|  1.35k|  master_th->th.th_info.ds.ds_tid = 0;
  938|  1.35k|  master_th->th.th_team = team;
  939|  1.35k|  master_th->th.th_team_nproc = team->t.t_nproc;
  940|  1.35k|  master_th->th.th_team_master = master_th;
  941|  1.35k|  master_th->th.th_team_serialized = FALSE;
  ------------------
  |  | 1279|  1.35k|#define FALSE 0
  ------------------
  942|  1.35k|  master_th->th.th_dispatch = &team->t.t_dispatch[0];
  943|       |
  944|       |/* make sure we are not the optimized hot team */
  945|  1.35k|#if KMP_NESTED_HOT_TEAMS
  946|  1.35k|  use_hot_team = 0;
  947|  1.35k|  kmp_hot_team_ptr_t *hot_teams = master_th->th.th_hot_teams;
  948|  1.35k|  if (hot_teams) { // hot teams array is not allocated if
  ------------------
  |  Branch (948:7): [True: 1.35k, False: 0]
  ------------------
  949|       |    // KMP_HOT_TEAMS_MAX_LEVEL=0
  950|  1.35k|    int level = team->t.t_active_level - 1; // index in array of hot teams
  951|  1.35k|    if (master_th->th.th_teams_microtask) { // are we inside the teams?
  ------------------
  |  Branch (951:9): [True: 0, False: 1.35k]
  ------------------
  952|      0|      if (master_th->th.th_teams_size.nteams > 1) {
  ------------------
  |  Branch (952:11): [True: 0, False: 0]
  ------------------
  953|      0|        ++level; // level was not increased in teams construct for
  954|       |        // team_of_masters
  955|      0|      }
  956|      0|      if (team->t.t_pkfn != (microtask_t)__kmp_teams_master &&
  ------------------
  |  Branch (956:11): [True: 0, False: 0]
  ------------------
  957|      0|          master_th->th.th_teams_level == team->t.t_level) {
  ------------------
  |  Branch (957:11): [True: 0, False: 0]
  ------------------
  958|      0|        ++level; // level was not increased in teams construct for
  959|       |        // team_of_workers before the parallel
  960|      0|      } // team->t.t_level will be increased inside parallel
  961|      0|    }
  962|  1.35k|    if (level < __kmp_hot_teams_max_level) {
  ------------------
  |  Branch (962:9): [True: 1.35k, False: 0]
  ------------------
  963|  1.35k|      if (hot_teams[level].hot_team) {
  ------------------
  |  Branch (963:11): [True: 1.35k, False: 0]
  ------------------
  964|       |        // hot team has already been allocated for given level
  965|  1.35k|        KMP_DEBUG_ASSERT(hot_teams[level].hot_team == team);
  966|  1.35k|        use_hot_team = 1; // the team is ready to use
  967|  1.35k|      } else {
  968|      0|        use_hot_team = 0; // AC: threads are not allocated yet
  969|      0|        hot_teams[level].hot_team = team; // remember new hot team
  970|      0|        hot_teams[level].hot_team_nth = team->t.t_nproc;
  971|      0|      }
  972|  1.35k|    } else {
  973|      0|      use_hot_team = 0;
  974|      0|    }
  975|  1.35k|  }
  976|       |#else
  977|       |  use_hot_team = team == root->r.r_hot_team;
  978|       |#endif
  979|  1.35k|  if (!use_hot_team) {
  ------------------
  |  Branch (979:7): [True: 0, False: 1.35k]
  ------------------
  980|       |
  981|       |    /* install the primary thread */
  982|      0|    team->t.t_threads[0] = master_th;
  983|      0|    __kmp_initialize_info(master_th, team, 0, master_gtid);
  984|       |
  985|       |    /* now, install the worker threads */
  986|      0|    for (i = 1; i < team->t.t_nproc; i++) {
  ------------------
  |  Branch (986:17): [True: 0, False: 0]
  ------------------
  987|       |
  988|       |      /* fork or reallocate a new thread and install it in team */
  989|      0|      kmp_info_t *thr = __kmp_allocate_thread(root, team, i);
  990|      0|      team->t.t_threads[i] = thr;
  991|      0|      KMP_DEBUG_ASSERT(thr);
  992|      0|      KMP_DEBUG_ASSERT(thr->th.th_team == team);
  993|       |      /* align team and thread arrived states */
  994|      0|      KA_TRACE(20, ("__kmp_fork_team_threads: T#%d(%d:%d) init arrived "
  995|      0|                    "T#%d(%d:%d) join =%llu, plain=%llu\n",
  996|      0|                    __kmp_gtid_from_tid(0, team), team->t.t_id, 0,
  997|      0|                    __kmp_gtid_from_tid(i, team), team->t.t_id, i,
  998|      0|                    team->t.t_bar[bs_forkjoin_barrier].b_arrived,
  999|      0|                    team->t.t_bar[bs_plain_barrier].b_arrived));
 1000|      0|      thr->th.th_teams_microtask = master_th->th.th_teams_microtask;
 1001|      0|      thr->th.th_teams_level = master_th->th.th_teams_level;
 1002|      0|      thr->th.th_teams_size = master_th->th.th_teams_size;
 1003|      0|      { // Initialize threads' barrier data.
 1004|      0|        int b;
 1005|      0|        kmp_balign_t *balign = team->t.t_threads[i]->th.th_bar;
 1006|      0|        for (b = 0; b < bs_last_barrier; ++b) {
  ------------------
  |  Branch (1006:21): [True: 0, False: 0]
  ------------------
 1007|      0|          balign[b].bb.b_arrived = team->t.t_bar[b].b_arrived;
 1008|      0|          KMP_DEBUG_ASSERT(balign[b].bb.wait_flag != KMP_BARRIER_PARENT_FLAG);
 1009|       |#if USE_DEBUGGER
 1010|       |          balign[b].bb.b_worker_arrived = team->t.t_bar[b].b_team_arrived;
 1011|       |#endif
 1012|      0|        }
 1013|      0|      }
 1014|      0|    }
 1015|       |
 1016|      0|#if KMP_AFFINITY_SUPPORTED
 1017|       |    // Do not partition the places list for teams construct workers who
 1018|       |    // haven't actually been forked to do real work yet. This partitioning
 1019|       |    // will take place in the parallel region nested within the teams construct.
 1020|      0|    if (!fork_teams_workers) {
  ------------------
  |  Branch (1020:9): [True: 0, False: 0]
  ------------------
 1021|      0|      __kmp_partition_places(team);
 1022|      0|    }
 1023|      0|#endif
 1024|       |
 1025|      0|    if (team->t.t_nproc > 1 &&
  ------------------
  |  Branch (1025:9): [True: 0, False: 0]
  ------------------
 1026|      0|        __kmp_barrier_gather_pattern[bs_forkjoin_barrier] == bp_dist_bar) {
  ------------------
  |  Branch (1026:9): [True: 0, False: 0]
  ------------------
 1027|      0|      team->t.b->update_num_threads(team->t.t_nproc);
 1028|      0|      __kmp_add_threads_to_team(team, team->t.t_nproc);
 1029|      0|    }
 1030|      0|  }
 1031|       |
 1032|  1.35k|  if (__kmp_display_affinity && team->t.t_display_affinity != 1) {
  ------------------
  |  Branch (1032:7): [True: 0, False: 1.35k]
  |  Branch (1032:33): [True: 0, False: 0]
  ------------------
 1033|      0|    for (i = 0; i < team->t.t_nproc; i++) {
  ------------------
  |  Branch (1033:17): [True: 0, False: 0]
  ------------------
 1034|      0|      kmp_info_t *thr = team->t.t_threads[i];
 1035|      0|      if (thr->th.th_prev_num_threads != team->t.t_nproc ||
  ------------------
  |  Branch (1035:11): [True: 0, False: 0]
  ------------------
 1036|      0|          thr->th.th_prev_level != team->t.t_level) {
  ------------------
  |  Branch (1036:11): [True: 0, False: 0]
  ------------------
 1037|      0|        team->t.t_display_affinity = 1;
 1038|      0|        break;
 1039|      0|      }
 1040|      0|    }
 1041|      0|  }
 1042|       |
 1043|  1.35k|  KMP_MB();
 1044|  1.35k|}
kmp_runtime.cpp:_ZL17updateHWFPControlP8kmp_team:
 1083|  42.6k|inline static void updateHWFPControl(kmp_team_t *team) {
 1084|  42.6k|  if (__kmp_inherit_fp_control && team->t.t_fp_control_saved) {
  ------------------
  |  Branch (1084:7): [True: 42.6k, False: 13]
  |  Branch (1084:35): [True: 42.5k, False: 30]
  ------------------
 1085|       |    // Only reset the fp control regs if they have been changed in the team.
 1086|       |    // the parallel region that we are exiting.
 1087|  42.5k|    kmp_int16 x87_fpu_control_word;
 1088|  42.5k|    kmp_uint32 mxcsr;
 1089|  42.5k|    __kmp_store_x87_fpu_control_word(&x87_fpu_control_word);
 1090|  42.5k|    __kmp_store_mxcsr(&mxcsr);
 1091|  42.5k|    mxcsr &= KMP_X86_MXCSR_MASK;
  ------------------
  |  | 1403|  42.5k|#define KMP_X86_MXCSR_MASK 0xffffffc0 /* ignore status flags (6 lsb) */
  ------------------
 1092|       |
 1093|  42.5k|    if (team->t.t_x87_fpu_control_word != x87_fpu_control_word) {
  ------------------
  |  Branch (1093:9): [True: 0, False: 42.5k]
  ------------------
 1094|      0|      __kmp_clear_x87_fpu_status_word();
 1095|      0|      __kmp_load_x87_fpu_control_word(&team->t.t_x87_fpu_control_word);
 1096|      0|    }
 1097|       |
 1098|  42.5k|    if (team->t.t_mxcsr != mxcsr) {
  ------------------
  |  Branch (1098:9): [True: 0, False: 42.5k]
  ------------------
 1099|      0|      __kmp_load_mxcsr(&team->t.t_mxcsr);
 1100|      0|    }
 1101|  42.5k|  }
 1102|  42.6k|}
kmp_runtime.cpp:_ZL21__kmp_initialize_rootP8kmp_root:
 3317|      1|static void __kmp_initialize_root(kmp_root_t *root) {
 3318|      1|  int f;
 3319|      1|  kmp_team_t *root_team;
 3320|      1|  kmp_team_t *hot_team;
 3321|      1|  int hot_team_max_nth;
 3322|      1|  kmp_r_sched_t r_sched =
 3323|      1|      __kmp_get_schedule_global(); // get current state of scheduling globals
 3324|      1|  kmp_internal_control_t r_icvs = __kmp_get_global_icvs();
 3325|      1|  KMP_DEBUG_ASSERT(root);
 3326|      1|  KMP_ASSERT(!root->r.r_begin);
  ------------------
  |  |   50|      1|  if (!(cond)) {                                                               \
  |  |  ------------------
  |  |  |  Branch (50:7): [True: 0, False: 1]
  |  |  ------------------
  |  |   51|      0|    __kmp_debug_assert("assertion failure", __FILE__, __LINE__);               \
  |  |   52|      0|  }
  ------------------
 3327|       |
 3328|       |  /* setup the root state structure */
 3329|      1|  __kmp_init_lock(&root->r.r_begin_lock);
 3330|      1|  root->r.r_begin = FALSE;
  ------------------
  |  | 1279|      1|#define FALSE 0
  ------------------
 3331|      1|  root->r.r_active = FALSE;
  ------------------
  |  | 1279|      1|#define FALSE 0
  ------------------
 3332|      1|  root->r.r_in_parallel = 0;
 3333|      1|  root->r.r_blocktime = __kmp_dflt_blocktime;
 3334|      1|#if KMP_AFFINITY_SUPPORTED
 3335|      1|  root->r.r_affinity_assigned = FALSE;
  ------------------
  |  | 1279|      1|#define FALSE 0
  ------------------
 3336|      1|#endif
 3337|       |
 3338|       |  /* setup the root team for this task */
 3339|       |  /* allocate the root team structure */
 3340|      1|  KF_TRACE(10, ("__kmp_initialize_root: before root_team\n"));
 3341|       |
 3342|      1|  root_team =
 3343|      1|      __kmp_allocate_team(root,
 3344|      1|                          1, // new_nproc
 3345|      1|                          1, // max_nproc
 3346|      1|#if OMPT_SUPPORT
 3347|      1|                          ompt_data_none, // root parallel id
  ------------------
  |  | 1408|      1|#define ompt_data_none {0}
  ------------------
 3348|      1|#endif
 3349|      1|                          __kmp_nested_proc_bind.bind_types[0], &r_icvs,
 3350|      1|                          0 // argc
 3351|      1|                          USE_NESTED_HOT_ARG(NULL) // primary thread is unknown
  ------------------
  |  |  165|      1|#define USE_NESTED_HOT_ARG(x) , x
  ------------------
 3352|      1|      );
 3353|       |#if USE_DEBUGGER
 3354|       |  // Non-NULL value should be assigned to make the debugger display the root
 3355|       |  // team.
 3356|       |  TCW_SYNC_PTR(root_team->t.t_pkfn, (microtask_t)(~0));
 3357|       |#endif
 3358|       |
 3359|      1|  KF_TRACE(10, ("__kmp_initialize_root: after root_team = %p\n", root_team));
 3360|       |
 3361|      1|  root->r.r_root_team = root_team;
 3362|      1|  root_team->t.t_control_stack_top = NULL;
 3363|       |
 3364|       |  /* initialize root team */
 3365|      1|  root_team->t.t_threads[0] = NULL;
 3366|      1|  root_team->t.t_nproc = 1;
 3367|      1|  root_team->t.t_serialized = 1;
 3368|       |  // TODO???: root_team->t.t_max_active_levels = __kmp_dflt_max_active_levels;
 3369|      1|  root_team->t.t_sched.sched = r_sched.sched;
 3370|      1|  KA_TRACE(
 3371|      1|      20,
 3372|      1|      ("__kmp_initialize_root: init root team %d arrived: join=%u, plain=%u\n",
 3373|      1|       root_team->t.t_id, KMP_INIT_BARRIER_STATE, KMP_INIT_BARRIER_STATE));
 3374|       |
 3375|       |  /* setup the  hot team for this task */
 3376|       |  /* allocate the hot team structure */
 3377|      1|  KF_TRACE(10, ("__kmp_initialize_root: before hot_team\n"));
 3378|       |
 3379|      1|  hot_team =
 3380|      1|      __kmp_allocate_team(root,
 3381|      1|                          1, // new_nproc
 3382|      1|                          __kmp_dflt_team_nth_ub * 2, // max_nproc
 3383|      1|#if OMPT_SUPPORT
 3384|      1|                          ompt_data_none, // root parallel id
  ------------------
  |  | 1408|      1|#define ompt_data_none {0}
  ------------------
 3385|      1|#endif
 3386|      1|                          __kmp_nested_proc_bind.bind_types[0], &r_icvs,
 3387|      1|                          0 // argc
 3388|      1|                          USE_NESTED_HOT_ARG(NULL) // primary thread is unknown
  ------------------
  |  |  165|      1|#define USE_NESTED_HOT_ARG(x) , x
  ------------------
 3389|      1|      );
 3390|      1|  KF_TRACE(10, ("__kmp_initialize_root: after hot_team = %p\n", hot_team));
 3391|       |
 3392|      1|  root->r.r_hot_team = hot_team;
 3393|      1|  root_team->t.t_control_stack_top = NULL;
 3394|       |
 3395|       |  /* first-time initialization */
 3396|      1|  hot_team->t.t_parent = root_team;
 3397|       |
 3398|       |  /* initialize hot team */
 3399|      1|  hot_team_max_nth = hot_team->t.t_max_nproc;
 3400|     65|  for (f = 0; f < hot_team_max_nth; ++f) {
  ------------------
  |  Branch (3400:15): [True: 64, False: 1]
  ------------------
 3401|     64|    hot_team->t.t_threads[f] = NULL;
 3402|     64|  }
 3403|      1|  hot_team->t.t_nproc = 1;
 3404|       |  // TODO???: hot_team->t.t_max_active_levels = __kmp_dflt_max_active_levels;
 3405|      1|  hot_team->t.t_sched.sched = r_sched.sched;
 3406|      1|  hot_team->t.t_size_changed = 0;
 3407|      1|}
kmp_runtime.cpp:_ZL21__kmp_get_global_icvsv:
 3272|      2|static kmp_internal_control_t __kmp_get_global_icvs(void) {
 3273|       |
 3274|      2|  kmp_r_sched_t r_sched =
 3275|      2|      __kmp_get_schedule_global(); // get current state of scheduling globals
 3276|       |
 3277|      2|  KMP_DEBUG_ASSERT(__kmp_nested_proc_bind.used > 0);
 3278|       |
 3279|      2|  kmp_internal_control_t g_icvs = {
 3280|      2|    0, // int serial_nesting_level; //corresponds to value of th_team_serialized
 3281|      2|    (kmp_int8)__kmp_global.g.g_dynamic, // internal control for dynamic
 3282|       |    // adjustment of threads (per thread)
 3283|      2|    (kmp_int8)__kmp_env_blocktime, // int bt_set; //internal control for
 3284|       |    // whether blocktime is explicitly set
 3285|      2|    __kmp_dflt_blocktime, // int blocktime; //internal control for blocktime
 3286|       |#if KMP_USE_MONITOR
 3287|       |    __kmp_bt_intervals, // int bt_intervals; //internal control for blocktime
 3288|       |// intervals
 3289|       |#endif
 3290|      2|    __kmp_dflt_team_nth, // int nproc; //internal control for # of threads for
 3291|       |    // next parallel region (per thread)
 3292|       |    // (use a max ub on value if __kmp_parallel_initialize not called yet)
 3293|      2|    __kmp_cg_max_nth, // int thread_limit;
 3294|      2|    __kmp_dflt_max_active_levels, // int max_active_levels; //internal control
 3295|       |    // for max_active_levels
 3296|      2|    r_sched, // kmp_r_sched_t sched; //internal control for runtime schedule
 3297|       |    // {sched,chunk} pair
 3298|      2|    __kmp_nested_proc_bind.bind_types[0],
 3299|      2|    __kmp_default_device,
 3300|       |    NULL // struct kmp_internal_control *next;
 3301|      2|  };
 3302|       |
 3303|      2|  return g_icvs;
 3304|      2|}
kmp_runtime.cpp:_ZL16__kmp_reset_rootiP8kmp_root:
 4067|      1|static int __kmp_reset_root(int gtid, kmp_root_t *root) {
 4068|      1|  kmp_team_t *root_team = root->r.r_root_team;
 4069|      1|  kmp_team_t *hot_team = root->r.r_hot_team;
 4070|      1|  int n = hot_team->t.t_nproc;
 4071|      1|  int i;
 4072|       |
 4073|      1|  KMP_DEBUG_ASSERT(!root->r.r_active);
 4074|       |
 4075|      1|  root->r.r_root_team = NULL;
 4076|      1|  root->r.r_hot_team = NULL;
 4077|       |  // __kmp_free_team() does not free hot teams, so we have to clear r_hot_team
 4078|       |  // before call to __kmp_free_team().
 4079|      1|  __kmp_free_team(root, root_team USE_NESTED_HOT_ARG(NULL));
  ------------------
  |  |  165|      1|#define USE_NESTED_HOT_ARG(x) , x
  ------------------
 4080|      1|#if KMP_NESTED_HOT_TEAMS
 4081|      1|  if (__kmp_hot_teams_max_level >
  ------------------
  |  Branch (4081:7): [True: 1, False: 0]
  ------------------
 4082|      1|      0) { // need to free nested hot teams and their threads if any
 4083|     33|    for (i = 0; i < hot_team->t.t_nproc; ++i) {
  ------------------
  |  Branch (4083:17): [True: 32, False: 1]
  ------------------
 4084|     32|      kmp_info_t *th = hot_team->t.t_threads[i];
 4085|     32|      if (__kmp_hot_teams_max_level > 1) {
  ------------------
  |  Branch (4085:11): [True: 0, False: 32]
  ------------------
 4086|      0|        n += __kmp_free_hot_teams(root, th, 1, __kmp_hot_teams_max_level);
 4087|      0|      }
 4088|     32|      if (th->th.th_hot_teams) {
  ------------------
  |  Branch (4088:11): [True: 1, False: 31]
  ------------------
 4089|      1|        __kmp_free(th->th.th_hot_teams);
  ------------------
  |  | 3619|      1|#define __kmp_free(ptr) ___kmp_free((ptr)KMP_SRC_LOC_CURR)
  ------------------
 4090|      1|        th->th.th_hot_teams = NULL;
 4091|      1|      }
 4092|     32|    }
 4093|      1|  }
 4094|      1|#endif
 4095|      1|  __kmp_free_team(root, hot_team USE_NESTED_HOT_ARG(NULL));
  ------------------
  |  |  165|      1|#define USE_NESTED_HOT_ARG(x) , x
  ------------------
 4096|       |
 4097|       |  // Before we can reap the thread, we need to make certain that all other
 4098|       |  // threads in the teams that had this root as ancestor have stopped trying to
 4099|       |  // steal tasks.
 4100|      1|  if (__kmp_tasking_mode != tskm_immediate_exec) {
  ------------------
  |  Branch (4100:7): [True: 1, False: 0]
  ------------------
 4101|      1|    __kmp_wait_to_unref_task_teams();
 4102|      1|  }
 4103|       |
 4104|       |#if KMP_OS_WINDOWS
 4105|       |  /* Close Handle of root duplicated in __kmp_create_worker (tr #62919) */
 4106|       |  KA_TRACE(
 4107|       |      10, ("__kmp_reset_root: free handle, th = %p, handle = %" KMP_UINTPTR_SPEC
 4108|       |           "\n",
 4109|       |           (LPVOID) & (root->r.r_uber_thread->th),
 4110|       |           root->r.r_uber_thread->th.th_info.ds.ds_thread));
 4111|       |  __kmp_free_handle(root->r.r_uber_thread->th.th_info.ds.ds_thread);
 4112|       |#endif /* KMP_OS_WINDOWS */
 4113|       |
 4114|      1|#if OMPD_SUPPORT
 4115|      1|  if (ompd_state & OMPD_ENABLE_BP)
  ------------------
  |  |   35|      1|#define OMPD_ENABLE_BP 0x1
  ------------------
  |  Branch (4115:7): [True: 0, False: 1]
  ------------------
 4116|      0|    ompd_bp_thread_end();
 4117|      1|#endif
 4118|       |
 4119|      1|#if OMPT_SUPPORT
 4120|      1|  ompt_data_t *task_data;
 4121|      1|  ompt_data_t *parallel_data;
 4122|      1|  __ompt_get_task_info_internal(0, NULL, &task_data, NULL, &parallel_data,
 4123|      1|                                NULL);
 4124|      1|  if (ompt_enabled.ompt_callback_implicit_task) {
  ------------------
  |  Branch (4124:7): [True: 0, False: 1]
  ------------------
 4125|      0|    ompt_callbacks.ompt_callback(ompt_callback_implicit_task)(
  ------------------
  |  |   27|      0|#define ompt_callback(e) e##_callback
  ------------------
 4126|      0|        ompt_scope_end, parallel_data, task_data, 0, 1, ompt_task_initial);
 4127|      0|  }
 4128|      1|  if (ompt_enabled.ompt_callback_thread_end) {
  ------------------
  |  Branch (4128:7): [True: 0, False: 1]
  ------------------
 4129|      0|    ompt_callbacks.ompt_callback(ompt_callback_thread_end)(
  ------------------
  |  |   27|      0|#define ompt_callback(e) e##_callback
  ------------------
 4130|      0|        &(root->r.r_uber_thread->th.ompt_thread_info.thread_data));
 4131|      0|  }
 4132|      1|#endif
 4133|       |
 4134|      1|  TCW_4(__kmp_nth,
  ------------------
  |  | 1128|      1|#define TCW_4(a, b) (a) = (b)
  ------------------
 4135|      1|        __kmp_nth - 1); // __kmp_reap_thread will decrement __kmp_all_nth.
 4136|      1|  i = root->r.r_uber_thread->th.th_cg_roots->cg_nthreads--;
 4137|      1|  KA_TRACE(100, ("__kmp_reset_root: Thread %p decrement cg_nthreads on node %p"
 4138|      1|                 " to %d\n",
 4139|      1|                 root->r.r_uber_thread, root->r.r_uber_thread->th.th_cg_roots,
 4140|      1|                 root->r.r_uber_thread->th.th_cg_roots->cg_nthreads));
 4141|      1|  if (i == 1) {
  ------------------
  |  Branch (4141:7): [True: 1, False: 0]
  ------------------
 4142|       |    // need to free contention group structure
 4143|      1|    KMP_DEBUG_ASSERT(root->r.r_uber_thread ==
 4144|      1|                     root->r.r_uber_thread->th.th_cg_roots->cg_root);
 4145|      1|    KMP_DEBUG_ASSERT(root->r.r_uber_thread->th.th_cg_roots->up == NULL);
 4146|      1|    __kmp_free(root->r.r_uber_thread->th.th_cg_roots);
  ------------------
  |  | 3619|      1|#define __kmp_free(ptr) ___kmp_free((ptr)KMP_SRC_LOC_CURR)
  ------------------
 4147|      1|    root->r.r_uber_thread->th.th_cg_roots = NULL;
 4148|      1|  }
 4149|      1|  __kmp_reap_thread(root->r.r_uber_thread, 1);
 4150|       |
 4151|       |  // We canot put root thread to __kmp_thread_pool, so we have to reap it
 4152|       |  // instead of freeing.
 4153|      1|  root->r.r_uber_thread = NULL;
 4154|       |  /* mark root as no longer in use */
 4155|      1|  root->r.r_begin = FALSE;
  ------------------
  |  | 1279|      1|#define FALSE 0
  ------------------
 4156|       |
 4157|      1|  return n;
 4158|      1|}
kmp_runtime.cpp:_ZL17__kmp_reap_threadP8kmp_infoi:
 6160|     32|static void __kmp_reap_thread(kmp_info_t *thread, int is_root) {
 6161|       |  // It is assumed __kmp_forkjoin_lock is acquired.
 6162|       |
 6163|     32|  int gtid;
 6164|       |
 6165|     32|  KMP_DEBUG_ASSERT(thread != NULL);
 6166|       |
 6167|     32|  gtid = thread->th.th_info.ds.ds_gtid;
 6168|       |
 6169|     32|  if (!is_root) {
  ------------------
  |  Branch (6169:7): [True: 31, False: 1]
  ------------------
 6170|     31|    if (__kmp_dflt_blocktime != KMP_MAX_BLOCKTIME) {
  ------------------
  |  | 1184|     31|  (INT_MAX) /* Must be this for "infinite" setting the work */
  ------------------
  |  Branch (6170:9): [True: 31, False: 0]
  ------------------
 6171|       |      /* Assume the threads are at the fork barrier here */
 6172|     31|      KA_TRACE(
 6173|     31|          20, ("__kmp_reap_thread: releasing T#%d from fork barrier for reap\n",
 6174|     31|               gtid));
 6175|     31|      if (__kmp_barrier_gather_pattern[bs_forkjoin_barrier] == bp_dist_bar) {
  ------------------
  |  Branch (6175:11): [True: 0, False: 31]
  ------------------
 6176|      0|        while (
 6177|      0|            !KMP_COMPARE_AND_STORE_ACQ32(&(thread->th.th_used_in_team), 0, 3))
  ------------------
  |  |  807|      0|  __sync_bool_compare_and_swap((volatile kmp_uint32 *)(p), (kmp_uint32)(cv),   \
  |  |  808|      0|                               (kmp_uint32)(sv))
  ------------------
  |  Branch (6177:13): [True: 0, False: 0]
  ------------------
 6178|      0|          KMP_CPU_PAUSE();
  ------------------
  |  | 1498|      0|#define KMP_CPU_PAUSE() __kmp_x86_pause()
  ------------------
 6179|      0|        __kmp_resume_32(gtid, (kmp_flag_32<false, false> *)NULL);
 6180|     31|      } else {
 6181|       |        /* Need release fence here to prevent seg faults for tree forkjoin
 6182|       |           barrier (GEH) */
 6183|     31|        kmp_flag_64<> flag(&thread->th.th_bar[bs_forkjoin_barrier].bb.b_go,
 6184|     31|                           thread);
 6185|     31|        __kmp_release_64(&flag);
 6186|     31|      }
 6187|     31|    }
 6188|       |
 6189|       |    // Terminate OS thread.
 6190|     31|    __kmp_reap_worker(thread);
 6191|       |
 6192|       |    // The thread was killed asynchronously.  If it was actively
 6193|       |    // spinning in the thread pool, decrement the global count.
 6194|       |    //
 6195|       |    // There is a small timing hole here - if the worker thread was just waking
 6196|       |    // up after sleeping in the pool, had reset it's th_active_in_pool flag but
 6197|       |    // not decremented the global counter __kmp_thread_pool_active_nth yet, then
 6198|       |    // the global counter might not get updated.
 6199|       |    //
 6200|       |    // Currently, this can only happen as the library is unloaded,
 6201|       |    // so there are no harmful side effects.
 6202|     31|    if (thread->th.th_active_in_pool) {
  ------------------
  |  Branch (6202:9): [True: 0, False: 31]
  ------------------
 6203|      0|      thread->th.th_active_in_pool = FALSE;
  ------------------
  |  | 1279|      0|#define FALSE 0
  ------------------
 6204|      0|      KMP_ATOMIC_DEC(&__kmp_thread_pool_active_nth);
  ------------------
  |  | 1260|      0|#define KMP_ATOMIC_DEC(p) KMP_ATOMIC_OP(fetch_sub, p, 1, acq_rel)
  |  |  ------------------
  |  |  |  | 1246|      0|#define KMP_ATOMIC_OP(op, p, v, order) (p)->op(v, std::memory_order_##order)
  |  |  ------------------
  ------------------
 6205|      0|      KMP_DEBUG_ASSERT(__kmp_thread_pool_active_nth >= 0);
 6206|      0|    }
 6207|     31|  }
 6208|       |
 6209|     32|  __kmp_free_implicit_task(thread);
 6210|       |
 6211|       |// Free the fast memory for tasking
 6212|     32|#if USE_FAST_MEMORY
 6213|     32|  __kmp_free_fast_memory(thread);
 6214|     32|#endif /* USE_FAST_MEMORY */
 6215|       |
 6216|     32|  __kmp_suspend_uninitialize_thread(thread);
 6217|       |
 6218|     32|  KMP_DEBUG_ASSERT(__kmp_threads[gtid] == thread);
 6219|     32|  TCW_SYNC_PTR(__kmp_threads[gtid], NULL);
  ------------------
  |  | 1159|     32|#define TCW_SYNC_PTR(a, b) TCW_SYNC_8((a), (b))
  |  |  ------------------
  |  |  |  | 1141|     32|#define TCW_SYNC_8(a, b) (a) = (b)
  |  |  ------------------
  ------------------
 6220|       |
 6221|     32|  --__kmp_all_nth;
 6222|       |  // __kmp_nth was decremented when thread is added to the pool.
 6223|       |
 6224|     32|#ifdef KMP_ADJUST_BLOCKTIME
 6225|       |  /* Adjust blocktime back to user setting or default if necessary */
 6226|       |  /* Middle initialization might never have occurred                */
 6227|     32|  if (!__kmp_env_blocktime && (__kmp_avail_proc > 0)) {
  ------------------
  |  Branch (6227:7): [True: 32, False: 0]
  |  Branch (6227:31): [True: 32, False: 0]
  ------------------
 6228|     32|    KMP_DEBUG_ASSERT(__kmp_avail_proc > 0);
 6229|     32|    if (__kmp_nth <= __kmp_avail_proc) {
  ------------------
  |  Branch (6229:9): [True: 32, False: 0]
  ------------------
 6230|     32|      __kmp_zero_bt = FALSE;
  ------------------
  |  | 1279|     32|#define FALSE 0
  ------------------
 6231|     32|    }
 6232|     32|  }
 6233|     32|#endif /* KMP_ADJUST_BLOCKTIME */
 6234|       |
 6235|       |  /* free the memory being used */
 6236|     32|  if (__kmp_env_consistency_check) {
  ------------------
  |  Branch (6236:7): [True: 0, False: 32]
  ------------------
 6237|      0|    if (thread->th.th_cons) {
  ------------------
  |  Branch (6237:9): [True: 0, False: 0]
  ------------------
 6238|      0|      __kmp_free_cons_stack(thread->th.th_cons);
 6239|      0|      thread->th.th_cons = NULL;
 6240|      0|    }
 6241|      0|  }
 6242|       |
 6243|     32|  if (thread->th.th_pri_common != NULL) {
  ------------------
  |  Branch (6243:7): [True: 32, False: 0]
  ------------------
 6244|     32|    __kmp_free(thread->th.th_pri_common);
  ------------------
  |  | 3619|     32|#define __kmp_free(ptr) ___kmp_free((ptr)KMP_SRC_LOC_CURR)
  ------------------
 6245|     32|    thread->th.th_pri_common = NULL;
 6246|     32|  }
 6247|       |
 6248|     32|  if (thread->th.th_task_state_memo_stack != NULL) {
  ------------------
  |  Branch (6248:7): [True: 32, False: 0]
  ------------------
 6249|     32|    __kmp_free(thread->th.th_task_state_memo_stack);
  ------------------
  |  | 3619|     32|#define __kmp_free(ptr) ___kmp_free((ptr)KMP_SRC_LOC_CURR)
  ------------------
 6250|     32|    thread->th.th_task_state_memo_stack = NULL;
 6251|     32|  }
 6252|       |
 6253|     32|#if KMP_USE_BGET
 6254|     32|  if (thread->th.th_local.bget_data != NULL) {
  ------------------
  |  Branch (6254:7): [True: 32, False: 0]
  ------------------
 6255|     32|    __kmp_finalize_bget(thread);
 6256|     32|  }
 6257|     32|#endif
 6258|       |
 6259|     32|#if KMP_AFFINITY_SUPPORTED
 6260|     32|  if (thread->th.th_affin_mask != NULL) {
  ------------------
  |  Branch (6260:7): [True: 32, False: 0]
  ------------------
 6261|     32|    KMP_CPU_FREE(thread->th.th_affin_mask);
  ------------------
  |  |  698|     32|#define KMP_CPU_FREE(ptr) __kmp_affinity_dispatch->deallocate_mask(ptr)
  ------------------
 6262|     32|    thread->th.th_affin_mask = NULL;
 6263|     32|  }
 6264|     32|#endif /* KMP_AFFINITY_SUPPORTED */
 6265|       |
 6266|       |#if KMP_USE_HIER_SCHED
 6267|       |  if (thread->th.th_hier_bar_data != NULL) {
 6268|       |    __kmp_free(thread->th.th_hier_bar_data);
 6269|       |    thread->th.th_hier_bar_data = NULL;
 6270|       |  }
 6271|       |#endif
 6272|       |
 6273|     32|  __kmp_reap_team(thread->th.th_serial_team);
 6274|     32|  thread->th.th_serial_team = NULL;
 6275|     32|  __kmp_free(thread);
  ------------------
  |  | 3619|     32|#define __kmp_free(ptr) ___kmp_free((ptr)KMP_SRC_LOC_CURR)
  ------------------
 6276|       |
 6277|     32|  KMP_MB();
 6278|       |
 6279|     32|} // __kmp_reap_thread
kmp_runtime.cpp:_ZL21__kmp_initialize_infoP8kmp_infoP8kmp_teamii:
 4247|     64|                                  int tid, int gtid) {
 4248|       |  /* this_thr->th.th_info.ds.ds_gtid is setup in
 4249|       |     kmp_allocate_thread/create_worker.
 4250|       |     this_thr->th.th_serial_team is setup in __kmp_allocate_thread */
 4251|     64|  KMP_DEBUG_ASSERT(this_thr != NULL);
 4252|     64|  KMP_DEBUG_ASSERT(this_thr->th.th_serial_team);
 4253|     64|  KMP_DEBUG_ASSERT(team);
 4254|     64|  KMP_DEBUG_ASSERT(team->t.t_threads);
 4255|     64|  KMP_DEBUG_ASSERT(team->t.t_dispatch);
 4256|     64|  kmp_info_t *master = team->t.t_threads[0];
 4257|     64|  KMP_DEBUG_ASSERT(master);
 4258|     64|  KMP_DEBUG_ASSERT(master->th.th_root);
 4259|       |
 4260|     64|  KMP_MB();
 4261|       |
 4262|     64|  TCW_SYNC_PTR(this_thr->th.th_team, team);
  ------------------
  |  | 1159|     64|#define TCW_SYNC_PTR(a, b) TCW_SYNC_8((a), (b))
  |  |  ------------------
  |  |  |  | 1141|     64|#define TCW_SYNC_8(a, b) (a) = (b)
  |  |  ------------------
  ------------------
 4263|       |
 4264|     64|  this_thr->th.th_info.ds.ds_tid = tid;
 4265|     64|  this_thr->th.th_set_nproc = 0;
 4266|     64|  if (__kmp_tasking_mode != tskm_immediate_exec)
  ------------------
  |  Branch (4266:7): [True: 64, False: 0]
  ------------------
 4267|       |    // When tasking is possible, threads are not safe to reap until they are
 4268|       |    // done tasking; this will be set when tasking code is exited in wait
 4269|     64|    this_thr->th.th_reap_state = KMP_NOT_SAFE_TO_REAP;
  ------------------
  |  | 2046|     64|  0 // Thread th_reap_state: not safe to reap (tasking)
  ------------------
 4270|      0|  else // no tasking --> always safe to reap
 4271|      0|    this_thr->th.th_reap_state = KMP_SAFE_TO_REAP;
  ------------------
  |  | 2047|      0|#define KMP_SAFE_TO_REAP 1 // Thread th_reap_state: safe to reap (not tasking)
  ------------------
 4272|     64|  this_thr->th.th_set_proc_bind = proc_bind_default;
 4273|     64|#if KMP_AFFINITY_SUPPORTED
 4274|     64|  this_thr->th.th_new_place = this_thr->th.th_current_place;
 4275|     64|#endif
 4276|     64|  this_thr->th.th_root = master->th.th_root;
 4277|       |
 4278|       |  /* setup the thread's cache of the team structure */
 4279|     64|  this_thr->th.th_team_nproc = team->t.t_nproc;
 4280|     64|  this_thr->th.th_team_master = master;
 4281|     64|  this_thr->th.th_team_serialized = team->t.t_serialized;
 4282|       |
 4283|     64|  KMP_DEBUG_ASSERT(team->t.t_implicit_task_taskdata);
 4284|       |
 4285|     64|  KF_TRACE(10, ("__kmp_initialize_info1: T#%d:%d this_thread=%p curtask=%p\n",
 4286|     64|                tid, gtid, this_thr, this_thr->th.th_current_task));
 4287|       |
 4288|     64|  __kmp_init_implicit_task(this_thr->th.th_team_master->th.th_ident, this_thr,
 4289|     64|                           team, tid, TRUE);
  ------------------
  |  | 1280|     64|#define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  | 1279|     64|#define FALSE 0
  |  |  ------------------
  ------------------
 4290|       |
 4291|     64|  KF_TRACE(10, ("__kmp_initialize_info2: T#%d:%d this_thread=%p curtask=%p\n",
 4292|     64|                tid, gtid, this_thr, this_thr->th.th_current_task));
 4293|       |  // TODO: Initialize ICVs from parent; GEH - isn't that already done in
 4294|       |  // __kmp_initialize_team()?
 4295|       |
 4296|       |  /* TODO no worksharing in speculative threads */
 4297|     64|  this_thr->th.th_dispatch = &team->t.t_dispatch[tid];
 4298|       |
 4299|     64|  this_thr->th.th_local.this_construct = 0;
 4300|       |
 4301|     64|  if (!this_thr->th.th_pri_common) {
  ------------------
  |  Branch (4301:7): [True: 32, False: 32]
  ------------------
 4302|     32|    this_thr->th.th_pri_common =
 4303|     32|        (struct common_table *)__kmp_allocate(sizeof(struct common_table));
  ------------------
  |  | 3617|     32|#define __kmp_allocate(size) ___kmp_allocate((size)KMP_SRC_LOC_CURR)
  ------------------
 4304|     32|    if (__kmp_storage_map) {
  ------------------
  |  Branch (4304:9): [True: 0, False: 32]
  ------------------
 4305|      0|      __kmp_print_storage_map_gtid(
 4306|      0|          gtid, this_thr->th.th_pri_common, this_thr->th.th_pri_common + 1,
 4307|      0|          sizeof(struct common_table), "th_%d.th_pri_common\n", gtid);
 4308|      0|    }
 4309|     32|    this_thr->th.th_pri_head = NULL;
 4310|     32|  }
 4311|       |
 4312|     64|  if (this_thr != master && // Primary thread's CG root is initialized elsewhere
  ------------------
  |  Branch (4312:7): [True: 62, False: 2]
  ------------------
 4313|     62|      this_thr->th.th_cg_roots != master->th.th_cg_roots) { // CG root not set
  ------------------
  |  Branch (4313:7): [True: 31, False: 31]
  ------------------
 4314|       |    // Make new thread's CG root same as primary thread's
 4315|     31|    KMP_DEBUG_ASSERT(master->th.th_cg_roots);
 4316|     31|    kmp_cg_root_t *tmp = this_thr->th.th_cg_roots;
 4317|     31|    if (tmp) {
  ------------------
  |  Branch (4317:9): [True: 0, False: 31]
  ------------------
 4318|       |      // worker changes CG, need to check if old CG should be freed
 4319|      0|      int i = tmp->cg_nthreads--;
 4320|      0|      KA_TRACE(100, ("__kmp_initialize_info: Thread %p decrement cg_nthreads"
 4321|      0|                     " on node %p of thread %p to %d\n",
 4322|      0|                     this_thr, tmp, tmp->cg_root, tmp->cg_nthreads));
 4323|      0|      if (i == 1) {
  ------------------
  |  Branch (4323:11): [True: 0, False: 0]
  ------------------
 4324|      0|        __kmp_free(tmp); // last thread left CG --> free it
  ------------------
  |  | 3619|      0|#define __kmp_free(ptr) ___kmp_free((ptr)KMP_SRC_LOC_CURR)
  ------------------
 4325|      0|      }
 4326|      0|    }
 4327|     31|    this_thr->th.th_cg_roots = master->th.th_cg_roots;
 4328|       |    // Increment new thread's CG root's counter to add the new thread
 4329|     31|    this_thr->th.th_cg_roots->cg_nthreads++;
 4330|     31|    KA_TRACE(100, ("__kmp_initialize_info: Thread %p increment cg_nthreads on"
 4331|     31|                   " node %p of thread %p to %d\n",
 4332|     31|                   this_thr, this_thr->th.th_cg_roots,
 4333|     31|                   this_thr->th.th_cg_roots->cg_root,
 4334|     31|                   this_thr->th.th_cg_roots->cg_nthreads));
 4335|     31|    this_thr->th.th_current_task->td_icvs.thread_limit =
 4336|     31|        this_thr->th.th_cg_roots->cg_thread_limit;
 4337|     31|  }
 4338|       |
 4339|       |  /* Initialize dynamic dispatch */
 4340|     64|  {
 4341|     64|    volatile kmp_disp_t *dispatch = this_thr->th.th_dispatch;
 4342|       |    // Use team max_nproc since this will never change for the team.
 4343|     64|    size_t disp_size =
 4344|     64|        sizeof(dispatch_private_info_t) *
 4345|     64|        (team->t.t_max_nproc == 1 ? 1 : __kmp_dispatch_num_buffers);
  ------------------
  |  Branch (4345:10): [True: 1, False: 63]
  ------------------
 4346|     64|    KD_TRACE(10, ("__kmp_initialize_info: T#%d max_nproc: %d\n", gtid,
 4347|     64|                  team->t.t_max_nproc));
 4348|     64|    KMP_ASSERT(dispatch);
  ------------------
  |  |   50|     64|  if (!(cond)) {                                                               \
  |  |  ------------------
  |  |  |  Branch (50:7): [True: 0, False: 64]
  |  |  ------------------
  |  |   51|      0|    __kmp_debug_assert("assertion failure", __FILE__, __LINE__);               \
  |  |   52|      0|  }
  ------------------
 4349|     64|    KMP_DEBUG_ASSERT(team->t.t_dispatch);
 4350|     64|    KMP_DEBUG_ASSERT(dispatch == &team->t.t_dispatch[tid]);
 4351|       |
 4352|     64|    dispatch->th_disp_index = 0;
 4353|     64|    dispatch->th_doacross_buf_idx = 0;
 4354|     64|    if (!dispatch->th_disp_buffer) {
  ------------------
  |  Branch (4354:9): [True: 33, False: 31]
  ------------------
 4355|     33|      dispatch->th_disp_buffer =
 4356|     33|          (dispatch_private_info_t *)__kmp_allocate(disp_size);
  ------------------
  |  | 3617|     33|#define __kmp_allocate(size) ___kmp_allocate((size)KMP_SRC_LOC_CURR)
  ------------------
 4357|       |
 4358|     33|      if (__kmp_storage_map) {
  ------------------
  |  Branch (4358:11): [True: 0, False: 33]
  ------------------
 4359|      0|        __kmp_print_storage_map_gtid(
 4360|      0|            gtid, &dispatch->th_disp_buffer[0],
 4361|      0|            &dispatch->th_disp_buffer[team->t.t_max_nproc == 1
  ------------------
  |  Branch (4361:39): [True: 0, False: 0]
  ------------------
 4362|      0|                                          ? 1
 4363|      0|                                          : __kmp_dispatch_num_buffers],
 4364|      0|            disp_size,
 4365|      0|            "th_%d.th_dispatch.th_disp_buffer "
 4366|      0|            "(team_%d.t_dispatch[%d].th_disp_buffer)",
 4367|      0|            gtid, team->t.t_id, gtid);
 4368|      0|      }
 4369|     33|    } else {
 4370|     31|      memset(&dispatch->th_disp_buffer[0], '\0', disp_size);
 4371|     31|    }
 4372|       |
 4373|     64|    dispatch->th_dispatch_pr_current = 0;
 4374|     64|    dispatch->th_dispatch_sh_current = 0;
 4375|       |
 4376|     64|    dispatch->th_deo_fcn = 0; /* ORDERED     */
 4377|     64|    dispatch->th_dxo_fcn = 0; /* END ORDERED */
 4378|     64|  }
 4379|       |
 4380|     64|  this_thr->th.th_next_pool = NULL;
 4381|       |
 4382|     64|  if (!this_thr->th.th_task_state_memo_stack) {
  ------------------
  |  Branch (4382:7): [True: 32, False: 32]
  ------------------
 4383|     32|    size_t i;
 4384|     32|    this_thr->th.th_task_state_memo_stack =
 4385|     32|        (kmp_uint8 *)__kmp_allocate(4 * sizeof(kmp_uint8));
  ------------------
  |  | 3617|     32|#define __kmp_allocate(size) ___kmp_allocate((size)KMP_SRC_LOC_CURR)
  ------------------
 4386|     32|    this_thr->th.th_task_state_top = 0;
 4387|     32|    this_thr->th.th_task_state_stack_sz = 4;
 4388|    160|    for (i = 0; i < this_thr->th.th_task_state_stack_sz;
  ------------------
  |  Branch (4388:17): [True: 128, False: 32]
  ------------------
 4389|    128|         ++i) // zero init the stack
 4390|    128|      this_thr->th.th_task_state_memo_stack[i] = 0;
 4391|     32|  }
 4392|       |
 4393|     64|  KMP_DEBUG_ASSERT(!this_thr->th.th_spin_here);
 4394|     64|  KMP_DEBUG_ASSERT(this_thr->th.th_next_waiting == 0);
 4395|       |
 4396|     64|  KMP_MB();
 4397|     64|}
kmp_runtime.cpp:_ZL23__kmp_get_x_global_icvsPK8kmp_team:
 3306|     31|static kmp_internal_control_t __kmp_get_x_global_icvs(const kmp_team_t *team) {
 3307|       |
 3308|     31|  kmp_internal_control_t gx_icvs;
 3309|     31|  gx_icvs.serial_nesting_level =
 3310|     31|      0; // probably =team->t.t_serial like in save_inter_controls
 3311|     31|  copy_icvs(&gx_icvs, &team->t.t_threads[0]->th.th_current_task->td_icvs);
 3312|     31|  gx_icvs.next = NULL;
 3313|       |
 3314|     31|  return gx_icvs;
 3315|     31|}
kmp_runtime.cpp:_ZL23__kmp_reinitialize_teamP8kmp_teamP20kmp_internal_controlP5ident:
 4694|  1.38k|                                    ident_t *loc) {
 4695|  1.38k|  KF_TRACE(10, ("__kmp_reinitialize_team: enter this_thread=%p team=%p\n",
 4696|  1.38k|                team->t.t_threads[0], team));
 4697|  1.38k|  KMP_DEBUG_ASSERT(team && new_icvs);
 4698|  1.38k|  KMP_DEBUG_ASSERT((!TCR_4(__kmp_init_parallel)) || new_icvs->nproc);
 4699|  1.38k|  KMP_CHECK_UPDATE(team->t.t_ident, loc);
  ------------------
  |  | 2280|  1.38k|  if ((a) != (b))                                                              \
  |  |  ------------------
  |  |  |  Branch (2280:7): [True: 321, False: 1.06k]
  |  |  ------------------
  |  | 2281|  1.38k|  (a) = (b)
  ------------------
 4700|       |
 4701|  1.38k|  KMP_CHECK_UPDATE(team->t.t_id, KMP_GEN_TEAM_ID());
  ------------------
  |  | 2280|  1.38k|  if ((a) != (b))                                                              \
  |  |  ------------------
  |  |  |  Branch (2280:7): [True: 34, False: 1.35k]
  |  |  ------------------
  |  | 2281|  1.38k|  (a) = (b)
  ------------------
 4702|       |  // Copy ICVs to the primary thread's implicit taskdata
 4703|  1.38k|  __kmp_init_implicit_task(loc, team->t.t_threads[0], team, 0, FALSE);
  ------------------
  |  | 1279|  1.38k|#define FALSE 0
  ------------------
 4704|  1.38k|  copy_icvs(&team->t.t_implicit_task_taskdata[0].td_icvs, new_icvs);
 4705|       |
 4706|  1.38k|  KF_TRACE(10, ("__kmp_reinitialize_team: exit this_thread=%p team=%p\n",
 4707|  1.38k|                team->t.t_threads[0], team));
 4708|  1.38k|}
kmp_runtime.cpp:_ZL22__kmp_partition_placesP8kmp_teami:
 4772|      1|static void __kmp_partition_places(kmp_team_t *team, int update_master_only) {
 4773|       |  // Do not partition places for the hidden helper team
 4774|      1|  if (KMP_HIDDEN_HELPER_TEAM(team))
  ------------------
  |  | 4426|      1|  (team->t.t_threads[0] == __kmp_hidden_helper_main_thread)
  |  |  ------------------
  |  |  |  Branch (4426:3): [True: 0, False: 1]
  |  |  ------------------
  ------------------
 4775|      0|    return;
 4776|       |  // Copy the primary thread's place partition to the team struct
 4777|      1|  kmp_info_t *master_th = team->t.t_threads[0];
 4778|      1|  KMP_DEBUG_ASSERT(master_th != NULL);
 4779|      1|  kmp_proc_bind_t proc_bind = team->t.t_proc_bind;
 4780|      1|  int first_place = master_th->th.th_first_place;
 4781|      1|  int last_place = master_th->th.th_last_place;
 4782|      1|  int masters_place = master_th->th.th_current_place;
 4783|      1|  int num_masks = __kmp_affinity.num_masks;
 4784|      1|  team->t.t_first_place = first_place;
 4785|      1|  team->t.t_last_place = last_place;
 4786|       |
 4787|      1|  KA_TRACE(20, ("__kmp_partition_places: enter: proc_bind = %d T#%d(%d:0) "
 4788|      1|                "bound to place %d partition = [%d,%d]\n",
 4789|      1|                proc_bind, __kmp_gtid_from_thread(team->t.t_threads[0]),
 4790|      1|                team->t.t_id, masters_place, first_place, last_place));
 4791|       |
 4792|      1|  switch (proc_bind) {
 4793|       |
 4794|      0|  case proc_bind_default:
  ------------------
  |  Branch (4794:3): [True: 0, False: 1]
  ------------------
 4795|       |    // Serial teams might have the proc_bind policy set to proc_bind_default.
 4796|       |    // Not an issue -- we don't rebind primary thread for any proc_bind policy.
 4797|      0|    KMP_DEBUG_ASSERT(team->t.t_nproc == 1);
 4798|      0|    break;
 4799|       |
 4800|      0|  case proc_bind_primary: {
  ------------------
  |  Branch (4800:3): [True: 0, False: 1]
  ------------------
 4801|      0|    int f;
 4802|      0|    int n_th = team->t.t_nproc;
 4803|      0|    for (f = 1; f < n_th; f++) {
  ------------------
  |  Branch (4803:17): [True: 0, False: 0]
  ------------------
 4804|      0|      kmp_info_t *th = team->t.t_threads[f];
 4805|      0|      KMP_DEBUG_ASSERT(th != NULL);
 4806|      0|      th->th.th_first_place = first_place;
 4807|      0|      th->th.th_last_place = last_place;
 4808|      0|      th->th.th_new_place = masters_place;
 4809|      0|      if (__kmp_display_affinity && masters_place != th->th.th_current_place &&
  ------------------
  |  Branch (4809:11): [True: 0, False: 0]
  |  Branch (4809:37): [True: 0, False: 0]
  ------------------
 4810|      0|          team->t.t_display_affinity != 1) {
  ------------------
  |  Branch (4810:11): [True: 0, False: 0]
  ------------------
 4811|      0|        team->t.t_display_affinity = 1;
 4812|      0|      }
 4813|       |
 4814|      0|      KA_TRACE(100, ("__kmp_partition_places: primary: T#%d(%d:%d) place %d "
 4815|      0|                     "partition = [%d,%d]\n",
 4816|      0|                     __kmp_gtid_from_thread(team->t.t_threads[f]), team->t.t_id,
 4817|      0|                     f, masters_place, first_place, last_place));
 4818|      0|    }
 4819|      0|  } break;
 4820|       |
 4821|      0|  case proc_bind_close: {
  ------------------
  |  Branch (4821:3): [True: 0, False: 1]
  ------------------
 4822|      0|    int f;
 4823|      0|    int n_th = team->t.t_nproc;
 4824|      0|    int n_places;
 4825|      0|    if (first_place <= last_place) {
  ------------------
  |  Branch (4825:9): [True: 0, False: 0]
  ------------------
 4826|      0|      n_places = last_place - first_place + 1;
 4827|      0|    } else {
 4828|      0|      n_places = num_masks - first_place + last_place + 1;
 4829|      0|    }
 4830|      0|    if (n_th <= n_places) {
  ------------------
  |  Branch (4830:9): [True: 0, False: 0]
  ------------------
 4831|      0|      int place = masters_place;
 4832|      0|      for (f = 1; f < n_th; f++) {
  ------------------
  |  Branch (4832:19): [True: 0, False: 0]
  ------------------
 4833|      0|        kmp_info_t *th = team->t.t_threads[f];
 4834|      0|        KMP_DEBUG_ASSERT(th != NULL);
 4835|       |
 4836|      0|        if (place == last_place) {
  ------------------
  |  Branch (4836:13): [True: 0, False: 0]
  ------------------
 4837|      0|          place = first_place;
 4838|      0|        } else if (place == (num_masks - 1)) {
  ------------------
  |  Branch (4838:20): [True: 0, False: 0]
  ------------------
 4839|      0|          place = 0;
 4840|      0|        } else {
 4841|      0|          place++;
 4842|      0|        }
 4843|      0|        th->th.th_first_place = first_place;
 4844|      0|        th->th.th_last_place = last_place;
 4845|      0|        th->th.th_new_place = place;
 4846|      0|        if (__kmp_display_affinity && place != th->th.th_current_place &&
  ------------------
  |  Branch (4846:13): [True: 0, False: 0]
  |  Branch (4846:39): [True: 0, False: 0]
  ------------------
 4847|      0|            team->t.t_display_affinity != 1) {
  ------------------
  |  Branch (4847:13): [True: 0, False: 0]
  ------------------
 4848|      0|          team->t.t_display_affinity = 1;
 4849|      0|        }
 4850|       |
 4851|      0|        KA_TRACE(100, ("__kmp_partition_places: close: T#%d(%d:%d) place %d "
 4852|      0|                       "partition = [%d,%d]\n",
 4853|      0|                       __kmp_gtid_from_thread(team->t.t_threads[f]),
 4854|      0|                       team->t.t_id, f, place, first_place, last_place));
 4855|      0|      }
 4856|      0|    } else {
 4857|      0|      int S, rem, gap, s_count;
 4858|      0|      S = n_th / n_places;
 4859|      0|      s_count = 0;
 4860|      0|      rem = n_th - (S * n_places);
 4861|      0|      gap = rem > 0 ? n_places / rem : n_places;
  ------------------
  |  Branch (4861:13): [True: 0, False: 0]
  ------------------
 4862|      0|      int place = masters_place;
 4863|      0|      int gap_ct = gap;
 4864|      0|      for (f = 0; f < n_th; f++) {
  ------------------
  |  Branch (4864:19): [True: 0, False: 0]
  ------------------
 4865|      0|        kmp_info_t *th = team->t.t_threads[f];
 4866|      0|        KMP_DEBUG_ASSERT(th != NULL);
 4867|       |
 4868|      0|        th->th.th_first_place = first_place;
 4869|      0|        th->th.th_last_place = last_place;
 4870|      0|        th->th.th_new_place = place;
 4871|      0|        if (__kmp_display_affinity && place != th->th.th_current_place &&
  ------------------
  |  Branch (4871:13): [True: 0, False: 0]
  |  Branch (4871:39): [True: 0, False: 0]
  ------------------
 4872|      0|            team->t.t_display_affinity != 1) {
  ------------------
  |  Branch (4872:13): [True: 0, False: 0]
  ------------------
 4873|      0|          team->t.t_display_affinity = 1;
 4874|      0|        }
 4875|      0|        s_count++;
 4876|       |
 4877|      0|        if ((s_count == S) && rem && (gap_ct == gap)) {
  ------------------
  |  Branch (4877:13): [True: 0, False: 0]
  |  Branch (4877:31): [True: 0, False: 0]
  |  Branch (4877:38): [True: 0, False: 0]
  ------------------
 4878|       |          // do nothing, add an extra thread to place on next iteration
 4879|      0|        } else if ((s_count == S + 1) && rem && (gap_ct == gap)) {
  ------------------
  |  Branch (4879:20): [True: 0, False: 0]
  |  Branch (4879:42): [True: 0, False: 0]
  |  Branch (4879:49): [True: 0, False: 0]
  ------------------
 4880|       |          // we added an extra thread to this place; move to next place
 4881|      0|          if (place == last_place) {
  ------------------
  |  Branch (4881:15): [True: 0, False: 0]
  ------------------
 4882|      0|            place = first_place;
 4883|      0|          } else if (place == (num_masks - 1)) {
  ------------------
  |  Branch (4883:22): [True: 0, False: 0]
  ------------------
 4884|      0|            place = 0;
 4885|      0|          } else {
 4886|      0|            place++;
 4887|      0|          }
 4888|      0|          s_count = 0;
 4889|      0|          gap_ct = 1;
 4890|      0|          rem--;
 4891|      0|        } else if (s_count == S) { // place full; don't add extra
  ------------------
  |  Branch (4891:20): [True: 0, False: 0]
  ------------------
 4892|      0|          if (place == last_place) {
  ------------------
  |  Branch (4892:15): [True: 0, False: 0]
  ------------------
 4893|      0|            place = first_place;
 4894|      0|          } else if (place == (num_masks - 1)) {
  ------------------
  |  Branch (4894:22): [True: 0, False: 0]
  ------------------
 4895|      0|            place = 0;
 4896|      0|          } else {
 4897|      0|            place++;
 4898|      0|          }
 4899|      0|          gap_ct++;
 4900|      0|          s_count = 0;
 4901|      0|        }
 4902|       |
 4903|      0|        KA_TRACE(100,
 4904|      0|                 ("__kmp_partition_places: close: T#%d(%d:%d) place %d "
 4905|      0|                  "partition = [%d,%d]\n",
 4906|      0|                  __kmp_gtid_from_thread(team->t.t_threads[f]), team->t.t_id, f,
 4907|      0|                  th->th.th_new_place, first_place, last_place));
 4908|      0|      }
 4909|      0|      KMP_DEBUG_ASSERT(place == masters_place);
 4910|      0|    }
 4911|      0|  } break;
 4912|       |
 4913|      0|  case proc_bind_spread: {
  ------------------
  |  Branch (4913:3): [True: 0, False: 1]
  ------------------
 4914|      0|    int f;
 4915|      0|    int n_th = team->t.t_nproc;
 4916|      0|    int n_places;
 4917|      0|    int thidx;
 4918|      0|    if (first_place <= last_place) {
  ------------------
  |  Branch (4918:9): [True: 0, False: 0]
  ------------------
 4919|      0|      n_places = last_place - first_place + 1;
 4920|      0|    } else {
 4921|      0|      n_places = num_masks - first_place + last_place + 1;
 4922|      0|    }
 4923|      0|    if (n_th <= n_places) {
  ------------------
  |  Branch (4923:9): [True: 0, False: 0]
  ------------------
 4924|      0|      int place = -1;
 4925|       |
 4926|      0|      if (n_places != num_masks) {
  ------------------
  |  Branch (4926:11): [True: 0, False: 0]
  ------------------
 4927|      0|        int S = n_places / n_th;
 4928|      0|        int s_count, rem, gap, gap_ct;
 4929|       |
 4930|      0|        place = masters_place;
 4931|      0|        rem = n_places - n_th * S;
 4932|      0|        gap = rem ? n_th / rem : 1;
  ------------------
  |  Branch (4932:15): [True: 0, False: 0]
  ------------------
 4933|      0|        gap_ct = gap;
 4934|      0|        thidx = n_th;
 4935|      0|        if (update_master_only == 1)
  ------------------
  |  Branch (4935:13): [True: 0, False: 0]
  ------------------
 4936|      0|          thidx = 1;
 4937|      0|        for (f = 0; f < thidx; f++) {
  ------------------
  |  Branch (4937:21): [True: 0, False: 0]
  ------------------
 4938|      0|          kmp_info_t *th = team->t.t_threads[f];
 4939|      0|          KMP_DEBUG_ASSERT(th != NULL);
 4940|       |
 4941|      0|          th->th.th_first_place = place;
 4942|      0|          th->th.th_new_place = place;
 4943|      0|          if (__kmp_display_affinity && place != th->th.th_current_place &&
  ------------------
  |  Branch (4943:15): [True: 0, False: 0]
  |  Branch (4943:41): [True: 0, False: 0]
  ------------------
 4944|      0|              team->t.t_display_affinity != 1) {
  ------------------
  |  Branch (4944:15): [True: 0, False: 0]
  ------------------
 4945|      0|            team->t.t_display_affinity = 1;
 4946|      0|          }
 4947|      0|          s_count = 1;
 4948|      0|          while (s_count < S) {
  ------------------
  |  Branch (4948:18): [True: 0, False: 0]
  ------------------
 4949|      0|            if (place == last_place) {
  ------------------
  |  Branch (4949:17): [True: 0, False: 0]
  ------------------
 4950|      0|              place = first_place;
 4951|      0|            } else if (place == (num_masks - 1)) {
  ------------------
  |  Branch (4951:24): [True: 0, False: 0]
  ------------------
 4952|      0|              place = 0;
 4953|      0|            } else {
 4954|      0|              place++;
 4955|      0|            }
 4956|      0|            s_count++;
 4957|      0|          }
 4958|      0|          if (rem && (gap_ct == gap)) {
  ------------------
  |  Branch (4958:15): [True: 0, False: 0]
  |  Branch (4958:22): [True: 0, False: 0]
  ------------------
 4959|      0|            if (place == last_place) {
  ------------------
  |  Branch (4959:17): [True: 0, False: 0]
  ------------------
 4960|      0|              place = first_place;
 4961|      0|            } else if (place == (num_masks - 1)) {
  ------------------
  |  Branch (4961:24): [True: 0, False: 0]
  ------------------
 4962|      0|              place = 0;
 4963|      0|            } else {
 4964|      0|              place++;
 4965|      0|            }
 4966|      0|            rem--;
 4967|      0|            gap_ct = 0;
 4968|      0|          }
 4969|      0|          th->th.th_last_place = place;
 4970|      0|          gap_ct++;
 4971|       |
 4972|      0|          if (place == last_place) {
  ------------------
  |  Branch (4972:15): [True: 0, False: 0]
  ------------------
 4973|      0|            place = first_place;
 4974|      0|          } else if (place == (num_masks - 1)) {
  ------------------
  |  Branch (4974:22): [True: 0, False: 0]
  ------------------
 4975|      0|            place = 0;
 4976|      0|          } else {
 4977|      0|            place++;
 4978|      0|          }
 4979|       |
 4980|      0|          KA_TRACE(100,
 4981|      0|                   ("__kmp_partition_places: spread: T#%d(%d:%d) place %d "
 4982|      0|                    "partition = [%d,%d], num_masks: %u\n",
 4983|      0|                    __kmp_gtid_from_thread(team->t.t_threads[f]), team->t.t_id,
 4984|      0|                    f, th->th.th_new_place, th->th.th_first_place,
 4985|      0|                    th->th.th_last_place, num_masks));
 4986|      0|        }
 4987|      0|      } else {
 4988|       |        /* Having uniform space of available computation places I can create
 4989|       |           T partitions of round(P/T) size and put threads into the first
 4990|       |           place of each partition. */
 4991|      0|        double current = static_cast<double>(masters_place);
 4992|      0|        double spacing =
 4993|      0|            (static_cast<double>(n_places + 1) / static_cast<double>(n_th));
 4994|      0|        int first, last;
 4995|      0|        kmp_info_t *th;
 4996|       |
 4997|      0|        thidx = n_th + 1;
 4998|      0|        if (update_master_only == 1)
  ------------------
  |  Branch (4998:13): [True: 0, False: 0]
  ------------------
 4999|      0|          thidx = 1;
 5000|      0|        for (f = 0; f < thidx; f++) {
  ------------------
  |  Branch (5000:21): [True: 0, False: 0]
  ------------------
 5001|      0|          first = static_cast<int>(current);
 5002|      0|          last = static_cast<int>(current + spacing) - 1;
 5003|      0|          KMP_DEBUG_ASSERT(last >= first);
 5004|      0|          if (first >= n_places) {
  ------------------
  |  Branch (5004:15): [True: 0, False: 0]
  ------------------
 5005|      0|            if (masters_place) {
  ------------------
  |  Branch (5005:17): [True: 0, False: 0]
  ------------------
 5006|      0|              first -= n_places;
 5007|      0|              last -= n_places;
 5008|      0|              if (first == (masters_place + 1)) {
  ------------------
  |  Branch (5008:19): [True: 0, False: 0]
  ------------------
 5009|      0|                KMP_DEBUG_ASSERT(f == n_th);
 5010|      0|                first--;
 5011|      0|              }
 5012|      0|              if (last == masters_place) {
  ------------------
  |  Branch (5012:19): [True: 0, False: 0]
  ------------------
 5013|      0|                KMP_DEBUG_ASSERT(f == (n_th - 1));
 5014|      0|                last--;
 5015|      0|              }
 5016|      0|            } else {
 5017|      0|              KMP_DEBUG_ASSERT(f == n_th);
 5018|      0|              first = 0;
 5019|      0|              last = 0;
 5020|      0|            }
 5021|      0|          }
 5022|      0|          if (last >= n_places) {
  ------------------
  |  Branch (5022:15): [True: 0, False: 0]
  ------------------
 5023|      0|            last = (n_places - 1);
 5024|      0|          }
 5025|      0|          place = first;
 5026|      0|          current += spacing;
 5027|      0|          if (f < n_th) {
  ------------------
  |  Branch (5027:15): [True: 0, False: 0]
  ------------------
 5028|      0|            KMP_DEBUG_ASSERT(0 <= first);
 5029|      0|            KMP_DEBUG_ASSERT(n_places > first);
 5030|      0|            KMP_DEBUG_ASSERT(0 <= last);
 5031|      0|            KMP_DEBUG_ASSERT(n_places > last);
 5032|      0|            KMP_DEBUG_ASSERT(last_place >= first_place);
 5033|      0|            th = team->t.t_threads[f];
 5034|      0|            KMP_DEBUG_ASSERT(th);
 5035|      0|            th->th.th_first_place = first;
 5036|      0|            th->th.th_new_place = place;
 5037|      0|            th->th.th_last_place = last;
 5038|      0|            if (__kmp_display_affinity && place != th->th.th_current_place &&
  ------------------
  |  Branch (5038:17): [True: 0, False: 0]
  |  Branch (5038:43): [True: 0, False: 0]
  ------------------
 5039|      0|                team->t.t_display_affinity != 1) {
  ------------------
  |  Branch (5039:17): [True: 0, False: 0]
  ------------------
 5040|      0|              team->t.t_display_affinity = 1;
 5041|      0|            }
 5042|      0|            KA_TRACE(100,
 5043|      0|                     ("__kmp_partition_places: spread: T#%d(%d:%d) place %d "
 5044|      0|                      "partition = [%d,%d], spacing = %.4f\n",
 5045|      0|                      __kmp_gtid_from_thread(team->t.t_threads[f]),
 5046|      0|                      team->t.t_id, f, th->th.th_new_place,
 5047|      0|                      th->th.th_first_place, th->th.th_last_place, spacing));
 5048|      0|          }
 5049|      0|        }
 5050|      0|      }
 5051|      0|      KMP_DEBUG_ASSERT(update_master_only || place == masters_place);
 5052|      0|    } else {
 5053|      0|      int S, rem, gap, s_count;
 5054|      0|      S = n_th / n_places;
 5055|      0|      s_count = 0;
 5056|      0|      rem = n_th - (S * n_places);
 5057|      0|      gap = rem > 0 ? n_places / rem : n_places;
  ------------------
  |  Branch (5057:13): [True: 0, False: 0]
  ------------------
 5058|      0|      int place = masters_place;
 5059|      0|      int gap_ct = gap;
 5060|      0|      thidx = n_th;
 5061|      0|      if (update_master_only == 1)
  ------------------
  |  Branch (5061:11): [True: 0, False: 0]
  ------------------
 5062|      0|        thidx = 1;
 5063|      0|      for (f = 0; f < thidx; f++) {
  ------------------
  |  Branch (5063:19): [True: 0, False: 0]
  ------------------
 5064|      0|        kmp_info_t *th = team->t.t_threads[f];
 5065|      0|        KMP_DEBUG_ASSERT(th != NULL);
 5066|       |
 5067|      0|        th->th.th_first_place = place;
 5068|      0|        th->th.th_last_place = place;
 5069|      0|        th->th.th_new_place = place;
 5070|      0|        if (__kmp_display_affinity && place != th->th.th_current_place &&
  ------------------
  |  Branch (5070:13): [True: 0, False: 0]
  |  Branch (5070:39): [True: 0, False: 0]
  ------------------
 5071|      0|            team->t.t_display_affinity != 1) {
  ------------------
  |  Branch (5071:13): [True: 0, False: 0]
  ------------------
 5072|      0|          team->t.t_display_affinity = 1;
 5073|      0|        }
 5074|      0|        s_count++;
 5075|       |
 5076|      0|        if ((s_count == S) && rem && (gap_ct == gap)) {
  ------------------
  |  Branch (5076:13): [True: 0, False: 0]
  |  Branch (5076:31): [True: 0, False: 0]
  |  Branch (5076:38): [True: 0, False: 0]
  ------------------
 5077|       |          // do nothing, add an extra thread to place on next iteration
 5078|      0|        } else if ((s_count == S + 1) && rem && (gap_ct == gap)) {
  ------------------
  |  Branch (5078:20): [True: 0, False: 0]
  |  Branch (5078:42): [True: 0, False: 0]
  |  Branch (5078:49): [True: 0, False: 0]
  ------------------
 5079|       |          // we added an extra thread to this place; move on to next place
 5080|      0|          if (place == last_place) {
  ------------------
  |  Branch (5080:15): [True: 0, False: 0]
  ------------------
 5081|      0|            place = first_place;
 5082|      0|          } else if (place == (num_masks - 1)) {
  ------------------
  |  Branch (5082:22): [True: 0, False: 0]
  ------------------
 5083|      0|            place = 0;
 5084|      0|          } else {
 5085|      0|            place++;
 5086|      0|          }
 5087|      0|          s_count = 0;
 5088|      0|          gap_ct = 1;
 5089|      0|          rem--;
 5090|      0|        } else if (s_count == S) { // place is full; don't add extra thread
  ------------------
  |  Branch (5090:20): [True: 0, False: 0]
  ------------------
 5091|      0|          if (place == last_place) {
  ------------------
  |  Branch (5091:15): [True: 0, False: 0]
  ------------------
 5092|      0|            place = first_place;
 5093|      0|          } else if (place == (num_masks - 1)) {
  ------------------
  |  Branch (5093:22): [True: 0, False: 0]
  ------------------
 5094|      0|            place = 0;
 5095|      0|          } else {
 5096|      0|            place++;
 5097|      0|          }
 5098|      0|          gap_ct++;
 5099|      0|          s_count = 0;
 5100|      0|        }
 5101|       |
 5102|      0|        KA_TRACE(100, ("__kmp_partition_places: spread: T#%d(%d:%d) place %d "
 5103|      0|                       "partition = [%d,%d]\n",
 5104|      0|                       __kmp_gtid_from_thread(team->t.t_threads[f]),
 5105|      0|                       team->t.t_id, f, th->th.th_new_place,
 5106|      0|                       th->th.th_first_place, th->th.th_last_place));
 5107|      0|      }
 5108|      0|      KMP_DEBUG_ASSERT(update_master_only || place == masters_place);
 5109|      0|    }
 5110|      0|  } break;
 5111|       |
 5112|      1|  default:
  ------------------
  |  Branch (5112:3): [True: 1, False: 0]
  ------------------
 5113|      1|    break;
 5114|      1|  }
 5115|       |
 5116|      1|  KA_TRACE(20, ("__kmp_partition_places: exit T#%d\n", team->t.t_id));
 5117|      1|}
kmp_runtime.cpp:_ZL21__kmp_initialize_teamP8kmp_teamiP20kmp_internal_controlP5ident:
 4715|     35|                                  ident_t *loc) {
 4716|     35|  KF_TRACE(10, ("__kmp_initialize_team: enter: team=%p\n", team));
 4717|       |
 4718|       |  /* verify */
 4719|     35|  KMP_DEBUG_ASSERT(team);
 4720|     35|  KMP_DEBUG_ASSERT(new_nproc <= team->t.t_max_nproc);
 4721|     35|  KMP_DEBUG_ASSERT(team->t.t_threads);
 4722|     35|  KMP_MB();
 4723|       |
 4724|     35|  team->t.t_master_tid = 0; /* not needed */
 4725|       |  /* team->t.t_master_bar;        not needed */
 4726|     35|  team->t.t_serialized = new_nproc > 1 ? 0 : 1;
  ------------------
  |  Branch (4726:26): [True: 1, False: 34]
  ------------------
 4727|     35|  team->t.t_nproc = new_nproc;
 4728|       |
 4729|       |  /* team->t.t_parent     = NULL; TODO not needed & would mess up hot team */
 4730|     35|  team->t.t_next_pool = NULL;
 4731|       |  /* memset( team->t.t_threads, 0, sizeof(kmp_info_t*)*new_nproc ); would mess
 4732|       |   * up hot team */
 4733|       |
 4734|     35|  TCW_SYNC_PTR(team->t.t_pkfn, NULL); /* not needed */
  ------------------
  |  | 1159|     35|#define TCW_SYNC_PTR(a, b) TCW_SYNC_8((a), (b))
  |  |  ------------------
  |  |  |  | 1141|     35|#define TCW_SYNC_8(a, b) (a) = (b)
  |  |  ------------------
  ------------------
 4735|     35|  team->t.t_invoke = NULL; /* not needed */
 4736|       |
 4737|       |  // TODO???: team->t.t_max_active_levels       = new_max_active_levels;
 4738|     35|  team->t.t_sched.sched = new_icvs->sched.sched;
 4739|       |
 4740|     35|#if KMP_ARCH_X86 || KMP_ARCH_X86_64
 4741|     35|  team->t.t_fp_control_saved = FALSE; /* not needed */
  ------------------
  |  | 1279|     35|#define FALSE 0
  ------------------
 4742|     35|  team->t.t_x87_fpu_control_word = 0; /* not needed */
 4743|     35|  team->t.t_mxcsr = 0; /* not needed */
 4744|     35|#endif /* KMP_ARCH_X86 || KMP_ARCH_X86_64 */
 4745|       |
 4746|     35|  team->t.t_construct = 0;
 4747|       |
 4748|     35|  team->t.t_ordered.dt.t_value = 0;
 4749|     35|  team->t.t_master_active = FALSE;
  ------------------
  |  | 1279|     35|#define FALSE 0
  ------------------
 4750|       |
 4751|       |#ifdef KMP_DEBUG
 4752|       |  team->t.t_copypriv_data = NULL; /* not necessary, but nice for debugging */
 4753|       |#endif
 4754|       |#if KMP_OS_WINDOWS
 4755|       |  team->t.t_copyin_counter = 0; /* for barrier-free copyin implementation */
 4756|       |#endif
 4757|       |
 4758|     35|  team->t.t_control_stack_top = NULL;
 4759|       |
 4760|     35|  __kmp_reinitialize_team(team, new_icvs, loc);
 4761|       |
 4762|     35|  KMP_MB();
 4763|     35|  KF_TRACE(10, ("__kmp_initialize_team: exit: team=%p\n", team));
 4764|     35|}
kmp_runtime.cpp:_ZL24__kmp_alloc_argv_entriesiP8kmp_teami:
 3170|  1.38k|static void __kmp_alloc_argv_entries(int argc, kmp_team_t *team, int realloc) {
 3171|       |
 3172|  1.38k|  KMP_DEBUG_ASSERT(team);
 3173|  1.38k|  if (!realloc || argc > team->t.t_max_argc) {
  ------------------
  |  Branch (3173:7): [True: 34, False: 1.35k]
  |  Branch (3173:19): [True: 0, False: 1.35k]
  ------------------
 3174|       |
 3175|     34|    KA_TRACE(100, ("__kmp_alloc_argv_entries: team %d: needed entries=%d, "
 3176|     34|                   "current entries=%d\n",
 3177|     34|                   team->t.t_id, argc, (realloc) ? team->t.t_max_argc : 0));
 3178|       |    /* if previously allocated heap space for args, free them */
 3179|     34|    if (realloc && team->t.t_argv != &team->t.t_inline_argv[0])
  ------------------
  |  Branch (3179:9): [True: 0, False: 34]
  |  Branch (3179:20): [True: 0, False: 0]
  ------------------
 3180|      0|      __kmp_free((void *)team->t.t_argv);
  ------------------
  |  | 3619|      0|#define __kmp_free(ptr) ___kmp_free((ptr)KMP_SRC_LOC_CURR)
  ------------------
 3181|       |
 3182|     34|    if (argc <= KMP_INLINE_ARGV_ENTRIES) {
  ------------------
  |  | 2998|     34|#define KMP_INLINE_ARGV_ENTRIES (int)(KMP_INLINE_ARGV_BYTES / KMP_PTR_SKIP)
  |  |  ------------------
  |  |  |  | 2990|     34|  (4 * CACHE_LINE -                                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|     34|# define CACHE_LINE 64
  |  |  |  |  ------------------
  |  |  |  | 2991|     34|   ((3 * KMP_PTR_SKIP + 2 * sizeof(int) + 2 * sizeof(kmp_int8) +               \
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|     34|#define KMP_PTR_SKIP (sizeof(void *))
  |  |  |  |  ------------------
  |  |  |  | 2992|     34|     sizeof(kmp_int16) + sizeof(kmp_uint32)) %                                 \
  |  |  |  | 2993|     34|    CACHE_LINE))
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|     34|# define CACHE_LINE 64
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define KMP_INLINE_ARGV_ENTRIES (int)(KMP_INLINE_ARGV_BYTES / KMP_PTR_SKIP)
  |  |  ------------------
  |  |  |  |   30|     34|#define KMP_PTR_SKIP (sizeof(void *))
  |  |  ------------------
  ------------------
  |  Branch (3182:9): [True: 34, False: 0]
  ------------------
 3183|       |      /* use unused space in the cache line for arguments */
 3184|     34|      team->t.t_max_argc = KMP_INLINE_ARGV_ENTRIES;
  ------------------
  |  | 2998|     34|#define KMP_INLINE_ARGV_ENTRIES (int)(KMP_INLINE_ARGV_BYTES / KMP_PTR_SKIP)
  |  |  ------------------
  |  |  |  | 2990|     34|  (4 * CACHE_LINE -                                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|     34|# define CACHE_LINE 64
  |  |  |  |  ------------------
  |  |  |  | 2991|     34|   ((3 * KMP_PTR_SKIP + 2 * sizeof(int) + 2 * sizeof(kmp_int8) +               \
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|     34|#define KMP_PTR_SKIP (sizeof(void *))
  |  |  |  |  ------------------
  |  |  |  | 2992|     34|     sizeof(kmp_int16) + sizeof(kmp_uint32)) %                                 \
  |  |  |  | 2993|     34|    CACHE_LINE))
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|     34|# define CACHE_LINE 64
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define KMP_INLINE_ARGV_ENTRIES (int)(KMP_INLINE_ARGV_BYTES / KMP_PTR_SKIP)
  |  |  ------------------
  |  |  |  |   30|     34|#define KMP_PTR_SKIP (sizeof(void *))
  |  |  ------------------
  ------------------
 3185|     34|      KA_TRACE(100, ("__kmp_alloc_argv_entries: team %d: inline allocate %d "
 3186|     34|                     "argv entries\n",
 3187|     34|                     team->t.t_id, team->t.t_max_argc));
 3188|     34|      team->t.t_argv = &team->t.t_inline_argv[0];
 3189|     34|      if (__kmp_storage_map) {
  ------------------
  |  Branch (3189:11): [True: 0, False: 34]
  ------------------
 3190|      0|        __kmp_print_storage_map_gtid(
 3191|      0|            -1, &team->t.t_inline_argv[0],
 3192|      0|            &team->t.t_inline_argv[KMP_INLINE_ARGV_ENTRIES],
  ------------------
  |  | 2998|      0|#define KMP_INLINE_ARGV_ENTRIES (int)(KMP_INLINE_ARGV_BYTES / KMP_PTR_SKIP)
  |  |  ------------------
  |  |  |  | 2990|      0|  (4 * CACHE_LINE -                                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|      0|# define CACHE_LINE 64
  |  |  |  |  ------------------
  |  |  |  | 2991|      0|   ((3 * KMP_PTR_SKIP + 2 * sizeof(int) + 2 * sizeof(kmp_int8) +               \
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|      0|#define KMP_PTR_SKIP (sizeof(void *))
  |  |  |  |  ------------------
  |  |  |  | 2992|      0|     sizeof(kmp_int16) + sizeof(kmp_uint32)) %                                 \
  |  |  |  | 2993|      0|    CACHE_LINE))
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|      0|# define CACHE_LINE 64
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define KMP_INLINE_ARGV_ENTRIES (int)(KMP_INLINE_ARGV_BYTES / KMP_PTR_SKIP)
  |  |  ------------------
  |  |  |  |   30|      0|#define KMP_PTR_SKIP (sizeof(void *))
  |  |  ------------------
  ------------------
 3193|      0|            (sizeof(void *) * KMP_INLINE_ARGV_ENTRIES), "team_%d.t_inline_argv",
  ------------------
  |  | 2998|      0|#define KMP_INLINE_ARGV_ENTRIES (int)(KMP_INLINE_ARGV_BYTES / KMP_PTR_SKIP)
  |  |  ------------------
  |  |  |  | 2990|      0|  (4 * CACHE_LINE -                                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|      0|# define CACHE_LINE 64
  |  |  |  |  ------------------
  |  |  |  | 2991|      0|   ((3 * KMP_PTR_SKIP + 2 * sizeof(int) + 2 * sizeof(kmp_int8) +               \
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|      0|#define KMP_PTR_SKIP (sizeof(void *))
  |  |  |  |  ------------------
  |  |  |  | 2992|      0|     sizeof(kmp_int16) + sizeof(kmp_uint32)) %                                 \
  |  |  |  | 2993|      0|    CACHE_LINE))
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|      0|# define CACHE_LINE 64
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define KMP_INLINE_ARGV_ENTRIES (int)(KMP_INLINE_ARGV_BYTES / KMP_PTR_SKIP)
  |  |  ------------------
  |  |  |  |   30|      0|#define KMP_PTR_SKIP (sizeof(void *))
  |  |  ------------------
  ------------------
 3194|      0|            team->t.t_id);
 3195|      0|      }
 3196|     34|    } else {
 3197|       |      /* allocate space for arguments in the heap */
 3198|      0|      team->t.t_max_argc = (argc <= (KMP_MIN_MALLOC_ARGV_ENTRIES >> 1))
  ------------------
  |  | 2982|      0|#define KMP_MIN_MALLOC_ARGV_ENTRIES 100
  ------------------
  |  Branch (3198:28): [True: 0, False: 0]
  ------------------
 3199|      0|                               ? KMP_MIN_MALLOC_ARGV_ENTRIES
  ------------------
  |  | 2982|      0|#define KMP_MIN_MALLOC_ARGV_ENTRIES 100
  ------------------
 3200|      0|                               : 2 * argc;
 3201|      0|      KA_TRACE(100, ("__kmp_alloc_argv_entries: team %d: dynamic allocate %d "
 3202|      0|                     "argv entries\n",
 3203|      0|                     team->t.t_id, team->t.t_max_argc));
 3204|      0|      team->t.t_argv =
 3205|      0|          (void **)__kmp_page_allocate(sizeof(void *) * team->t.t_max_argc);
  ------------------
  |  | 3618|      0|#define __kmp_page_allocate(size) ___kmp_page_allocate((size)KMP_SRC_LOC_CURR)
  ------------------
 3206|      0|      if (__kmp_storage_map) {
  ------------------
  |  Branch (3206:11): [True: 0, False: 0]
  ------------------
 3207|      0|        __kmp_print_storage_map_gtid(-1, &team->t.t_argv[0],
 3208|      0|                                     &team->t.t_argv[team->t.t_max_argc],
 3209|      0|                                     sizeof(void *) * team->t.t_max_argc,
 3210|      0|                                     "team_%d.t_argv", team->t.t_id);
 3211|      0|      }
 3212|      0|    }
 3213|     34|  }
 3214|  1.38k|}
kmp_runtime.cpp:_ZL26__kmp_allocate_team_arraysP8kmp_teami:
 3216|     34|static void __kmp_allocate_team_arrays(kmp_team_t *team, int max_nth) {
 3217|     34|  int i;
 3218|     34|  int num_disp_buff = max_nth > 1 ? __kmp_dispatch_num_buffers : 2;
  ------------------
  |  Branch (3218:23): [True: 1, False: 33]
  ------------------
 3219|     34|  team->t.t_threads =
 3220|     34|      (kmp_info_t **)__kmp_allocate(sizeof(kmp_info_t *) * max_nth);
  ------------------
  |  | 3617|     34|#define __kmp_allocate(size) ___kmp_allocate((size)KMP_SRC_LOC_CURR)
  ------------------
 3221|     34|  team->t.t_disp_buffer = (dispatch_shared_info_t *)__kmp_allocate(
  ------------------
  |  | 3617|     34|#define __kmp_allocate(size) ___kmp_allocate((size)KMP_SRC_LOC_CURR)
  ------------------
 3222|     34|      sizeof(dispatch_shared_info_t) * num_disp_buff);
 3223|     34|  team->t.t_dispatch =
 3224|     34|      (kmp_disp_t *)__kmp_allocate(sizeof(kmp_disp_t) * max_nth);
  ------------------
  |  | 3617|     34|#define __kmp_allocate(size) ___kmp_allocate((size)KMP_SRC_LOC_CURR)
  ------------------
 3225|     34|  team->t.t_implicit_task_taskdata =
 3226|     34|      (kmp_taskdata_t *)__kmp_allocate(sizeof(kmp_taskdata_t) * max_nth);
  ------------------
  |  | 3617|     34|#define __kmp_allocate(size) ___kmp_allocate((size)KMP_SRC_LOC_CURR)
  ------------------
 3227|     34|  team->t.t_max_nproc = max_nth;
 3228|       |
 3229|       |  /* setup dispatch buffers */
 3230|    107|  for (i = 0; i < num_disp_buff; ++i) {
  ------------------
  |  Branch (3230:15): [True: 73, False: 34]
  ------------------
 3231|     73|    team->t.t_disp_buffer[i].buffer_index = i;
 3232|     73|    team->t.t_disp_buffer[i].doacross_buf_idx = i;
 3233|     73|  }
 3234|     34|}
kmp_runtime.cpp:_ZL22__kmp_free_team_arraysP8kmp_team:
 3236|     34|static void __kmp_free_team_arrays(kmp_team_t *team) {
 3237|       |  /* Note: this does not free the threads in t_threads (__kmp_free_threads) */
 3238|     34|  int i;
 3239|    131|  for (i = 0; i < team->t.t_max_nproc; ++i) {
  ------------------
  |  Branch (3239:15): [True: 97, False: 34]
  ------------------
 3240|     97|    if (team->t.t_dispatch[i].th_disp_buffer != NULL) {
  ------------------
  |  Branch (3240:9): [True: 33, False: 64]
  ------------------
 3241|     33|      __kmp_free(team->t.t_dispatch[i].th_disp_buffer);
  ------------------
  |  | 3619|     33|#define __kmp_free(ptr) ___kmp_free((ptr)KMP_SRC_LOC_CURR)
  ------------------
 3242|     33|      team->t.t_dispatch[i].th_disp_buffer = NULL;
 3243|     33|    }
 3244|     97|  }
 3245|       |#if KMP_USE_HIER_SCHED
 3246|       |  __kmp_dispatch_free_hierarchies(team);
 3247|       |#endif
 3248|     34|  __kmp_free(team->t.t_threads);
  ------------------
  |  | 3619|     34|#define __kmp_free(ptr) ___kmp_free((ptr)KMP_SRC_LOC_CURR)
  ------------------
 3249|     34|  __kmp_free(team->t.t_disp_buffer);
  ------------------
  |  | 3619|     34|#define __kmp_free(ptr) ___kmp_free((ptr)KMP_SRC_LOC_CURR)
  ------------------
 3250|     34|  __kmp_free(team->t.t_dispatch);
  ------------------
  |  | 3619|     34|#define __kmp_free(ptr) ___kmp_free((ptr)KMP_SRC_LOC_CURR)
  ------------------
 3251|     34|  __kmp_free(team->t.t_implicit_task_taskdata);
  ------------------
  |  | 3619|     34|#define __kmp_free(ptr) ___kmp_free((ptr)KMP_SRC_LOC_CURR)
  ------------------
 3252|     34|  team->t.t_threads = NULL;
 3253|     34|  team->t.t_disp_buffer = NULL;
 3254|       |  team->t.t_dispatch = NULL;
 3255|     34|  team->t.t_implicit_task_taskdata = 0;
 3256|     34|}
kmp_runtime.cpp:_ZL19__kmp_itthash_cleanP8kmp_info:
 6281|      1|static void __kmp_itthash_clean(kmp_info_t *th) {
 6282|       |#if USE_ITT_NOTIFY
 6283|       |  if (__kmp_itt_region_domains.count > 0) {
 6284|       |    for (int i = 0; i < KMP_MAX_FRAME_DOMAINS; ++i) {
 6285|       |      kmp_itthash_entry_t *bucket = __kmp_itt_region_domains.buckets[i];
 6286|       |      while (bucket) {
 6287|       |        kmp_itthash_entry_t *next = bucket->next_in_bucket;
 6288|       |        __kmp_thread_free(th, bucket);
 6289|       |        bucket = next;
 6290|       |      }
 6291|       |    }
 6292|       |  }
 6293|       |  if (__kmp_itt_barrier_domains.count > 0) {
 6294|       |    for (int i = 0; i < KMP_MAX_FRAME_DOMAINS; ++i) {
 6295|       |      kmp_itthash_entry_t *bucket = __kmp_itt_barrier_domains.buckets[i];
 6296|       |      while (bucket) {
 6297|       |        kmp_itthash_entry_t *next = bucket->next_in_bucket;
 6298|       |        __kmp_thread_free(th, bucket);
 6299|       |        bucket = next;
 6300|       |      }
 6301|       |    }
 6302|       |  }
 6303|       |#endif
 6304|      1|}
kmp_runtime.cpp:_ZL18__kmp_internal_endv:
 6306|      1|static void __kmp_internal_end(void) {
 6307|      1|  int i;
 6308|       |
 6309|       |  /* First, unregister the library */
 6310|      1|  __kmp_unregister_library();
 6311|       |
 6312|       |#if KMP_OS_WINDOWS
 6313|       |  /* In Win static library, we can't tell when a root actually dies, so we
 6314|       |     reclaim the data structures for any root threads that have died but not
 6315|       |     unregistered themselves, in order to shut down cleanly.
 6316|       |     In Win dynamic library we also can't tell when a thread dies.  */
 6317|       |  __kmp_reclaim_dead_roots(); // AC: moved here to always clean resources of
 6318|       |// dead roots
 6319|       |#endif
 6320|       |
 6321|    137|  for (i = 0; i < __kmp_threads_capacity; i++)
  ------------------
  |  Branch (6321:15): [True: 136, False: 1]
  ------------------
 6322|    136|    if (__kmp_root[i])
  ------------------
  |  Branch (6322:9): [True: 1, False: 135]
  ------------------
 6323|      1|      if (__kmp_root[i]->r.r_active)
  ------------------
  |  Branch (6323:11): [True: 0, False: 1]
  ------------------
 6324|      0|        break;
 6325|      1|  KMP_MB(); /* Flush all pending memory write invalidates.  */
 6326|      1|  TCW_SYNC_4(__kmp_global.g.g_done, TRUE);
  ------------------
  |  | 1136|      1|#define TCW_SYNC_4(a, b) (a) = (b)
  ------------------
 6327|       |
 6328|      1|  if (i < __kmp_threads_capacity) {
  ------------------
  |  Branch (6328:7): [True: 0, False: 1]
  ------------------
 6329|       |#if KMP_USE_MONITOR
 6330|       |    // 2009-09-08 (lev): Other alive roots found. Why do we kill the monitor??
 6331|       |    KMP_MB(); /* Flush all pending memory write invalidates.  */
 6332|       |
 6333|       |    // Need to check that monitor was initialized before reaping it. If we are
 6334|       |    // called form __kmp_atfork_child (which sets __kmp_init_parallel = 0), then
 6335|       |    // __kmp_monitor will appear to contain valid data, but it is only valid in
 6336|       |    // the parent process, not the child.
 6337|       |    // New behavior (201008): instead of keying off of the flag
 6338|       |    // __kmp_init_parallel, the monitor thread creation is keyed off
 6339|       |    // of the new flag __kmp_init_monitor.
 6340|       |    __kmp_acquire_bootstrap_lock(&__kmp_monitor_lock);
 6341|       |    if (TCR_4(__kmp_init_monitor)) {
 6342|       |      __kmp_reap_monitor(&__kmp_monitor);
 6343|       |      TCW_4(__kmp_init_monitor, 0);
 6344|       |    }
 6345|       |    __kmp_release_bootstrap_lock(&__kmp_monitor_lock);
 6346|       |    KA_TRACE(10, ("__kmp_internal_end: monitor reaped\n"));
 6347|       |#endif // KMP_USE_MONITOR
 6348|      1|  } else {
 6349|       |/* TODO move this to cleanup code */
 6350|       |#ifdef KMP_DEBUG
 6351|       |    /* make sure that everything has properly ended */
 6352|       |    for (i = 0; i < __kmp_threads_capacity; i++) {
 6353|       |      if (__kmp_root[i]) {
 6354|       |        //                    KMP_ASSERT( ! KMP_UBER_GTID( i ) );         // AC:
 6355|       |        //                    there can be uber threads alive here
 6356|       |        KMP_ASSERT(!__kmp_root[i]->r.r_active); // TODO: can they be active?
 6357|       |      }
 6358|       |    }
 6359|       |#endif
 6360|       |
 6361|      1|    KMP_MB();
 6362|       |
 6363|       |    // Reap the worker threads.
 6364|       |    // This is valid for now, but be careful if threads are reaped sooner.
 6365|     32|    while (__kmp_thread_pool != NULL) { // Loop thru all the thread in the pool.
  ------------------
  |  Branch (6365:12): [True: 31, False: 1]
  ------------------
 6366|       |      // Get the next thread from the pool.
 6367|     31|      kmp_info_t *thread = CCAST(kmp_info_t *, __kmp_thread_pool);
  ------------------
  |  |  229|     31|#define CCAST(type, var) const_cast<type>(var)
  ------------------
 6368|     31|      __kmp_thread_pool = thread->th.th_next_pool;
 6369|       |      // Reap it.
 6370|     31|      KMP_DEBUG_ASSERT(thread->th.th_reap_state == KMP_SAFE_TO_REAP);
 6371|     31|      thread->th.th_next_pool = NULL;
 6372|     31|      thread->th.th_in_pool = FALSE;
  ------------------
  |  | 1279|     31|#define FALSE 0
  ------------------
 6373|     31|      __kmp_reap_thread(thread, 0);
 6374|     31|    }
 6375|      1|    __kmp_thread_pool_insert_pt = NULL;
 6376|       |
 6377|       |    // Reap teams.
 6378|      3|    while (__kmp_team_pool != NULL) { // Loop thru all the teams in the pool.
  ------------------
  |  Branch (6378:12): [True: 2, False: 1]
  ------------------
 6379|       |      // Get the next team from the pool.
 6380|      2|      kmp_team_t *team = CCAST(kmp_team_t *, __kmp_team_pool);
  ------------------
  |  |  229|      2|#define CCAST(type, var) const_cast<type>(var)
  ------------------
 6381|      2|      __kmp_team_pool = team->t.t_next_pool;
 6382|       |      // Reap it.
 6383|      2|      team->t.t_next_pool = NULL;
 6384|      2|      __kmp_reap_team(team);
 6385|      2|    }
 6386|       |
 6387|      1|    __kmp_reap_task_teams();
 6388|       |
 6389|      1|#if KMP_OS_UNIX
 6390|       |    // Threads that are not reaped should not access any resources since they
 6391|       |    // are going to be deallocated soon, so the shutdown sequence should wait
 6392|       |    // until all threads either exit the final spin-waiting loop or begin
 6393|       |    // sleeping after the given blocktime.
 6394|    137|    for (i = 0; i < __kmp_threads_capacity; i++) {
  ------------------
  |  Branch (6394:17): [True: 136, False: 1]
  ------------------
 6395|    136|      kmp_info_t *thr = __kmp_threads[i];
 6396|    136|      while (thr && KMP_ATOMIC_LD_ACQ(&thr->th.th_blocking))
  ------------------
  |  | 1249|      0|#define KMP_ATOMIC_LD_ACQ(p) KMP_ATOMIC_LD(p, acquire)
  |  |  ------------------
  |  |  |  | 1245|      0|#define KMP_ATOMIC_LD(p, order) (p)->load(std::memory_order_##order)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1245:33): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (6396:14): [True: 0, False: 136]
  ------------------
 6397|      0|        KMP_CPU_PAUSE();
  ------------------
  |  | 1498|      0|#define KMP_CPU_PAUSE() __kmp_x86_pause()
  ------------------
 6398|    136|    }
 6399|      1|#endif
 6400|       |
 6401|    137|    for (i = 0; i < __kmp_threads_capacity; ++i) {
  ------------------
  |  Branch (6401:17): [True: 136, False: 1]
  ------------------
 6402|       |      // TBD: Add some checking...
 6403|       |      // Something like KMP_DEBUG_ASSERT( __kmp_thread[ i ] == NULL );
 6404|    136|    }
 6405|       |
 6406|       |    /* Make sure all threadprivate destructors get run by joining with all
 6407|       |       worker threads before resetting this flag */
 6408|      1|    TCW_SYNC_4(__kmp_init_common, FALSE);
  ------------------
  |  | 1136|      1|#define TCW_SYNC_4(a, b) (a) = (b)
  ------------------
 6409|       |
 6410|      1|    KA_TRACE(10, ("__kmp_internal_end: all workers reaped\n"));
 6411|      1|    KMP_MB();
 6412|       |
 6413|       |#if KMP_USE_MONITOR
 6414|       |    // See note above: One of the possible fixes for CQ138434 / CQ140126
 6415|       |    //
 6416|       |    // FIXME: push both code fragments down and CSE them?
 6417|       |    // push them into __kmp_cleanup() ?
 6418|       |    __kmp_acquire_bootstrap_lock(&__kmp_monitor_lock);
 6419|       |    if (TCR_4(__kmp_init_monitor)) {
 6420|       |      __kmp_reap_monitor(&__kmp_monitor);
 6421|       |      TCW_4(__kmp_init_monitor, 0);
 6422|       |    }
 6423|       |    __kmp_release_bootstrap_lock(&__kmp_monitor_lock);
 6424|       |    KA_TRACE(10, ("__kmp_internal_end: monitor reaped\n"));
 6425|       |#endif
 6426|      1|  } /* else !__kmp_global.t_active */
 6427|      1|  TCW_4(__kmp_init_gtid, FALSE);
  ------------------
  |  | 1128|      1|#define TCW_4(a, b) (a) = (b)
  ------------------
 6428|      1|  KMP_MB(); /* Flush all pending memory write invalidates.  */
 6429|       |
 6430|      1|  __kmp_cleanup();
 6431|      1|#if OMPT_SUPPORT
 6432|      1|  ompt_fini();
 6433|      1|#endif
 6434|      1|}
kmp_runtime.cpp:_ZL20__kmp_fini_allocatorv:
  554|      1|static void __kmp_fini_allocator() { __kmp_fini_memkind(); }
kmp_runtime.cpp:_ZL21__kmp_reg_status_namev:
 6701|      2|static inline char *__kmp_reg_status_name() {
 6702|       |/* On RHEL 3u5 if linked statically, getpid() returns different values in
 6703|       |   each thread. If registration and unregistration go in different threads
 6704|       |   (omp_misc_other_root_exit.cpp test case), the name of registered_lib_env
 6705|       |   env var can not be found, because the name will contain different pid. */
 6706|       |// macOS* complains about name being too long with additional getuid()
 6707|       |#if KMP_OS_UNIX && !KMP_OS_DARWIN && KMP_DYNAMIC_LIB
 6708|       |  return __kmp_str_format("__KMP_REGISTERED_LIB_%d_%d", (int)getpid(),
 6709|       |                          (int)getuid());
 6710|       |#else
 6711|      2|  return __kmp_str_format("__KMP_REGISTERED_LIB_%d", (int)getpid());
 6712|      2|#endif
 6713|      2|} // __kmp_reg_status_get
kmp_runtime.cpp:_ZL26__kmp_do_serial_initializev:
 7006|      1|static void __kmp_do_serial_initialize(void) {
 7007|      1|  int i, gtid;
 7008|      1|  size_t size;
 7009|       |
 7010|      1|  KA_TRACE(10, ("__kmp_do_serial_initialize: enter\n"));
 7011|       |
 7012|      1|  KMP_DEBUG_ASSERT(sizeof(kmp_int32) == 4);
 7013|      1|  KMP_DEBUG_ASSERT(sizeof(kmp_uint32) == 4);
 7014|      1|  KMP_DEBUG_ASSERT(sizeof(kmp_int64) == 8);
 7015|      1|  KMP_DEBUG_ASSERT(sizeof(kmp_uint64) == 8);
 7016|      1|  KMP_DEBUG_ASSERT(sizeof(kmp_intptr_t) == sizeof(void *));
 7017|       |
 7018|      1|#if OMPT_SUPPORT
 7019|      1|  ompt_pre_init();
 7020|      1|#endif
 7021|      1|#if OMPD_SUPPORT
 7022|      1|  __kmp_env_dump();
 7023|      1|  ompd_init();
 7024|      1|#endif
 7025|       |
 7026|      1|  __kmp_validate_locks();
 7027|       |
 7028|       |#if ENABLE_LIBOMPTARGET
 7029|       |  /* Initialize functions from libomptarget */
 7030|       |  __kmp_init_omptarget();
 7031|       |#endif
 7032|       |
 7033|       |  /* Initialize internal memory allocator */
 7034|      1|  __kmp_init_allocator();
 7035|       |
 7036|       |  /* Register the library startup via an environment variable or via mapped
 7037|       |     shared memory file and check to see whether another copy of the library is
 7038|       |     already registered. Since forked child process is often terminated, we
 7039|       |     postpone the registration till middle initialization in the child */
 7040|      1|  if (__kmp_need_register_serial)
  ------------------
  |  Branch (7040:7): [True: 1, False: 0]
  ------------------
 7041|      1|    __kmp_register_library_startup();
 7042|       |
 7043|       |  /* TODO reinitialization of library */
 7044|      1|  if (TCR_4(__kmp_global.g.g_done)) {
  ------------------
  |  | 1127|      1|#define TCR_4(a) (a)
  |  |  ------------------
  |  |  |  Branch (1127:18): [True: 0, False: 1]
  |  |  ------------------
  ------------------
 7045|      0|    KA_TRACE(10, ("__kmp_do_serial_initialize: reinitialization of library\n"));
 7046|      0|  }
 7047|       |
 7048|      1|  __kmp_global.g.g_abort = 0;
 7049|      1|  TCW_SYNC_4(__kmp_global.g.g_done, FALSE);
  ------------------
  |  | 1136|      1|#define TCW_SYNC_4(a, b) (a) = (b)
  ------------------
 7050|       |
 7051|       |/* initialize the locks */
 7052|      1|#if KMP_USE_ADAPTIVE_LOCKS
 7053|       |#if KMP_DEBUG_ADAPTIVE_LOCKS
 7054|       |  __kmp_init_speculative_stats();
 7055|       |#endif
 7056|      1|#endif
 7057|       |#if KMP_STATS_ENABLED
 7058|       |  __kmp_stats_init();
 7059|       |#endif
 7060|      1|  __kmp_init_lock(&__kmp_global_lock);
 7061|      1|  __kmp_init_queuing_lock(&__kmp_dispatch_lock);
 7062|      1|  __kmp_init_lock(&__kmp_debug_lock);
 7063|      1|  __kmp_init_atomic_lock(&__kmp_atomic_lock);
 7064|      1|  __kmp_init_atomic_lock(&__kmp_atomic_lock_1i);
 7065|      1|  __kmp_init_atomic_lock(&__kmp_atomic_lock_2i);
 7066|      1|  __kmp_init_atomic_lock(&__kmp_atomic_lock_4i);
 7067|      1|  __kmp_init_atomic_lock(&__kmp_atomic_lock_4r);
 7068|      1|  __kmp_init_atomic_lock(&__kmp_atomic_lock_8i);
 7069|      1|  __kmp_init_atomic_lock(&__kmp_atomic_lock_8r);
 7070|      1|  __kmp_init_atomic_lock(&__kmp_atomic_lock_8c);
 7071|      1|  __kmp_init_atomic_lock(&__kmp_atomic_lock_10r);
 7072|      1|  __kmp_init_atomic_lock(&__kmp_atomic_lock_16r);
 7073|      1|  __kmp_init_atomic_lock(&__kmp_atomic_lock_16c);
 7074|      1|  __kmp_init_atomic_lock(&__kmp_atomic_lock_20c);
 7075|      1|  __kmp_init_atomic_lock(&__kmp_atomic_lock_32c);
 7076|      1|  __kmp_init_bootstrap_lock(&__kmp_forkjoin_lock);
 7077|      1|  __kmp_init_bootstrap_lock(&__kmp_exit_lock);
 7078|       |#if KMP_USE_MONITOR
 7079|       |  __kmp_init_bootstrap_lock(&__kmp_monitor_lock);
 7080|       |#endif
 7081|      1|  __kmp_init_bootstrap_lock(&__kmp_tp_cached_lock);
 7082|       |
 7083|       |  /* conduct initialization and initial setup of configuration */
 7084|       |
 7085|      1|  __kmp_runtime_initialize();
 7086|       |
 7087|      1|#if KMP_MIC_SUPPORTED
 7088|      1|  __kmp_check_mic_type();
 7089|      1|#endif
 7090|       |
 7091|       |// Some global variable initialization moved here from kmp_env_initialize()
 7092|       |#ifdef KMP_DEBUG
 7093|       |  kmp_diag = 0;
 7094|       |#endif
 7095|      1|  __kmp_abort_delay = 0;
 7096|       |
 7097|       |  // From __kmp_init_dflt_team_nth()
 7098|       |  /* assume the entire machine will be used */
 7099|      1|  __kmp_dflt_team_nth_ub = __kmp_xproc;
 7100|      1|  if (__kmp_dflt_team_nth_ub < KMP_MIN_NTH) {
  ------------------
  |  | 1137|      1|#define KMP_MIN_NTH 1
  ------------------
  |  Branch (7100:7): [True: 0, False: 1]
  ------------------
 7101|      0|    __kmp_dflt_team_nth_ub = KMP_MIN_NTH;
  ------------------
  |  | 1137|      0|#define KMP_MIN_NTH 1
  ------------------
 7102|      0|  }
 7103|      1|  if (__kmp_dflt_team_nth_ub > __kmp_sys_max_nth) {
  ------------------
  |  Branch (7103:7): [True: 0, False: 1]
  ------------------
 7104|      0|    __kmp_dflt_team_nth_ub = __kmp_sys_max_nth;
 7105|      0|  }
 7106|      1|  __kmp_max_nth = __kmp_sys_max_nth;
 7107|      1|  __kmp_cg_max_nth = __kmp_sys_max_nth;
 7108|      1|  __kmp_teams_max_nth = __kmp_xproc; // set a "reasonable" default
 7109|      1|  if (__kmp_teams_max_nth > __kmp_sys_max_nth) {
  ------------------
  |  Branch (7109:7): [True: 0, False: 1]
  ------------------
 7110|      0|    __kmp_teams_max_nth = __kmp_sys_max_nth;
 7111|      0|  }
 7112|       |
 7113|       |  // Three vars below moved here from __kmp_env_initialize() "KMP_BLOCKTIME"
 7114|       |  // part
 7115|      1|  __kmp_dflt_blocktime = KMP_DEFAULT_BLOCKTIME;
  ------------------
  |  | 1187|      1|#define KMP_DEFAULT_BLOCKTIME (__kmp_is_hybrid_cpu() ? (0) : (200))
  |  |  ------------------
  |  |  |  Branch (1187:32): [True: 0, False: 1]
  |  |  ------------------
  ------------------
 7116|       |#if KMP_USE_MONITOR
 7117|       |  __kmp_monitor_wakeups =
 7118|       |      KMP_WAKEUPS_FROM_BLOCKTIME(__kmp_dflt_blocktime, __kmp_monitor_wakeups);
 7119|       |  __kmp_bt_intervals =
 7120|       |      KMP_INTERVALS_FROM_BLOCKTIME(__kmp_dflt_blocktime, __kmp_monitor_wakeups);
 7121|       |#endif
 7122|       |  // From "KMP_LIBRARY" part of __kmp_env_initialize()
 7123|      1|  __kmp_library = library_throughput;
 7124|       |  // From KMP_SCHEDULE initialization
 7125|      1|  __kmp_static = kmp_sch_static_balanced;
 7126|       |// AC: do not use analytical here, because it is non-monotonous
 7127|       |//__kmp_guided = kmp_sch_guided_iterative_chunked;
 7128|       |//__kmp_auto = kmp_sch_guided_analytical_chunked; // AC: it is the default, no
 7129|       |// need to repeat assignment
 7130|       |// Barrier initialization. Moved here from __kmp_env_initialize() Barrier branch
 7131|       |// bit control and barrier method control parts
 7132|      1|#if KMP_FAST_REDUCTION_BARRIER
 7133|      1|#define kmp_reduction_barrier_gather_bb ((int)1)
 7134|      1|#define kmp_reduction_barrier_release_bb ((int)1)
 7135|      1|#define kmp_reduction_barrier_gather_pat __kmp_barrier_gather_pat_dflt
 7136|      1|#define kmp_reduction_barrier_release_pat __kmp_barrier_release_pat_dflt
 7137|      1|#endif // KMP_FAST_REDUCTION_BARRIER
 7138|      4|  for (i = bs_plain_barrier; i < bs_last_barrier; i++) {
  ------------------
  |  Branch (7138:30): [True: 3, False: 1]
  ------------------
 7139|      3|    __kmp_barrier_gather_branch_bits[i] = __kmp_barrier_gather_bb_dflt;
 7140|      3|    __kmp_barrier_release_branch_bits[i] = __kmp_barrier_release_bb_dflt;
 7141|      3|    __kmp_barrier_gather_pattern[i] = __kmp_barrier_gather_pat_dflt;
 7142|      3|    __kmp_barrier_release_pattern[i] = __kmp_barrier_release_pat_dflt;
 7143|      3|#if KMP_FAST_REDUCTION_BARRIER
 7144|      3|    if (i == bs_reduction_barrier) { // tested and confirmed on ALTIX only (
  ------------------
  |  Branch (7144:9): [True: 1, False: 2]
  ------------------
 7145|       |      // lin_64 ): hyper,1
 7146|      1|      __kmp_barrier_gather_branch_bits[i] = kmp_reduction_barrier_gather_bb;
  ------------------
  |  | 7133|      1|#define kmp_reduction_barrier_gather_bb ((int)1)
  ------------------
 7147|      1|      __kmp_barrier_release_branch_bits[i] = kmp_reduction_barrier_release_bb;
  ------------------
  |  | 7134|      1|#define kmp_reduction_barrier_release_bb ((int)1)
  ------------------
 7148|      1|      __kmp_barrier_gather_pattern[i] = kmp_reduction_barrier_gather_pat;
  ------------------
  |  | 7135|      1|#define kmp_reduction_barrier_gather_pat __kmp_barrier_gather_pat_dflt
  ------------------
 7149|      1|      __kmp_barrier_release_pattern[i] = kmp_reduction_barrier_release_pat;
  ------------------
  |  | 7136|      1|#define kmp_reduction_barrier_release_pat __kmp_barrier_release_pat_dflt
  ------------------
 7150|      1|    }
 7151|      3|#endif // KMP_FAST_REDUCTION_BARRIER
 7152|      3|  }
 7153|      1|#if KMP_FAST_REDUCTION_BARRIER
 7154|      1|#undef kmp_reduction_barrier_release_pat
 7155|      1|#undef kmp_reduction_barrier_gather_pat
 7156|      1|#undef kmp_reduction_barrier_release_bb
 7157|      1|#undef kmp_reduction_barrier_gather_bb
 7158|      1|#endif // KMP_FAST_REDUCTION_BARRIER
 7159|      1|#if KMP_MIC_SUPPORTED
 7160|      1|  if (__kmp_mic_type == mic2) { // KNC
  ------------------
  |  Branch (7160:7): [True: 0, False: 1]
  ------------------
 7161|       |    // AC: plane=3,2, forkjoin=2,1 are optimal for 240 threads on KNC
 7162|      0|    __kmp_barrier_gather_branch_bits[bs_plain_barrier] = 3; // plain gather
 7163|      0|    __kmp_barrier_release_branch_bits[bs_forkjoin_barrier] =
 7164|      0|        1; // forkjoin release
 7165|      0|    __kmp_barrier_gather_pattern[bs_forkjoin_barrier] = bp_hierarchical_bar;
 7166|      0|    __kmp_barrier_release_pattern[bs_forkjoin_barrier] = bp_hierarchical_bar;
 7167|      0|  }
 7168|      1|#if KMP_FAST_REDUCTION_BARRIER
 7169|      1|  if (__kmp_mic_type == mic2) { // KNC
  ------------------
  |  Branch (7169:7): [True: 0, False: 1]
  ------------------
 7170|      0|    __kmp_barrier_gather_pattern[bs_reduction_barrier] = bp_hierarchical_bar;
 7171|      0|    __kmp_barrier_release_pattern[bs_reduction_barrier] = bp_hierarchical_bar;
 7172|      0|  }
 7173|      1|#endif // KMP_FAST_REDUCTION_BARRIER
 7174|      1|#endif // KMP_MIC_SUPPORTED
 7175|       |
 7176|       |// From KMP_CHECKS initialization
 7177|       |#ifdef KMP_DEBUG
 7178|       |  __kmp_env_checks = TRUE; /* development versions have the extra checks */
 7179|       |#else
 7180|      1|  __kmp_env_checks = FALSE; /* port versions do not have the extra checks */
  ------------------
  |  | 1279|      1|#define FALSE 0
  ------------------
 7181|      1|#endif
 7182|       |
 7183|       |  // From "KMP_FOREIGN_THREADS_THREADPRIVATE" initialization
 7184|      1|  __kmp_foreign_tp = TRUE;
  ------------------
  |  | 1280|      1|#define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  | 1279|      1|#define FALSE 0
  |  |  ------------------
  ------------------
 7185|       |
 7186|      1|  __kmp_global.g.g_dynamic = FALSE;
  ------------------
  |  | 1279|      1|#define FALSE 0
  ------------------
 7187|      1|  __kmp_global.g.g_dynamic_mode = dynamic_default;
 7188|       |
 7189|      1|  __kmp_init_nesting_mode();
 7190|       |
 7191|      1|  __kmp_env_initialize(NULL);
 7192|       |
 7193|      1|#if KMP_HAVE_MWAIT || KMP_HAVE_UMWAIT
 7194|      1|  __kmp_user_level_mwait_init();
 7195|      1|#endif
 7196|       |// Print all messages in message catalog for testing purposes.
 7197|       |#ifdef KMP_DEBUG
 7198|       |  char const *val = __kmp_env_get("KMP_DUMP_CATALOG");
 7199|       |  if (__kmp_str_match_true(val)) {
 7200|       |    kmp_str_buf_t buffer;
 7201|       |    __kmp_str_buf_init(&buffer);
 7202|       |    __kmp_i18n_dump_catalog(&buffer);
 7203|       |    __kmp_printf("%s", buffer.str);
 7204|       |    __kmp_str_buf_free(&buffer);
 7205|       |  }
 7206|       |  __kmp_env_free(&val);
 7207|       |#endif
 7208|       |
 7209|      1|  __kmp_threads_capacity =
 7210|      1|      __kmp_initial_threads_capacity(__kmp_dflt_team_nth_ub);
 7211|       |  // Moved here from __kmp_env_initialize() "KMP_ALL_THREADPRIVATE" part
 7212|      1|  __kmp_tp_capacity = __kmp_default_tp_capacity(
 7213|      1|      __kmp_dflt_team_nth_ub, __kmp_max_nth, __kmp_allThreadsSpecified);
 7214|       |
 7215|       |  // If the library is shut down properly, both pools must be NULL. Just in
 7216|       |  // case, set them to NULL -- some memory may leak, but subsequent code will
 7217|       |  // work even if pools are not freed.
 7218|      1|  KMP_DEBUG_ASSERT(__kmp_thread_pool == NULL);
 7219|      1|  KMP_DEBUG_ASSERT(__kmp_thread_pool_insert_pt == NULL);
 7220|      1|  KMP_DEBUG_ASSERT(__kmp_team_pool == NULL);
 7221|      1|  __kmp_thread_pool = NULL;
 7222|      1|  __kmp_thread_pool_insert_pt = NULL;
 7223|      1|  __kmp_team_pool = NULL;
 7224|       |
 7225|       |  /* Allocate all of the variable sized records */
 7226|       |  /* NOTE: __kmp_threads_capacity entries are allocated, but the arrays are
 7227|       |   * expandable */
 7228|       |  /* Since allocation is cache-aligned, just add extra padding at the end */
 7229|      1|  size =
 7230|      1|      (sizeof(kmp_info_t *) + sizeof(kmp_root_t *)) * __kmp_threads_capacity +
 7231|      1|      CACHE_LINE;
  ------------------
  |  |  108|      1|# define CACHE_LINE 64
  ------------------
 7232|      1|  __kmp_threads = (kmp_info_t **)__kmp_allocate(size);
  ------------------
  |  | 3617|      1|#define __kmp_allocate(size) ___kmp_allocate((size)KMP_SRC_LOC_CURR)
  ------------------
 7233|      1|  __kmp_root = (kmp_root_t **)((char *)__kmp_threads +
 7234|      1|                               sizeof(kmp_info_t *) * __kmp_threads_capacity);
 7235|       |
 7236|       |  /* init thread counts */
 7237|      1|  KMP_DEBUG_ASSERT(__kmp_all_nth ==
 7238|      1|                   0); // Asserts fail if the library is reinitializing and
 7239|      1|  KMP_DEBUG_ASSERT(__kmp_nth == 0); // something was wrong in termination.
 7240|      1|  __kmp_all_nth = 0;
 7241|      1|  __kmp_nth = 0;
 7242|       |
 7243|       |  /* setup the uber master thread and hierarchy */
 7244|      1|  gtid = __kmp_register_root(TRUE);
  ------------------
  |  | 1280|      1|#define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  | 1279|      1|#define FALSE 0
  |  |  ------------------
  ------------------
 7245|      1|  KA_TRACE(10, ("__kmp_do_serial_initialize  T#%d\n", gtid));
 7246|      1|  KMP_ASSERT(KMP_UBER_GTID(gtid));
  ------------------
  |  |   50|      1|  if (!(cond)) {                                                               \
  |  |  ------------------
  |  |  |  Branch (50:7): [True: 0, False: 1]
  |  |  ------------------
  |  |   51|      0|    __kmp_debug_assert("assertion failure", __FILE__, __LINE__);               \
  |  |   52|      0|  }
  ------------------
 7247|      1|  KMP_ASSERT(KMP_INITIAL_GTID(gtid));
  ------------------
  |  |   50|      1|  if (!(cond)) {                                                               \
  |  |  ------------------
  |  |  |  Branch (50:7): [True: 0, False: 1]
  |  |  ------------------
  |  |   51|      0|    __kmp_debug_assert("assertion failure", __FILE__, __LINE__);               \
  |  |   52|      0|  }
  ------------------
 7248|       |
 7249|      1|  KMP_MB(); /* Flush all pending memory write invalidates.  */
 7250|       |
 7251|      1|  __kmp_common_initialize();
 7252|       |
 7253|      1|#if KMP_OS_UNIX
 7254|       |  /* invoke the child fork handler */
 7255|      1|  __kmp_register_atfork();
 7256|      1|#endif
 7257|       |
 7258|      1|#if !KMP_DYNAMIC_LIB ||                                                        \
 7259|      1|    ((KMP_COMPILER_ICC || KMP_COMPILER_ICX) && KMP_OS_DARWIN)
 7260|      1|  {
 7261|       |    /* Invoke the exit handler when the program finishes, only for static
 7262|       |       library and macOS* dynamic. For other dynamic libraries, we already
 7263|       |       have _fini and DllMain. */
 7264|      1|    int rc = atexit(__kmp_internal_end_atexit);
 7265|      1|    if (rc != 0) {
  ------------------
  |  Branch (7265:9): [True: 0, False: 1]
  ------------------
 7266|      0|      __kmp_fatal(KMP_MSG(FunctionError, "atexit()"), KMP_ERR(rc),
  ------------------
  |  |  121|      0|#define KMP_MSG(...) __kmp_msg_format(kmp_i18n_msg_##__VA_ARGS__)
  ------------------
                    __kmp_fatal(KMP_MSG(FunctionError, "atexit()"), KMP_ERR(rc),
  ------------------
  |  |  125|      0|#define KMP_ERR KMP_SYSERRCODE
  |  |  ------------------
  |  |  |  |  123|      0|#define KMP_SYSERRCODE(code) __kmp_msg_error_code(code)
  |  |  ------------------
  ------------------
 7267|      0|                  __kmp_msg_null);
 7268|      0|    }
 7269|      1|  }
 7270|      1|#endif
 7271|       |
 7272|      1|#if KMP_HANDLE_SIGNALS
 7273|      1|#if KMP_OS_UNIX
 7274|       |  /* NOTE: make sure that this is called before the user installs their own
 7275|       |     signal handlers so that the user handlers are called first. this way they
 7276|       |     can return false, not call our handler, avoid terminating the library, and
 7277|       |     continue execution where they left off. */
 7278|      1|  __kmp_install_signals(FALSE);
  ------------------
  |  | 1279|      1|#define FALSE 0
  ------------------
 7279|      1|#endif /* KMP_OS_UNIX */
 7280|       |#if KMP_OS_WINDOWS
 7281|       |  __kmp_install_signals(TRUE);
 7282|       |#endif /* KMP_OS_WINDOWS */
 7283|      1|#endif
 7284|       |
 7285|       |  /* we have finished the serial initialization */
 7286|      1|  __kmp_init_counter++;
 7287|       |
 7288|      1|  __kmp_init_serial = TRUE;
  ------------------
  |  | 1280|      1|#define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  | 1279|      1|#define FALSE 0
  |  |  ------------------
  ------------------
 7289|       |
 7290|      1|  if (__kmp_version) {
  ------------------
  |  Branch (7290:7): [True: 0, False: 1]
  ------------------
 7291|      0|    __kmp_print_version_1();
 7292|      0|  }
 7293|       |
 7294|      1|  if (__kmp_settings) {
  ------------------
  |  Branch (7294:7): [True: 0, False: 1]
  ------------------
 7295|      0|    __kmp_env_print();
 7296|      0|  }
 7297|       |
 7298|      1|  if (__kmp_display_env || __kmp_display_env_verbose) {
  ------------------
  |  Branch (7298:7): [True: 0, False: 1]
  |  Branch (7298:28): [True: 0, False: 1]
  ------------------
 7299|      0|    __kmp_env_print_2();
 7300|      0|  }
 7301|       |
 7302|      1|#if OMPT_SUPPORT
 7303|      1|  ompt_post_init();
 7304|      1|#endif
 7305|       |
 7306|      1|  KMP_MB();
 7307|       |
 7308|      1|  KA_TRACE(10, ("__kmp_do_serial_initialize: exit\n"));
 7309|      1|}
kmp_runtime.cpp:_ZL20__kmp_init_allocatorv:
  550|      1|static void __kmp_init_allocator() {
  551|      1|  __kmp_init_memkind();
  552|      1|  __kmp_init_target_mem();
  553|      1|}
kmp_runtime.cpp:_ZL20__kmp_check_mic_typev:
 6946|      1|static void __kmp_check_mic_type() {
 6947|      1|  kmp_cpuid_t cpuid_state = {0};
 6948|      1|  kmp_cpuid_t *cs_p = &cpuid_state;
 6949|      1|  __kmp_x86_cpuid(1, 0, cs_p);
 6950|       |  // We don't support mic1 at the moment
 6951|      1|  if ((cs_p->eax & 0xff0) == 0xB10) {
  ------------------
  |  Branch (6951:7): [True: 0, False: 1]
  ------------------
 6952|      0|    __kmp_mic_type = mic2;
 6953|      1|  } else if ((cs_p->eax & 0xf0ff0) == 0x50670) {
  ------------------
  |  Branch (6953:14): [True: 0, False: 1]
  ------------------
 6954|      0|    __kmp_mic_type = mic3;
 6955|      1|  } else {
 6956|      1|    __kmp_mic_type = non_mic;
 6957|      1|  }
 6958|      1|}
kmp_runtime.cpp:_ZL27__kmp_user_level_mwait_initv:
 6963|      1|static void __kmp_user_level_mwait_init() {
 6964|      1|  struct kmp_cpuid buf;
 6965|      1|  __kmp_x86_cpuid(7, 0, &buf);
 6966|      1|  __kmp_waitpkg_enabled = ((buf.ecx >> 5) & 1);
 6967|      1|  __kmp_umwait_enabled = __kmp_waitpkg_enabled && __kmp_user_level_mwait;
  ------------------
  |  Branch (6967:26): [True: 0, False: 1]
  |  Branch (6967:51): [True: 0, False: 0]
  ------------------
 6968|      1|  __kmp_tpause_enabled = __kmp_waitpkg_enabled && (__kmp_tpause_state > 0);
  ------------------
  |  Branch (6968:26): [True: 0, False: 1]
  |  Branch (6968:51): [True: 0, False: 0]
  ------------------
 6969|      1|  KF_TRACE(30, ("__kmp_user_level_mwait_init: __kmp_umwait_enabled = %d\n",
 6970|      1|                __kmp_umwait_enabled));
 6971|      1|}
kmp_runtime.cpp:_ZL26__kmp_do_middle_initializev:
 7324|      1|static void __kmp_do_middle_initialize(void) {
 7325|      1|  int i, j;
 7326|      1|  int prev_dflt_team_nth;
 7327|       |
 7328|      1|  if (!__kmp_init_serial) {
  ------------------
  |  Branch (7328:7): [True: 0, False: 1]
  ------------------
 7329|      0|    __kmp_do_serial_initialize();
 7330|      0|  }
 7331|       |
 7332|      1|  KA_TRACE(10, ("__kmp_middle_initialize: enter\n"));
 7333|       |
 7334|      1|  if (UNLIKELY(!__kmp_need_register_serial)) {
  ------------------
  |  |  119|      1|#define UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (119:21): [True: 0, False: 1]
  |  |  ------------------
  ------------------
 7335|       |    // We are in a forked child process. The registration was skipped during
 7336|       |    // serial initialization in __kmp_atfork_child handler. Do it here.
 7337|      0|    __kmp_register_library_startup();
 7338|      0|  }
 7339|       |
 7340|       |  // Save the previous value for the __kmp_dflt_team_nth so that
 7341|       |  // we can avoid some reinitialization if it hasn't changed.
 7342|      1|  prev_dflt_team_nth = __kmp_dflt_team_nth;
 7343|       |
 7344|      1|#if KMP_AFFINITY_SUPPORTED
 7345|       |  // __kmp_affinity_initialize() will try to set __kmp_ncores to the
 7346|       |  // number of cores on the machine.
 7347|      1|  __kmp_affinity_initialize(__kmp_affinity);
 7348|       |
 7349|      1|#endif /* KMP_AFFINITY_SUPPORTED */
 7350|       |
 7351|      1|  KMP_ASSERT(__kmp_xproc > 0);
  ------------------
  |  |   50|      1|  if (!(cond)) {                                                               \
  |  |  ------------------
  |  |  |  Branch (50:7): [True: 0, False: 1]
  |  |  ------------------
  |  |   51|      0|    __kmp_debug_assert("assertion failure", __FILE__, __LINE__);               \
  |  |   52|      0|  }
  ------------------
 7352|      1|  if (__kmp_avail_proc == 0) {
  ------------------
  |  Branch (7352:7): [True: 0, False: 1]
  ------------------
 7353|      0|    __kmp_avail_proc = __kmp_xproc;
 7354|      0|  }
 7355|       |
 7356|       |  // If there were empty places in num_threads list (OMP_NUM_THREADS=,,2,3),
 7357|       |  // correct them now
 7358|      1|  j = 0;
 7359|      1|  while ((j < __kmp_nested_nth.used) && !__kmp_nested_nth.nth[j]) {
  ------------------
  |  Branch (7359:10): [True: 0, False: 1]
  |  Branch (7359:41): [True: 0, False: 0]
  ------------------
 7360|      0|    __kmp_nested_nth.nth[j] = __kmp_dflt_team_nth = __kmp_dflt_team_nth_ub =
 7361|      0|        __kmp_avail_proc;
 7362|      0|    j++;
 7363|      0|  }
 7364|       |
 7365|      1|  if (__kmp_dflt_team_nth == 0) {
  ------------------
  |  Branch (7365:7): [True: 1, False: 0]
  ------------------
 7366|       |#ifdef KMP_DFLT_NTH_CORES
 7367|       |    // Default #threads = #cores
 7368|       |    __kmp_dflt_team_nth = __kmp_ncores;
 7369|       |    KA_TRACE(20, ("__kmp_middle_initialize: setting __kmp_dflt_team_nth = "
 7370|       |                  "__kmp_ncores (%d)\n",
 7371|       |                  __kmp_dflt_team_nth));
 7372|       |#else
 7373|       |    // Default #threads = #available OS procs
 7374|      1|    __kmp_dflt_team_nth = __kmp_avail_proc;
 7375|      1|    KA_TRACE(20, ("__kmp_middle_initialize: setting __kmp_dflt_team_nth = "
 7376|      1|                  "__kmp_avail_proc(%d)\n",
 7377|      1|                  __kmp_dflt_team_nth));
 7378|      1|#endif /* KMP_DFLT_NTH_CORES */
 7379|      1|  }
 7380|       |
 7381|      1|  if (__kmp_dflt_team_nth < KMP_MIN_NTH) {
  ------------------
  |  | 1137|      1|#define KMP_MIN_NTH 1
  ------------------
  |  Branch (7381:7): [True: 0, False: 1]
  ------------------
 7382|      0|    __kmp_dflt_team_nth = KMP_MIN_NTH;
  ------------------
  |  | 1137|      0|#define KMP_MIN_NTH 1
  ------------------
 7383|      0|  }
 7384|      1|  if (__kmp_dflt_team_nth > __kmp_sys_max_nth) {
  ------------------
  |  Branch (7384:7): [True: 0, False: 1]
  ------------------
 7385|      0|    __kmp_dflt_team_nth = __kmp_sys_max_nth;
 7386|      0|  }
 7387|       |
 7388|      1|  if (__kmp_nesting_mode > 0)
  ------------------
  |  Branch (7388:7): [True: 0, False: 1]
  ------------------
 7389|      0|    __kmp_set_nesting_mode_threads();
 7390|       |
 7391|       |  // There's no harm in continuing if the following check fails,
 7392|       |  // but it indicates an error in the previous logic.
 7393|      1|  KMP_DEBUG_ASSERT(__kmp_dflt_team_nth <= __kmp_dflt_team_nth_ub);
 7394|       |
 7395|      1|  if (__kmp_dflt_team_nth != prev_dflt_team_nth) {
  ------------------
  |  Branch (7395:7): [True: 1, False: 0]
  ------------------
 7396|       |    // Run through the __kmp_threads array and set the num threads icv for each
 7397|       |    // root thread that is currently registered with the RTL (which has not
 7398|       |    // already explicitly set its nthreads-var with a call to
 7399|       |    // omp_set_num_threads()).
 7400|    137|    for (i = 0; i < __kmp_threads_capacity; i++) {
  ------------------
  |  Branch (7400:17): [True: 136, False: 1]
  ------------------
 7401|    136|      kmp_info_t *thread = __kmp_threads[i];
 7402|    136|      if (thread == NULL)
  ------------------
  |  Branch (7402:11): [True: 135, False: 1]
  ------------------
 7403|    135|        continue;
 7404|      1|      if (thread->th.th_current_task->td_icvs.nproc != 0)
  ------------------
  |  Branch (7404:11): [True: 0, False: 1]
  ------------------
 7405|      0|        continue;
 7406|       |
 7407|      1|      set__nproc(__kmp_threads[i], __kmp_dflt_team_nth);
  ------------------
  |  | 2321|      1|  (((xthread)->th.th_current_task->td_icvs.nproc) = (xval))
  ------------------
 7408|      1|    }
 7409|      1|  }
 7410|      1|  KA_TRACE(
 7411|      1|      20,
 7412|      1|      ("__kmp_middle_initialize: final value for __kmp_dflt_team_nth = %d\n",
 7413|      1|       __kmp_dflt_team_nth));
 7414|       |
 7415|      1|#ifdef KMP_ADJUST_BLOCKTIME
 7416|       |  /* Adjust blocktime to zero if necessary  now that __kmp_avail_proc is set */
 7417|      1|  if (!__kmp_env_blocktime && (__kmp_avail_proc > 0)) {
  ------------------
  |  Branch (7417:7): [True: 1, False: 0]
  |  Branch (7417:31): [True: 1, False: 0]
  ------------------
 7418|      1|    KMP_DEBUG_ASSERT(__kmp_avail_proc > 0);
 7419|      1|    if (__kmp_nth > __kmp_avail_proc) {
  ------------------
  |  Branch (7419:9): [True: 0, False: 1]
  ------------------
 7420|      0|      __kmp_zero_bt = TRUE;
  ------------------
  |  | 1280|      0|#define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  | 1279|      0|#define FALSE 0
  |  |  ------------------
  ------------------
 7421|      0|    }
 7422|      1|  }
 7423|      1|#endif /* KMP_ADJUST_BLOCKTIME */
 7424|       |
 7425|       |  /* we have finished middle initialization */
 7426|      1|  TCW_SYNC_4(__kmp_init_middle, TRUE);
  ------------------
  |  | 1136|      1|#define TCW_SYNC_4(a, b) (a) = (b)
  ------------------
 7427|       |
 7428|      1|  KA_TRACE(10, ("__kmp_do_middle_initialize: exit\n"));
 7429|      1|}

__kmpc_for_static_init_4:
  875|  8.87k|                              kmp_int32 incr, kmp_int32 chunk) {
  876|  8.87k|  __kmp_for_static_init<kmp_int32>(loc, gtid, schedtype, plastiter, plower,
  877|  8.87k|                                   pupper, pstride, incr, chunk
  878|  8.87k|#if OMPT_SUPPORT && OMPT_OPTIONAL
  879|  8.87k|                                   ,
  880|  8.87k|                                   OMPT_GET_RETURN_ADDRESS(0)
  ------------------
  |  |  108|  8.87k|#define OMPT_GET_RETURN_ADDRESS(level) __builtin_return_address(level)
  ------------------
  881|  8.87k|#endif
  882|  8.87k|  );
  883|  8.87k|}
__kmpc_for_static_init_8:
  908|  36.2k|                              kmp_int64 incr, kmp_int64 chunk) {
  909|  36.2k|  __kmp_for_static_init<kmp_int64>(loc, gtid, schedtype, plastiter, plower,
  910|  36.2k|                                   pupper, pstride, incr, chunk
  911|  36.2k|#if OMPT_SUPPORT && OMPT_OPTIONAL
  912|  36.2k|                                   ,
  913|  36.2k|                                   OMPT_GET_RETURN_ADDRESS(0)
  ------------------
  |  |  108|  36.2k|#define OMPT_GET_RETURN_ADDRESS(level) __builtin_return_address(level)
  ------------------
  914|  36.2k|#endif
  915|  36.2k|  );
  916|  36.2k|}
kmp_sched.cpp:_ZL21__kmp_for_static_initIiEvP5identiiPiPT_S4_PN8traits_tIS3_E8signed_tES7_S7_Pv:
   83|  8.87k|) {
   84|  8.87k|  KMP_COUNT_BLOCK(OMP_LOOP_STATIC);
  ------------------
  |  | 1001|  8.87k|#define KMP_COUNT_BLOCK(n) ((void)0)
  ------------------
   85|  8.87k|  KMP_PUSH_PARTITIONED_TIMER(OMP_loop_static);
  ------------------
  |  | 1014|  8.87k|#define KMP_PUSH_PARTITIONED_TIMER(name) ((void)0)
  ------------------
   86|  8.87k|  KMP_PUSH_PARTITIONED_TIMER(OMP_loop_static_scheduling);
  ------------------
  |  | 1014|  8.87k|#define KMP_PUSH_PARTITIONED_TIMER(name) ((void)0)
  ------------------
   87|       |
   88|       |  // Clear monotonic/nonmonotonic bits (ignore it)
   89|  8.87k|  schedtype = SCHEDULE_WITHOUT_MODIFIERS(schedtype);
  ------------------
  |  |  451|  8.87k|  (enum sched_type)(                                                           \
  |  |  452|  8.87k|      (s) & ~(kmp_sch_modifier_nonmonotonic | kmp_sch_modifier_monotonic))
  ------------------
   90|       |
   91|  8.87k|  typedef typename traits_t<T>::unsigned_t UT;
   92|  8.87k|  typedef typename traits_t<T>::signed_t ST;
   93|       |  /*  this all has to be changed back to TID and such.. */
   94|  8.87k|  kmp_int32 gtid = global_tid;
   95|  8.87k|  kmp_uint32 tid;
   96|  8.87k|  kmp_uint32 nth;
   97|  8.87k|  UT trip_count;
   98|  8.87k|  kmp_team_t *team;
   99|  8.87k|  __kmp_assert_valid_gtid(gtid);
  100|  8.87k|  kmp_info_t *th = __kmp_threads[gtid];
  101|       |
  102|  8.87k|#if OMPT_SUPPORT && OMPT_OPTIONAL
  103|  8.87k|  ompt_team_info_t *team_info = NULL;
  104|  8.87k|  ompt_task_info_t *task_info = NULL;
  105|  8.87k|  ompt_work_t ompt_work_type = ompt_work_loop;
  106|       |
  107|  8.87k|  static kmp_int8 warn = 0;
  108|       |
  109|  8.87k|  if (ompt_enabled.ompt_callback_work || ompt_enabled.ompt_callback_dispatch) {
  ------------------
  |  Branch (109:7): [True: 5, False: 8.87k]
  |  Branch (109:42): [True: 6, False: 8.86k]
  ------------------
  110|       |    // Only fully initialize variables needed by OMPT if OMPT is enabled.
  111|      0|    team_info = __ompt_get_teaminfo(0, NULL);
  112|      0|    task_info = __ompt_get_task_info_object(0);
  113|       |    // Determine workshare type
  114|      0|    if (loc != NULL) {
  ------------------
  |  Branch (114:9): [True: 0, False: 0]
  ------------------
  115|      0|      if ((loc->flags & KMP_IDENT_WORK_LOOP) != 0) {
  ------------------
  |  Branch (115:11): [True: 0, False: 0]
  ------------------
  116|      0|        ompt_work_type = ompt_work_loop;
  117|      0|      } else if ((loc->flags & KMP_IDENT_WORK_SECTIONS) != 0) {
  ------------------
  |  Branch (117:18): [True: 0, False: 0]
  ------------------
  118|      0|        ompt_work_type = ompt_work_sections;
  119|      0|      } else if ((loc->flags & KMP_IDENT_WORK_DISTRIBUTE) != 0) {
  ------------------
  |  Branch (119:18): [True: 0, False: 0]
  ------------------
  120|      0|        ompt_work_type = ompt_work_distribute;
  121|      0|      } else {
  122|      0|        kmp_int8 bool_res =
  123|      0|            KMP_COMPARE_AND_STORE_ACQ8(&warn, (kmp_int8)0, (kmp_int8)1);
  ------------------
  |  |  795|      0|  __sync_bool_compare_and_swap((volatile kmp_uint8 *)(p), (kmp_uint8)(cv),     \
  |  |  796|      0|                               (kmp_uint8)(sv))
  ------------------
  124|      0|        if (bool_res)
  ------------------
  |  Branch (124:13): [True: 0, False: 0]
  ------------------
  125|      0|          KMP_WARNING(OmptOutdatedWorkshare);
  ------------------
  |  |  145|      0|  __kmp_msg(kmp_ms_warning, KMP_MSG(__VA_ARGS__), __kmp_msg_null)
  |  |  ------------------
  |  |  |  |  121|      0|#define KMP_MSG(...) __kmp_msg_format(kmp_i18n_msg_##__VA_ARGS__)
  |  |  ------------------
  ------------------
  126|      0|      }
  127|      0|      KMP_DEBUG_ASSERT(ompt_work_type);
  128|      0|    }
  129|      0|  }
  130|  8.87k|#endif
  131|       |
  132|  8.87k|  KMP_DEBUG_ASSERT(plastiter && plower && pupper && pstride);
  133|  8.87k|  KE_TRACE(10, ("__kmpc_for_static_init called (%d)\n", global_tid));
  134|       |#ifdef KMP_DEBUG
  135|       |  {
  136|       |    char *buff;
  137|       |    // create format specifiers before the debug output
  138|       |    buff = __kmp_str_format(
  139|       |        "__kmpc_for_static_init: T#%%d sched=%%d liter=%%d iter=(%%%s,"
  140|       |        " %%%s, %%%s) incr=%%%s chunk=%%%s signed?<%s>\n",
  141|       |        traits_t<T>::spec, traits_t<T>::spec, traits_t<ST>::spec,
  142|       |        traits_t<ST>::spec, traits_t<ST>::spec, traits_t<T>::spec);
  143|       |    KD_TRACE(100, (buff, global_tid, schedtype, *plastiter, *plower, *pupper,
  144|       |                   *pstride, incr, chunk));
  145|       |    __kmp_str_free(&buff);
  146|       |  }
  147|       |#endif
  148|       |
  149|  8.87k|  if (__kmp_env_consistency_check) {
  ------------------
  |  Branch (149:7): [True: 0, False: 8.87k]
  ------------------
  150|      0|    __kmp_push_workshare(global_tid, ct_pdo, loc);
  151|      0|    if (incr == 0) {
  ------------------
  |  Branch (151:9): [True: 0, False: 0]
  ------------------
  152|      0|      __kmp_error_construct(kmp_i18n_msg_CnsLoopIncrZeroProhibited, ct_pdo,
  153|      0|                            loc);
  154|      0|    }
  155|      0|  }
  156|       |  /* special handling for zero-trip loops */
  157|  18.4E|  if (incr > 0 ? (*pupper < *plower) : (*plower < *pupper)) {
  ------------------
  |  Branch (157:7): [True: 8.89k, False: 18.4E]
  |  Branch (157:7): [True: 0, False: 8.87k]
  ------------------
  158|      0|    if (plastiter != NULL)
  ------------------
  |  Branch (158:9): [True: 0, False: 0]
  ------------------
  159|      0|      *plastiter = FALSE;
  ------------------
  |  | 1279|      0|#define FALSE 0
  ------------------
  160|       |    /* leave pupper and plower set to entire iteration space */
  161|      0|    *pstride = incr; /* value should never be used */
  162|       |// *plower = *pupper - incr;
  163|       |// let compiler bypass the illegal loop (like for(i=1;i<10;i--))
  164|       |// THE LINE COMMENTED ABOVE CAUSED shape2F/h_tests_1.f TO HAVE A FAILURE
  165|       |// ON A ZERO-TRIP LOOP (lower=1, upper=0,stride=1) - JPH June 23, 2009.
  166|       |#ifdef KMP_DEBUG
  167|       |    {
  168|       |      char *buff;
  169|       |      // create format specifiers before the debug output
  170|       |      buff = __kmp_str_format("__kmpc_for_static_init:(ZERO TRIP) liter=%%d "
  171|       |                              "lower=%%%s upper=%%%s stride = %%%s "
  172|       |                              "signed?<%s>, loc = %%s\n",
  173|       |                              traits_t<T>::spec, traits_t<T>::spec,
  174|       |                              traits_t<ST>::spec, traits_t<T>::spec);
  175|       |      check_loc(loc);
  176|       |      KD_TRACE(100,
  177|       |               (buff, *plastiter, *plower, *pupper, *pstride, loc->psource));
  178|       |      __kmp_str_free(&buff);
  179|       |    }
  180|       |#endif
  181|      0|    KE_TRACE(10, ("__kmpc_for_static_init: T#%d return\n", global_tid));
  182|       |
  183|      0|#if OMPT_SUPPORT && OMPT_OPTIONAL
  184|      0|    if (ompt_enabled.ompt_callback_work) {
  ------------------
  |  Branch (184:9): [True: 0, False: 0]
  ------------------
  185|      0|      ompt_callbacks.ompt_callback(ompt_callback_work)(
  ------------------
  |  |   27|      0|#define ompt_callback(e) e##_callback
  ------------------
  186|      0|          ompt_work_type, ompt_scope_begin, &(team_info->parallel_data),
  187|      0|          &(task_info->task_data), 0, codeptr);
  188|      0|    }
  189|      0|#endif
  190|      0|    KMP_STATS_LOOP_END(OMP_loop_static_iterations);
  191|      0|    return;
  192|      0|  }
  193|       |
  194|       |  // Although there are schedule enumerations above kmp_ord_upper which are not
  195|       |  // schedules for "distribute", the only ones which are useful are dynamic, so
  196|       |  // cannot be seen here, since this codepath is only executed for static
  197|       |  // schedules.
  198|  8.87k|  if (schedtype > kmp_ord_upper) {
  ------------------
  |  Branch (198:7): [True: 0, False: 8.87k]
  ------------------
  199|       |    // we are in DISTRIBUTE construct
  200|      0|    schedtype += kmp_sch_static -
  201|      0|                 kmp_distribute_static; // AC: convert to usual schedule type
  202|      0|    if (th->th.th_team->t.t_serialized > 1) {
  ------------------
  |  Branch (202:9): [True: 0, False: 0]
  ------------------
  203|      0|      tid = 0;
  204|      0|      team = th->th.th_team;
  205|      0|    } else {
  206|      0|      tid = th->th.th_team->t.t_master_tid;
  207|      0|      team = th->th.th_team->t.t_parent;
  208|      0|    }
  209|  8.87k|  } else {
  210|  8.87k|    tid = __kmp_tid_from_gtid(global_tid);
  211|  8.87k|    team = th->th.th_team;
  212|  8.87k|  }
  213|       |
  214|       |  /* determine if "for" loop is an active worksharing construct */
  215|  8.87k|  if (team->t.t_serialized) {
  ------------------
  |  Branch (215:7): [True: 0, False: 8.87k]
  ------------------
  216|       |    /* serialized parallel, each thread executes whole iteration space */
  217|      0|    if (plastiter != NULL)
  ------------------
  |  Branch (217:9): [True: 0, False: 0]
  ------------------
  218|      0|      *plastiter = TRUE;
  ------------------
  |  | 1280|      0|#define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  | 1279|      0|#define FALSE 0
  |  |  ------------------
  ------------------
  219|       |    /* leave pupper and plower set to entire iteration space */
  220|      0|    *pstride =
  221|      0|        (incr > 0) ? (*pupper - *plower + 1) : (-(*plower - *pupper + 1));
  ------------------
  |  Branch (221:9): [True: 0, False: 0]
  ------------------
  222|       |
  223|       |#ifdef KMP_DEBUG
  224|       |    {
  225|       |      char *buff;
  226|       |      // create format specifiers before the debug output
  227|       |      buff = __kmp_str_format("__kmpc_for_static_init: (serial) liter=%%d "
  228|       |                              "lower=%%%s upper=%%%s stride = %%%s\n",
  229|       |                              traits_t<T>::spec, traits_t<T>::spec,
  230|       |                              traits_t<ST>::spec);
  231|       |      KD_TRACE(100, (buff, *plastiter, *plower, *pupper, *pstride));
  232|       |      __kmp_str_free(&buff);
  233|       |    }
  234|       |#endif
  235|      0|    KE_TRACE(10, ("__kmpc_for_static_init: T#%d return\n", global_tid));
  236|       |
  237|      0|#if OMPT_SUPPORT && OMPT_OPTIONAL
  238|      0|    if (ompt_enabled.ompt_callback_work) {
  ------------------
  |  Branch (238:9): [True: 0, False: 0]
  ------------------
  239|      0|      ompt_callbacks.ompt_callback(ompt_callback_work)(
  ------------------
  |  |   27|      0|#define ompt_callback(e) e##_callback
  ------------------
  240|      0|          ompt_work_type, ompt_scope_begin, &(team_info->parallel_data),
  241|      0|          &(task_info->task_data), *pstride, codeptr);
  242|      0|    }
  243|      0|#endif
  244|      0|    KMP_STATS_LOOP_END(OMP_loop_static_iterations);
  245|      0|    return;
  246|      0|  }
  247|  8.87k|  nth = team->t.t_nproc;
  248|  8.87k|  if (nth == 1) {
  ------------------
  |  Branch (248:7): [True: 0, False: 8.87k]
  ------------------
  249|      0|    if (plastiter != NULL)
  ------------------
  |  Branch (249:9): [True: 0, False: 0]
  ------------------
  250|      0|      *plastiter = TRUE;
  ------------------
  |  | 1280|      0|#define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  | 1279|      0|#define FALSE 0
  |  |  ------------------
  ------------------
  251|      0|    *pstride =
  252|      0|        (incr > 0) ? (*pupper - *plower + 1) : (-(*plower - *pupper + 1));
  ------------------
  |  Branch (252:9): [True: 0, False: 0]
  ------------------
  253|       |#ifdef KMP_DEBUG
  254|       |    {
  255|       |      char *buff;
  256|       |      // create format specifiers before the debug output
  257|       |      buff = __kmp_str_format("__kmpc_for_static_init: (serial) liter=%%d "
  258|       |                              "lower=%%%s upper=%%%s stride = %%%s\n",
  259|       |                              traits_t<T>::spec, traits_t<T>::spec,
  260|       |                              traits_t<ST>::spec);
  261|       |      KD_TRACE(100, (buff, *plastiter, *plower, *pupper, *pstride));
  262|       |      __kmp_str_free(&buff);
  263|       |    }
  264|       |#endif
  265|      0|    KE_TRACE(10, ("__kmpc_for_static_init: T#%d return\n", global_tid));
  266|       |
  267|      0|#if OMPT_SUPPORT && OMPT_OPTIONAL
  268|      0|    if (ompt_enabled.ompt_callback_work) {
  ------------------
  |  Branch (268:9): [True: 0, False: 0]
  ------------------
  269|      0|      ompt_callbacks.ompt_callback(ompt_callback_work)(
  ------------------
  |  |   27|      0|#define ompt_callback(e) e##_callback
  ------------------
  270|      0|          ompt_work_type, ompt_scope_begin, &(team_info->parallel_data),
  271|      0|          &(task_info->task_data), *pstride, codeptr);
  272|      0|    }
  273|      0|#endif
  274|      0|    KMP_STATS_LOOP_END(OMP_loop_static_iterations);
  275|      0|    return;
  276|      0|  }
  277|       |
  278|       |  /* compute trip count */
  279|  8.92k|  if (incr == 1) {
  ------------------
  |  Branch (279:7): [True: 8.92k, False: 18.4E]
  ------------------
  280|  8.92k|    trip_count = *pupper - *plower + 1;
  281|  18.4E|  } else if (incr == -1) {
  ------------------
  |  Branch (281:14): [True: 0, False: 18.4E]
  ------------------
  282|      0|    trip_count = *plower - *pupper + 1;
  283|  18.4E|  } else if (incr > 0) {
  ------------------
  |  Branch (283:14): [True: 0, False: 18.4E]
  ------------------
  284|       |    // upper-lower can exceed the limit of signed type
  285|      0|    trip_count = (UT)(*pupper - *plower) / incr + 1;
  286|  18.4E|  } else {
  287|  18.4E|    trip_count = (UT)(*plower - *pupper) / (-incr) + 1;
  288|  18.4E|  }
  289|       |
  290|       |#if KMP_STATS_ENABLED
  291|       |  if (KMP_MASTER_GTID(gtid)) {
  292|       |    KMP_COUNT_VALUE(OMP_loop_static_total_iterations, trip_count);
  293|       |  }
  294|       |#endif
  295|       |
  296|  8.87k|  if (__kmp_env_consistency_check) {
  ------------------
  |  Branch (296:7): [True: 0, False: 8.87k]
  ------------------
  297|       |    /* tripcount overflow? */
  298|      0|    if (trip_count == 0 && *pupper != *plower) {
  ------------------
  |  Branch (298:9): [True: 0, False: 0]
  |  Branch (298:28): [True: 0, False: 0]
  ------------------
  299|      0|      __kmp_error_construct(kmp_i18n_msg_CnsIterationRangeTooLarge, ct_pdo,
  300|      0|                            loc);
  301|      0|    }
  302|      0|  }
  303|       |
  304|       |  /* compute remaining parameters */
  305|  8.87k|  switch (schedtype) {
  306|  8.93k|  case kmp_sch_static: {
  ------------------
  |  Branch (306:3): [True: 8.93k, False: 18.4E]
  ------------------
  307|  8.93k|    if (trip_count < nth) {
  ------------------
  |  Branch (307:9): [True: 4.48k, False: 4.44k]
  ------------------
  308|  4.48k|      KMP_DEBUG_ASSERT(
  309|  4.48k|          __kmp_static == kmp_sch_static_greedy ||
  310|  4.48k|          __kmp_static ==
  311|  4.48k|              kmp_sch_static_balanced); // Unknown static scheduling type.
  312|  4.48k|      if (tid < trip_count) {
  ------------------
  |  Branch (312:11): [True: 916, False: 3.57k]
  ------------------
  313|    916|        *pupper = *plower = *plower + tid * incr;
  314|  3.57k|      } else {
  315|       |        // set bounds so non-active threads execute no iterations
  316|  18.4E|        *plower = *pupper + (incr > 0 ? 1 : -1);
  ------------------
  |  Branch (316:30): [True: 3.58k, False: 18.4E]
  ------------------
  317|  3.57k|      }
  318|  4.48k|      if (plastiter != NULL)
  ------------------
  |  Branch (318:11): [True: 4.48k, False: 0]
  ------------------
  319|  4.48k|        *plastiter = (tid == trip_count - 1);
  320|  4.48k|    } else {
  321|  4.45k|      if (__kmp_static == kmp_sch_static_balanced) {
  ------------------
  |  Branch (321:11): [True: 4.45k, False: 18.4E]
  ------------------
  322|  4.45k|        UT small_chunk = trip_count / nth;
  323|  4.45k|        UT extras = trip_count % nth;
  324|  4.45k|        *plower += incr * (tid * small_chunk + (tid < extras ? tid : extras));
  ------------------
  |  Branch (324:49): [True: 642, False: 3.81k]
  ------------------
  325|  4.45k|        *pupper = *plower + small_chunk * incr - (tid < extras ? 0 : incr);
  ------------------
  |  Branch (325:51): [True: 642, False: 3.81k]
  ------------------
  326|  4.45k|        if (plastiter != NULL)
  ------------------
  |  Branch (326:13): [True: 4.44k, False: 8]
  ------------------
  327|  4.44k|          *plastiter = (tid == nth - 1);
  328|  18.4E|      } else {
  329|  18.4E|        T big_chunk_inc_count =
  330|  18.4E|            (trip_count / nth + ((trip_count % nth) ? 1 : 0)) * incr;
  ------------------
  |  Branch (330:34): [True: 0, False: 18.4E]
  ------------------
  331|  18.4E|        T old_upper = *pupper;
  332|       |
  333|  18.4E|        KMP_DEBUG_ASSERT(__kmp_static == kmp_sch_static_greedy);
  334|       |        // Unknown static scheduling type.
  335|       |
  336|  18.4E|        *plower += tid * big_chunk_inc_count;
  337|  18.4E|        *pupper = *plower + big_chunk_inc_count - incr;
  338|  18.4E|        if (incr > 0) {
  ------------------
  |  Branch (338:13): [True: 0, False: 18.4E]
  ------------------
  339|      0|          if (*pupper < *plower)
  ------------------
  |  Branch (339:15): [True: 0, False: 0]
  ------------------
  340|      0|            *pupper = traits_t<T>::max_value;
  341|      0|          if (plastiter != NULL)
  ------------------
  |  Branch (341:15): [True: 0, False: 0]
  ------------------
  342|      0|            *plastiter = *plower <= old_upper && *pupper > old_upper - incr;
  ------------------
  |  Branch (342:26): [True: 0, False: 0]
  |  Branch (342:50): [True: 0, False: 0]
  ------------------
  343|      0|          if (*pupper > old_upper)
  ------------------
  |  Branch (343:15): [True: 0, False: 0]
  ------------------
  344|      0|            *pupper = old_upper; // tracker C73258
  345|  18.4E|        } else {
  346|  18.4E|          if (*pupper > *plower)
  ------------------
  |  Branch (346:15): [True: 0, False: 18.4E]
  ------------------
  347|      0|            *pupper = traits_t<T>::min_value;
  348|  18.4E|          if (plastiter != NULL)
  ------------------
  |  Branch (348:15): [True: 0, False: 18.4E]
  ------------------
  349|      0|            *plastiter = *plower >= old_upper && *pupper < old_upper - incr;
  ------------------
  |  Branch (349:26): [True: 0, False: 0]
  |  Branch (349:50): [True: 0, False: 0]
  ------------------
  350|  18.4E|          if (*pupper < old_upper)
  ------------------
  |  Branch (350:15): [True: 0, False: 18.4E]
  ------------------
  351|      0|            *pupper = old_upper; // tracker C73258
  352|  18.4E|        }
  353|  18.4E|      }
  354|  4.44k|    }
  355|  8.93k|    *pstride = trip_count;
  356|  8.93k|    break;
  357|      0|  }
  358|      0|  case kmp_sch_static_chunked: {
  ------------------
  |  Branch (358:3): [True: 0, False: 8.87k]
  ------------------
  359|      0|    ST span;
  360|      0|    UT nchunks;
  361|      0|    if (chunk < 1)
  ------------------
  |  Branch (361:9): [True: 0, False: 0]
  ------------------
  362|      0|      chunk = 1;
  363|      0|    else if ((UT)chunk > trip_count)
  ------------------
  |  Branch (363:14): [True: 0, False: 0]
  ------------------
  364|      0|      chunk = trip_count;
  365|      0|    nchunks = (trip_count) / (UT)chunk + (trip_count % (UT)chunk ? 1 : 0);
  ------------------
  |  Branch (365:43): [True: 0, False: 0]
  ------------------
  366|      0|    span = chunk * incr;
  367|      0|    if (nchunks < nth) {
  ------------------
  |  Branch (367:9): [True: 0, False: 0]
  ------------------
  368|      0|      *pstride = span * nchunks;
  369|      0|      if (tid < nchunks) {
  ------------------
  |  Branch (369:11): [True: 0, False: 0]
  ------------------
  370|      0|        *plower = *plower + (span * tid);
  371|      0|        *pupper = *plower + span - incr;
  372|      0|      } else {
  373|      0|        *plower = *pupper + (incr > 0 ? 1 : -1);
  ------------------
  |  Branch (373:30): [True: 0, False: 0]
  ------------------
  374|      0|      }
  375|      0|    } else {
  376|      0|      *pstride = span * nth;
  377|      0|      *plower = *plower + (span * tid);
  378|      0|      *pupper = *plower + span - incr;
  379|      0|    }
  380|      0|    if (plastiter != NULL)
  ------------------
  |  Branch (380:9): [True: 0, False: 0]
  ------------------
  381|      0|      *plastiter = (tid == (nchunks - 1) % nth);
  382|      0|    break;
  383|      0|  }
  384|      0|  case kmp_sch_static_balanced_chunked: {
  ------------------
  |  Branch (384:3): [True: 0, False: 8.87k]
  ------------------
  385|      0|    T old_upper = *pupper;
  386|       |    // round up to make sure the chunk is enough to cover all iterations
  387|      0|    UT span = (trip_count + nth - 1) / nth;
  388|       |
  389|       |    // perform chunk adjustment
  390|      0|    chunk = (span + chunk - 1) & ~(chunk - 1);
  391|       |
  392|      0|    span = chunk * incr;
  393|      0|    *plower = *plower + (span * tid);
  394|      0|    *pupper = *plower + span - incr;
  395|      0|    if (incr > 0) {
  ------------------
  |  Branch (395:9): [True: 0, False: 0]
  ------------------
  396|      0|      if (*pupper > old_upper)
  ------------------
  |  Branch (396:11): [True: 0, False: 0]
  ------------------
  397|      0|        *pupper = old_upper;
  398|      0|    } else if (*pupper < old_upper)
  ------------------
  |  Branch (398:16): [True: 0, False: 0]
  ------------------
  399|      0|      *pupper = old_upper;
  400|       |
  401|      0|    if (plastiter != NULL)
  ------------------
  |  Branch (401:9): [True: 0, False: 0]
  ------------------
  402|      0|      *plastiter = (tid == ((trip_count - 1) / (UT)chunk));
  403|      0|    break;
  404|      0|  }
  405|      0|  default:
  ------------------
  |  Branch (405:3): [True: 0, False: 8.87k]
  ------------------
  406|      0|    KMP_ASSERT2(0, "__kmpc_for_static_init: unknown scheduling type");
  ------------------
  |  |   53|      0|#define KMP_ASSERT2(cond, msg) KMP_ASSERT(cond)
  |  |  ------------------
  |  |  |  |   50|      0|  if (!(cond)) {                                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (50:7): [True: 0, Folded]
  |  |  |  |  ------------------
  |  |  |  |   51|      0|    __kmp_debug_assert("assertion failure", __FILE__, __LINE__);               \
  |  |  |  |   52|      0|  }
  |  |  ------------------
  ------------------
  407|      0|    break;
  408|  8.87k|  }
  409|       |
  410|       |#if USE_ITT_BUILD
  411|       |  // Report loop metadata
  412|       |  if (KMP_MASTER_TID(tid) && __itt_metadata_add_ptr &&
  413|       |      __kmp_forkjoin_frames_mode == 3 && th->th.th_teams_microtask == NULL &&
  414|       |      team->t.t_active_level == 1) {
  415|       |    kmp_uint64 cur_chunk = chunk;
  416|       |    check_loc(loc);
  417|       |    // Calculate chunk in case it was not specified; it is specified for
  418|       |    // kmp_sch_static_chunked
  419|       |    if (schedtype == kmp_sch_static) {
  420|       |      cur_chunk = trip_count / nth + ((trip_count % nth) ? 1 : 0);
  421|       |    }
  422|       |    // 0 - "static" schedule
  423|       |    __kmp_itt_metadata_loop(loc, 0, trip_count, cur_chunk);
  424|       |  }
  425|       |#endif
  426|       |#ifdef KMP_DEBUG
  427|       |  {
  428|       |    char *buff;
  429|       |    // create format specifiers before the debug output
  430|       |    buff = __kmp_str_format("__kmpc_for_static_init: liter=%%d lower=%%%s "
  431|       |                            "upper=%%%s stride = %%%s signed?<%s>\n",
  432|       |                            traits_t<T>::spec, traits_t<T>::spec,
  433|       |                            traits_t<ST>::spec, traits_t<T>::spec);
  434|       |    KD_TRACE(100, (buff, *plastiter, *plower, *pupper, *pstride));
  435|       |    __kmp_str_free(&buff);
  436|       |  }
  437|       |#endif
  438|  8.92k|  KE_TRACE(10, ("__kmpc_for_static_init: T#%d return\n", global_tid));
  439|       |
  440|  8.92k|#if OMPT_SUPPORT && OMPT_OPTIONAL
  441|  8.92k|  if (ompt_enabled.ompt_callback_work) {
  ------------------
  |  Branch (441:7): [True: 0, False: 8.92k]
  ------------------
  442|      0|    ompt_callbacks.ompt_callback(ompt_callback_work)(
  ------------------
  |  |   27|      0|#define ompt_callback(e) e##_callback
  ------------------
  443|      0|        ompt_work_type, ompt_scope_begin, &(team_info->parallel_data),
  444|      0|        &(task_info->task_data), trip_count, codeptr);
  445|      0|  }
  446|  8.92k|  if (ompt_enabled.ompt_callback_dispatch) {
  ------------------
  |  Branch (446:7): [True: 0, False: 8.92k]
  ------------------
  447|      0|    ompt_dispatch_t dispatch_type;
  448|      0|    ompt_data_t instance = ompt_data_none;
  ------------------
  |  | 1408|      0|#define ompt_data_none {0}
  ------------------
  449|      0|    ompt_dispatch_chunk_t dispatch_chunk;
  450|      0|    if (ompt_work_type == ompt_work_sections) {
  ------------------
  |  Branch (450:9): [True: 0, False: 0]
  ------------------
  451|      0|      dispatch_type = ompt_dispatch_section;
  452|      0|      instance.ptr = codeptr;
  453|      0|    } else {
  454|      0|      OMPT_GET_DISPATCH_CHUNK(dispatch_chunk, *plower, *pupper, incr);
  ------------------
  |  |  101|      0|  do {                                                                         \
  |  |  102|      0|    if (incr > 0) {                                                            \
  |  |  ------------------
  |  |  |  Branch (102:9): [True: 0, False: 0]
  |  |  ------------------
  |  |  103|      0|      chunk.start = static_cast<uint64_t>(lb);                                 \
  |  |  104|      0|      chunk.iterations = static_cast<uint64_t>(((ub) - (lb)) / (incr) + 1);    \
  |  |  105|      0|    } else {                                                                   \
  |  |  106|      0|      chunk.start = static_cast<uint64_t>(ub);                                 \
  |  |  107|      0|      chunk.iterations = static_cast<uint64_t>(((lb) - (ub)) / -(incr) + 1);   \
  |  |  108|      0|    }                                                                          \
  |  |  109|      0|  } while (0)
  |  |  ------------------
  |  |  |  Branch (109:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
  455|      0|      dispatch_type = (ompt_work_type == ompt_work_distribute)
  ------------------
  |  Branch (455:23): [True: 0, False: 0]
  ------------------
  456|      0|                          ? ompt_dispatch_distribute_chunk
  457|      0|                          : ompt_dispatch_ws_loop_chunk;
  458|      0|      instance.ptr = &dispatch_chunk;
  459|      0|    }
  460|      0|    ompt_callbacks.ompt_callback(ompt_callback_dispatch)(
  ------------------
  |  |   27|      0|#define ompt_callback(e) e##_callback
  ------------------
  461|      0|        &(team_info->parallel_data), &(task_info->task_data), dispatch_type,
  462|      0|        instance);
  463|      0|  }
  464|  8.92k|#endif
  465|       |
  466|  8.92k|  KMP_STATS_LOOP_END(OMP_loop_static_iterations);
  467|  8.92k|  return;
  468|  8.87k|}
kmp_sched.cpp:_ZL21__kmp_for_static_initIxEvP5identiiPiPT_S4_PN8traits_tIS3_E8signed_tES7_S7_Pv:
   83|  36.2k|) {
   84|  36.2k|  KMP_COUNT_BLOCK(OMP_LOOP_STATIC);
  ------------------
  |  | 1001|  36.2k|#define KMP_COUNT_BLOCK(n) ((void)0)
  ------------------
   85|  36.2k|  KMP_PUSH_PARTITIONED_TIMER(OMP_loop_static);
  ------------------
  |  | 1014|  36.2k|#define KMP_PUSH_PARTITIONED_TIMER(name) ((void)0)
  ------------------
   86|  36.2k|  KMP_PUSH_PARTITIONED_TIMER(OMP_loop_static_scheduling);
  ------------------
  |  | 1014|  36.2k|#define KMP_PUSH_PARTITIONED_TIMER(name) ((void)0)
  ------------------
   87|       |
   88|       |  // Clear monotonic/nonmonotonic bits (ignore it)
   89|  36.2k|  schedtype = SCHEDULE_WITHOUT_MODIFIERS(schedtype);
  ------------------
  |  |  451|  36.2k|  (enum sched_type)(                                                           \
  |  |  452|  36.2k|      (s) & ~(kmp_sch_modifier_nonmonotonic | kmp_sch_modifier_monotonic))
  ------------------
   90|       |
   91|  36.2k|  typedef typename traits_t<T>::unsigned_t UT;
   92|  36.2k|  typedef typename traits_t<T>::signed_t ST;
   93|       |  /*  this all has to be changed back to TID and such.. */
   94|  36.2k|  kmp_int32 gtid = global_tid;
   95|  36.2k|  kmp_uint32 tid;
   96|  36.2k|  kmp_uint32 nth;
   97|  36.2k|  UT trip_count;
   98|  36.2k|  kmp_team_t *team;
   99|  36.2k|  __kmp_assert_valid_gtid(gtid);
  100|  36.2k|  kmp_info_t *th = __kmp_threads[gtid];
  101|       |
  102|  36.2k|#if OMPT_SUPPORT && OMPT_OPTIONAL
  103|  36.2k|  ompt_team_info_t *team_info = NULL;
  104|  36.2k|  ompt_task_info_t *task_info = NULL;
  105|  36.2k|  ompt_work_t ompt_work_type = ompt_work_loop;
  106|       |
  107|  36.2k|  static kmp_int8 warn = 0;
  108|       |
  109|  36.2k|  if (ompt_enabled.ompt_callback_work || ompt_enabled.ompt_callback_dispatch) {
  ------------------
  |  Branch (109:7): [True: 23, False: 36.2k]
  |  Branch (109:42): [True: 18.4E, False: 36.2k]
  ------------------
  110|       |    // Only fully initialize variables needed by OMPT if OMPT is enabled.
  111|      0|    team_info = __ompt_get_teaminfo(0, NULL);
  112|      0|    task_info = __ompt_get_task_info_object(0);
  113|       |    // Determine workshare type
  114|      0|    if (loc != NULL) {
  ------------------
  |  Branch (114:9): [True: 0, False: 0]
  ------------------
  115|      0|      if ((loc->flags & KMP_IDENT_WORK_LOOP) != 0) {
  ------------------
  |  Branch (115:11): [True: 0, False: 0]
  ------------------
  116|      0|        ompt_work_type = ompt_work_loop;
  117|      0|      } else if ((loc->flags & KMP_IDENT_WORK_SECTIONS) != 0) {
  ------------------
  |  Branch (117:18): [True: 0, False: 0]
  ------------------
  118|      0|        ompt_work_type = ompt_work_sections;
  119|      0|      } else if ((loc->flags & KMP_IDENT_WORK_DISTRIBUTE) != 0) {
  ------------------
  |  Branch (119:18): [True: 0, False: 0]
  ------------------
  120|      0|        ompt_work_type = ompt_work_distribute;
  121|      0|      } else {
  122|      0|        kmp_int8 bool_res =
  123|      0|            KMP_COMPARE_AND_STORE_ACQ8(&warn, (kmp_int8)0, (kmp_int8)1);
  ------------------
  |  |  795|      0|  __sync_bool_compare_and_swap((volatile kmp_uint8 *)(p), (kmp_uint8)(cv),     \
  |  |  796|      0|                               (kmp_uint8)(sv))
  ------------------
  124|      0|        if (bool_res)
  ------------------
  |  Branch (124:13): [True: 0, False: 0]
  ------------------
  125|      0|          KMP_WARNING(OmptOutdatedWorkshare);
  ------------------
  |  |  145|      0|  __kmp_msg(kmp_ms_warning, KMP_MSG(__VA_ARGS__), __kmp_msg_null)
  |  |  ------------------
  |  |  |  |  121|      0|#define KMP_MSG(...) __kmp_msg_format(kmp_i18n_msg_##__VA_ARGS__)
  |  |  ------------------
  ------------------
  126|      0|      }
  127|      0|      KMP_DEBUG_ASSERT(ompt_work_type);
  128|      0|    }
  129|      0|  }
  130|  36.2k|#endif
  131|       |
  132|  36.2k|  KMP_DEBUG_ASSERT(plastiter && plower && pupper && pstride);
  133|  36.2k|  KE_TRACE(10, ("__kmpc_for_static_init called (%d)\n", global_tid));
  134|       |#ifdef KMP_DEBUG
  135|       |  {
  136|       |    char *buff;
  137|       |    // create format specifiers before the debug output
  138|       |    buff = __kmp_str_format(
  139|       |        "__kmpc_for_static_init: T#%%d sched=%%d liter=%%d iter=(%%%s,"
  140|       |        " %%%s, %%%s) incr=%%%s chunk=%%%s signed?<%s>\n",
  141|       |        traits_t<T>::spec, traits_t<T>::spec, traits_t<ST>::spec,
  142|       |        traits_t<ST>::spec, traits_t<ST>::spec, traits_t<T>::spec);
  143|       |    KD_TRACE(100, (buff, global_tid, schedtype, *plastiter, *plower, *pupper,
  144|       |                   *pstride, incr, chunk));
  145|       |    __kmp_str_free(&buff);
  146|       |  }
  147|       |#endif
  148|       |
  149|  36.2k|  if (__kmp_env_consistency_check) {
  ------------------
  |  Branch (149:7): [True: 0, False: 36.2k]
  ------------------
  150|      0|    __kmp_push_workshare(global_tid, ct_pdo, loc);
  151|      0|    if (incr == 0) {
  ------------------
  |  Branch (151:9): [True: 0, False: 0]
  ------------------
  152|      0|      __kmp_error_construct(kmp_i18n_msg_CnsLoopIncrZeroProhibited, ct_pdo,
  153|      0|                            loc);
  154|      0|    }
  155|      0|  }
  156|       |  /* special handling for zero-trip loops */
  157|  18.4E|  if (incr > 0 ? (*pupper < *plower) : (*plower < *pupper)) {
  ------------------
  |  Branch (157:7): [True: 36.3k, False: 18.4E]
  |  Branch (157:7): [True: 0, False: 36.2k]
  ------------------
  158|      0|    if (plastiter != NULL)
  ------------------
  |  Branch (158:9): [True: 0, False: 0]
  ------------------
  159|      0|      *plastiter = FALSE;
  ------------------
  |  | 1279|      0|#define FALSE 0
  ------------------
  160|       |    /* leave pupper and plower set to entire iteration space */
  161|      0|    *pstride = incr; /* value should never be used */
  162|       |// *plower = *pupper - incr;
  163|       |// let compiler bypass the illegal loop (like for(i=1;i<10;i--))
  164|       |// THE LINE COMMENTED ABOVE CAUSED shape2F/h_tests_1.f TO HAVE A FAILURE
  165|       |// ON A ZERO-TRIP LOOP (lower=1, upper=0,stride=1) - JPH June 23, 2009.
  166|       |#ifdef KMP_DEBUG
  167|       |    {
  168|       |      char *buff;
  169|       |      // create format specifiers before the debug output
  170|       |      buff = __kmp_str_format("__kmpc_for_static_init:(ZERO TRIP) liter=%%d "
  171|       |                              "lower=%%%s upper=%%%s stride = %%%s "
  172|       |                              "signed?<%s>, loc = %%s\n",
  173|       |                              traits_t<T>::spec, traits_t<T>::spec,
  174|       |                              traits_t<ST>::spec, traits_t<T>::spec);
  175|       |      check_loc(loc);
  176|       |      KD_TRACE(100,
  177|       |               (buff, *plastiter, *plower, *pupper, *pstride, loc->psource));
  178|       |      __kmp_str_free(&buff);
  179|       |    }
  180|       |#endif
  181|      0|    KE_TRACE(10, ("__kmpc_for_static_init: T#%d return\n", global_tid));
  182|       |
  183|      0|#if OMPT_SUPPORT && OMPT_OPTIONAL
  184|      0|    if (ompt_enabled.ompt_callback_work) {
  ------------------
  |  Branch (184:9): [True: 0, False: 0]
  ------------------
  185|      0|      ompt_callbacks.ompt_callback(ompt_callback_work)(
  ------------------
  |  |   27|      0|#define ompt_callback(e) e##_callback
  ------------------
  186|      0|          ompt_work_type, ompt_scope_begin, &(team_info->parallel_data),
  187|      0|          &(task_info->task_data), 0, codeptr);
  188|      0|    }
  189|      0|#endif
  190|      0|    KMP_STATS_LOOP_END(OMP_loop_static_iterations);
  191|      0|    return;
  192|      0|  }
  193|       |
  194|       |  // Although there are schedule enumerations above kmp_ord_upper which are not
  195|       |  // schedules for "distribute", the only ones which are useful are dynamic, so
  196|       |  // cannot be seen here, since this codepath is only executed for static
  197|       |  // schedules.
  198|  36.2k|  if (schedtype > kmp_ord_upper) {
  ------------------
  |  Branch (198:7): [True: 0, False: 36.2k]
  ------------------
  199|       |    // we are in DISTRIBUTE construct
  200|      0|    schedtype += kmp_sch_static -
  201|      0|                 kmp_distribute_static; // AC: convert to usual schedule type
  202|      0|    if (th->th.th_team->t.t_serialized > 1) {
  ------------------
  |  Branch (202:9): [True: 0, False: 0]
  ------------------
  203|      0|      tid = 0;
  204|      0|      team = th->th.th_team;
  205|      0|    } else {
  206|      0|      tid = th->th.th_team->t.t_master_tid;
  207|      0|      team = th->th.th_team->t.t_parent;
  208|      0|    }
  209|  36.2k|  } else {
  210|  36.2k|    tid = __kmp_tid_from_gtid(global_tid);
  211|  36.2k|    team = th->th.th_team;
  212|  36.2k|  }
  213|       |
  214|       |  /* determine if "for" loop is an active worksharing construct */
  215|  36.2k|  if (team->t.t_serialized) {
  ------------------
  |  Branch (215:7): [True: 3.01k, False: 33.2k]
  ------------------
  216|       |    /* serialized parallel, each thread executes whole iteration space */
  217|  3.01k|    if (plastiter != NULL)
  ------------------
  |  Branch (217:9): [True: 3.01k, False: 0]
  ------------------
  218|  3.01k|      *plastiter = TRUE;
  ------------------
  |  | 1280|  3.01k|#define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  | 1279|  3.01k|#define FALSE 0
  |  |  ------------------
  ------------------
  219|       |    /* leave pupper and plower set to entire iteration space */
  220|  3.01k|    *pstride =
  221|  3.01k|        (incr > 0) ? (*pupper - *plower + 1) : (-(*plower - *pupper + 1));
  ------------------
  |  Branch (221:9): [True: 3.01k, False: 0]
  ------------------
  222|       |
  223|       |#ifdef KMP_DEBUG
  224|       |    {
  225|       |      char *buff;
  226|       |      // create format specifiers before the debug output
  227|       |      buff = __kmp_str_format("__kmpc_for_static_init: (serial) liter=%%d "
  228|       |                              "lower=%%%s upper=%%%s stride = %%%s\n",
  229|       |                              traits_t<T>::spec, traits_t<T>::spec,
  230|       |                              traits_t<ST>::spec);
  231|       |      KD_TRACE(100, (buff, *plastiter, *plower, *pupper, *pstride));
  232|       |      __kmp_str_free(&buff);
  233|       |    }
  234|       |#endif
  235|  3.01k|    KE_TRACE(10, ("__kmpc_for_static_init: T#%d return\n", global_tid));
  236|       |
  237|  3.01k|#if OMPT_SUPPORT && OMPT_OPTIONAL
  238|  3.01k|    if (ompt_enabled.ompt_callback_work) {
  ------------------
  |  Branch (238:9): [True: 0, False: 3.01k]
  ------------------
  239|      0|      ompt_callbacks.ompt_callback(ompt_callback_work)(
  ------------------
  |  |   27|      0|#define ompt_callback(e) e##_callback
  ------------------
  240|      0|          ompt_work_type, ompt_scope_begin, &(team_info->parallel_data),
  241|      0|          &(task_info->task_data), *pstride, codeptr);
  242|      0|    }
  243|  3.01k|#endif
  244|  3.01k|    KMP_STATS_LOOP_END(OMP_loop_static_iterations);
  245|  3.01k|    return;
  246|  3.01k|  }
  247|  33.2k|  nth = team->t.t_nproc;
  248|  33.2k|  if (nth == 1) {
  ------------------
  |  Branch (248:7): [True: 0, False: 33.2k]
  ------------------
  249|      0|    if (plastiter != NULL)
  ------------------
  |  Branch (249:9): [True: 0, False: 0]
  ------------------
  250|      0|      *plastiter = TRUE;
  ------------------
  |  | 1280|      0|#define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  | 1279|      0|#define FALSE 0
  |  |  ------------------
  ------------------
  251|      0|    *pstride =
  252|      0|        (incr > 0) ? (*pupper - *plower + 1) : (-(*plower - *pupper + 1));
  ------------------
  |  Branch (252:9): [True: 0, False: 0]
  ------------------
  253|       |#ifdef KMP_DEBUG
  254|       |    {
  255|       |      char *buff;
  256|       |      // create format specifiers before the debug output
  257|       |      buff = __kmp_str_format("__kmpc_for_static_init: (serial) liter=%%d "
  258|       |                              "lower=%%%s upper=%%%s stride = %%%s\n",
  259|       |                              traits_t<T>::spec, traits_t<T>::spec,
  260|       |                              traits_t<ST>::spec);
  261|       |      KD_TRACE(100, (buff, *plastiter, *plower, *pupper, *pstride));
  262|       |      __kmp_str_free(&buff);
  263|       |    }
  264|       |#endif
  265|      0|    KE_TRACE(10, ("__kmpc_for_static_init: T#%d return\n", global_tid));
  266|       |
  267|      0|#if OMPT_SUPPORT && OMPT_OPTIONAL
  268|      0|    if (ompt_enabled.ompt_callback_work) {
  ------------------
  |  Branch (268:9): [True: 0, False: 0]
  ------------------
  269|      0|      ompt_callbacks.ompt_callback(ompt_callback_work)(
  ------------------
  |  |   27|      0|#define ompt_callback(e) e##_callback
  ------------------
  270|      0|          ompt_work_type, ompt_scope_begin, &(team_info->parallel_data),
  271|      0|          &(task_info->task_data), *pstride, codeptr);
  272|      0|    }
  273|      0|#endif
  274|      0|    KMP_STATS_LOOP_END(OMP_loop_static_iterations);
  275|      0|    return;
  276|      0|  }
  277|       |
  278|       |  /* compute trip count */
  279|  33.5k|  if (incr == 1) {
  ------------------
  |  Branch (279:7): [True: 33.5k, False: 18.4E]
  ------------------
  280|  33.5k|    trip_count = *pupper - *plower + 1;
  281|  18.4E|  } else if (incr == -1) {
  ------------------
  |  Branch (281:14): [True: 0, False: 18.4E]
  ------------------
  282|      0|    trip_count = *plower - *pupper + 1;
  283|  18.4E|  } else if (incr > 0) {
  ------------------
  |  Branch (283:14): [True: 0, False: 18.4E]
  ------------------
  284|       |    // upper-lower can exceed the limit of signed type
  285|      0|    trip_count = (UT)(*pupper - *plower) / incr + 1;
  286|  18.4E|  } else {
  287|  18.4E|    trip_count = (UT)(*plower - *pupper) / (-incr) + 1;
  288|  18.4E|  }
  289|       |
  290|       |#if KMP_STATS_ENABLED
  291|       |  if (KMP_MASTER_GTID(gtid)) {
  292|       |    KMP_COUNT_VALUE(OMP_loop_static_total_iterations, trip_count);
  293|       |  }
  294|       |#endif
  295|       |
  296|  33.2k|  if (__kmp_env_consistency_check) {
  ------------------
  |  Branch (296:7): [True: 0, False: 33.2k]
  ------------------
  297|       |    /* tripcount overflow? */
  298|      0|    if (trip_count == 0 && *pupper != *plower) {
  ------------------
  |  Branch (298:9): [True: 0, False: 0]
  |  Branch (298:28): [True: 0, False: 0]
  ------------------
  299|      0|      __kmp_error_construct(kmp_i18n_msg_CnsIterationRangeTooLarge, ct_pdo,
  300|      0|                            loc);
  301|      0|    }
  302|      0|  }
  303|       |
  304|       |  /* compute remaining parameters */
  305|  33.2k|  switch (schedtype) {
  306|  33.5k|  case kmp_sch_static: {
  ------------------
  |  Branch (306:3): [True: 33.5k, False: 18.4E]
  ------------------
  307|  33.5k|    if (trip_count < nth) {
  ------------------
  |  Branch (307:9): [True: 32.8k, False: 648]
  ------------------
  308|  32.8k|      KMP_DEBUG_ASSERT(
  309|  32.8k|          __kmp_static == kmp_sch_static_greedy ||
  310|  32.8k|          __kmp_static ==
  311|  32.8k|              kmp_sch_static_balanced); // Unknown static scheduling type.
  312|  32.8k|      if (tid < trip_count) {
  ------------------
  |  Branch (312:11): [True: 5.53k, False: 27.3k]
  ------------------
  313|  5.53k|        *pupper = *plower = *plower + tid * incr;
  314|  27.3k|      } else {
  315|       |        // set bounds so non-active threads execute no iterations
  316|  18.4E|        *plower = *pupper + (incr > 0 ? 1 : -1);
  ------------------
  |  Branch (316:30): [True: 27.5k, False: 18.4E]
  ------------------
  317|  27.3k|      }
  318|  32.8k|      if (plastiter != NULL)
  ------------------
  |  Branch (318:11): [True: 32.9k, False: 18.4E]
  ------------------
  319|  32.9k|        *plastiter = (tid == trip_count - 1);
  320|  32.8k|    } else {
  321|    648|      if (__kmp_static == kmp_sch_static_balanced) {
  ------------------
  |  Branch (321:11): [True: 645, False: 3]
  ------------------
  322|    645|        UT small_chunk = trip_count / nth;
  323|    645|        UT extras = trip_count % nth;
  324|    645|        *plower += incr * (tid * small_chunk + (tid < extras ? tid : extras));
  ------------------
  |  Branch (324:49): [True: 79, False: 566]
  ------------------
  325|    645|        *pupper = *plower + small_chunk * incr - (tid < extras ? 0 : incr);
  ------------------
  |  Branch (325:51): [True: 79, False: 566]
  ------------------
  326|    645|        if (plastiter != NULL)
  ------------------
  |  Branch (326:13): [True: 642, False: 3]
  ------------------
  327|    642|          *plastiter = (tid == nth - 1);
  328|    645|      } else {
  329|      3|        T big_chunk_inc_count =
  330|      3|            (trip_count / nth + ((trip_count % nth) ? 1 : 0)) * incr;
  ------------------
  |  Branch (330:34): [True: 0, False: 3]
  ------------------
  331|      3|        T old_upper = *pupper;
  332|       |
  333|      3|        KMP_DEBUG_ASSERT(__kmp_static == kmp_sch_static_greedy);
  334|       |        // Unknown static scheduling type.
  335|       |
  336|      3|        *plower += tid * big_chunk_inc_count;
  337|      3|        *pupper = *plower + big_chunk_inc_count - incr;
  338|      3|        if (incr > 0) {
  ------------------
  |  Branch (338:13): [True: 0, False: 3]
  ------------------
  339|      0|          if (*pupper < *plower)
  ------------------
  |  Branch (339:15): [True: 0, False: 0]
  ------------------
  340|      0|            *pupper = traits_t<T>::max_value;
  341|      0|          if (plastiter != NULL)
  ------------------
  |  Branch (341:15): [True: 0, False: 0]
  ------------------
  342|      0|            *plastiter = *plower <= old_upper && *pupper > old_upper - incr;
  ------------------
  |  Branch (342:26): [True: 0, False: 0]
  |  Branch (342:50): [True: 0, False: 0]
  ------------------
  343|      0|          if (*pupper > old_upper)
  ------------------
  |  Branch (343:15): [True: 0, False: 0]
  ------------------
  344|      0|            *pupper = old_upper; // tracker C73258
  345|      3|        } else {
  346|      3|          if (*pupper > *plower)
  ------------------
  |  Branch (346:15): [True: 0, False: 3]
  ------------------
  347|      0|            *pupper = traits_t<T>::min_value;
  348|      3|          if (plastiter != NULL)
  ------------------
  |  Branch (348:15): [True: 0, False: 3]
  ------------------
  349|      0|            *plastiter = *plower >= old_upper && *pupper < old_upper - incr;
  ------------------
  |  Branch (349:26): [True: 0, False: 0]
  |  Branch (349:50): [True: 0, False: 0]
  ------------------
  350|      3|          if (*pupper < old_upper)
  ------------------
  |  Branch (350:15): [True: 0, False: 3]
  ------------------
  351|      0|            *pupper = old_upper; // tracker C73258
  352|      3|        }
  353|      3|      }
  354|    648|    }
  355|  33.5k|    *pstride = trip_count;
  356|  33.5k|    break;
  357|      0|  }
  358|      0|  case kmp_sch_static_chunked: {
  ------------------
  |  Branch (358:3): [True: 0, False: 33.2k]
  ------------------
  359|      0|    ST span;
  360|      0|    UT nchunks;
  361|      0|    if (chunk < 1)
  ------------------
  |  Branch (361:9): [True: 0, False: 0]
  ------------------
  362|      0|      chunk = 1;
  363|      0|    else if ((UT)chunk > trip_count)
  ------------------
  |  Branch (363:14): [True: 0, False: 0]
  ------------------
  364|      0|      chunk = trip_count;
  365|      0|    nchunks = (trip_count) / (UT)chunk + (trip_count % (UT)chunk ? 1 : 0);
  ------------------
  |  Branch (365:43): [True: 0, False: 0]
  ------------------
  366|      0|    span = chunk * incr;
  367|      0|    if (nchunks < nth) {
  ------------------
  |  Branch (367:9): [True: 0, False: 0]
  ------------------
  368|      0|      *pstride = span * nchunks;
  369|      0|      if (tid < nchunks) {
  ------------------
  |  Branch (369:11): [True: 0, False: 0]
  ------------------
  370|      0|        *plower = *plower + (span * tid);
  371|      0|        *pupper = *plower + span - incr;
  372|      0|      } else {
  373|      0|        *plower = *pupper + (incr > 0 ? 1 : -1);
  ------------------
  |  Branch (373:30): [True: 0, False: 0]
  ------------------
  374|      0|      }
  375|      0|    } else {
  376|      0|      *pstride = span * nth;
  377|      0|      *plower = *plower + (span * tid);
  378|      0|      *pupper = *plower + span - incr;
  379|      0|    }
  380|      0|    if (plastiter != NULL)
  ------------------
  |  Branch (380:9): [True: 0, False: 0]
  ------------------
  381|      0|      *plastiter = (tid == (nchunks - 1) % nth);
  382|      0|    break;
  383|      0|  }
  384|      0|  case kmp_sch_static_balanced_chunked: {
  ------------------
  |  Branch (384:3): [True: 0, False: 33.2k]
  ------------------
  385|      0|    T old_upper = *pupper;
  386|       |    // round up to make sure the chunk is enough to cover all iterations
  387|      0|    UT span = (trip_count + nth - 1) / nth;
  388|       |
  389|       |    // perform chunk adjustment
  390|      0|    chunk = (span + chunk - 1) & ~(chunk - 1);
  391|       |
  392|      0|    span = chunk * incr;
  393|      0|    *plower = *plower + (span * tid);
  394|      0|    *pupper = *plower + span - incr;
  395|      0|    if (incr > 0) {
  ------------------
  |  Branch (395:9): [True: 0, False: 0]
  ------------------
  396|      0|      if (*pupper > old_upper)
  ------------------
  |  Branch (396:11): [True: 0, False: 0]
  ------------------
  397|      0|        *pupper = old_upper;
  398|      0|    } else if (*pupper < old_upper)
  ------------------
  |  Branch (398:16): [True: 0, False: 0]
  ------------------
  399|      0|      *pupper = old_upper;
  400|       |
  401|      0|    if (plastiter != NULL)
  ------------------
  |  Branch (401:9): [True: 0, False: 0]
  ------------------
  402|      0|      *plastiter = (tid == ((trip_count - 1) / (UT)chunk));
  403|      0|    break;
  404|      0|  }
  405|      0|  default:
  ------------------
  |  Branch (405:3): [True: 0, False: 33.2k]
  ------------------
  406|      0|    KMP_ASSERT2(0, "__kmpc_for_static_init: unknown scheduling type");
  ------------------
  |  |   53|      0|#define KMP_ASSERT2(cond, msg) KMP_ASSERT(cond)
  |  |  ------------------
  |  |  |  |   50|      0|  if (!(cond)) {                                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (50:7): [True: 0, Folded]
  |  |  |  |  ------------------
  |  |  |  |   51|      0|    __kmp_debug_assert("assertion failure", __FILE__, __LINE__);               \
  |  |  |  |   52|      0|  }
  |  |  ------------------
  ------------------
  407|      0|    break;
  408|  33.2k|  }
  409|       |
  410|       |#if USE_ITT_BUILD
  411|       |  // Report loop metadata
  412|       |  if (KMP_MASTER_TID(tid) && __itt_metadata_add_ptr &&
  413|       |      __kmp_forkjoin_frames_mode == 3 && th->th.th_teams_microtask == NULL &&
  414|       |      team->t.t_active_level == 1) {
  415|       |    kmp_uint64 cur_chunk = chunk;
  416|       |    check_loc(loc);
  417|       |    // Calculate chunk in case it was not specified; it is specified for
  418|       |    // kmp_sch_static_chunked
  419|       |    if (schedtype == kmp_sch_static) {
  420|       |      cur_chunk = trip_count / nth + ((trip_count % nth) ? 1 : 0);
  421|       |    }
  422|       |    // 0 - "static" schedule
  423|       |    __kmp_itt_metadata_loop(loc, 0, trip_count, cur_chunk);
  424|       |  }
  425|       |#endif
  426|       |#ifdef KMP_DEBUG
  427|       |  {
  428|       |    char *buff;
  429|       |    // create format specifiers before the debug output
  430|       |    buff = __kmp_str_format("__kmpc_for_static_init: liter=%%d lower=%%%s "
  431|       |                            "upper=%%%s stride = %%%s signed?<%s>\n",
  432|       |                            traits_t<T>::spec, traits_t<T>::spec,
  433|       |                            traits_t<ST>::spec, traits_t<T>::spec);
  434|       |    KD_TRACE(100, (buff, *plastiter, *plower, *pupper, *pstride));
  435|       |    __kmp_str_free(&buff);
  436|       |  }
  437|       |#endif
  438|  33.5k|  KE_TRACE(10, ("__kmpc_for_static_init: T#%d return\n", global_tid));
  439|       |
  440|  33.5k|#if OMPT_SUPPORT && OMPT_OPTIONAL
  441|  33.5k|  if (ompt_enabled.ompt_callback_work) {
  ------------------
  |  Branch (441:7): [True: 0, False: 33.5k]
  ------------------
  442|      0|    ompt_callbacks.ompt_callback(ompt_callback_work)(
  ------------------
  |  |   27|      0|#define ompt_callback(e) e##_callback
  ------------------
  443|      0|        ompt_work_type, ompt_scope_begin, &(team_info->parallel_data),
  444|      0|        &(task_info->task_data), trip_count, codeptr);
  445|      0|  }
  446|  33.5k|  if (ompt_enabled.ompt_callback_dispatch) {
  ------------------
  |  Branch (446:7): [True: 0, False: 33.5k]
  ------------------
  447|      0|    ompt_dispatch_t dispatch_type;
  448|      0|    ompt_data_t instance = ompt_data_none;
  ------------------
  |  | 1408|      0|#define ompt_data_none {0}
  ------------------
  449|      0|    ompt_dispatch_chunk_t dispatch_chunk;
  450|      0|    if (ompt_work_type == ompt_work_sections) {
  ------------------
  |  Branch (450:9): [True: 0, False: 0]
  ------------------
  451|      0|      dispatch_type = ompt_dispatch_section;
  452|      0|      instance.ptr = codeptr;
  453|      0|    } else {
  454|      0|      OMPT_GET_DISPATCH_CHUNK(dispatch_chunk, *plower, *pupper, incr);
  ------------------
  |  |  101|      0|  do {                                                                         \
  |  |  102|      0|    if (incr > 0) {                                                            \
  |  |  ------------------
  |  |  |  Branch (102:9): [True: 0, False: 0]
  |  |  ------------------
  |  |  103|      0|      chunk.start = static_cast<uint64_t>(lb);                                 \
  |  |  104|      0|      chunk.iterations = static_cast<uint64_t>(((ub) - (lb)) / (incr) + 1);    \
  |  |  105|      0|    } else {                                                                   \
  |  |  106|      0|      chunk.start = static_cast<uint64_t>(ub);                                 \
  |  |  107|      0|      chunk.iterations = static_cast<uint64_t>(((lb) - (ub)) / -(incr) + 1);   \
  |  |  108|      0|    }                                                                          \
  |  |  109|      0|  } while (0)
  |  |  ------------------
  |  |  |  Branch (109:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
  455|      0|      dispatch_type = (ompt_work_type == ompt_work_distribute)
  ------------------
  |  Branch (455:23): [True: 0, False: 0]
  ------------------
  456|      0|                          ? ompt_dispatch_distribute_chunk
  457|      0|                          : ompt_dispatch_ws_loop_chunk;
  458|      0|      instance.ptr = &dispatch_chunk;
  459|      0|    }
  460|      0|    ompt_callbacks.ompt_callback(ompt_callback_dispatch)(
  ------------------
  |  |   27|      0|#define ompt_callback(e) e##_callback
  ------------------
  461|      0|        &(team_info->parallel_data), &(task_info->task_data), dispatch_type,
  462|      0|        instance);
  463|      0|  }
  464|  33.5k|#endif
  465|       |
  466|  33.5k|  KMP_STATS_LOOP_END(OMP_loop_static_iterations);
  467|  33.5k|  return;
  468|  33.2k|}

__kmp_check_stksize:
  320|      1|void __kmp_check_stksize(size_t *val) {
  321|       |  // if system stack size is too big then limit the size for worker threads
  322|      1|  if (*val > KMP_DEFAULT_STKSIZE * 16) // just a heuristics...
  ------------------
  |  | 1158|      1|#define KMP_DEFAULT_STKSIZE ((size_t)(4 * 1024 * 1024))
  ------------------
  |  Branch (322:7): [True: 0, False: 1]
  ------------------
  323|      0|    *val = KMP_DEFAULT_STKSIZE * 16;
  ------------------
  |  | 1158|      0|#define KMP_DEFAULT_STKSIZE ((size_t)(4 * 1024 * 1024))
  ------------------
  324|      1|  if (*val < __kmp_sys_min_stksize)
  ------------------
  |  Branch (324:7): [True: 0, False: 1]
  ------------------
  325|      0|    *val = __kmp_sys_min_stksize;
  326|      1|  if (*val > KMP_MAX_STKSIZE)
  ------------------
  |  | 1153|      1|#define KMP_MAX_STKSIZE (~((size_t)1 << ((sizeof(size_t) * (1 << 3)) - 1)))
  ------------------
  |  Branch (326:7): [True: 0, False: 1]
  ------------------
  327|      0|    *val = KMP_MAX_STKSIZE; // dead code currently, but may work in future
  ------------------
  |  | 1153|      0|#define KMP_MAX_STKSIZE (~((size_t)1 << ((sizeof(size_t) * (1 << 3)) - 1)))
  ------------------
  328|       |#if KMP_OS_DARWIN
  329|       |  *val = __kmp_round4k(*val);
  330|       |#endif // KMP_OS_DARWIN
  331|      1|}
_Z30__kmp_initial_threads_capacityi:
  536|      2|int __kmp_initial_threads_capacity(int req_nproc) {
  537|      2|  int nth = 32;
  538|       |
  539|       |  /* MIN( MAX( 32, 4 * $OMP_NUM_THREADS, 4 * omp_get_num_procs() ),
  540|       |   * __kmp_max_nth) */
  541|      2|  if (nth < (4 * req_nproc))
  ------------------
  |  Branch (541:7): [True: 2, False: 0]
  ------------------
  542|      2|    nth = (4 * req_nproc);
  543|      2|  if (nth < (4 * __kmp_xproc))
  ------------------
  |  Branch (543:7): [True: 0, False: 2]
  ------------------
  544|      0|    nth = (4 * __kmp_xproc);
  545|       |
  546|       |  // If hidden helper task is enabled, we initialize the thread capacity with
  547|       |  // extra __kmp_hidden_helper_threads_num.
  548|      2|  if (__kmp_enable_hidden_helper) {
  ------------------
  |  Branch (548:7): [True: 2, False: 0]
  ------------------
  549|      2|    nth += __kmp_hidden_helper_threads_num;
  550|      2|  }
  551|       |
  552|      2|  if (nth > __kmp_max_nth)
  ------------------
  |  Branch (552:7): [True: 0, False: 2]
  ------------------
  553|      0|    nth = __kmp_max_nth;
  554|       |
  555|      2|  return nth;
  556|      2|}
_Z25__kmp_default_tp_capacityiii:
  559|      1|                              int all_threads_specified) {
  560|      1|  int nth = 128;
  561|       |
  562|      1|  if (all_threads_specified)
  ------------------
  |  Branch (562:7): [True: 0, False: 1]
  ------------------
  563|      0|    return max_nth;
  564|       |  /* MIN( MAX (128, 4 * $OMP_NUM_THREADS, 4 * omp_get_num_procs() ),
  565|       |   * __kmp_max_nth ) */
  566|      1|  if (nth < (4 * req_nproc))
  ------------------
  |  Branch (566:7): [True: 0, False: 1]
  ------------------
  567|      0|    nth = (4 * req_nproc);
  568|      1|  if (nth < (4 * __kmp_xproc))
  ------------------
  |  Branch (568:7): [True: 0, False: 1]
  ------------------
  569|      0|    nth = (4 * __kmp_xproc);
  570|       |
  571|      1|  if (nth > __kmp_max_nth)
  ------------------
  |  Branch (571:7): [True: 0, False: 1]
  ------------------
  572|      0|    nth = __kmp_max_nth;
  573|       |
  574|      1|  return nth;
  575|      1|}
_Z20__kmp_env_initializePKc:
 6003|      1|void __kmp_env_initialize(char const *string) {
 6004|       |
 6005|      1|  kmp_env_blk_t block;
 6006|      1|  int i;
 6007|       |
 6008|      1|  __kmp_stg_init();
 6009|       |
 6010|       |  // Hack!!!
 6011|      1|  if (string == NULL) {
  ------------------
  |  Branch (6011:7): [True: 1, False: 0]
  ------------------
 6012|       |    // __kmp_max_nth = __kmp_sys_max_nth;
 6013|      1|    __kmp_threads_capacity =
 6014|      1|        __kmp_initial_threads_capacity(__kmp_dflt_team_nth_ub);
 6015|      1|  }
 6016|      1|  __kmp_env_blk_init(&block, string);
 6017|       |
 6018|       |  // update the set flag on all entries that have an env var
 6019|     35|  for (i = 0; i < block.count; ++i) {
  ------------------
  |  Branch (6019:15): [True: 34, False: 1]
  ------------------
 6020|     34|    if ((block.vars[i].name == NULL) || (*block.vars[i].name == '\0')) {
  ------------------
  |  Branch (6020:9): [True: 0, False: 34]
  |  Branch (6020:41): [True: 0, False: 34]
  ------------------
 6021|      0|      continue;
 6022|      0|    }
 6023|     34|    if (block.vars[i].value == NULL) {
  ------------------
  |  Branch (6023:9): [True: 0, False: 34]
  ------------------
 6024|      0|      continue;
 6025|      0|    }
 6026|     34|    kmp_setting_t *setting = __kmp_stg_find(block.vars[i].name);
 6027|     34|    if (setting != NULL) {
  ------------------
  |  Branch (6027:9): [True: 0, False: 34]
  ------------------
 6028|      0|      setting->set = 1;
 6029|      0|    }
 6030|     34|  }
 6031|       |
 6032|       |  // We need to know if blocktime was set when processing OMP_WAIT_POLICY
 6033|      1|  blocktime_str = __kmp_env_blk_var(&block, "KMP_BLOCKTIME");
 6034|       |
 6035|       |  // Special case. If we parse environment, not a string, process KMP_WARNINGS
 6036|       |  // first.
 6037|      1|  if (string == NULL) {
  ------------------
  |  Branch (6037:7): [True: 1, False: 0]
  ------------------
 6038|      1|    char const *name = "KMP_WARNINGS";
 6039|      1|    char const *value = __kmp_env_blk_var(&block, name);
 6040|      1|    __kmp_stg_parse(name, value);
 6041|      1|  }
 6042|       |
 6043|      1|#if KMP_AFFINITY_SUPPORTED
 6044|       |  // Special case. KMP_AFFINITY is not a rival to other affinity env vars
 6045|       |  // if no affinity type is specified.  We want to allow
 6046|       |  // KMP_AFFINITY=[no],verbose/[no]warnings/etc.  to be enabled when
 6047|       |  // specifying the affinity type via GOMP_CPU_AFFINITY or the OMP 4.0
 6048|       |  // affinity mechanism.
 6049|      1|  __kmp_affinity_notype = NULL;
 6050|      1|  char const *aff_str = __kmp_env_blk_var(&block, "KMP_AFFINITY");
 6051|      1|  if (aff_str != NULL) {
  ------------------
  |  Branch (6051:7): [True: 0, False: 1]
  ------------------
 6052|       |    // Check if the KMP_AFFINITY type is specified in the string.
 6053|       |    // We just search the string for "compact", "scatter", etc.
 6054|       |    // without really parsing the string.  The syntax of the
 6055|       |    // KMP_AFFINITY env var is such that none of the affinity
 6056|       |    // type names can appear anywhere other that the type
 6057|       |    // specifier, even as substrings.
 6058|       |    //
 6059|       |    // I can't find a case-insensitive version of strstr on Windows* OS.
 6060|       |    // Use the case-sensitive version for now.
 6061|       |
 6062|       |#if KMP_OS_WINDOWS
 6063|       |#define FIND strstr
 6064|       |#else
 6065|      0|#define FIND strcasestr
 6066|      0|#endif
 6067|       |
 6068|      0|    if ((FIND(aff_str, "none") == NULL) &&
  ------------------
  |  | 6065|      0|#define FIND strcasestr
  ------------------
  |  Branch (6068:9): [True: 0, False: 0]
  ------------------
 6069|      0|        (FIND(aff_str, "physical") == NULL) &&
  ------------------
  |  | 6065|      0|#define FIND strcasestr
  ------------------
  |  Branch (6069:9): [True: 0, False: 0]
  ------------------
 6070|      0|        (FIND(aff_str, "logical") == NULL) &&
  ------------------
  |  | 6065|      0|#define FIND strcasestr
  ------------------
  |  Branch (6070:9): [True: 0, False: 0]
  ------------------
 6071|      0|        (FIND(aff_str, "compact") == NULL) &&
  ------------------
  |  | 6065|      0|#define FIND strcasestr
  ------------------
  |  Branch (6071:9): [True: 0, False: 0]
  ------------------
 6072|      0|        (FIND(aff_str, "scatter") == NULL) &&
  ------------------
  |  | 6065|      0|#define FIND strcasestr
  ------------------
  |  Branch (6072:9): [True: 0, False: 0]
  ------------------
 6073|      0|        (FIND(aff_str, "explicit") == NULL) &&
  ------------------
  |  | 6065|      0|#define FIND strcasestr
  ------------------
  |  Branch (6073:9): [True: 0, False: 0]
  ------------------
 6074|      0|        (FIND(aff_str, "balanced") == NULL) &&
  ------------------
  |  | 6065|      0|#define FIND strcasestr
  ------------------
  |  Branch (6074:9): [True: 0, False: 0]
  ------------------
 6075|      0|        (FIND(aff_str, "disabled") == NULL)) {
  ------------------
  |  | 6065|      0|#define FIND strcasestr
  ------------------
  |  Branch (6075:9): [True: 0, False: 0]
  ------------------
 6076|      0|      __kmp_affinity_notype = __kmp_stg_find("KMP_AFFINITY");
 6077|      0|    } else {
 6078|       |      // A new affinity type is specified.
 6079|       |      // Reset the affinity flags to their default values,
 6080|       |      // in case this is called from kmp_set_defaults().
 6081|      0|      __kmp_affinity.type = affinity_default;
 6082|      0|      __kmp_affinity.gran = KMP_HW_UNKNOWN;
 6083|      0|      __kmp_affinity_top_method = affinity_top_method_default;
 6084|      0|      __kmp_affinity.flags.respect = affinity_respect_mask_default;
  ------------------
  |  |  860|      0|#define affinity_respect_mask_default (2)
  ------------------
 6085|      0|    }
 6086|      0|#undef FIND
 6087|       |
 6088|       |    // Also reset the affinity flags if OMP_PROC_BIND is specified.
 6089|      0|    aff_str = __kmp_env_blk_var(&block, "OMP_PROC_BIND");
 6090|      0|    if (aff_str != NULL) {
  ------------------
  |  Branch (6090:9): [True: 0, False: 0]
  ------------------
 6091|      0|      __kmp_affinity.type = affinity_default;
 6092|      0|      __kmp_affinity.gran = KMP_HW_UNKNOWN;
 6093|      0|      __kmp_affinity_top_method = affinity_top_method_default;
 6094|      0|      __kmp_affinity.flags.respect = affinity_respect_mask_default;
  ------------------
  |  |  860|      0|#define affinity_respect_mask_default (2)
  ------------------
 6095|      0|    }
 6096|      0|  }
 6097|       |
 6098|      1|#endif /* KMP_AFFINITY_SUPPORTED */
 6099|       |
 6100|       |  // Set up the nested proc bind type vector.
 6101|      1|  if (__kmp_nested_proc_bind.bind_types == NULL) {
  ------------------
  |  Branch (6101:7): [True: 1, False: 0]
  ------------------
 6102|      1|    __kmp_nested_proc_bind.bind_types =
 6103|      1|        (kmp_proc_bind_t *)KMP_INTERNAL_MALLOC(sizeof(kmp_proc_bind_t));
  ------------------
  |  |  110|      1|#define KMP_INTERNAL_MALLOC(sz) malloc(sz)
  ------------------
 6104|      1|    if (__kmp_nested_proc_bind.bind_types == NULL) {
  ------------------
  |  Branch (6104:9): [True: 0, False: 1]
  ------------------
 6105|      0|      KMP_FATAL(MemoryAllocFailed);
  ------------------
  |  |  146|      0|#define KMP_FATAL(...) __kmp_fatal(KMP_MSG(__VA_ARGS__), __kmp_msg_null)
  |  |  ------------------
  |  |  |  |  121|      0|#define KMP_MSG(...) __kmp_msg_format(kmp_i18n_msg_##__VA_ARGS__)
  |  |  ------------------
  ------------------
 6106|      0|    }
 6107|      1|    __kmp_nested_proc_bind.size = 1;
 6108|      1|    __kmp_nested_proc_bind.used = 1;
 6109|      1|#if KMP_AFFINITY_SUPPORTED
 6110|      1|    __kmp_nested_proc_bind.bind_types[0] = proc_bind_default;
 6111|       |#else
 6112|       |    // default proc bind is false if affinity not supported
 6113|       |    __kmp_nested_proc_bind.bind_types[0] = proc_bind_false;
 6114|       |#endif
 6115|      1|  }
 6116|       |
 6117|       |  // Set up the affinity format ICV
 6118|       |  // Grab the default affinity format string from the message catalog
 6119|      1|  kmp_msg_t m =
 6120|      1|      __kmp_msg_format(kmp_i18n_msg_AffFormatDefault, "%P", "%i", "%n", "%A");
 6121|      1|  KMP_DEBUG_ASSERT(KMP_STRLEN(m.str) < KMP_AFFINITY_FORMAT_SIZE);
 6122|       |
 6123|      1|  if (__kmp_affinity_format == NULL) {
  ------------------
  |  Branch (6123:7): [True: 1, False: 0]
  ------------------
 6124|      1|    __kmp_affinity_format =
 6125|      1|        (char *)KMP_INTERNAL_MALLOC(sizeof(char) * KMP_AFFINITY_FORMAT_SIZE);
  ------------------
  |  |  110|      1|#define KMP_INTERNAL_MALLOC(sz) malloc(sz)
  ------------------
 6126|      1|  }
 6127|      1|  KMP_STRCPY_S(__kmp_affinity_format, KMP_AFFINITY_FORMAT_SIZE, m.str);
  ------------------
  |  |   63|      1|#define KMP_STRCPY_S(dst, bsz, src) strcpy(dst, src)
  ------------------
 6128|      1|  __kmp_str_free(&m.str);
 6129|       |
 6130|       |  // Now process all of the settings.
 6131|     35|  for (i = 0; i < block.count; ++i) {
  ------------------
  |  Branch (6131:15): [True: 34, False: 1]
  ------------------
 6132|     34|    __kmp_stg_parse(block.vars[i].name, block.vars[i].value);
 6133|     34|  }
 6134|       |
 6135|       |  // If user locks have been allocated yet, don't reset the lock vptr table.
 6136|      1|  if (!__kmp_init_user_locks) {
  ------------------
  |  Branch (6136:7): [True: 1, False: 0]
  ------------------
 6137|      1|    if (__kmp_user_lock_kind == lk_default) {
  ------------------
  |  Branch (6137:9): [True: 1, False: 0]
  ------------------
 6138|      1|      __kmp_user_lock_kind = lk_queuing;
 6139|      1|    }
 6140|      1|#if KMP_USE_DYNAMIC_LOCK
 6141|      1|    __kmp_init_dynamic_user_locks();
 6142|       |#else
 6143|       |    __kmp_set_user_lock_vptrs(__kmp_user_lock_kind);
 6144|       |#endif
 6145|      1|  } else {
 6146|      0|    KMP_DEBUG_ASSERT(string != NULL); // kmp_set_defaults() was called
 6147|      0|    KMP_DEBUG_ASSERT(__kmp_user_lock_kind != lk_default);
 6148|       |// Binds lock functions again to follow the transition between different
 6149|       |// KMP_CONSISTENCY_CHECK values. Calling this again is harmless as long
 6150|       |// as we do not allow lock kind changes after making a call to any
 6151|       |// user lock functions (true).
 6152|      0|#if KMP_USE_DYNAMIC_LOCK
 6153|      0|    __kmp_init_dynamic_user_locks();
 6154|       |#else
 6155|       |    __kmp_set_user_lock_vptrs(__kmp_user_lock_kind);
 6156|       |#endif
 6157|      0|  }
 6158|       |
 6159|      1|#if KMP_AFFINITY_SUPPORTED
 6160|       |
 6161|      1|  if (!TCR_4(__kmp_init_middle)) {
  ------------------
  |  | 1127|      1|#define TCR_4(a) (a)
  ------------------
  |  Branch (6161:7): [True: 1, False: 0]
  ------------------
 6162|       |#if KMP_USE_HWLOC
 6163|       |    // Force using hwloc when either tiles or numa nodes requested within
 6164|       |    // KMP_HW_SUBSET or granularity setting and no other topology method
 6165|       |    // is requested
 6166|       |    if (__kmp_hw_subset &&
 6167|       |        __kmp_affinity_top_method == affinity_top_method_default)
 6168|       |      if (__kmp_hw_subset->specified(KMP_HW_NUMA) ||
 6169|       |          __kmp_hw_subset->specified(KMP_HW_TILE) ||
 6170|       |          __kmp_affinity.gran == KMP_HW_TILE ||
 6171|       |          __kmp_affinity.gran == KMP_HW_NUMA)
 6172|       |        __kmp_affinity_top_method = affinity_top_method_hwloc;
 6173|       |    // Force using hwloc when tiles or numa nodes requested for OMP_PLACES
 6174|       |    if (__kmp_affinity.gran == KMP_HW_NUMA ||
 6175|       |        __kmp_affinity.gran == KMP_HW_TILE)
 6176|       |      __kmp_affinity_top_method = affinity_top_method_hwloc;
 6177|       |#endif
 6178|       |    // Determine if the machine/OS is actually capable of supporting
 6179|       |    // affinity.
 6180|      1|    const char *var = "KMP_AFFINITY";
 6181|      1|    KMPAffinity::pick_api();
 6182|       |#if KMP_USE_HWLOC
 6183|       |    // If Hwloc topology discovery was requested but affinity was also disabled,
 6184|       |    // then tell user that Hwloc request is being ignored and use default
 6185|       |    // topology discovery method.
 6186|       |    if (__kmp_affinity_top_method == affinity_top_method_hwloc &&
 6187|       |        __kmp_affinity_dispatch->get_api_type() != KMPAffinity::HWLOC) {
 6188|       |      KMP_WARNING(AffIgnoringHwloc, var);
 6189|       |      __kmp_affinity_top_method = affinity_top_method_all;
 6190|       |    }
 6191|       |#endif
 6192|      1|    if (__kmp_affinity.type == affinity_disabled) {
  ------------------
  |  Branch (6192:9): [True: 0, False: 1]
  ------------------
 6193|      0|      KMP_AFFINITY_DISABLE();
  ------------------
  |  |  685|      0|#define KMP_AFFINITY_DISABLE() (__kmp_affin_mask_size = 0)
  ------------------
 6194|      1|    } else if (!KMP_AFFINITY_CAPABLE()) {
  ------------------
  |  |  684|      1|#define KMP_AFFINITY_CAPABLE() (__kmp_affin_mask_size > 0)
  ------------------
  |  Branch (6194:16): [True: 1, False: 0]
  ------------------
 6195|      1|      __kmp_affinity_dispatch->determine_capable(var);
 6196|      1|      if (!KMP_AFFINITY_CAPABLE()) {
  ------------------
  |  |  684|      1|#define KMP_AFFINITY_CAPABLE() (__kmp_affin_mask_size > 0)
  ------------------
  |  Branch (6196:11): [True: 0, False: 1]
  ------------------
 6197|      0|        if (__kmp_affinity.flags.verbose ||
  ------------------
  |  Branch (6197:13): [True: 0, False: 0]
  ------------------
 6198|      0|            (__kmp_affinity.flags.warnings &&
  ------------------
  |  Branch (6198:14): [True: 0, False: 0]
  ------------------
 6199|      0|             (__kmp_affinity.type != affinity_default) &&
  ------------------
  |  Branch (6199:14): [True: 0, False: 0]
  ------------------
 6200|      0|             (__kmp_affinity.type != affinity_none) &&
  ------------------
  |  Branch (6200:14): [True: 0, False: 0]
  ------------------
 6201|      0|             (__kmp_affinity.type != affinity_disabled))) {
  ------------------
  |  Branch (6201:14): [True: 0, False: 0]
  ------------------
 6202|      0|          KMP_WARNING(AffNotSupported, var);
  ------------------
  |  |  145|      0|  __kmp_msg(kmp_ms_warning, KMP_MSG(__VA_ARGS__), __kmp_msg_null)
  |  |  ------------------
  |  |  |  |  121|      0|#define KMP_MSG(...) __kmp_msg_format(kmp_i18n_msg_##__VA_ARGS__)
  |  |  ------------------
  ------------------
 6203|      0|        }
 6204|      0|        __kmp_affinity.type = affinity_disabled;
 6205|      0|        __kmp_affinity.flags.respect = FALSE;
  ------------------
  |  | 1279|      0|#define FALSE 0
  ------------------
 6206|      0|        __kmp_affinity.gran = KMP_HW_THREAD;
 6207|      0|      }
 6208|      1|    }
 6209|       |
 6210|      1|    if (__kmp_affinity.type == affinity_disabled) {
  ------------------
  |  Branch (6210:9): [True: 0, False: 1]
  ------------------
 6211|      0|      __kmp_nested_proc_bind.bind_types[0] = proc_bind_false;
 6212|      1|    } else if (__kmp_nested_proc_bind.bind_types[0] == proc_bind_true) {
  ------------------
  |  Branch (6212:16): [True: 0, False: 1]
  ------------------
 6213|       |      // OMP_PROC_BIND=true maps to OMP_PROC_BIND=spread.
 6214|      0|      __kmp_nested_proc_bind.bind_types[0] = proc_bind_spread;
 6215|      0|    }
 6216|       |
 6217|      1|    if (KMP_AFFINITY_CAPABLE()) {
  ------------------
  |  |  684|      1|#define KMP_AFFINITY_CAPABLE() (__kmp_affin_mask_size > 0)
  |  |  ------------------
  |  |  |  Branch (684:32): [True: 1, False: 0]
  |  |  ------------------
  ------------------
 6218|       |
 6219|       |#if KMP_GROUP_AFFINITY
 6220|       |      // This checks to see if the initial affinity mask is equal
 6221|       |      // to a single windows processor group.  If it is, then we do
 6222|       |      // not respect the initial affinity mask and instead, use the
 6223|       |      // entire machine.
 6224|       |      bool exactly_one_group = false;
 6225|       |      if (__kmp_num_proc_groups > 1) {
 6226|       |        int group;
 6227|       |        bool within_one_group;
 6228|       |        // Get the initial affinity mask and determine if it is
 6229|       |        // contained within a single group.
 6230|       |        kmp_affin_mask_t *init_mask;
 6231|       |        KMP_CPU_ALLOC(init_mask);
 6232|       |        __kmp_get_system_affinity(init_mask, TRUE);
 6233|       |        group = __kmp_get_proc_group(init_mask);
 6234|       |        within_one_group = (group >= 0);
 6235|       |        // If the initial affinity is within a single group,
 6236|       |        // then determine if it is equal to that single group.
 6237|       |        if (within_one_group) {
 6238|       |          DWORD num_bits_in_group = __kmp_GetActiveProcessorCount(group);
 6239|       |          DWORD num_bits_in_mask = 0;
 6240|       |          for (int bit = init_mask->begin(); bit != init_mask->end();
 6241|       |               bit = init_mask->next(bit))
 6242|       |            num_bits_in_mask++;
 6243|       |          exactly_one_group = (num_bits_in_group == num_bits_in_mask);
 6244|       |        }
 6245|       |        KMP_CPU_FREE(init_mask);
 6246|       |      }
 6247|       |
 6248|       |      // Handle the Win 64 group affinity stuff if there are multiple
 6249|       |      // processor groups, or if the user requested it, and OMP 4.0
 6250|       |      // affinity is not in effect.
 6251|       |      if (__kmp_num_proc_groups > 1 &&
 6252|       |          __kmp_affinity.type == affinity_default &&
 6253|       |          __kmp_nested_proc_bind.bind_types[0] == proc_bind_default) {
 6254|       |        // Do not respect the initial processor affinity mask if it is assigned
 6255|       |        // exactly one Windows Processor Group since this is interpreted as the
 6256|       |        // default OS assignment. Not respecting the mask allows the runtime to
 6257|       |        // use all the logical processors in all groups.
 6258|       |        if (__kmp_affinity.flags.respect == affinity_respect_mask_default &&
 6259|       |            exactly_one_group) {
 6260|       |          __kmp_affinity.flags.respect = FALSE;
 6261|       |        }
 6262|       |        // Use compact affinity with anticipation of pinning to at least the
 6263|       |        // group granularity since threads can only be bound to one group.
 6264|       |        if (__kmp_affinity.type == affinity_default) {
 6265|       |          __kmp_affinity.type = affinity_compact;
 6266|       |          __kmp_nested_proc_bind.bind_types[0] = proc_bind_intel;
 6267|       |        }
 6268|       |        if (__kmp_hh_affinity.type == affinity_default)
 6269|       |          __kmp_hh_affinity.type = affinity_compact;
 6270|       |        if (__kmp_affinity_top_method == affinity_top_method_default)
 6271|       |          __kmp_affinity_top_method = affinity_top_method_all;
 6272|       |        if (__kmp_affinity.gran == KMP_HW_UNKNOWN)
 6273|       |          __kmp_affinity.gran = KMP_HW_PROC_GROUP;
 6274|       |        if (__kmp_hh_affinity.gran == KMP_HW_UNKNOWN)
 6275|       |          __kmp_hh_affinity.gran = KMP_HW_PROC_GROUP;
 6276|       |      } else
 6277|       |
 6278|       |#endif /* KMP_GROUP_AFFINITY */
 6279|       |
 6280|      1|      {
 6281|      1|        if (__kmp_affinity.flags.respect == affinity_respect_mask_default) {
  ------------------
  |  |  860|      1|#define affinity_respect_mask_default (2)
  ------------------
  |  Branch (6281:13): [True: 1, False: 0]
  ------------------
 6282|       |#if KMP_GROUP_AFFINITY
 6283|       |          if (__kmp_num_proc_groups > 1 && exactly_one_group) {
 6284|       |            __kmp_affinity.flags.respect = FALSE;
 6285|       |          } else
 6286|       |#endif /* KMP_GROUP_AFFINITY */
 6287|      1|          {
 6288|      1|            __kmp_affinity.flags.respect = TRUE;
  ------------------
  |  | 1280|      1|#define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  | 1279|      1|#define FALSE 0
  |  |  ------------------
  ------------------
 6289|      1|          }
 6290|      1|        }
 6291|      1|        if ((__kmp_nested_proc_bind.bind_types[0] != proc_bind_intel) &&
  ------------------
  |  Branch (6291:13): [True: 1, False: 0]
  ------------------
 6292|      1|            (__kmp_nested_proc_bind.bind_types[0] != proc_bind_default)) {
  ------------------
  |  Branch (6292:13): [True: 0, False: 1]
  ------------------
 6293|      0|          if (__kmp_affinity.type == affinity_default) {
  ------------------
  |  Branch (6293:15): [True: 0, False: 0]
  ------------------
 6294|      0|            __kmp_affinity.type = affinity_compact;
 6295|      0|            __kmp_affinity.flags.dups = FALSE;
  ------------------
  |  | 1279|      0|#define FALSE 0
  ------------------
 6296|      0|          }
 6297|      1|        } else if (__kmp_affinity.type == affinity_default) {
  ------------------
  |  Branch (6297:20): [True: 1, False: 0]
  ------------------
 6298|      1|#if KMP_MIC_SUPPORTED
 6299|      1|          if (__kmp_mic_type != non_mic) {
  ------------------
  |  Branch (6299:15): [True: 0, False: 1]
  ------------------
 6300|      0|            __kmp_nested_proc_bind.bind_types[0] = proc_bind_intel;
 6301|      0|          } else
 6302|      1|#endif
 6303|      1|          {
 6304|      1|            __kmp_nested_proc_bind.bind_types[0] = proc_bind_false;
 6305|      1|          }
 6306|      1|#if KMP_MIC_SUPPORTED
 6307|      1|          if (__kmp_mic_type != non_mic) {
  ------------------
  |  Branch (6307:15): [True: 0, False: 1]
  ------------------
 6308|      0|            __kmp_affinity.type = affinity_scatter;
 6309|      0|          } else
 6310|      1|#endif
 6311|      1|          {
 6312|      1|            __kmp_affinity.type = affinity_none;
 6313|      1|          }
 6314|      1|        }
 6315|      1|        if (__kmp_hh_affinity.type == affinity_default)
  ------------------
  |  Branch (6315:13): [True: 1, False: 0]
  ------------------
 6316|      1|          __kmp_hh_affinity.type = affinity_none;
 6317|      1|        if ((__kmp_affinity.gran == KMP_HW_UNKNOWN) &&
  ------------------
  |  Branch (6317:13): [True: 1, False: 0]
  ------------------
 6318|      1|            (__kmp_affinity.gran_levels < 0)) {
  ------------------
  |  Branch (6318:13): [True: 1, False: 0]
  ------------------
 6319|      1|#if KMP_MIC_SUPPORTED
 6320|      1|          if (__kmp_mic_type != non_mic) {
  ------------------
  |  Branch (6320:15): [True: 0, False: 1]
  ------------------
 6321|      0|            __kmp_affinity.gran = KMP_HW_THREAD;
 6322|      0|          } else
 6323|      1|#endif
 6324|      1|          {
 6325|      1|            __kmp_affinity.gran = KMP_HW_CORE;
 6326|      1|          }
 6327|      1|        }
 6328|      1|        if ((__kmp_hh_affinity.gran == KMP_HW_UNKNOWN) &&
  ------------------
  |  Branch (6328:13): [True: 1, False: 0]
  ------------------
 6329|      1|            (__kmp_hh_affinity.gran_levels < 0)) {
  ------------------
  |  Branch (6329:13): [True: 1, False: 0]
  ------------------
 6330|      1|#if KMP_MIC_SUPPORTED
 6331|      1|          if (__kmp_mic_type != non_mic) {
  ------------------
  |  Branch (6331:15): [True: 0, False: 1]
  ------------------
 6332|      0|            __kmp_hh_affinity.gran = KMP_HW_THREAD;
 6333|      0|          } else
 6334|      1|#endif
 6335|      1|          {
 6336|      1|            __kmp_hh_affinity.gran = KMP_HW_CORE;
 6337|      1|          }
 6338|      1|        }
 6339|      1|        if (__kmp_affinity_top_method == affinity_top_method_default) {
  ------------------
  |  Branch (6339:13): [True: 1, False: 0]
  ------------------
 6340|      1|          __kmp_affinity_top_method = affinity_top_method_all;
 6341|      1|        }
 6342|      1|      }
 6343|      1|    } else {
 6344|       |      // If affinity is disabled, then still need to assign topology method
 6345|       |      // to attempt machine detection and affinity types
 6346|      0|      if (__kmp_affinity_top_method == affinity_top_method_default)
  ------------------
  |  Branch (6346:11): [True: 0, False: 0]
  ------------------
 6347|      0|        __kmp_affinity_top_method = affinity_top_method_all;
 6348|      0|      if (__kmp_affinity.type == affinity_default)
  ------------------
  |  Branch (6348:11): [True: 0, False: 0]
  ------------------
 6349|      0|        __kmp_affinity.type = affinity_disabled;
 6350|      0|      if (__kmp_hh_affinity.type == affinity_default)
  ------------------
  |  Branch (6350:11): [True: 0, False: 0]
  ------------------
 6351|      0|        __kmp_hh_affinity.type = affinity_disabled;
 6352|      0|    }
 6353|       |
 6354|       |#ifdef KMP_DEBUG
 6355|       |    for (const kmp_affinity_t *affinity : __kmp_affinities)
 6356|       |      __kmp_print_affinity_settings(affinity);
 6357|       |    KMP_DEBUG_ASSERT(__kmp_nested_proc_bind.bind_types[0] != proc_bind_default);
 6358|       |    K_DIAG(1, ("__kmp_nested_proc_bind.bind_types[0] == %d\n",
 6359|       |               __kmp_nested_proc_bind.bind_types[0]));
 6360|       |#endif
 6361|      1|  }
 6362|       |
 6363|      1|#endif /* KMP_AFFINITY_SUPPORTED */
 6364|       |
 6365|       |  // Post-initialization step: some env. vars need their value's further
 6366|       |  // processing
 6367|      1|  if (string != NULL) { // kmp_set_defaults() was called
  ------------------
  |  Branch (6367:7): [True: 0, False: 1]
  ------------------
 6368|      0|    __kmp_aux_env_initialize(&block);
 6369|      0|  }
 6370|       |
 6371|      1|  __kmp_env_blk_free(&block);
 6372|       |
 6373|      1|  KMP_MB();
 6374|       |
 6375|      1|} // __kmp_env_initialize
_Z14__kmp_env_dumpv:
 6464|      1|void __kmp_env_dump() {
 6465|       |
 6466|      1|  kmp_env_blk_t block;
 6467|      1|  kmp_str_buf_t buffer, env, notdefined;
 6468|       |
 6469|      1|  __kmp_stg_init();
 6470|      1|  __kmp_str_buf_init(&buffer);
  ------------------
  |  |   41|      1|  {                                                                            \
  |  |   42|      1|    (b)->str = (b)->bulk;                                                      \
  |  |   43|      1|    (b)->size = sizeof((b)->bulk);                                             \
  |  |   44|      1|    (b)->used = 0;                                                             \
  |  |   45|      1|    (b)->bulk[0] = 0;                                                          \
  |  |   46|      1|  }
  ------------------
 6471|      1|  __kmp_str_buf_init(&env);
  ------------------
  |  |   41|      1|  {                                                                            \
  |  |   42|      1|    (b)->str = (b)->bulk;                                                      \
  |  |   43|      1|    (b)->size = sizeof((b)->bulk);                                             \
  |  |   44|      1|    (b)->used = 0;                                                             \
  |  |   45|      1|    (b)->bulk[0] = 0;                                                          \
  |  |   46|      1|  }
  ------------------
 6472|      1|  __kmp_str_buf_init(&notdefined);
  ------------------
  |  |   41|      1|  {                                                                            \
  |  |   42|      1|    (b)->str = (b)->bulk;                                                      \
  |  |   43|      1|    (b)->size = sizeof((b)->bulk);                                             \
  |  |   44|      1|    (b)->used = 0;                                                             \
  |  |   45|      1|    (b)->bulk[0] = 0;                                                          \
  |  |   46|      1|  }
  ------------------
 6473|       |
 6474|      1|  __kmp_env_blk_init(&block, NULL);
 6475|      1|  __kmp_env_blk_sort(&block);
 6476|       |
 6477|      1|  __kmp_str_buf_print(&notdefined, ": %s", KMP_I18N_STR(NotDefined));
  ------------------
  |  |   46|      1|#define KMP_I18N_STR(id) __kmp_i18n_catgets(kmp_i18n_str_##id)
  ------------------
 6478|       |
 6479|     88|  for (int i = 0; i < __kmp_stg_count; ++i) {
  ------------------
  |  Branch (6479:19): [True: 87, False: 1]
  ------------------
 6480|     87|    if (__kmp_stg_table[i].print == NULL)
  ------------------
  |  Branch (6480:9): [True: 4, False: 83]
  ------------------
 6481|      4|      continue;
 6482|     83|    __kmp_str_buf_clear(&env);
 6483|     83|    __kmp_stg_table[i].print(&env, __kmp_stg_table[i].name,
 6484|     83|                             __kmp_stg_table[i].data);
 6485|     83|    if (env.used < 4) // valid definition must have indents (3) and a new line
  ------------------
  |  Branch (6485:9): [True: 8, False: 75]
  ------------------
 6486|      8|      continue;
 6487|     75|    if (strstr(env.str, notdefined.str))
  ------------------
  |  Branch (6487:9): [True: 7, False: 68]
  ------------------
 6488|       |      // normalize the string
 6489|      7|      __kmp_str_buf_print(&buffer, "%s=undefined\n", __kmp_stg_table[i].name);
 6490|     68|    else
 6491|     68|      __kmp_str_buf_cat(&buffer, env.str + 3, env.used - 3);
 6492|     75|  }
 6493|       |
 6494|      1|  ompd_env_block = (char *)__kmp_allocate(buffer.used + 1);
  ------------------
  |  | 3617|      1|#define __kmp_allocate(size) ___kmp_allocate((size)KMP_SRC_LOC_CURR)
  ------------------
 6495|      1|  KMP_MEMCPY(ompd_env_block, buffer.str, buffer.used + 1);
  ------------------
  |  |   69|      1|#define KMP_MEMCPY memcpy
  ------------------
 6496|      1|  ompd_env_block_size = (ompd_size_t)KMP_STRLEN(ompd_env_block);
  ------------------
  |  |   68|      1|#define KMP_STRLEN strlen
  ------------------
 6497|       |
 6498|      1|  __kmp_env_blk_free(&block);
 6499|      1|  __kmp_str_buf_free(&buffer);
 6500|      1|  __kmp_str_buf_free(&env);
 6501|      1|  __kmp_str_buf_free(&notdefined);
 6502|      1|}
kmp_settings.cpp:_ZL14__kmp_stg_initv:
 5695|      2|static void __kmp_stg_init(void) {
 5696|       |
 5697|      2|  static int initialized = 0;
 5698|       |
 5699|      2|  if (!initialized) {
  ------------------
  |  Branch (5699:7): [True: 1, False: 1]
  ------------------
 5700|       |
 5701|       |    // Sort table.
 5702|      1|    qsort(__kmp_stg_table, __kmp_stg_count - 1, sizeof(kmp_setting_t),
 5703|      1|          __kmp_stg_cmp);
 5704|       |
 5705|      1|    { // Initialize *_STACKSIZE data.
 5706|      1|      kmp_setting_t *kmp_stacksize =
 5707|      1|          __kmp_stg_find("KMP_STACKSIZE"); // 1st priority.
 5708|      1|#ifdef KMP_GOMP_COMPAT
 5709|      1|      kmp_setting_t *gomp_stacksize =
 5710|      1|          __kmp_stg_find("GOMP_STACKSIZE"); // 2nd priority.
 5711|      1|#endif
 5712|      1|      kmp_setting_t *omp_stacksize =
 5713|      1|          __kmp_stg_find("OMP_STACKSIZE"); // 3rd priority.
 5714|       |
 5715|       |      // !!! volatile keyword is Intel(R) C Compiler bug CQ49908 workaround.
 5716|       |      // !!! Compiler does not understand rivals is used and optimizes out
 5717|       |      // assignments
 5718|       |      // !!!     rivals[ i ++ ] = ...;
 5719|      1|      static kmp_setting_t *volatile rivals[4];
 5720|      1|      static kmp_stg_ss_data_t kmp_data = {1, CCAST(kmp_setting_t **, rivals)};
  ------------------
  |  |  229|      1|#define CCAST(type, var) const_cast<type>(var)
  ------------------
 5721|      1|#ifdef KMP_GOMP_COMPAT
 5722|      1|      static kmp_stg_ss_data_t gomp_data = {1024,
 5723|      1|                                            CCAST(kmp_setting_t **, rivals)};
  ------------------
  |  |  229|      1|#define CCAST(type, var) const_cast<type>(var)
  ------------------
 5724|      1|#endif
 5725|      1|      static kmp_stg_ss_data_t omp_data = {1024,
 5726|      1|                                           CCAST(kmp_setting_t **, rivals)};
  ------------------
  |  |  229|      1|#define CCAST(type, var) const_cast<type>(var)
  ------------------
 5727|      1|      int i = 0;
 5728|       |
 5729|      1|      rivals[i++] = kmp_stacksize;
 5730|      1|#ifdef KMP_GOMP_COMPAT
 5731|      1|      if (gomp_stacksize != NULL) {
  ------------------
  |  Branch (5731:11): [True: 1, False: 0]
  ------------------
 5732|      1|        rivals[i++] = gomp_stacksize;
 5733|      1|      }
 5734|      1|#endif
 5735|      1|      rivals[i++] = omp_stacksize;
 5736|      1|      rivals[i++] = NULL;
 5737|       |
 5738|      1|      kmp_stacksize->data = &kmp_data;
 5739|      1|#ifdef KMP_GOMP_COMPAT
 5740|      1|      if (gomp_stacksize != NULL) {
  ------------------
  |  Branch (5740:11): [True: 1, False: 0]
  ------------------
 5741|      1|        gomp_stacksize->data = &gomp_data;
 5742|      1|      }
 5743|      1|#endif
 5744|      1|      omp_stacksize->data = &omp_data;
 5745|      1|    }
 5746|       |
 5747|      1|    { // Initialize KMP_LIBRARY and OMP_WAIT_POLICY data.
 5748|      1|      kmp_setting_t *kmp_library =
 5749|      1|          __kmp_stg_find("KMP_LIBRARY"); // 1st priority.
 5750|      1|      kmp_setting_t *omp_wait_policy =
 5751|      1|          __kmp_stg_find("OMP_WAIT_POLICY"); // 2nd priority.
 5752|       |
 5753|       |      // !!! volatile keyword is Intel(R) C Compiler bug CQ49908 workaround.
 5754|      1|      static kmp_setting_t *volatile rivals[3];
 5755|      1|      static kmp_stg_wp_data_t kmp_data = {0, CCAST(kmp_setting_t **, rivals)};
  ------------------
  |  |  229|      1|#define CCAST(type, var) const_cast<type>(var)
  ------------------
 5756|      1|      static kmp_stg_wp_data_t omp_data = {1, CCAST(kmp_setting_t **, rivals)};
  ------------------
  |  |  229|      1|#define CCAST(type, var) const_cast<type>(var)
  ------------------
 5757|      1|      int i = 0;
 5758|       |
 5759|      1|      rivals[i++] = kmp_library;
 5760|      1|      if (omp_wait_policy != NULL) {
  ------------------
  |  Branch (5760:11): [True: 1, False: 0]
  ------------------
 5761|      1|        rivals[i++] = omp_wait_policy;
 5762|      1|      }
 5763|      1|      rivals[i++] = NULL;
 5764|       |
 5765|      1|      kmp_library->data = &kmp_data;
 5766|      1|      if (omp_wait_policy != NULL) {
  ------------------
  |  Branch (5766:11): [True: 1, False: 0]
  ------------------
 5767|      1|        omp_wait_policy->data = &omp_data;
 5768|      1|      }
 5769|      1|    }
 5770|       |
 5771|      1|    { // Initialize KMP_DEVICE_THREAD_LIMIT and KMP_ALL_THREADS
 5772|      1|      kmp_setting_t *kmp_device_thread_limit =
 5773|      1|          __kmp_stg_find("KMP_DEVICE_THREAD_LIMIT"); // 1st priority.
 5774|      1|      kmp_setting_t *kmp_all_threads =
 5775|      1|          __kmp_stg_find("KMP_ALL_THREADS"); // 2nd priority.
 5776|       |
 5777|       |      // !!! volatile keyword is Intel(R) C Compiler bug CQ49908 workaround.
 5778|      1|      static kmp_setting_t *volatile rivals[3];
 5779|      1|      int i = 0;
 5780|       |
 5781|      1|      rivals[i++] = kmp_device_thread_limit;
 5782|      1|      rivals[i++] = kmp_all_threads;
 5783|      1|      rivals[i++] = NULL;
 5784|       |
 5785|      1|      kmp_device_thread_limit->data = CCAST(kmp_setting_t **, rivals);
  ------------------
  |  |  229|      1|#define CCAST(type, var) const_cast<type>(var)
  ------------------
 5786|      1|      kmp_all_threads->data = CCAST(kmp_setting_t **, rivals);
  ------------------
  |  |  229|      1|#define CCAST(type, var) const_cast<type>(var)
  ------------------
 5787|      1|    }
 5788|       |
 5789|      1|    { // Initialize KMP_HW_SUBSET and KMP_PLACE_THREADS
 5790|       |      // 1st priority
 5791|      1|      kmp_setting_t *kmp_hw_subset = __kmp_stg_find("KMP_HW_SUBSET");
 5792|       |      // 2nd priority
 5793|      1|      kmp_setting_t *kmp_place_threads = __kmp_stg_find("KMP_PLACE_THREADS");
 5794|       |
 5795|       |      // !!! volatile keyword is Intel(R) C Compiler bug CQ49908 workaround.
 5796|      1|      static kmp_setting_t *volatile rivals[3];
 5797|      1|      int i = 0;
 5798|       |
 5799|      1|      rivals[i++] = kmp_hw_subset;
 5800|      1|      rivals[i++] = kmp_place_threads;
 5801|      1|      rivals[i++] = NULL;
 5802|       |
 5803|      1|      kmp_hw_subset->data = CCAST(kmp_setting_t **, rivals);
  ------------------
  |  |  229|      1|#define CCAST(type, var) const_cast<type>(var)
  ------------------
 5804|      1|      kmp_place_threads->data = CCAST(kmp_setting_t **, rivals);
  ------------------
  |  |  229|      1|#define CCAST(type, var) const_cast<type>(var)
  ------------------
 5805|      1|    }
 5806|       |
 5807|      1|#if KMP_AFFINITY_SUPPORTED
 5808|      1|    { // Initialize KMP_AFFINITY, GOMP_CPU_AFFINITY, and OMP_PROC_BIND data.
 5809|      1|      kmp_setting_t *kmp_affinity =
 5810|      1|          __kmp_stg_find("KMP_AFFINITY"); // 1st priority.
 5811|      1|      KMP_DEBUG_ASSERT(kmp_affinity != NULL);
 5812|       |
 5813|      1|#ifdef KMP_GOMP_COMPAT
 5814|      1|      kmp_setting_t *gomp_cpu_affinity =
 5815|      1|          __kmp_stg_find("GOMP_CPU_AFFINITY"); // 2nd priority.
 5816|      1|      KMP_DEBUG_ASSERT(gomp_cpu_affinity != NULL);
 5817|      1|#endif
 5818|       |
 5819|      1|      kmp_setting_t *omp_proc_bind =
 5820|      1|          __kmp_stg_find("OMP_PROC_BIND"); // 3rd priority.
 5821|      1|      KMP_DEBUG_ASSERT(omp_proc_bind != NULL);
 5822|       |
 5823|       |      // !!! volatile keyword is Intel(R) C Compiler bug CQ49908 workaround.
 5824|      1|      static kmp_setting_t *volatile rivals[4];
 5825|      1|      int i = 0;
 5826|       |
 5827|      1|      rivals[i++] = kmp_affinity;
 5828|       |
 5829|      1|#ifdef KMP_GOMP_COMPAT
 5830|      1|      rivals[i++] = gomp_cpu_affinity;
 5831|      1|      gomp_cpu_affinity->data = CCAST(kmp_setting_t **, rivals);
  ------------------
  |  |  229|      1|#define CCAST(type, var) const_cast<type>(var)
  ------------------
 5832|      1|#endif
 5833|       |
 5834|      1|      rivals[i++] = omp_proc_bind;
 5835|      1|      omp_proc_bind->data = CCAST(kmp_setting_t **, rivals);
  ------------------
  |  |  229|      1|#define CCAST(type, var) const_cast<type>(var)
  ------------------
 5836|      1|      rivals[i++] = NULL;
 5837|       |
 5838|      1|      static kmp_setting_t *volatile places_rivals[4];
 5839|      1|      i = 0;
 5840|       |
 5841|      1|      kmp_setting_t *omp_places = __kmp_stg_find("OMP_PLACES"); // 3rd priority.
 5842|      1|      KMP_DEBUG_ASSERT(omp_places != NULL);
 5843|       |
 5844|      1|      places_rivals[i++] = kmp_affinity;
 5845|      1|#ifdef KMP_GOMP_COMPAT
 5846|      1|      places_rivals[i++] = gomp_cpu_affinity;
 5847|      1|#endif
 5848|      1|      places_rivals[i++] = omp_places;
 5849|      1|      omp_places->data = CCAST(kmp_setting_t **, places_rivals);
  ------------------
  |  |  229|      1|#define CCAST(type, var) const_cast<type>(var)
  ------------------
 5850|      1|      places_rivals[i++] = NULL;
 5851|      1|    }
 5852|       |#else
 5853|       |// KMP_AFFINITY not supported, so OMP_PROC_BIND has no rivals.
 5854|       |// OMP_PLACES not supported yet.
 5855|       |#endif // KMP_AFFINITY_SUPPORTED
 5856|       |
 5857|      1|    { // Initialize KMP_DETERMINISTIC_REDUCTION and KMP_FORCE_REDUCTION data.
 5858|      1|      kmp_setting_t *kmp_force_red =
 5859|      1|          __kmp_stg_find("KMP_FORCE_REDUCTION"); // 1st priority.
 5860|      1|      kmp_setting_t *kmp_determ_red =
 5861|      1|          __kmp_stg_find("KMP_DETERMINISTIC_REDUCTION"); // 2nd priority.
 5862|       |
 5863|       |      // !!! volatile keyword is Intel(R) C Compiler bug CQ49908 workaround.
 5864|      1|      static kmp_setting_t *volatile rivals[3];
 5865|      1|      static kmp_stg_fr_data_t force_data = {1,
 5866|      1|                                             CCAST(kmp_setting_t **, rivals)};
  ------------------
  |  |  229|      1|#define CCAST(type, var) const_cast<type>(var)
  ------------------
 5867|      1|      static kmp_stg_fr_data_t determ_data = {0,
 5868|      1|                                              CCAST(kmp_setting_t **, rivals)};
  ------------------
  |  |  229|      1|#define CCAST(type, var) const_cast<type>(var)
  ------------------
 5869|      1|      int i = 0;
 5870|       |
 5871|      1|      rivals[i++] = kmp_force_red;
 5872|      1|      if (kmp_determ_red != NULL) {
  ------------------
  |  Branch (5872:11): [True: 1, False: 0]
  ------------------
 5873|      1|        rivals[i++] = kmp_determ_red;
 5874|      1|      }
 5875|      1|      rivals[i++] = NULL;
 5876|       |
 5877|      1|      kmp_force_red->data = &force_data;
 5878|      1|      if (kmp_determ_red != NULL) {
  ------------------
  |  Branch (5878:11): [True: 1, False: 0]
  ------------------
 5879|      1|        kmp_determ_red->data = &determ_data;
 5880|      1|      }
 5881|      1|    }
 5882|       |
 5883|      1|    initialized = 1;
 5884|      1|  }
 5885|       |
 5886|       |  // Reset flags.
 5887|      2|  int i;
 5888|    176|  for (i = 0; i < __kmp_stg_count; ++i) {
  ------------------
  |  Branch (5888:15): [True: 174, False: 2]
  ------------------
 5889|    174|    __kmp_stg_table[i].set = 0;
 5890|    174|  }
 5891|       |
 5892|      2|} // __kmp_stg_init
kmp_settings.cpp:_ZL13__kmp_stg_cmpPKvS0_:
 5678|    431|static int __kmp_stg_cmp(void const *_a, void const *_b) {
 5679|    431|  const kmp_setting_t *a = RCAST(const kmp_setting_t *, _a);
  ------------------
  |  |  230|    431|#define RCAST(type, var) reinterpret_cast<type>(var)
  ------------------
 5680|    431|  const kmp_setting_t *b = RCAST(const kmp_setting_t *, _b);
  ------------------
  |  |  230|    431|#define RCAST(type, var) reinterpret_cast<type>(var)
  ------------------
 5681|       |
 5682|       |  // Process KMP_AFFINITY last.
 5683|       |  // It needs to come after OMP_PLACES and GOMP_CPU_AFFINITY.
 5684|    431|  if (strcmp(a->name, "KMP_AFFINITY") == 0) {
  ------------------
  |  Branch (5684:7): [True: 7, False: 424]
  ------------------
 5685|      7|    if (strcmp(b->name, "KMP_AFFINITY") == 0) {
  ------------------
  |  Branch (5685:9): [True: 0, False: 7]
  ------------------
 5686|      0|      return 0;
 5687|      0|    }
 5688|      7|    return 1;
 5689|    424|  } else if (strcmp(b->name, "KMP_AFFINITY") == 0) {
  ------------------
  |  Branch (5689:14): [True: 1, False: 423]
  ------------------
 5690|      1|    return -1;
 5691|      1|  }
 5692|    423|  return strcmp(a->name, b->name);
 5693|    431|} // __kmp_stg_cmp
kmp_settings.cpp:_ZL14__kmp_stg_findPKc:
 5664|     83|static inline kmp_setting_t *__kmp_stg_find(char const *name) {
 5665|       |
 5666|     83|  int i;
 5667|     83|  if (name != NULL) {
  ------------------
  |  Branch (5667:7): [True: 83, False: 0]
  ------------------
 5668|  6.58k|    for (i = 0; i < __kmp_stg_count; ++i) {
  ------------------
  |  Branch (5668:17): [True: 6.51k, False: 68]
  ------------------
 5669|  6.51k|      if (strcmp(__kmp_stg_table[i].name, name) == 0) {
  ------------------
  |  Branch (5669:11): [True: 15, False: 6.50k]
  ------------------
 5670|     15|        return &__kmp_stg_table[i];
 5671|     15|      }
 5672|  6.51k|    }
 5673|     83|  }
 5674|     68|  return NULL;
 5675|       |
 5676|     83|} // __kmp_stg_find
kmp_settings.cpp:_ZL15__kmp_stg_parsePKcS0_:
 5894|     35|static void __kmp_stg_parse(char const *name, char const *value) {
 5895|       |  // On Windows* OS there are some nameless variables like "C:=C:\" (yeah,
 5896|       |  // really nameless, they are presented in environment block as
 5897|       |  // "=C:=C\\\x00=D:=D:\\\x00...", so let us skip them.
 5898|     35|  if (name[0] == 0) {
  ------------------
  |  Branch (5898:7): [True: 0, False: 35]
  ------------------
 5899|      0|    return;
 5900|      0|  }
 5901|       |
 5902|     35|  if (value != NULL) {
  ------------------
  |  Branch (5902:7): [True: 34, False: 1]
  ------------------
 5903|     34|    kmp_setting_t *setting = __kmp_stg_find(name);
 5904|     34|    if (setting != NULL) {
  ------------------
  |  Branch (5904:9): [True: 0, False: 34]
  ------------------
 5905|      0|      setting->parse(name, value, setting->data);
 5906|      0|      setting->defined = 1;
 5907|      0|    }
 5908|     34|  }
 5909|       |
 5910|     35|} // __kmp_stg_parse
kmp_settings.cpp:_ZL25__kmp_stg_print_blocktimeP11kmp_str_bufPKcPv:
  770|      1|                                      void *data) {
  771|      1|  __kmp_stg_print_int(buffer, name, __kmp_dflt_blocktime);
  772|      1|} // __kmp_stg_print_blocktime
kmp_settings.cpp:_ZL19__kmp_stg_print_intP11kmp_str_bufPKci:
  590|     24|                                int value) {
  591|     24|  if (__kmp_env_format) {
  ------------------
  |  Branch (591:7): [True: 0, False: 24]
  ------------------
  592|      0|    KMP_STR_BUF_PRINT_INT;
  ------------------
  |  |   60|      0|  __kmp_str_buf_print(buffer, "  %s %s='%d'\n", KMP_I18N_STR(Host), name, value)
  |  |  ------------------
  |  |  |  |   46|      0|#define KMP_I18N_STR(id) __kmp_i18n_catgets(kmp_i18n_str_##id)
  |  |  ------------------
  ------------------
  593|     24|  } else {
  594|     24|    __kmp_str_buf_print(buffer, "   %s=%d\n", name, value);
  595|     24|  }
  596|     24|} // __kmp_stg_print_int
kmp_settings.cpp:_ZL25__kmp_stg_print_use_yieldP11kmp_str_bufPKcPv:
  725|      1|                                      void *data) {
  726|      1|  __kmp_stg_print_int(buffer, name, __kmp_use_yield);
  727|      1|} // __kmp_stg_print_use_yield
kmp_settings.cpp:_ZL32__kmp_stg_print_duplicate_lib_okP11kmp_str_bufPKcPv:
  785|      1|                                             char const *name, void *data) {
  786|      1|  __kmp_stg_print_bool(buffer, name, __kmp_duplicate_library_ok);
  787|      1|} // __kmp_stg_print_duplicate_lib_ok
kmp_settings.cpp:_ZL20__kmp_stg_print_boolP11kmp_str_bufPKci:
  581|     17|                                 int value) {
  582|     17|  if (__kmp_env_format) {
  ------------------
  |  Branch (582:7): [True: 0, False: 17]
  ------------------
  583|      0|    KMP_STR_BUF_PRINT_BOOL;
  ------------------
  |  |   58|      0|  KMP_STR_BUF_PRINT_BOOL_EX(name, value, "TRUE", "FALSE")
  |  |  ------------------
  |  |  |  |   55|      0|  __kmp_str_buf_print(buffer, "  %s %s='%s'\n", KMP_I18N_STR(Host), n,         \
  |  |  |  |  ------------------
  |  |  |  |  |  |   46|      0|#define KMP_I18N_STR(id) __kmp_i18n_catgets(kmp_i18n_str_##id)
  |  |  |  |  ------------------
  |  |  |  |   56|      0|                      (v) ? t : f)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (56:23): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  584|     17|  } else {
  585|     17|    __kmp_str_buf_print(buffer, "   %s=%s\n", name, value ? "true" : "false");
  ------------------
  |  Branch (585:53): [True: 5, False: 12]
  ------------------
  586|     17|  }
  587|     17|} // __kmp_stg_print_bool
kmp_settings.cpp:_ZL27__kmp_stg_print_wait_policyP11kmp_str_bufPKcPv:
  868|      2|                                        void *data) {
  869|       |
  870|      2|  kmp_stg_wp_data_t *wait = (kmp_stg_wp_data_t *)data;
  871|      2|  char const *value = NULL;
  872|       |
  873|      2|  if (wait->omp) {
  ------------------
  |  Branch (873:7): [True: 1, False: 1]
  ------------------
  874|      1|    switch (__kmp_library) {
  ------------------
  |  Branch (874:13): [True: 0, False: 1]
  ------------------
  875|      0|    case library_turnaround: {
  ------------------
  |  Branch (875:5): [True: 0, False: 1]
  ------------------
  876|      0|      value = "ACTIVE";
  877|      0|    } break;
  878|      0|    case library_throughput: {
  ------------------
  |  Branch (878:5): [True: 0, False: 1]
  ------------------
  879|      0|      value = "PASSIVE";
  880|      0|    } break;
  881|      1|    }
  882|      1|  } else {
  883|      1|    switch (__kmp_library) {
  ------------------
  |  Branch (883:13): [True: 0, False: 1]
  ------------------
  884|      0|    case library_serial: {
  ------------------
  |  Branch (884:5): [True: 0, False: 1]
  ------------------
  885|      0|      value = "serial";
  886|      0|    } break;
  887|      0|    case library_turnaround: {
  ------------------
  |  Branch (887:5): [True: 0, False: 1]
  ------------------
  888|      0|      value = "turnaround";
  889|      0|    } break;
  890|      0|    case library_throughput: {
  ------------------
  |  Branch (890:5): [True: 0, False: 1]
  ------------------
  891|      0|      value = "throughput";
  892|      0|    } break;
  893|      1|    }
  894|      1|  }
  895|      2|  if (value != NULL) {
  ------------------
  |  Branch (895:7): [True: 0, False: 2]
  ------------------
  896|      0|    __kmp_stg_print_str(buffer, name, value);
  897|      0|  }
  898|       |
  899|      2|} // __kmp_stg_print_wait_policy
kmp_settings.cpp:_ZL19__kmp_stg_print_strP11kmp_str_bufPKcS2_:
  608|      4|                                char const *value) {
  609|      4|  if (__kmp_env_format) {
  ------------------
  |  Branch (609:7): [True: 0, False: 4]
  ------------------
  610|      0|    KMP_STR_BUF_PRINT_STR;
  ------------------
  |  |   65|      0|  __kmp_str_buf_print(buffer, "  %s %s='%s'\n", KMP_I18N_STR(Host), name, value)
  |  |  ------------------
  |  |  |  |   46|      0|#define KMP_I18N_STR(id) __kmp_i18n_catgets(kmp_i18n_str_##id)
  |  |  ------------------
  ------------------
  611|      4|  } else {
  612|      4|    __kmp_str_buf_print(buffer, "   %s=%s\n", name, value);
  613|      4|  }
  614|      4|} // __kmp_stg_print_str
kmp_settings.cpp:_ZL35__kmp_stg_print_device_thread_limitP11kmp_str_bufPKcPv:
  659|      1|                                                char const *name, void *data) {
  660|      1|  __kmp_stg_print_int(buffer, name, __kmp_max_nth);
  661|      1|} // __kmp_stg_print_device_thread_limit
kmp_settings.cpp:_ZL24__kmp_stg_print_settingsP11kmp_str_bufPKcPv:
  941|      1|                                     void *data) {
  942|      1|  __kmp_stg_print_bool(buffer, name, __kmp_settings);
  943|      1|} // __kmp_stg_print_settings
kmp_settings.cpp:_ZL27__kmp_stg_print_stackoffsetP11kmp_str_bufPKcPv:
  978|      1|                                        void *data) {
  979|      1|  __kmp_stg_print_size(buffer, name, __kmp_stkoffset);
  980|      1|} // __kmp_stg_print_stackoffset
kmp_settings.cpp:_ZL20__kmp_stg_print_sizeP11kmp_str_bufPKcm:
  617|      3|                                 size_t value) {
  618|      3|  if (__kmp_env_format) {
  ------------------
  |  Branch (618:7): [True: 0, False: 3]
  ------------------
  619|      0|    KMP_STR_BUF_PRINT_NAME_EX(name);
  ------------------
  |  |   53|      0|  __kmp_str_buf_print(buffer, "  %s %s='", KMP_I18N_STR(Host), x)
  |  |  ------------------
  |  |  |  |   46|      0|#define KMP_I18N_STR(id) __kmp_i18n_catgets(kmp_i18n_str_##id)
  |  |  ------------------
  ------------------
  620|      0|    __kmp_str_buf_print_size(buffer, value);
  621|      0|    __kmp_str_buf_print(buffer, "'\n");
  622|      3|  } else {
  623|      3|    __kmp_str_buf_print(buffer, "   %s=", name);
  624|      3|    __kmp_str_buf_print_size(buffer, value);
  625|      3|    __kmp_str_buf_print(buffer, "\n");
  626|      3|    return;
  627|      3|  }
  628|      3|} // __kmp_stg_print_size
kmp_settings.cpp:_ZL25__kmp_stg_print_stacksizeP11kmp_str_bufPKcPv:
 1010|      2|                                      void *data) {
 1011|      2|  kmp_stg_ss_data_t *stacksize = (kmp_stg_ss_data_t *)data;
 1012|      2|  if (__kmp_env_format) {
  ------------------
  |  Branch (1012:7): [True: 0, False: 2]
  ------------------
 1013|      0|    KMP_STR_BUF_PRINT_NAME_EX(name);
  ------------------
  |  |   53|      0|  __kmp_str_buf_print(buffer, "  %s %s='", KMP_I18N_STR(Host), x)
  |  |  ------------------
  |  |  |  |   46|      0|#define KMP_I18N_STR(id) __kmp_i18n_catgets(kmp_i18n_str_##id)
  |  |  ------------------
  ------------------
 1014|      0|    __kmp_str_buf_print_size(buffer, (__kmp_stksize % 1024)
  ------------------
  |  Branch (1014:38): [True: 0, False: 0]
  ------------------
 1015|      0|                                         ? __kmp_stksize / stacksize->factor
 1016|      0|                                         : __kmp_stksize);
 1017|      0|    __kmp_str_buf_print(buffer, "'\n");
 1018|      2|  } else {
 1019|      2|    __kmp_str_buf_print(buffer, "   %s=", name);
 1020|      2|    __kmp_str_buf_print_size(buffer, (__kmp_stksize % 1024)
  ------------------
  |  Branch (1020:38): [True: 0, False: 2]
  ------------------
 1021|      2|                                         ? __kmp_stksize / stacksize->factor
 1022|      2|                                         : __kmp_stksize);
 1023|      2|    __kmp_str_buf_print(buffer, "\n");
 1024|      2|  }
 1025|      2|} // __kmp_stg_print_stacksize
kmp_settings.cpp:_ZL24__kmp_stg_print_stackpadP11kmp_str_bufPKcPv:
  959|      1|                                     void *data) {
  960|      1|  __kmp_stg_print_int(buffer, name, __kmp_stkpadding);
  961|      1|} // __kmp_stg_print_stackpad
kmp_settings.cpp:_ZL23__kmp_stg_print_versionP11kmp_str_bufPKcPv:
 1036|      1|                                    void *data) {
 1037|      1|  __kmp_stg_print_bool(buffer, name, __kmp_version);
 1038|      1|} // __kmp_stg_print_version
kmp_settings.cpp:_ZL24__kmp_stg_print_warningsP11kmp_str_bufPKcPv:
 1054|      1|                                     void *data) {
 1055|       |  // AC: TODO: change to print_int? (needs documentation change)
 1056|      1|  __kmp_stg_print_bool(buffer, name, __kmp_generate_warnings);
 1057|      1|} // __kmp_stg_print_warnings
kmp_settings.cpp:_ZL28__kmp_stg_print_nesting_modeP11kmp_str_bufPKcPv:
 1072|      1|                                         char const *name, void *data) {
 1073|      1|  if (__kmp_env_format) {
  ------------------
  |  Branch (1073:7): [True: 0, False: 1]
  ------------------
 1074|      0|    KMP_STR_BUF_PRINT_NAME;
  ------------------
  |  |   51|      0|  __kmp_str_buf_print(buffer, "  %s %s", KMP_I18N_STR(Host), name)
  |  |  ------------------
  |  |  |  |   46|      0|#define KMP_I18N_STR(id) __kmp_i18n_catgets(kmp_i18n_str_##id)
  |  |  ------------------
  ------------------
 1075|      1|  } else {
 1076|      1|    __kmp_str_buf_print(buffer, "   %s", name);
 1077|      1|  }
 1078|      1|  __kmp_str_buf_print(buffer, "=%d\n", __kmp_nesting_mode);
 1079|      1|} // __kmp_stg_print_nesting_mode
kmp_settings.cpp:_ZL22__kmp_stg_print_nestedP11kmp_str_bufPKcPv:
 1099|      1|                                   void *data) {
 1100|      1|  if (__kmp_env_format) {
  ------------------
  |  Branch (1100:7): [True: 0, False: 1]
  ------------------
 1101|      0|    KMP_STR_BUF_PRINT_NAME;
  ------------------
  |  |   51|      0|  __kmp_str_buf_print(buffer, "  %s %s", KMP_I18N_STR(Host), name)
  |  |  ------------------
  |  |  |  |   46|      0|#define KMP_I18N_STR(id) __kmp_i18n_catgets(kmp_i18n_str_##id)
  |  |  ------------------
  ------------------
 1102|      1|  } else {
 1103|      1|    __kmp_str_buf_print(buffer, "   %s", name);
 1104|      1|  }
 1105|      1|  __kmp_str_buf_print(buffer, ": deprecated; max-active-levels-var=%d\n",
 1106|      1|                      __kmp_dflt_max_active_levels);
 1107|      1|} // __kmp_stg_print_nested
kmp_settings.cpp:_ZL27__kmp_stg_print_num_threadsP11kmp_str_bufPKcPv:
 1328|      1|                                        void *data) {
 1329|      1|  if (__kmp_env_format) {
  ------------------
  |  Branch (1329:7): [True: 0, False: 1]
  ------------------
 1330|      0|    KMP_STR_BUF_PRINT_NAME;
  ------------------
  |  |   51|      0|  __kmp_str_buf_print(buffer, "  %s %s", KMP_I18N_STR(Host), name)
  |  |  ------------------
  |  |  |  |   46|      0|#define KMP_I18N_STR(id) __kmp_i18n_catgets(kmp_i18n_str_##id)
  |  |  ------------------
  ------------------
 1331|      1|  } else {
 1332|      1|    __kmp_str_buf_print(buffer, "   %s", name);
 1333|      1|  }
 1334|      1|  if (__kmp_nested_nth.used) {
  ------------------
  |  Branch (1334:7): [True: 0, False: 1]
  ------------------
 1335|      0|    kmp_str_buf_t buf;
 1336|      0|    __kmp_str_buf_init(&buf);
  ------------------
  |  |   41|      0|  {                                                                            \
  |  |   42|      0|    (b)->str = (b)->bulk;                                                      \
  |  |   43|      0|    (b)->size = sizeof((b)->bulk);                                             \
  |  |   44|      0|    (b)->used = 0;                                                             \
  |  |   45|      0|    (b)->bulk[0] = 0;                                                          \
  |  |   46|      0|  }
  ------------------
 1337|      0|    for (int i = 0; i < __kmp_nested_nth.used; i++) {
  ------------------
  |  Branch (1337:21): [True: 0, False: 0]
  ------------------
 1338|      0|      __kmp_str_buf_print(&buf, "%d", __kmp_nested_nth.nth[i]);
 1339|      0|      if (i < __kmp_nested_nth.used - 1) {
  ------------------
  |  Branch (1339:11): [True: 0, False: 0]
  ------------------
 1340|      0|        __kmp_str_buf_print(&buf, ",");
 1341|      0|      }
 1342|      0|    }
 1343|      0|    __kmp_str_buf_print(buffer, "='%s'\n", buf.str);
 1344|      0|    __kmp_str_buf_free(&buf);
 1345|      1|  } else {
 1346|      1|    __kmp_str_buf_print(buffer, ": %s\n", KMP_I18N_STR(NotDefined));
  ------------------
  |  |   46|      1|#define KMP_I18N_STR(id) __kmp_i18n_catgets(kmp_i18n_str_##id)
  ------------------
 1347|      1|  }
 1348|      1|} // __kmp_stg_print_num_threads
kmp_settings.cpp:_ZL23__kmp_stg_print_taskingP11kmp_str_bufPKcPv:
 1360|      1|                                    void *data) {
 1361|      1|  __kmp_stg_print_int(buffer, name, __kmp_tasking_mode);
 1362|      1|} // __kmp_stg_print_tasking
kmp_settings.cpp:_ZL29__kmp_stg_print_task_stealingP11kmp_str_bufPKcPv:
 1371|      1|                                          char const *name, void *data) {
 1372|      1|  __kmp_stg_print_int(buffer, name, __kmp_task_stealing_constraint);
 1373|      1|} // __kmp_stg_print_task_stealing
kmp_settings.cpp:_ZL33__kmp_stg_print_max_active_levelsP11kmp_str_bufPKcPv:
 1396|      1|                                              char const *name, void *data) {
 1397|      1|  __kmp_stg_print_int(buffer, name, __kmp_dflt_max_active_levels);
 1398|      1|} // __kmp_stg_print_max_active_levels
kmp_settings.cpp:_ZL30__kmp_stg_print_default_deviceP11kmp_str_bufPKcPv:
 1409|      1|                                           char const *name, void *data) {
 1410|      1|  __kmp_stg_print_int(buffer, name, __kmp_default_device);
 1411|      1|} // __kmp_stg_print_default_device
kmp_settings.cpp:_ZL30__kmp_stg_print_target_offloadP11kmp_str_bufPKcPv:
 1436|      1|                                           char const *name, void *data) {
 1437|      1|  const char *value = NULL;
 1438|      1|  if (__kmp_target_offload == tgt_default)
  ------------------
  |  Branch (1438:7): [True: 1, False: 0]
  ------------------
 1439|      1|    value = "DEFAULT";
 1440|      0|  else if (__kmp_target_offload == tgt_mandatory)
  ------------------
  |  Branch (1440:12): [True: 0, False: 0]
  ------------------
 1441|      0|    value = "MANDATORY";
 1442|      0|  else if (__kmp_target_offload == tgt_disabled)
  ------------------
  |  Branch (1442:12): [True: 0, False: 0]
  ------------------
 1443|      0|    value = "DISABLED";
 1444|      1|  KMP_DEBUG_ASSERT(value);
 1445|      1|  if (__kmp_env_format) {
  ------------------
  |  Branch (1445:7): [True: 0, False: 1]
  ------------------
 1446|      0|    KMP_STR_BUF_PRINT_NAME;
  ------------------
  |  |   51|      0|  __kmp_str_buf_print(buffer, "  %s %s", KMP_I18N_STR(Host), name)
  |  |  ------------------
  |  |  |  |   46|      0|#define KMP_I18N_STR(id) __kmp_i18n_catgets(kmp_i18n_str_##id)
  |  |  ------------------
  ------------------
 1447|      1|  } else {
 1448|      1|    __kmp_str_buf_print(buffer, "   %s", name);
 1449|      1|  }
 1450|      1|  __kmp_str_buf_print(buffer, "=%s\n", value);
 1451|      1|} // __kmp_stg_print_target_offload
kmp_settings.cpp:_ZL33__kmp_stg_print_max_task_priorityP11kmp_str_bufPKcPv:
 1462|      1|                                              char const *name, void *data) {
 1463|      1|  __kmp_stg_print_int(buffer, name, __kmp_max_task_priority);
 1464|      1|} // __kmp_stg_print_max_task_priority
kmp_settings.cpp:_ZL34__kmp_stg_print_taskloop_min_tasksP11kmp_str_bufPKcPv:
 1476|      1|                                               char const *name, void *data) {
 1477|      1|  __kmp_stg_print_uint64(buffer, name, __kmp_taskloop_min_tasks);
 1478|      1|} // __kmp_stg_print_taskloop_min_tasks
kmp_settings.cpp:_ZL22__kmp_stg_print_uint64P11kmp_str_bufPKcy:
  599|      1|                                   kmp_uint64 value) {
  600|      1|  if (__kmp_env_format) {
  ------------------
  |  Branch (600:7): [True: 0, False: 1]
  ------------------
  601|      0|    KMP_STR_BUF_PRINT_UINT64;
  ------------------
  |  |   62|      0|  __kmp_str_buf_print(buffer, "  %s %s='%" KMP_UINT64_SPEC "'\n",              \
  |  |   63|      0|                      KMP_I18N_STR(Host), name, value);
  |  |  ------------------
  |  |  |  |   46|      0|#define KMP_I18N_STR(id) __kmp_i18n_catgets(kmp_i18n_str_##id)
  |  |  ------------------
  ------------------
  602|      1|  } else {
  603|      1|    __kmp_str_buf_print(buffer, "   %s=%" KMP_UINT64_SPEC "\n", name, value);
  604|      1|  }
  605|      1|} // __kmp_stg_print_uint64
kmp_settings.cpp:_ZL28__kmp_stg_print_thread_limitP11kmp_str_bufPKcPv:
  673|      1|                                         char const *name, void *data) {
  674|      1|  __kmp_stg_print_int(buffer, name, __kmp_cg_max_nth);
  675|      1|} // __kmp_stg_print_thread_limit
kmp_settings.cpp:_ZL34__kmp_stg_print_teams_thread_limitP11kmp_str_bufPKcPv:
  712|      1|                                               char const *name, void *data) {
  713|      1|  __kmp_stg_print_int(buffer, name, __kmp_teams_max_nth);
  714|      1|} // __kmp_stg_print_teams_thread_limit
kmp_settings.cpp:_ZL22__kmp_stg_print_nteamsP11kmp_str_bufPKcPv:
  686|      1|                                   void *data) {
  687|      1|  __kmp_stg_print_int(buffer, name, __kmp_nteams);
  688|      1|} // __kmp_stg_print_nteams
kmp_settings.cpp:_ZL30__kmp_stg_print_teams_th_limitP11kmp_str_bufPKcPv:
  700|      1|                                           char const *name, void *data) {
  701|      1|  __kmp_stg_print_int(buffer, name, __kmp_teams_thread_limit);
  702|      1|} // __kmp_stg_print_teams_th_limit
kmp_settings.cpp:_ZL28__kmp_stg_print_disp_buffersP11kmp_str_bufPKcPv:
 1493|      1|                                         char const *name, void *data) {
 1494|      1|  __kmp_stg_print_int(buffer, name, __kmp_dispatch_num_buffers);
 1495|      1|} // __kmp_stg_print_disp_buffers
kmp_settings.cpp:_ZL31__kmp_stg_print_hot_teams_levelP11kmp_str_bufPKcPv:
 1512|      1|                                            char const *name, void *data) {
 1513|      1|  __kmp_stg_print_int(buffer, name, __kmp_hot_teams_max_level);
 1514|      1|} // __kmp_stg_print_hot_teams_level
kmp_settings.cpp:_ZL30__kmp_stg_print_hot_teams_modeP11kmp_str_bufPKcPv:
 1527|      1|                                           char const *name, void *data) {
 1528|      1|  __kmp_stg_print_int(buffer, name, __kmp_hot_teams_mode);
 1529|      1|} // __kmp_stg_print_hot_teams_mode
kmp_settings.cpp:_ZL30__kmp_stg_print_handle_signalsP11kmp_str_bufPKcPv:
 1544|      1|                                           char const *name, void *data) {
 1545|      1|  __kmp_stg_print_bool(buffer, name, __kmp_handle_signals);
 1546|      1|} // __kmp_stg_print_handle_signals
kmp_settings.cpp:_ZL34__kmp_stg_print_inherit_fp_controlP11kmp_str_bufPKcPv:
  800|      1|                                               char const *name, void *data) {
  801|       |#if KMP_DEBUG
  802|       |  __kmp_stg_print_bool(buffer, name, __kmp_inherit_fp_control);
  803|       |#endif /* KMP_DEBUG */
  804|      1|} // __kmp_stg_print_inherit_fp_control
kmp_settings.cpp:_ZL27__kmp_stg_print_align_allocP11kmp_str_bufPKcPv:
 1677|      1|                                        void *data) {
 1678|      1|  __kmp_stg_print_size(buffer, name, __kmp_align_alloc);
 1679|      1|} // __kmp_stg_print_align_alloc
kmp_settings.cpp:_ZL34__kmp_stg_print_barrier_branch_bitP11kmp_str_bufPKcPv:
 1727|      3|                                               char const *name, void *data) {
 1728|      3|  const char *var;
 1729|     12|  for (int i = bs_plain_barrier; i < bs_last_barrier; i++) {
  ------------------
  |  Branch (1729:34): [True: 9, False: 3]
  ------------------
 1730|      9|    var = __kmp_barrier_branch_bit_env_name[i];
 1731|      9|    if (strcmp(var, name) == 0) {
  ------------------
  |  Branch (1731:9): [True: 3, False: 6]
  ------------------
 1732|      3|      if (__kmp_env_format) {
  ------------------
  |  Branch (1732:11): [True: 0, False: 3]
  ------------------
 1733|      0|        KMP_STR_BUF_PRINT_NAME_EX(__kmp_barrier_branch_bit_env_name[i]);
  ------------------
  |  |   53|      0|  __kmp_str_buf_print(buffer, "  %s %s='", KMP_I18N_STR(Host), x)
  |  |  ------------------
  |  |  |  |   46|      0|#define KMP_I18N_STR(id) __kmp_i18n_catgets(kmp_i18n_str_##id)
  |  |  ------------------
  ------------------
 1734|      3|      } else {
 1735|      3|        __kmp_str_buf_print(buffer, "   %s='",
 1736|      3|                            __kmp_barrier_branch_bit_env_name[i]);
 1737|      3|      }
 1738|      3|      __kmp_str_buf_print(buffer, "%d,%d'\n",
 1739|      3|                          __kmp_barrier_gather_branch_bits[i],
 1740|      3|                          __kmp_barrier_release_branch_bits[i]);
 1741|      3|    }
 1742|      9|  }
 1743|      3|} // __kmp_stg_print_barrier_branch_bit
kmp_settings.cpp:_ZL31__kmp_stg_print_barrier_patternP11kmp_str_bufPKcPv:
 1825|      3|                                            char const *name, void *data) {
 1826|      3|  const char *var;
 1827|     12|  for (int i = bs_plain_barrier; i < bs_last_barrier; i++) {
  ------------------
  |  Branch (1827:34): [True: 9, False: 3]
  ------------------
 1828|      9|    var = __kmp_barrier_pattern_env_name[i];
 1829|      9|    if (strcmp(var, name) == 0) {
  ------------------
  |  Branch (1829:9): [True: 3, False: 6]
  ------------------
 1830|      3|      int j = __kmp_barrier_gather_pattern[i];
 1831|      3|      int k = __kmp_barrier_release_pattern[i];
 1832|      3|      if (__kmp_env_format) {
  ------------------
  |  Branch (1832:11): [True: 0, False: 3]
  ------------------
 1833|      0|        KMP_STR_BUF_PRINT_NAME_EX(__kmp_barrier_pattern_env_name[i]);
  ------------------
  |  |   53|      0|  __kmp_str_buf_print(buffer, "  %s %s='", KMP_I18N_STR(Host), x)
  |  |  ------------------
  |  |  |  |   46|      0|#define KMP_I18N_STR(id) __kmp_i18n_catgets(kmp_i18n_str_##id)
  |  |  ------------------
  ------------------
 1834|      3|      } else {
 1835|      3|        __kmp_str_buf_print(buffer, "   %s='",
 1836|      3|                            __kmp_barrier_pattern_env_name[i]);
 1837|      3|      }
 1838|      3|      KMP_DEBUG_ASSERT(j < bp_last_bar && k < bp_last_bar);
 1839|      3|      __kmp_str_buf_print(buffer, "%s,%s'\n", __kmp_barrier_pattern_name[j],
 1840|      3|                          __kmp_barrier_pattern_name[k]);
 1841|      3|    }
 1842|      9|  }
 1843|      3|} // __kmp_stg_print_barrier_pattern
kmp_settings.cpp:_ZL27__kmp_stg_print_abort_delayP11kmp_str_bufPKcPv:
 1858|      1|                                        void *data) {
 1859|      1|  __kmp_stg_print_int(buffer, name, __kmp_abort_delay);
 1860|      1|} // __kmp_stg_print_abort_delay
kmp_settings.cpp:_ZL28__kmp_stg_print_cpuinfo_fileP11kmp_str_bufPKcPv:
 1874|      1|                                         char const *name, void *data) {
 1875|      1|#if KMP_AFFINITY_SUPPORTED
 1876|      1|  if (__kmp_env_format) {
  ------------------
  |  Branch (1876:7): [True: 0, False: 1]
  ------------------
 1877|      0|    KMP_STR_BUF_PRINT_NAME;
  ------------------
  |  |   51|      0|  __kmp_str_buf_print(buffer, "  %s %s", KMP_I18N_STR(Host), name)
  |  |  ------------------
  |  |  |  |   46|      0|#define KMP_I18N_STR(id) __kmp_i18n_catgets(kmp_i18n_str_##id)
  |  |  ------------------
  ------------------
 1878|      1|  } else {
 1879|      1|    __kmp_str_buf_print(buffer, "   %s", name);
 1880|      1|  }
 1881|      1|  if (__kmp_cpuinfo_file) {
  ------------------
  |  Branch (1881:7): [True: 0, False: 1]
  ------------------
 1882|      0|    __kmp_str_buf_print(buffer, "='%s'\n", __kmp_cpuinfo_file);
 1883|      1|  } else {
 1884|      1|    __kmp_str_buf_print(buffer, ": %s\n", KMP_I18N_STR(NotDefined));
  ------------------
  |  |   46|      1|#define KMP_I18N_STR(id) __kmp_i18n_catgets(kmp_i18n_str_##id)
  ------------------
 1885|      1|  }
 1886|      1|#endif
 1887|      1|} //__kmp_stg_print_cpuinfo_file
kmp_settings.cpp:_ZL31__kmp_stg_print_force_reductionP11kmp_str_bufPKcPv:
 1926|      2|                                            char const *name, void *data) {
 1927|       |
 1928|      2|  kmp_stg_fr_data_t *reduction = (kmp_stg_fr_data_t *)data;
 1929|      2|  if (reduction->force) {
  ------------------
  |  Branch (1929:7): [True: 1, False: 1]
  ------------------
 1930|      1|    if (__kmp_force_reduction_method == critical_reduce_block) {
  ------------------
  |  Branch (1930:9): [True: 0, False: 1]
  ------------------
 1931|      0|      __kmp_stg_print_str(buffer, name, "critical");
 1932|      1|    } else if (__kmp_force_reduction_method == atomic_reduce_block) {
  ------------------
  |  Branch (1932:16): [True: 0, False: 1]
  ------------------
 1933|      0|      __kmp_stg_print_str(buffer, name, "atomic");
 1934|      1|    } else if (__kmp_force_reduction_method == tree_reduce_block) {
  ------------------
  |  Branch (1934:16): [True: 0, False: 1]
  ------------------
 1935|      0|      __kmp_stg_print_str(buffer, name, "tree");
 1936|      1|    } else {
 1937|      1|      if (__kmp_env_format) {
  ------------------
  |  Branch (1937:11): [True: 0, False: 1]
  ------------------
 1938|      0|        KMP_STR_BUF_PRINT_NAME;
  ------------------
  |  |   51|      0|  __kmp_str_buf_print(buffer, "  %s %s", KMP_I18N_STR(Host), name)
  |  |  ------------------
  |  |  |  |   46|      0|#define KMP_I18N_STR(id) __kmp_i18n_catgets(kmp_i18n_str_##id)
  |  |  ------------------
  ------------------
 1939|      1|      } else {
 1940|      1|        __kmp_str_buf_print(buffer, "   %s", name);
 1941|      1|      }
 1942|      1|      __kmp_str_buf_print(buffer, ": %s\n", KMP_I18N_STR(NotDefined));
  ------------------
  |  |   46|      1|#define KMP_I18N_STR(id) __kmp_i18n_catgets(kmp_i18n_str_##id)
  ------------------
 1943|      1|    }
 1944|      1|  } else {
 1945|      1|    __kmp_stg_print_bool(buffer, name, __kmp_determ_red);
 1946|      1|  }
 1947|       |
 1948|      2|} // __kmp_stg_print_force_reduction
kmp_settings.cpp:_ZL27__kmp_stg_print_storage_mapP11kmp_str_bufPKcPv:
 1967|      1|                                        void *data) {
 1968|      1|  if (__kmp_storage_map_verbose || __kmp_storage_map_verbose_specified) {
  ------------------
  |  Branch (1968:7): [True: 0, False: 1]
  |  Branch (1968:36): [True: 0, False: 1]
  ------------------
 1969|      0|    __kmp_stg_print_str(buffer, name, "verbose");
 1970|      1|  } else {
 1971|      1|    __kmp_stg_print_bool(buffer, name, __kmp_storage_map);
 1972|      1|  }
 1973|      1|} // __kmp_stg_print_storage_map
kmp_settings.cpp:_ZL33__kmp_stg_print_all_threadprivateP11kmp_str_bufPKcPv:
 1986|      1|                                              char const *name, void *data) {
 1987|      1|  __kmp_stg_print_int(buffer, name, __kmp_tp_capacity);
 1988|      1|}
kmp_settings.cpp:_ZL45__kmp_stg_print_foreign_threads_threadprivateP11kmp_str_bufPKcPv:
 2001|      1|                                                          void *data) {
 2002|      1|  __kmp_stg_print_bool(buffer, name, __kmp_foreign_tp);
 2003|      1|} // __kmp_stg_print_foreign_threads_threadprivate
kmp_settings.cpp:_ZL24__kmp_stg_print_affinityP11kmp_str_bufPKcPv:
 2675|      1|                                     void *data) {
 2676|      1|  __kmp_print_affinity_env(buffer, name, __kmp_affinity);
 2677|      1|}
kmp_settings.cpp:_ZL24__kmp_print_affinity_envP11kmp_str_bufPKcRK14kmp_affinity_t:
 2597|      2|                                     const kmp_affinity_t &affinity) {
 2598|      2|  bool is_hh_affinity = (&affinity == &__kmp_hh_affinity);
 2599|      2|  if (__kmp_env_format) {
  ------------------
  |  Branch (2599:7): [True: 0, False: 2]
  ------------------
 2600|      0|    KMP_STR_BUF_PRINT_NAME_EX(name);
  ------------------
  |  |   53|      0|  __kmp_str_buf_print(buffer, "  %s %s='", KMP_I18N_STR(Host), x)
  |  |  ------------------
  |  |  |  |   46|      0|#define KMP_I18N_STR(id) __kmp_i18n_catgets(kmp_i18n_str_##id)
  |  |  ------------------
  ------------------
 2601|      2|  } else {
 2602|      2|    __kmp_str_buf_print(buffer, "   %s='", name);
 2603|      2|  }
 2604|      2|  if (affinity.flags.verbose) {
  ------------------
  |  Branch (2604:7): [True: 0, False: 2]
  ------------------
 2605|      0|    __kmp_str_buf_print(buffer, "%s,", "verbose");
 2606|      2|  } else {
 2607|      2|    __kmp_str_buf_print(buffer, "%s,", "noverbose");
 2608|      2|  }
 2609|      2|  if (affinity.flags.warnings) {
  ------------------
  |  Branch (2609:7): [True: 2, False: 0]
  ------------------
 2610|      2|    __kmp_str_buf_print(buffer, "%s,", "warnings");
 2611|      2|  } else {
 2612|      0|    __kmp_str_buf_print(buffer, "%s,", "nowarnings");
 2613|      0|  }
 2614|      2|  if (KMP_AFFINITY_CAPABLE()) {
  ------------------
  |  |  684|      2|#define KMP_AFFINITY_CAPABLE() (__kmp_affin_mask_size > 0)
  |  |  ------------------
  |  |  |  Branch (684:32): [True: 0, False: 2]
  |  |  ------------------
  ------------------
 2615|       |    // Hidden helper affinity does not affect global reset
 2616|       |    // or respect flags. That is still solely controlled by KMP_AFFINITY.
 2617|      0|    if (!is_hh_affinity) {
  ------------------
  |  Branch (2617:9): [True: 0, False: 0]
  ------------------
 2618|      0|      if (affinity.flags.respect) {
  ------------------
  |  Branch (2618:11): [True: 0, False: 0]
  ------------------
 2619|      0|        __kmp_str_buf_print(buffer, "%s,", "respect");
 2620|      0|      } else {
 2621|      0|        __kmp_str_buf_print(buffer, "%s,", "norespect");
 2622|      0|      }
 2623|      0|      if (affinity.flags.reset) {
  ------------------
  |  Branch (2623:11): [True: 0, False: 0]
  ------------------
 2624|      0|        __kmp_str_buf_print(buffer, "%s,", "reset");
 2625|      0|      } else {
 2626|      0|        __kmp_str_buf_print(buffer, "%s,", "noreset");
 2627|      0|      }
 2628|      0|    }
 2629|      0|    __kmp_str_buf_print(buffer, "granularity=%s,",
 2630|      0|                        __kmp_hw_get_keyword(affinity.gran, false));
 2631|      0|  }
 2632|      2|  if (!KMP_AFFINITY_CAPABLE()) {
  ------------------
  |  |  684|      2|#define KMP_AFFINITY_CAPABLE() (__kmp_affin_mask_size > 0)
  ------------------
  |  Branch (2632:7): [True: 2, False: 0]
  ------------------
 2633|      2|    __kmp_str_buf_print(buffer, "%s", "disabled");
 2634|      2|  } else {
 2635|      0|    int compact = affinity.compact;
 2636|      0|    int offset = affinity.offset;
 2637|      0|    switch (affinity.type) {
 2638|      0|    case affinity_none:
  ------------------
  |  Branch (2638:5): [True: 0, False: 0]
  ------------------
 2639|      0|      __kmp_str_buf_print(buffer, "%s", "none");
 2640|      0|      break;
 2641|      0|    case affinity_physical:
  ------------------
  |  Branch (2641:5): [True: 0, False: 0]
  ------------------
 2642|      0|      __kmp_str_buf_print(buffer, "%s,%d", "physical", offset);
 2643|      0|      break;
 2644|      0|    case affinity_logical:
  ------------------
  |  Branch (2644:5): [True: 0, False: 0]
  ------------------
 2645|      0|      __kmp_str_buf_print(buffer, "%s,%d", "logical", offset);
 2646|      0|      break;
 2647|      0|    case affinity_compact:
  ------------------
  |  Branch (2647:5): [True: 0, False: 0]
  ------------------
 2648|      0|      __kmp_str_buf_print(buffer, "%s,%d,%d", "compact", compact, offset);
 2649|      0|      break;
 2650|      0|    case affinity_scatter:
  ------------------
  |  Branch (2650:5): [True: 0, False: 0]
  ------------------
 2651|      0|      __kmp_str_buf_print(buffer, "%s,%d,%d", "scatter", compact, offset);
 2652|      0|      break;
 2653|      0|    case affinity_explicit:
  ------------------
  |  Branch (2653:5): [True: 0, False: 0]
  ------------------
 2654|      0|      __kmp_str_buf_print(buffer, "%s=[%s],%s", "proclist", affinity.proclist,
 2655|      0|                          "explicit");
 2656|      0|      break;
 2657|      0|    case affinity_balanced:
  ------------------
  |  Branch (2657:5): [True: 0, False: 0]
  ------------------
 2658|      0|      __kmp_str_buf_print(buffer, "%s,%d,%d", "balanced", compact, offset);
 2659|      0|      break;
 2660|      0|    case affinity_disabled:
  ------------------
  |  Branch (2660:5): [True: 0, False: 0]
  ------------------
 2661|      0|      __kmp_str_buf_print(buffer, "%s", "disabled");
 2662|      0|      break;
 2663|      0|    case affinity_default:
  ------------------
  |  Branch (2663:5): [True: 0, False: 0]
  ------------------
 2664|      0|      __kmp_str_buf_print(buffer, "%s", "default");
 2665|      0|      break;
 2666|      0|    default:
  ------------------
  |  Branch (2666:5): [True: 0, False: 0]
  ------------------
 2667|      0|      __kmp_str_buf_print(buffer, "%s", "<unknown>");
 2668|      0|      break;
 2669|      0|    }
 2670|      0|  }
 2671|      2|  __kmp_str_buf_print(buffer, "'\n");
 2672|      2|} //__kmp_stg_print_affinity
kmp_settings.cpp:_ZL27__kmp_stg_print_hh_affinityP11kmp_str_bufPKcPv:
 2679|      1|                                        void *data) {
 2680|      1|  __kmp_print_affinity_env(buffer, name, __kmp_hh_affinity);
 2681|      1|}
kmp_settings.cpp:_ZL25__kmp_stg_print_proc_bindP11kmp_str_bufPKcPv:
 3471|      1|                                      void *data) {
 3472|      1|  int nelem = __kmp_nested_proc_bind.used;
 3473|      1|  if (__kmp_env_format) {
  ------------------
  |  Branch (3473:7): [True: 0, False: 1]
  ------------------
 3474|      0|    KMP_STR_BUF_PRINT_NAME;
  ------------------
  |  |   51|      0|  __kmp_str_buf_print(buffer, "  %s %s", KMP_I18N_STR(Host), name)
  |  |  ------------------
  |  |  |  |   46|      0|#define KMP_I18N_STR(id) __kmp_i18n_catgets(kmp_i18n_str_##id)
  |  |  ------------------
  ------------------
 3475|      1|  } else {
 3476|      1|    __kmp_str_buf_print(buffer, "   %s", name);
 3477|      1|  }
 3478|      1|  if (nelem == 0) {
  ------------------
  |  Branch (3478:7): [True: 1, False: 0]
  ------------------
 3479|      1|    __kmp_str_buf_print(buffer, ": %s\n", KMP_I18N_STR(NotDefined));
  ------------------
  |  |   46|      1|#define KMP_I18N_STR(id) __kmp_i18n_catgets(kmp_i18n_str_##id)
  ------------------
 3480|      1|  } else {
 3481|      0|    int i;
 3482|      0|    __kmp_str_buf_print(buffer, "='", name);
 3483|      0|    for (i = 0; i < nelem; i++) {
  ------------------
  |  Branch (3483:17): [True: 0, False: 0]
  ------------------
 3484|      0|      switch (__kmp_nested_proc_bind.bind_types[i]) {
  ------------------
  |  Branch (3484:15): [True: 0, False: 0]
  ------------------
 3485|      0|      case proc_bind_false:
  ------------------
  |  Branch (3485:7): [True: 0, False: 0]
  ------------------
 3486|      0|        __kmp_str_buf_print(buffer, "false");
 3487|      0|        break;
 3488|       |
 3489|      0|      case proc_bind_true:
  ------------------
  |  Branch (3489:7): [True: 0, False: 0]
  ------------------
 3490|      0|        __kmp_str_buf_print(buffer, "true");
 3491|      0|        break;
 3492|       |
 3493|      0|      case proc_bind_primary:
  ------------------
  |  Branch (3493:7): [True: 0, False: 0]
  ------------------
 3494|      0|        __kmp_str_buf_print(buffer, "primary");
 3495|      0|        break;
 3496|       |
 3497|      0|      case proc_bind_close:
  ------------------
  |  Branch (3497:7): [True: 0, False: 0]
  ------------------
 3498|      0|        __kmp_str_buf_print(buffer, "close");
 3499|      0|        break;
 3500|       |
 3501|      0|      case proc_bind_spread:
  ------------------
  |  Branch (3501:7): [True: 0, False: 0]
  ------------------
 3502|      0|        __kmp_str_buf_print(buffer, "spread");
 3503|      0|        break;
 3504|       |
 3505|      0|      case proc_bind_intel:
  ------------------
  |  Branch (3505:7): [True: 0, False: 0]
  ------------------
 3506|      0|        __kmp_str_buf_print(buffer, "intel");
 3507|      0|        break;
 3508|       |
 3509|      0|      case proc_bind_default:
  ------------------
  |  Branch (3509:7): [True: 0, False: 0]
  ------------------
 3510|      0|        __kmp_str_buf_print(buffer, "default");
 3511|      0|        break;
 3512|      0|      }
 3513|      0|      if (i < nelem - 1) {
  ------------------
  |  Branch (3513:11): [True: 0, False: 0]
  ------------------
 3514|      0|        __kmp_str_buf_print(buffer, ",");
 3515|      0|      }
 3516|      0|    }
 3517|      0|    __kmp_str_buf_print(buffer, "'\n");
 3518|      0|  }
 3519|      1|}
kmp_settings.cpp:_ZL31__kmp_stg_print_teams_proc_bindP11kmp_str_bufPKcPv:
 3321|      1|                                            char const *name, void *data) {
 3322|      1|  const char *value = KMP_I18N_STR(NotDefined);
  ------------------
  |  |   46|      1|#define KMP_I18N_STR(id) __kmp_i18n_catgets(kmp_i18n_str_##id)
  ------------------
 3323|      1|  for (size_t i = 0; i < sizeof(proc_bind_table) / sizeof(proc_bind_table[0]);
  ------------------
  |  Branch (3323:22): [True: 1, False: 0]
  ------------------
 3324|      1|       ++i) {
 3325|      1|    if (__kmp_teams_proc_bind == proc_bind_table[i].proc_bind) {
  ------------------
  |  Branch (3325:9): [True: 1, False: 0]
  ------------------
 3326|      1|      value = proc_bind_table[i].name;
 3327|      1|      break;
 3328|      1|    }
 3329|      1|  }
 3330|      1|  __kmp_stg_print_str(buffer, name, value);
 3331|      1|}
kmp_settings.cpp:_ZL22__kmp_stg_print_placesP11kmp_str_bufPKcPv:
 3108|      1|                                   void *data) {
 3109|      1|  enum affinity_type type = __kmp_affinity.type;
 3110|      1|  const char *proclist = __kmp_affinity.proclist;
 3111|      1|  kmp_hw_t gran = __kmp_affinity.gran;
 3112|       |
 3113|      1|  if (__kmp_env_format) {
  ------------------
  |  Branch (3113:7): [True: 0, False: 1]
  ------------------
 3114|      0|    KMP_STR_BUF_PRINT_NAME;
  ------------------
  |  |   51|      0|  __kmp_str_buf_print(buffer, "  %s %s", KMP_I18N_STR(Host), name)
  |  |  ------------------
  |  |  |  |   46|      0|#define KMP_I18N_STR(id) __kmp_i18n_catgets(kmp_i18n_str_##id)
  |  |  ------------------
  ------------------
 3115|      1|  } else {
 3116|      1|    __kmp_str_buf_print(buffer, "   %s", name);
 3117|      1|  }
 3118|      1|  if ((__kmp_nested_proc_bind.used == 0) ||
  ------------------
  |  Branch (3118:7): [True: 1, False: 0]
  ------------------
 3119|      0|      (__kmp_nested_proc_bind.bind_types == NULL) ||
  ------------------
  |  Branch (3119:7): [True: 0, False: 0]
  ------------------
 3120|      1|      (__kmp_nested_proc_bind.bind_types[0] == proc_bind_false)) {
  ------------------
  |  Branch (3120:7): [True: 0, False: 0]
  ------------------
 3121|      1|    __kmp_str_buf_print(buffer, ": %s\n", KMP_I18N_STR(NotDefined));
  ------------------
  |  |   46|      1|#define KMP_I18N_STR(id) __kmp_i18n_catgets(kmp_i18n_str_##id)
  ------------------
 3122|      1|  } else if (type == affinity_explicit) {
  ------------------
  |  Branch (3122:14): [True: 0, False: 0]
  ------------------
 3123|      0|    if (proclist != NULL) {
  ------------------
  |  Branch (3123:9): [True: 0, False: 0]
  ------------------
 3124|      0|      __kmp_str_buf_print(buffer, "='%s'\n", proclist);
 3125|      0|    } else {
 3126|      0|      __kmp_str_buf_print(buffer, ": %s\n", KMP_I18N_STR(NotDefined));
  ------------------
  |  |   46|      0|#define KMP_I18N_STR(id) __kmp_i18n_catgets(kmp_i18n_str_##id)
  ------------------
 3127|      0|    }
 3128|      0|  } else if (type == affinity_compact) {
  ------------------
  |  Branch (3128:14): [True: 0, False: 0]
  ------------------
 3129|      0|    int num;
 3130|      0|    if (__kmp_affinity.num_masks > 0) {
  ------------------
  |  Branch (3130:9): [True: 0, False: 0]
  ------------------
 3131|      0|      num = __kmp_affinity.num_masks;
 3132|      0|    } else if (__kmp_affinity_num_places > 0) {
  ------------------
  |  Branch (3132:16): [True: 0, False: 0]
  ------------------
 3133|      0|      num = __kmp_affinity_num_places;
 3134|      0|    } else {
 3135|      0|      num = 0;
 3136|      0|    }
 3137|      0|    if (gran != KMP_HW_UNKNOWN) {
  ------------------
  |  Branch (3137:9): [True: 0, False: 0]
  ------------------
 3138|      0|      const char *name = __kmp_hw_get_keyword(gran, true);
 3139|      0|      if (num > 0) {
  ------------------
  |  Branch (3139:11): [True: 0, False: 0]
  ------------------
 3140|      0|        __kmp_str_buf_print(buffer, "='%s(%d)'\n", name, num);
 3141|      0|      } else {
 3142|      0|        __kmp_str_buf_print(buffer, "='%s'\n", name);
 3143|      0|      }
 3144|      0|    } else {
 3145|      0|      __kmp_str_buf_print(buffer, ": %s\n", KMP_I18N_STR(NotDefined));
  ------------------
  |  |   46|      0|#define KMP_I18N_STR(id) __kmp_i18n_catgets(kmp_i18n_str_##id)
  ------------------
 3146|      0|    }
 3147|      0|  } else {
 3148|      0|    __kmp_str_buf_print(buffer, ": %s\n", KMP_I18N_STR(NotDefined));
  ------------------
  |  |   46|      0|#define KMP_I18N_STR(id) __kmp_i18n_catgets(kmp_i18n_str_##id)
  ------------------
 3149|      0|  }
 3150|      1|}
kmp_settings.cpp:_ZL31__kmp_stg_print_topology_methodP11kmp_str_bufPKcPv:
 3239|      1|                                            char const *name, void *data) {
 3240|      1|  char const *value = NULL;
 3241|       |
 3242|      1|  switch (__kmp_affinity_top_method) {
  ------------------
  |  Branch (3242:11): [True: 1, False: 0]
  ------------------
 3243|      1|  case affinity_top_method_default:
  ------------------
  |  Branch (3243:3): [True: 1, False: 0]
  ------------------
 3244|      1|    value = "default";
 3245|      1|    break;
 3246|       |
 3247|      0|  case affinity_top_method_all:
  ------------------
  |  Branch (3247:3): [True: 0, False: 1]
  ------------------
 3248|      0|    value = "all";
 3249|      0|    break;
 3250|       |
 3251|      0|#if KMP_ARCH_X86 || KMP_ARCH_X86_64
 3252|      0|  case affinity_top_method_x2apicid_1f:
  ------------------
  |  Branch (3252:3): [True: 0, False: 1]
  ------------------
 3253|      0|    value = "x2APIC id leaf 0x1f";
 3254|      0|    break;
 3255|       |
 3256|      0|  case affinity_top_method_x2apicid:
  ------------------
  |  Branch (3256:3): [True: 0, False: 1]
  ------------------
 3257|      0|    value = "x2APIC id leaf 0xb";
 3258|      0|    break;
 3259|       |
 3260|      0|  case affinity_top_method_apicid:
  ------------------
  |  Branch (3260:3): [True: 0, False: 1]
  ------------------
 3261|      0|    value = "APIC id";
 3262|      0|    break;
 3263|      0|#endif /* KMP_ARCH_X86 || KMP_ARCH_X86_64 */
 3264|       |
 3265|       |#if KMP_USE_HWLOC
 3266|       |  case affinity_top_method_hwloc:
 3267|       |    value = "hwloc";
 3268|       |    break;
 3269|       |#endif
 3270|       |
 3271|      0|  case affinity_top_method_cpuinfo:
  ------------------
  |  Branch (3271:3): [True: 0, False: 1]
  ------------------
 3272|      0|    value = "cpuinfo";
 3273|      0|    break;
 3274|       |
 3275|       |#if KMP_GROUP_AFFINITY
 3276|       |  case affinity_top_method_group:
 3277|       |    value = "group";
 3278|       |    break;
 3279|       |#endif /* KMP_GROUP_AFFINITY */
 3280|       |
 3281|      0|  case affinity_top_method_flat:
  ------------------
  |  Branch (3281:3): [True: 0, False: 1]
  ------------------
 3282|      0|    value = "flat";
 3283|      0|    break;
 3284|      1|  }
 3285|       |
 3286|      1|  if (value != NULL) {
  ------------------
  |  Branch (3286:7): [True: 1, False: 0]
  ------------------
 3287|      1|    __kmp_stg_print_str(buffer, name, value);
 3288|      1|  }
 3289|      1|} // __kmp_stg_print_topology_method
kmp_settings.cpp:_ZL32__kmp_stg_print_display_affinityP11kmp_str_bufPKcPv:
 3526|      1|                                             char const *name, void *data) {
 3527|      1|  __kmp_stg_print_bool(buffer, name, __kmp_display_affinity);
 3528|      1|}
kmp_settings.cpp:_ZL31__kmp_stg_print_affinity_formatP11kmp_str_bufPKcPv:
 3536|      1|                                            char const *name, void *data) {
 3537|      1|  if (__kmp_env_format) {
  ------------------
  |  Branch (3537:7): [True: 0, False: 1]
  ------------------
 3538|      0|    KMP_STR_BUF_PRINT_NAME_EX(name);
  ------------------
  |  |   53|      0|  __kmp_str_buf_print(buffer, "  %s %s='", KMP_I18N_STR(Host), x)
  |  |  ------------------
  |  |  |  |   46|      0|#define KMP_I18N_STR(id) __kmp_i18n_catgets(kmp_i18n_str_##id)
  |  |  ------------------
  ------------------
 3539|      1|  } else {
 3540|      1|    __kmp_str_buf_print(buffer, "   %s='", name);
 3541|      1|  }
 3542|      1|  __kmp_str_buf_print(buffer, "%s'\n", __kmp_affinity_format);
 3543|      1|}
kmp_settings.cpp:_ZL28__kmp_stg_print_init_at_forkP11kmp_str_bufPKcPv:
 3999|      1|                                         char const *name, void *data) {
 4000|      1|  __kmp_stg_print_bool(buffer, name, __kmp_need_register_atfork_specified);
 4001|      1|} // __kmp_stg_print_init_at_fork
kmp_settings.cpp:_ZL24__kmp_stg_print_scheduleP11kmp_str_bufPKcPv:
 4060|      1|                                     void *data) {
 4061|      1|  if (__kmp_env_format) {
  ------------------
  |  Branch (4061:7): [True: 0, False: 1]
  ------------------
 4062|      0|    KMP_STR_BUF_PRINT_NAME_EX(name);
  ------------------
  |  |   53|      0|  __kmp_str_buf_print(buffer, "  %s %s='", KMP_I18N_STR(Host), x)
  |  |  ------------------
  |  |  |  |   46|      0|#define KMP_I18N_STR(id) __kmp_i18n_catgets(kmp_i18n_str_##id)
  |  |  ------------------
  ------------------
 4063|      1|  } else {
 4064|      1|    __kmp_str_buf_print(buffer, "   %s='", name);
 4065|      1|  }
 4066|      1|  if (__kmp_static == kmp_sch_static_greedy) {
  ------------------
  |  Branch (4066:7): [True: 1, False: 0]
  ------------------
 4067|      1|    __kmp_str_buf_print(buffer, "%s", "static,greedy");
 4068|      1|  } else if (__kmp_static == kmp_sch_static_balanced) {
  ------------------
  |  Branch (4068:14): [True: 0, False: 0]
  ------------------
 4069|      0|    __kmp_str_buf_print(buffer, "%s", "static,balanced");
 4070|      0|  }
 4071|      1|  if (__kmp_guided == kmp_sch_guided_iterative_chunked) {
  ------------------
  |  Branch (4071:7): [True: 1, False: 0]
  ------------------
 4072|      1|    __kmp_str_buf_print(buffer, ";%s'\n", "guided,iterative");
 4073|      1|  } else if (__kmp_guided == kmp_sch_guided_analytical_chunked) {
  ------------------
  |  Branch (4073:14): [True: 0, False: 0]
  ------------------
 4074|      0|    __kmp_str_buf_print(buffer, ";%s'\n", "guided,analytical");
 4075|      0|  }
 4076|      1|} // __kmp_stg_print_schedule
kmp_settings.cpp:_ZL28__kmp_stg_print_omp_scheduleP11kmp_str_bufPKcPv:
 4272|      1|                                         char const *name, void *data) {
 4273|      1|  if (__kmp_env_format) {
  ------------------
  |  Branch (4273:7): [True: 0, False: 1]
  ------------------
 4274|      0|    KMP_STR_BUF_PRINT_NAME_EX(name);
  ------------------
  |  |   53|      0|  __kmp_str_buf_print(buffer, "  %s %s='", KMP_I18N_STR(Host), x)
  |  |  ------------------
  |  |  |  |   46|      0|#define KMP_I18N_STR(id) __kmp_i18n_catgets(kmp_i18n_str_##id)
  |  |  ------------------
  ------------------
 4275|      1|  } else {
 4276|      1|    __kmp_str_buf_print(buffer, "   %s='", name);
 4277|      1|  }
 4278|      1|  enum sched_type sched = SCHEDULE_WITHOUT_MODIFIERS(__kmp_sched);
  ------------------
  |  |  451|      1|  (enum sched_type)(                                                           \
  |  |  452|      1|      (s) & ~(kmp_sch_modifier_nonmonotonic | kmp_sch_modifier_monotonic))
  ------------------
 4279|      1|  if (SCHEDULE_HAS_MONOTONIC(__kmp_sched)) {
  ------------------
  |  |  453|      1|#define SCHEDULE_HAS_MONOTONIC(s) (((s)&kmp_sch_modifier_monotonic) != 0)
  |  |  ------------------
  |  |  |  Branch (453:35): [True: 0, False: 1]
  |  |  ------------------
  ------------------
 4280|      0|    __kmp_str_buf_print(buffer, "monotonic:");
 4281|      1|  } else if (SCHEDULE_HAS_NONMONOTONIC(__kmp_sched)) {
  ------------------
  |  |  454|      1|#define SCHEDULE_HAS_NONMONOTONIC(s) (((s)&kmp_sch_modifier_nonmonotonic) != 0)
  |  |  ------------------
  |  |  |  Branch (454:38): [True: 0, False: 1]
  |  |  ------------------
  ------------------
 4282|      0|    __kmp_str_buf_print(buffer, "nonmonotonic:");
 4283|      0|  }
 4284|      1|  if (__kmp_chunk) {
  ------------------
  |  Branch (4284:7): [True: 0, False: 1]
  ------------------
 4285|      0|    switch (sched) {
  ------------------
  |  Branch (4285:13): [True: 0, False: 0]
  ------------------
 4286|      0|    case kmp_sch_dynamic_chunked:
  ------------------
  |  Branch (4286:5): [True: 0, False: 0]
  ------------------
 4287|      0|      __kmp_str_buf_print(buffer, "%s,%d'\n", "dynamic", __kmp_chunk);
 4288|      0|      break;
 4289|      0|    case kmp_sch_guided_iterative_chunked:
  ------------------
  |  Branch (4289:5): [True: 0, False: 0]
  ------------------
 4290|      0|    case kmp_sch_guided_analytical_chunked:
  ------------------
  |  Branch (4290:5): [True: 0, False: 0]
  ------------------
 4291|      0|      __kmp_str_buf_print(buffer, "%s,%d'\n", "guided", __kmp_chunk);
 4292|      0|      break;
 4293|      0|    case kmp_sch_trapezoidal:
  ------------------
  |  Branch (4293:5): [True: 0, False: 0]
  ------------------
 4294|      0|      __kmp_str_buf_print(buffer, "%s,%d'\n", "trapezoidal", __kmp_chunk);
 4295|      0|      break;
 4296|      0|    case kmp_sch_static:
  ------------------
  |  Branch (4296:5): [True: 0, False: 0]
  ------------------
 4297|      0|    case kmp_sch_static_chunked:
  ------------------
  |  Branch (4297:5): [True: 0, False: 0]
  ------------------
 4298|      0|    case kmp_sch_static_balanced:
  ------------------
  |  Branch (4298:5): [True: 0, False: 0]
  ------------------
 4299|      0|    case kmp_sch_static_greedy:
  ------------------
  |  Branch (4299:5): [True: 0, False: 0]
  ------------------
 4300|      0|      __kmp_str_buf_print(buffer, "%s,%d'\n", "static", __kmp_chunk);
 4301|      0|      break;
 4302|      0|    case kmp_sch_static_steal:
  ------------------
  |  Branch (4302:5): [True: 0, False: 0]
  ------------------
 4303|      0|      __kmp_str_buf_print(buffer, "%s,%d'\n", "static_steal", __kmp_chunk);
 4304|      0|      break;
 4305|      0|    case kmp_sch_auto:
  ------------------
  |  Branch (4305:5): [True: 0, False: 0]
  ------------------
 4306|      0|      __kmp_str_buf_print(buffer, "%s,%d'\n", "auto", __kmp_chunk);
 4307|      0|      break;
 4308|      0|    }
 4309|      1|  } else {
 4310|      1|    switch (sched) {
  ------------------
  |  Branch (4310:13): [True: 1, False: 0]
  ------------------
 4311|      0|    case kmp_sch_dynamic_chunked:
  ------------------
  |  Branch (4311:5): [True: 0, False: 1]
  ------------------
 4312|      0|      __kmp_str_buf_print(buffer, "%s'\n", "dynamic");
 4313|      0|      break;
 4314|      0|    case kmp_sch_guided_iterative_chunked:
  ------------------
  |  Branch (4314:5): [True: 0, False: 1]
  ------------------
 4315|      0|    case kmp_sch_guided_analytical_chunked:
  ------------------
  |  Branch (4315:5): [True: 0, False: 1]
  ------------------
 4316|      0|      __kmp_str_buf_print(buffer, "%s'\n", "guided");
 4317|      0|      break;
 4318|      0|    case kmp_sch_trapezoidal:
  ------------------
  |  Branch (4318:5): [True: 0, False: 1]
  ------------------
 4319|      0|      __kmp_str_buf_print(buffer, "%s'\n", "trapezoidal");
 4320|      0|      break;
 4321|      1|    case kmp_sch_static:
  ------------------
  |  Branch (4321:5): [True: 1, False: 0]
  ------------------
 4322|      1|    case kmp_sch_static_chunked:
  ------------------
  |  Branch (4322:5): [True: 0, False: 1]
  ------------------
 4323|      1|    case kmp_sch_static_balanced:
  ------------------
  |  Branch (4323:5): [True: 0, False: 1]
  ------------------
 4324|      1|    case kmp_sch_static_greedy:
  ------------------
  |  Branch (4324:5): [True: 0, False: 1]
  ------------------
 4325|      1|      __kmp_str_buf_print(buffer, "%s'\n", "static");
 4326|      1|      break;
 4327|      0|    case kmp_sch_static_steal:
  ------------------
  |  Branch (4327:5): [True: 0, False: 1]
  ------------------
 4328|      0|      __kmp_str_buf_print(buffer, "%s'\n", "static_steal");
 4329|      0|      break;
 4330|      0|    case kmp_sch_auto:
  ------------------
  |  Branch (4330:5): [True: 0, False: 1]
  ------------------
 4331|      0|      __kmp_str_buf_print(buffer, "%s'\n", "auto");
 4332|      0|      break;
 4333|      1|    }
 4334|      1|  }
 4335|      1|} // __kmp_stg_print_omp_schedule
kmp_settings.cpp:_ZL35__kmp_stg_print_kmp_force_monotonicP11kmp_str_bufPKcPv:
 4359|      1|                                                char const *name, void *data) {
 4360|      1|  __kmp_stg_print_bool(buffer, name, __kmp_force_monotonic);
 4361|      1|} // __kmp_stg_print_kmp_force_monotonic
kmp_settings.cpp:_ZL27__kmp_stg_print_atomic_modeP11kmp_str_bufPKcPv:
 4385|      1|                                        void *data) {
 4386|      1|  __kmp_stg_print_int(buffer, name, __kmp_atomic_mode);
 4387|      1|} // __kmp_stg_print_atomic_mode
kmp_settings.cpp:_ZL33__kmp_stg_print_consistency_checkP11kmp_str_bufPKcPv:
 4409|      1|                                              char const *name, void *data) {
 4410|       |#if KMP_DEBUG
 4411|       |  const char *value = NULL;
 4412|       |
 4413|       |  if (__kmp_env_consistency_check) {
 4414|       |    value = "all";
 4415|       |  } else {
 4416|       |    value = "none";
 4417|       |  }
 4418|       |
 4419|       |  if (value != NULL) {
 4420|       |    __kmp_stg_print_str(buffer, name, value);
 4421|       |  }
 4422|       |#endif /* KMP_DEBUG */
 4423|      1|} // __kmp_stg_print_consistency_check
kmp_settings.cpp:_ZL32__kmp_stg_print_malloc_pool_incrP11kmp_str_bufPKcPv:
 4460|      1|                                             char const *name, void *data) {
 4461|      1|  __kmp_stg_print_size(buffer, name, __kmp_malloc_pool_incr);
 4462|       |
 4463|      1|} // _kmp_stg_print_malloc_pool_incr
kmp_settings.cpp:_ZL25__kmp_stg_print_gtid_modeP11kmp_str_bufPKcPv:
 4514|      1|                                      void *data) {
 4515|      1|  if (__kmp_adjust_gtid_mode) {
  ------------------
  |  Branch (4515:7): [True: 0, False: 1]
  ------------------
 4516|      0|    __kmp_stg_print_int(buffer, name, 0);
 4517|      1|  } else {
 4518|      1|    __kmp_stg_print_int(buffer, name, __kmp_gtid_mode);
 4519|      1|  }
 4520|      1|} // __kmp_stg_print_gtid_mode
kmp_settings.cpp:_ZL27__kmp_stg_print_omp_dynamicP11kmp_str_bufPKcPv:
 3908|      1|                                        void *data) {
 3909|      1|  __kmp_stg_print_bool(buffer, name, __kmp_global.g.g_dynamic);
 3910|      1|} // __kmp_stg_print_omp_dynamic
kmp_settings.cpp:_ZL32__kmp_stg_print_kmp_dynamic_modeP11kmp_str_bufPKcPv:
 3942|      1|                                             char const *name, void *data) {
 3943|       |#if KMP_DEBUG
 3944|       |  if (__kmp_global.g.g_dynamic_mode == dynamic_default) {
 3945|       |    __kmp_str_buf_print(buffer, "   %s: %s \n", name, KMP_I18N_STR(NotDefined));
 3946|       |  }
 3947|       |#ifdef USE_LOAD_BALANCE
 3948|       |  else if (__kmp_global.g.g_dynamic_mode == dynamic_load_balance) {
 3949|       |    __kmp_stg_print_str(buffer, name, "load balance");
 3950|       |  }
 3951|       |#endif /* USE_LOAD_BALANCE */
 3952|       |  else if (__kmp_global.g.g_dynamic_mode == dynamic_thread_limit) {
 3953|       |    __kmp_stg_print_str(buffer, name, "thread limit");
 3954|       |  } else if (__kmp_global.g.g_dynamic_mode == dynamic_random) {
 3955|       |    __kmp_stg_print_str(buffer, name, "random");
 3956|       |  } else {
 3957|       |    KMP_ASSERT(0);
 3958|       |  }
 3959|       |#endif /* KMP_DEBUG */
 3960|      1|} // __kmp_stg_print_kmp_dynamic_mode
kmp_settings.cpp:_ZL35__kmp_stg_print_ld_balance_intervalP11kmp_str_bufPKcPv:
 3978|      1|                                                char const *name, void *data) {
 3979|       |#if KMP_DEBUG
 3980|       |  __kmp_str_buf_print(buffer, "   %s=%8.6f\n", name,
 3981|       |                      __kmp_load_balance_interval);
 3982|       |#endif /* KMP_DEBUG */
 3983|      1|} // __kmp_stg_print_load_balance_interval
kmp_settings.cpp:_ZL26__kmp_stg_print_lock_blockP11kmp_str_bufPKcPv:
 4531|      1|                                       void *data) {
 4532|      1|  __kmp_stg_print_int(buffer, name, __kmp_num_locks_in_block);
 4533|      1|} // __kmp_stg_print_lock_block
kmp_settings.cpp:_ZL25__kmp_stg_print_lock_kindP11kmp_str_bufPKcPv:
 4632|      1|                                      void *data) {
 4633|      1|  const char *value = NULL;
 4634|       |
 4635|      1|  switch (__kmp_user_lock_kind) {
  ------------------
  |  Branch (4635:11): [True: 1, False: 0]
  ------------------
 4636|      1|  case lk_default:
  ------------------
  |  Branch (4636:3): [True: 1, False: 0]
  ------------------
 4637|      1|    value = "default";
 4638|      1|    break;
 4639|       |
 4640|      0|  case lk_tas:
  ------------------
  |  Branch (4640:3): [True: 0, False: 1]
  ------------------
 4641|      0|    value = "tas";
 4642|      0|    break;
 4643|       |
 4644|      0|#if KMP_USE_FUTEX
 4645|      0|  case lk_futex:
  ------------------
  |  Branch (4645:3): [True: 0, False: 1]
  ------------------
 4646|      0|    value = "futex";
 4647|      0|    break;
 4648|      0|#endif
 4649|       |
 4650|      0|#if KMP_USE_DYNAMIC_LOCK && KMP_USE_TSX
 4651|      0|  case lk_rtm_queuing:
  ------------------
  |  Branch (4651:3): [True: 0, False: 1]
  ------------------
 4652|      0|    value = "rtm_queuing";
 4653|      0|    break;
 4654|       |
 4655|      0|  case lk_rtm_spin:
  ------------------
  |  Branch (4655:3): [True: 0, False: 1]
  ------------------
 4656|      0|    value = "rtm_spin";
 4657|      0|    break;
 4658|       |
 4659|      0|  case lk_hle:
  ------------------
  |  Branch (4659:3): [True: 0, False: 1]
  ------------------
 4660|      0|    value = "hle";
 4661|      0|    break;
 4662|      0|#endif
 4663|       |
 4664|      0|  case lk_ticket:
  ------------------
  |  Branch (4664:3): [True: 0, False: 1]
  ------------------
 4665|      0|    value = "ticket";
 4666|      0|    break;
 4667|       |
 4668|      0|  case lk_queuing:
  ------------------
  |  Branch (4668:3): [True: 0, False: 1]
  ------------------
 4669|      0|    value = "queuing";
 4670|      0|    break;
 4671|       |
 4672|      0|  case lk_drdpa:
  ------------------
  |  Branch (4672:3): [True: 0, False: 1]
  ------------------
 4673|      0|    value = "drdpa";
 4674|      0|    break;
 4675|      0|#if KMP_USE_ADAPTIVE_LOCKS
 4676|      0|  case lk_adaptive:
  ------------------
  |  Branch (4676:3): [True: 0, False: 1]
  ------------------
 4677|      0|    value = "adaptive";
 4678|      0|    break;
 4679|      1|#endif
 4680|      1|  }
 4681|       |
 4682|      1|  if (value != NULL) {
  ------------------
  |  Branch (4682:7): [True: 1, False: 0]
  ------------------
 4683|      1|    __kmp_stg_print_str(buffer, name, value);
 4684|      1|  }
 4685|      1|}
kmp_settings.cpp:_ZL35__kmp_stg_print_spin_backoff_paramsP11kmp_str_bufPKcPv:
 4773|      1|                                                char const *name, void *data) {
 4774|      1|  if (__kmp_env_format) {
  ------------------
  |  Branch (4774:7): [True: 0, False: 1]
  ------------------
 4775|      0|    KMP_STR_BUF_PRINT_NAME_EX(name);
  ------------------
  |  |   53|      0|  __kmp_str_buf_print(buffer, "  %s %s='", KMP_I18N_STR(Host), x)
  |  |  ------------------
  |  |  |  |   46|      0|#define KMP_I18N_STR(id) __kmp_i18n_catgets(kmp_i18n_str_##id)
  |  |  ------------------
  ------------------
 4776|      1|  } else {
 4777|      1|    __kmp_str_buf_print(buffer, "   %s='", name);
 4778|      1|  }
 4779|      1|  __kmp_str_buf_print(buffer, "%d,%d'\n", __kmp_spin_backoff_params.max_backoff,
 4780|      1|                      __kmp_spin_backoff_params.min_tick);
 4781|      1|}
kmp_settings.cpp:_ZL35__kmp_stg_print_adaptive_lock_propsP11kmp_str_bufPKcPv:
 4872|      1|                                                char const *name, void *data) {
 4873|      1|  if (__kmp_env_format) {
  ------------------
  |  Branch (4873:7): [True: 0, False: 1]
  ------------------
 4874|      0|    KMP_STR_BUF_PRINT_NAME_EX(name);
  ------------------
  |  |   53|      0|  __kmp_str_buf_print(buffer, "  %s %s='", KMP_I18N_STR(Host), x)
  |  |  ------------------
  |  |  |  |   46|      0|#define KMP_I18N_STR(id) __kmp_i18n_catgets(kmp_i18n_str_##id)
  |  |  ------------------
  ------------------
 4875|      1|  } else {
 4876|      1|    __kmp_str_buf_print(buffer, "   %s='", name);
 4877|      1|  }
 4878|      1|  __kmp_str_buf_print(buffer, "%d,%d'\n",
 4879|      1|                      __kmp_adaptive_backoff_params.max_soft_retries,
 4880|      1|                      __kmp_adaptive_backoff_params.max_badness);
 4881|      1|} // __kmp_stg_print_adaptive_lock_props
kmp_settings.cpp:_ZL25__kmp_stg_print_hw_subsetP11kmp_str_bufPKcPv:
 5158|      2|                                      void *data) {
 5159|      2|  kmp_str_buf_t buf;
 5160|      2|  int depth;
 5161|      2|  if (!__kmp_hw_subset)
  ------------------
  |  Branch (5161:7): [True: 2, False: 0]
  ------------------
 5162|      2|    return;
 5163|      0|  __kmp_str_buf_init(&buf);
  ------------------
  |  |   41|      0|  {                                                                            \
  |  |   42|      0|    (b)->str = (b)->bulk;                                                      \
  |  |   43|      0|    (b)->size = sizeof((b)->bulk);                                             \
  |  |   44|      0|    (b)->used = 0;                                                             \
  |  |   45|      0|    (b)->bulk[0] = 0;                                                          \
  |  |   46|      0|  }
  ------------------
 5164|      0|  if (__kmp_env_format)
  ------------------
  |  Branch (5164:7): [True: 0, False: 0]
  ------------------
 5165|      0|    KMP_STR_BUF_PRINT_NAME_EX(name);
  ------------------
  |  |   53|      0|  __kmp_str_buf_print(buffer, "  %s %s='", KMP_I18N_STR(Host), x)
  |  |  ------------------
  |  |  |  |   46|      0|#define KMP_I18N_STR(id) __kmp_i18n_catgets(kmp_i18n_str_##id)
  |  |  ------------------
  ------------------
 5166|      0|  else
 5167|      0|    __kmp_str_buf_print(buffer, "   %s='", name);
 5168|       |
 5169|      0|  depth = __kmp_hw_subset->get_depth();
 5170|      0|  for (int i = 0; i < depth; ++i) {
  ------------------
  |  Branch (5170:19): [True: 0, False: 0]
  ------------------
 5171|      0|    const auto &item = __kmp_hw_subset->at(i);
 5172|      0|    if (i > 0)
  ------------------
  |  Branch (5172:9): [True: 0, False: 0]
  ------------------
 5173|      0|      __kmp_str_buf_print(&buf, "%c", ',');
 5174|      0|    for (int j = 0; j < item.num_attrs; ++j) {
  ------------------
  |  Branch (5174:21): [True: 0, False: 0]
  ------------------
 5175|      0|      __kmp_str_buf_print(&buf, "%s%d%s", (j > 0 ? "&" : ""), item.num[j],
  ------------------
  |  Branch (5175:44): [True: 0, False: 0]
  ------------------
 5176|      0|                          __kmp_hw_get_keyword(item.type));
 5177|      0|      if (item.attr[j].is_core_type_valid())
  ------------------
  |  Branch (5177:11): [True: 0, False: 0]
  ------------------
 5178|      0|        __kmp_str_buf_print(
 5179|      0|            &buf, ":%s",
 5180|      0|            __kmp_hw_get_core_type_keyword(item.attr[j].get_core_type()));
 5181|      0|      if (item.attr[j].is_core_eff_valid())
  ------------------
  |  Branch (5181:11): [True: 0, False: 0]
  ------------------
 5182|      0|        __kmp_str_buf_print(&buf, ":eff%d", item.attr[j].get_core_eff());
 5183|      0|      if (item.offset[j])
  ------------------
  |  Branch (5183:11): [True: 0, False: 0]
  ------------------
 5184|      0|        __kmp_str_buf_print(&buf, "@%d", item.offset[j]);
 5185|      0|    }
 5186|      0|  }
 5187|      0|  __kmp_str_buf_print(buffer, "%s'\n", buf.str);
 5188|      0|  __kmp_str_buf_free(&buf);
 5189|      0|}
kmp_settings.cpp:_ZL31__kmp_stg_print_task_throttlingP11kmp_str_bufPKcPv:
 5229|      1|                                            char const *name, void *data) {
 5230|      1|  __kmp_stg_print_bool(buffer, name, __kmp_enable_task_throttling);
 5231|      1|} // __kmp_stg_print_task_throttling
kmp_settings.cpp:_ZL31__kmp_stg_print_omp_display_envP11kmp_str_bufPKcPv:
 5296|      1|                                            char const *name, void *data) {
 5297|      1|  if (__kmp_display_env_verbose) {
  ------------------
  |  Branch (5297:7): [True: 0, False: 1]
  ------------------
 5298|      0|    __kmp_stg_print_str(buffer, name, "VERBOSE");
 5299|      1|  } else {
 5300|      1|    __kmp_stg_print_bool(buffer, name, __kmp_display_env);
 5301|      1|  }
 5302|      1|} // __kmp_stg_print_omp_display_env
kmp_settings.cpp:_ZL32__kmp_stg_print_omp_cancellationP11kmp_str_bufPKcPv:
 5314|      1|                                             char const *name, void *data) {
 5315|      1|  __kmp_stg_print_bool(buffer, name, __kmp_omp_cancellation);
 5316|      1|} // __kmp_stg_print_omp_cancellation
kmp_settings.cpp:_ZL25__kmp_stg_print_allocatorP11kmp_str_bufPKcPv:
 3879|      1|                                      void *data) {
 3880|      1|  if (__kmp_def_allocator == omp_default_mem_alloc) {
  ------------------
  |  Branch (3880:7): [True: 1, False: 0]
  ------------------
 3881|      1|    __kmp_stg_print_str(buffer, name, "omp_default_mem_alloc");
 3882|      1|  } else if (__kmp_def_allocator == omp_high_bw_mem_alloc) {
  ------------------
  |  Branch (3882:14): [True: 0, False: 0]
  ------------------
 3883|      0|    __kmp_stg_print_str(buffer, name, "omp_high_bw_mem_alloc");
 3884|      0|  } else if (__kmp_def_allocator == omp_large_cap_mem_alloc) {
  ------------------
  |  Branch (3884:14): [True: 0, False: 0]
  ------------------
 3885|      0|    __kmp_stg_print_str(buffer, name, "omp_large_cap_mem_alloc");
 3886|      0|  } else if (__kmp_def_allocator == omp_const_mem_alloc) {
  ------------------
  |  Branch (3886:14): [True: 0, False: 0]
  ------------------
 3887|      0|    __kmp_stg_print_str(buffer, name, "omp_const_mem_alloc");
 3888|      0|  } else if (__kmp_def_allocator == omp_low_lat_mem_alloc) {
  ------------------
  |  Branch (3888:14): [True: 0, False: 0]
  ------------------
 3889|      0|    __kmp_stg_print_str(buffer, name, "omp_low_lat_mem_alloc");
 3890|      0|  } else if (__kmp_def_allocator == omp_cgroup_mem_alloc) {
  ------------------
  |  Branch (3890:14): [True: 0, False: 0]
  ------------------
 3891|      0|    __kmp_stg_print_str(buffer, name, "omp_cgroup_mem_alloc");
 3892|      0|  } else if (__kmp_def_allocator == omp_pteam_mem_alloc) {
  ------------------
  |  Branch (3892:14): [True: 0, False: 0]
  ------------------
 3893|      0|    __kmp_stg_print_str(buffer, name, "omp_pteam_mem_alloc");
 3894|      0|  } else if (__kmp_def_allocator == omp_thread_mem_alloc) {
  ------------------
  |  Branch (3894:14): [True: 0, False: 0]
  ------------------
 3895|      0|    __kmp_stg_print_str(buffer, name, "omp_thread_mem_alloc");
 3896|      0|  }
 3897|      1|}
kmp_settings.cpp:_ZL33__kmp_stg_print_use_hidden_helperP11kmp_str_bufPKcPv:
 1323|      1|                                              char const *name, void *data) {
 1324|      1|  __kmp_stg_print_bool(buffer, name, __kmp_enable_hidden_helper);
 1325|      1|} // __kmp_stg_print_use_hidden_helper
kmp_settings.cpp:_ZL41__kmp_stg_print_num_hidden_helper_threadsP11kmp_str_bufPKcPv:
 1300|      1|                                                      void *data) {
 1301|      1|  if (__kmp_hidden_helper_threads_num == 0) {
  ------------------
  |  Branch (1301:7): [True: 0, False: 1]
  ------------------
 1302|      0|    __kmp_stg_print_int(buffer, name, __kmp_hidden_helper_threads_num);
 1303|      1|  } else {
 1304|      1|    KMP_DEBUG_ASSERT(__kmp_hidden_helper_threads_num > 1);
 1305|       |    // Let's exclude the main thread of hidden helper team and print
 1306|       |    // number of worker threads those do actual job.
 1307|      1|    __kmp_stg_print_int(buffer, name, __kmp_hidden_helper_threads_num - 1);
 1308|      1|  }
 1309|      1|} // __kmp_stg_print_num_hidden_helper_threads
kmp_settings.cpp:_ZL24__kmp_stg_print_omp_toolP11kmp_str_bufPKcPv:
 5327|      1|                                     void *data) {
 5328|      1|  if (__kmp_env_format) {
  ------------------
  |  Branch (5328:7): [True: 0, False: 1]
  ------------------
 5329|      0|    KMP_STR_BUF_PRINT_BOOL_EX(name, __kmp_tool, "enabled", "disabled");
  ------------------
  |  |   55|      0|  __kmp_str_buf_print(buffer, "  %s %s='%s'\n", KMP_I18N_STR(Host), n,         \
  |  |  ------------------
  |  |  |  |   46|      0|#define KMP_I18N_STR(id) __kmp_i18n_catgets(kmp_i18n_str_##id)
  |  |  ------------------
  |  |   56|      0|                      (v) ? t : f)
  |  |  ------------------
  |  |  |  Branch (56:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 5330|      1|  } else {
 5331|      1|    __kmp_str_buf_print(buffer, "   %s=%s\n", name,
 5332|      1|                        __kmp_tool ? "enabled" : "disabled");
  ------------------
  |  Branch (5332:25): [True: 1, False: 0]
  ------------------
 5333|      1|  }
 5334|      1|} // __kmp_stg_print_omp_tool
kmp_settings.cpp:_ZL34__kmp_stg_print_omp_tool_librariesP11kmp_str_bufPKcPv:
 5344|      1|                                               char const *name, void *data) {
 5345|      1|  if (__kmp_tool_libraries)
  ------------------
  |  Branch (5345:7): [True: 0, False: 1]
  ------------------
 5346|      0|    __kmp_stg_print_str(buffer, name, __kmp_tool_libraries);
 5347|      1|  else {
 5348|      1|    if (__kmp_env_format) {
  ------------------
  |  Branch (5348:9): [True: 0, False: 1]
  ------------------
 5349|      0|      KMP_STR_BUF_PRINT_NAME;
  ------------------
  |  |   51|      0|  __kmp_str_buf_print(buffer, "  %s %s", KMP_I18N_STR(Host), name)
  |  |  ------------------
  |  |  |  |   46|      0|#define KMP_I18N_STR(id) __kmp_i18n_catgets(kmp_i18n_str_##id)
  |  |  ------------------
  ------------------
 5350|      1|    } else {
 5351|      1|      __kmp_str_buf_print(buffer, "   %s", name);
 5352|      1|    }
 5353|      1|    __kmp_str_buf_print(buffer, ": %s\n", KMP_I18N_STR(NotDefined));
  ------------------
  |  |   46|      1|#define KMP_I18N_STR(id) __kmp_i18n_catgets(kmp_i18n_str_##id)
  ------------------
 5354|      1|  }
 5355|      1|} // __kmp_stg_print_omp_tool_libraries
kmp_settings.cpp:_ZL37__kmp_stg_print_omp_tool_verbose_initP11kmp_str_bufPKcPv:
 5367|      1|                                                  void *data) {
 5368|      1|  if (__kmp_tool_verbose_init)
  ------------------
  |  Branch (5368:7): [True: 0, False: 1]
  ------------------
 5369|      0|    __kmp_stg_print_str(buffer, name, __kmp_tool_verbose_init);
 5370|      1|  else {
 5371|      1|    if (__kmp_env_format) {
  ------------------
  |  Branch (5371:9): [True: 0, False: 1]
  ------------------
 5372|      0|      KMP_STR_BUF_PRINT_NAME;
  ------------------
  |  |   51|      0|  __kmp_str_buf_print(buffer, "  %s %s", KMP_I18N_STR(Host), name)
  |  |  ------------------
  |  |  |  |   46|      0|#define KMP_I18N_STR(id) __kmp_i18n_catgets(kmp_i18n_str_##id)
  |  |  ------------------
  ------------------
 5373|      1|    } else {
 5374|      1|      __kmp_str_buf_print(buffer, "   %s", name);
 5375|      1|    }
 5376|      1|    __kmp_str_buf_print(buffer, ": %s\n", KMP_I18N_STR(NotDefined));
  ------------------
  |  |   46|      1|#define KMP_I18N_STR(id) __kmp_i18n_catgets(kmp_i18n_str_##id)
  ------------------
 5377|      1|  }
 5378|      1|} // __kmp_stg_print_omp_tool_verbose_init
kmp_settings.cpp:_ZL32__kmp_stg_print_user_level_mwaitP11kmp_str_bufPKcPv:
 5243|      1|                                             char const *name, void *data) {
 5244|      1|  __kmp_stg_print_bool(buffer, name, __kmp_user_level_mwait);
 5245|      1|} // __kmp_stg_print_user_level_mwait
kmp_settings.cpp:_ZL27__kmp_stg_print_mwait_hintsP11kmp_str_bufPKcPv:
 5256|      1|                                        void *data) {
 5257|      1|  __kmp_stg_print_int(buffer, name, __kmp_mwait_hints);
 5258|      1|} // __kmp_stg_print_mwait_hints
kmp_settings.cpp:_ZL22__kmp_stg_print_tpauseP11kmp_str_bufPKcPv:
 5278|      1|                                   void *data) {
 5279|      1|  __kmp_stg_print_int(buffer, name, __kmp_tpause_state);
 5280|      1|} // __kmp_stg_print_tpause

__kmp_str_buf_clear:
   71|     83|void __kmp_str_buf_clear(kmp_str_buf_t *buffer) {
   72|     83|  KMP_STR_BUF_INVARIANT(buffer);
  ------------------
  |  |   60|     83|  {                                                                            \
  |  |   61|     83|    KMP_DEBUG_ASSERT((b)->str != NULL);                                        \
  |  |   62|     83|    KMP_DEBUG_ASSERT((b)->size >= sizeof((b)->bulk));                          \
  |  |   63|     83|    KMP_DEBUG_ASSERT((b)->size % sizeof((b)->bulk) == 0);                      \
  |  |   64|     83|    KMP_DEBUG_ASSERT((unsigned)(b)->used < (b)->size);                         \
  |  |   65|     83|    KMP_DEBUG_ASSERT(                                                          \
  |  |   66|     83|        (b)->size == sizeof((b)->bulk) ? (b)->str == &(b)->bulk[0] : 1);       \
  |  |   67|     83|    KMP_DEBUG_ASSERT((b)->size > sizeof((b)->bulk) ? (b)->str != &(b)->bulk[0] \
  |  |   68|     83|                                                   : 1);                       \
  |  |   69|     83|  }
  ------------------
   73|     83|  if (buffer->used > 0) {
  ------------------
  |  Branch (73:7): [True: 74, False: 9]
  ------------------
   74|     74|    buffer->used = 0;
   75|     74|    buffer->str[0] = 0;
   76|     74|  }
   77|     83|  KMP_STR_BUF_INVARIANT(buffer);
  ------------------
  |  |   60|     83|  {                                                                            \
  |  |   61|     83|    KMP_DEBUG_ASSERT((b)->str != NULL);                                        \
  |  |   62|     83|    KMP_DEBUG_ASSERT((b)->size >= sizeof((b)->bulk));                          \
  |  |   63|     83|    KMP_DEBUG_ASSERT((b)->size % sizeof((b)->bulk) == 0);                      \
  |  |   64|     83|    KMP_DEBUG_ASSERT((unsigned)(b)->used < (b)->size);                         \
  |  |   65|     83|    KMP_DEBUG_ASSERT(                                                          \
  |  |   66|     83|        (b)->size == sizeof((b)->bulk) ? (b)->str == &(b)->bulk[0] : 1);       \
  |  |   67|     83|    KMP_DEBUG_ASSERT((b)->size > sizeof((b)->bulk) ? (b)->str != &(b)->bulk[0] \
  |  |   68|     83|                                                   : 1);                       \
  |  |   69|     83|  }
  ------------------
   78|     83|} // __kmp_str_buf_clear
__kmp_str_buf_reserve:
   80|     68|void __kmp_str_buf_reserve(kmp_str_buf_t *buffer, size_t size) {
   81|     68|  KMP_STR_BUF_INVARIANT(buffer);
  ------------------
  |  |   60|     68|  {                                                                            \
  |  |   61|     68|    KMP_DEBUG_ASSERT((b)->str != NULL);                                        \
  |  |   62|     68|    KMP_DEBUG_ASSERT((b)->size >= sizeof((b)->bulk));                          \
  |  |   63|     68|    KMP_DEBUG_ASSERT((b)->size % sizeof((b)->bulk) == 0);                      \
  |  |   64|     68|    KMP_DEBUG_ASSERT((unsigned)(b)->used < (b)->size);                         \
  |  |   65|     68|    KMP_DEBUG_ASSERT(                                                          \
  |  |   66|     68|        (b)->size == sizeof((b)->bulk) ? (b)->str == &(b)->bulk[0] : 1);       \
  |  |   67|     68|    KMP_DEBUG_ASSERT((b)->size > sizeof((b)->bulk) ? (b)->str != &(b)->bulk[0] \
  |  |   68|     68|                                                   : 1);                       \
  |  |   69|     68|  }
  ------------------
   82|     68|  KMP_DEBUG_ASSERT(size >= 0);
   83|       |
   84|     68|  if (buffer->size < (unsigned int)size) {
  ------------------
  |  Branch (84:7): [True: 2, False: 66]
  ------------------
   85|       |    // Calculate buffer size.
   86|      2|    do {
   87|      2|      buffer->size *= 2;
   88|      2|    } while (buffer->size < (unsigned int)size);
  ------------------
  |  Branch (88:14): [True: 0, False: 2]
  ------------------
   89|       |
   90|       |    // Enlarge buffer.
   91|      2|    if (buffer->str == &buffer->bulk[0]) {
  ------------------
  |  Branch (91:9): [True: 1, False: 1]
  ------------------
   92|      1|      buffer->str = (char *)KMP_INTERNAL_MALLOC(buffer->size);
  ------------------
  |  |  110|      1|#define KMP_INTERNAL_MALLOC(sz) malloc(sz)
  ------------------
   93|      1|      if (buffer->str == NULL) {
  ------------------
  |  Branch (93:11): [True: 0, False: 1]
  ------------------
   94|      0|        KMP_FATAL(MemoryAllocFailed);
  ------------------
  |  |  146|      0|#define KMP_FATAL(...) __kmp_fatal(KMP_MSG(__VA_ARGS__), __kmp_msg_null)
  |  |  ------------------
  |  |  |  |  121|      0|#define KMP_MSG(...) __kmp_msg_format(kmp_i18n_msg_##__VA_ARGS__)
  |  |  ------------------
  ------------------
   95|      0|      }
   96|      1|      KMP_MEMCPY_S(buffer->str, buffer->size, buffer->bulk, buffer->used + 1);
  ------------------
  |  |   60|      1|#define KMP_MEMCPY_S(dst, bsz, src, cnt) memcpy(dst, src, cnt)
  ------------------
   97|      1|    } else {
   98|      1|      buffer->str = (char *)KMP_INTERNAL_REALLOC(buffer->str, buffer->size);
  ------------------
  |  |  112|      1|#define KMP_INTERNAL_REALLOC(p, sz) realloc((p), (sz))
  ------------------
   99|      1|      if (buffer->str == NULL) {
  ------------------
  |  Branch (99:11): [True: 0, False: 1]
  ------------------
  100|      0|        KMP_FATAL(MemoryAllocFailed);
  ------------------
  |  |  146|      0|#define KMP_FATAL(...) __kmp_fatal(KMP_MSG(__VA_ARGS__), __kmp_msg_null)
  |  |  ------------------
  |  |  |  |  121|      0|#define KMP_MSG(...) __kmp_msg_format(kmp_i18n_msg_##__VA_ARGS__)
  |  |  ------------------
  ------------------
  101|      0|      }
  102|      1|    }
  103|      2|  }
  104|       |
  105|     68|  KMP_DEBUG_ASSERT(buffer->size > 0);
  106|     68|  KMP_DEBUG_ASSERT(buffer->size >= (unsigned)size);
  107|     68|  KMP_STR_BUF_INVARIANT(buffer);
  ------------------
  |  |   60|     68|  {                                                                            \
  |  |   61|     68|    KMP_DEBUG_ASSERT((b)->str != NULL);                                        \
  |  |   62|     68|    KMP_DEBUG_ASSERT((b)->size >= sizeof((b)->bulk));                          \
  |  |   63|     68|    KMP_DEBUG_ASSERT((b)->size % sizeof((b)->bulk) == 0);                      \
  |  |   64|     68|    KMP_DEBUG_ASSERT((unsigned)(b)->used < (b)->size);                         \
  |  |   65|     68|    KMP_DEBUG_ASSERT(                                                          \
  |  |   66|     68|        (b)->size == sizeof((b)->bulk) ? (b)->str == &(b)->bulk[0] : 1);       \
  |  |   67|     68|    KMP_DEBUG_ASSERT((b)->size > sizeof((b)->bulk) ? (b)->str != &(b)->bulk[0] \
  |  |   68|     68|                                                   : 1);                       \
  |  |   69|     68|  }
  ------------------
  108|     68|} // __kmp_str_buf_reserve
__kmp_str_buf_detach:
  110|      1|void __kmp_str_buf_detach(kmp_str_buf_t *buffer) {
  111|      1|  KMP_STR_BUF_INVARIANT(buffer);
  ------------------
  |  |   60|      1|  {                                                                            \
  |  |   61|      1|    KMP_DEBUG_ASSERT((b)->str != NULL);                                        \
  |  |   62|      1|    KMP_DEBUG_ASSERT((b)->size >= sizeof((b)->bulk));                          \
  |  |   63|      1|    KMP_DEBUG_ASSERT((b)->size % sizeof((b)->bulk) == 0);                      \
  |  |   64|      1|    KMP_DEBUG_ASSERT((unsigned)(b)->used < (b)->size);                         \
  |  |   65|      1|    KMP_DEBUG_ASSERT(                                                          \
  |  |   66|      1|        (b)->size == sizeof((b)->bulk) ? (b)->str == &(b)->bulk[0] : 1);       \
  |  |   67|      1|    KMP_DEBUG_ASSERT((b)->size > sizeof((b)->bulk) ? (b)->str != &(b)->bulk[0] \
  |  |   68|      1|                                                   : 1);                       \
  |  |   69|      1|  }
  ------------------
  112|       |
  113|       |  // If internal bulk is used, allocate memory and copy it.
  114|      1|  if (buffer->size <= sizeof(buffer->bulk)) {
  ------------------
  |  Branch (114:7): [True: 1, False: 0]
  ------------------
  115|      1|    buffer->str = (char *)KMP_INTERNAL_MALLOC(buffer->size);
  ------------------
  |  |  110|      1|#define KMP_INTERNAL_MALLOC(sz) malloc(sz)
  ------------------
  116|      1|    if (buffer->str == NULL) {
  ------------------
  |  Branch (116:9): [True: 0, False: 1]
  ------------------
  117|      0|      KMP_FATAL(MemoryAllocFailed);
  ------------------
  |  |  146|      0|#define KMP_FATAL(...) __kmp_fatal(KMP_MSG(__VA_ARGS__), __kmp_msg_null)
  |  |  ------------------
  |  |  |  |  121|      0|#define KMP_MSG(...) __kmp_msg_format(kmp_i18n_msg_##__VA_ARGS__)
  |  |  ------------------
  ------------------
  118|      0|    }
  119|      1|    KMP_MEMCPY_S(buffer->str, buffer->size, buffer->bulk, buffer->used + 1);
  ------------------
  |  |   60|      1|#define KMP_MEMCPY_S(dst, bsz, src, cnt) memcpy(dst, src, cnt)
  ------------------
  120|      1|  }
  121|      1|} // __kmp_str_buf_detach
__kmp_str_buf_free:
  123|      3|void __kmp_str_buf_free(kmp_str_buf_t *buffer) {
  124|      3|  KMP_STR_BUF_INVARIANT(buffer);
  ------------------
  |  |   60|      3|  {                                                                            \
  |  |   61|      3|    KMP_DEBUG_ASSERT((b)->str != NULL);                                        \
  |  |   62|      3|    KMP_DEBUG_ASSERT((b)->size >= sizeof((b)->bulk));                          \
  |  |   63|      3|    KMP_DEBUG_ASSERT((b)->size % sizeof((b)->bulk) == 0);                      \
  |  |   64|      3|    KMP_DEBUG_ASSERT((unsigned)(b)->used < (b)->size);                         \
  |  |   65|      3|    KMP_DEBUG_ASSERT(                                                          \
  |  |   66|      3|        (b)->size == sizeof((b)->bulk) ? (b)->str == &(b)->bulk[0] : 1);       \
  |  |   67|      3|    KMP_DEBUG_ASSERT((b)->size > sizeof((b)->bulk) ? (b)->str != &(b)->bulk[0] \
  |  |   68|      3|                                                   : 1);                       \
  |  |   69|      3|  }
  ------------------
  125|      3|  if (buffer->size > sizeof(buffer->bulk)) {
  ------------------
  |  Branch (125:7): [True: 1, False: 2]
  ------------------
  126|      1|    KMP_INTERNAL_FREE(buffer->str);
  ------------------
  |  |  111|      1|#define KMP_INTERNAL_FREE(p) free(p)
  ------------------
  127|      1|  }
  128|      3|  buffer->str = buffer->bulk;
  129|      3|  buffer->size = sizeof(buffer->bulk);
  130|      3|  buffer->used = 0;
  131|      3|  KMP_STR_BUF_INVARIANT(buffer);
  ------------------
  |  |   60|      3|  {                                                                            \
  |  |   61|      3|    KMP_DEBUG_ASSERT((b)->str != NULL);                                        \
  |  |   62|      3|    KMP_DEBUG_ASSERT((b)->size >= sizeof((b)->bulk));                          \
  |  |   63|      3|    KMP_DEBUG_ASSERT((b)->size % sizeof((b)->bulk) == 0);                      \
  |  |   64|      3|    KMP_DEBUG_ASSERT((unsigned)(b)->used < (b)->size);                         \
  |  |   65|      3|    KMP_DEBUG_ASSERT(                                                          \
  |  |   66|      3|        (b)->size == sizeof((b)->bulk) ? (b)->str == &(b)->bulk[0] : 1);       \
  |  |   67|      3|    KMP_DEBUG_ASSERT((b)->size > sizeof((b)->bulk) ? (b)->str != &(b)->bulk[0] \
  |  |   68|      3|                                                   : 1);                       \
  |  |   69|      3|  }
  ------------------
  132|      3|} // __kmp_str_buf_free
__kmp_str_buf_cat:
  134|     68|void __kmp_str_buf_cat(kmp_str_buf_t *buffer, char const *str, size_t len) {
  135|     68|  KMP_STR_BUF_INVARIANT(buffer);
  ------------------
  |  |   60|     68|  {                                                                            \
  |  |   61|     68|    KMP_DEBUG_ASSERT((b)->str != NULL);                                        \
  |  |   62|     68|    KMP_DEBUG_ASSERT((b)->size >= sizeof((b)->bulk));                          \
  |  |   63|     68|    KMP_DEBUG_ASSERT((b)->size % sizeof((b)->bulk) == 0);                      \
  |  |   64|     68|    KMP_DEBUG_ASSERT((unsigned)(b)->used < (b)->size);                         \
  |  |   65|     68|    KMP_DEBUG_ASSERT(                                                          \
  |  |   66|     68|        (b)->size == sizeof((b)->bulk) ? (b)->str == &(b)->bulk[0] : 1);       \
  |  |   67|     68|    KMP_DEBUG_ASSERT((b)->size > sizeof((b)->bulk) ? (b)->str != &(b)->bulk[0] \
  |  |   68|     68|                                                   : 1);                       \
  |  |   69|     68|  }
  ------------------
  136|     68|  KMP_DEBUG_ASSERT(str != NULL);
  137|     68|  KMP_DEBUG_ASSERT(len >= 0);
  138|       |
  139|     68|  __kmp_str_buf_reserve(buffer, buffer->used + len + 1);
  140|     68|  buffer->str[buffer->used] = '\0';
  141|     68|  KMP_STRNCAT_S(buffer->str + buffer->used, len + 1, str, len);
  ------------------
  |  |   65|     68|#define KMP_STRNCAT_S(dst, bsz, src, cnt) strncat(dst, src, cnt)
  ------------------
  142|     68|  __kmp_type_convert(buffer->used + len, &(buffer->used));
  143|     68|  KMP_STR_BUF_INVARIANT(buffer);
  ------------------
  |  |   60|     68|  {                                                                            \
  |  |   61|     68|    KMP_DEBUG_ASSERT((b)->str != NULL);                                        \
  |  |   62|     68|    KMP_DEBUG_ASSERT((b)->size >= sizeof((b)->bulk));                          \
  |  |   63|     68|    KMP_DEBUG_ASSERT((b)->size % sizeof((b)->bulk) == 0);                      \
  |  |   64|     68|    KMP_DEBUG_ASSERT((unsigned)(b)->used < (b)->size);                         \
  |  |   65|     68|    KMP_DEBUG_ASSERT(                                                          \
  |  |   66|     68|        (b)->size == sizeof((b)->bulk) ? (b)->str == &(b)->bulk[0] : 1);       \
  |  |   67|     68|    KMP_DEBUG_ASSERT((b)->size > sizeof((b)->bulk) ? (b)->str != &(b)->bulk[0] \
  |  |   68|     68|                                                   : 1);                       \
  |  |   69|     68|  }
  ------------------
  144|     68|} // __kmp_str_buf_cat
__kmp_str_buf_vprint:
  162|    124|                         va_list args) {
  163|    124|  int rc;
  164|    124|  KMP_STR_BUF_INVARIANT(buffer);
  ------------------
  |  |   60|    124|  {                                                                            \
  |  |   61|    124|    KMP_DEBUG_ASSERT((b)->str != NULL);                                        \
  |  |   62|    124|    KMP_DEBUG_ASSERT((b)->size >= sizeof((b)->bulk));                          \
  |  |   63|    124|    KMP_DEBUG_ASSERT((b)->size % sizeof((b)->bulk) == 0);                      \
  |  |   64|    124|    KMP_DEBUG_ASSERT((unsigned)(b)->used < (b)->size);                         \
  |  |   65|    124|    KMP_DEBUG_ASSERT(                                                          \
  |  |   66|    124|        (b)->size == sizeof((b)->bulk) ? (b)->str == &(b)->bulk[0] : 1);       \
  |  |   67|    124|    KMP_DEBUG_ASSERT((b)->size > sizeof((b)->bulk) ? (b)->str != &(b)->bulk[0] \
  |  |   68|    124|                                                   : 1);                       \
  |  |   69|    124|  }
  ------------------
  165|       |
  166|    124|  for (;;) {
  167|    124|    int const free = buffer->size - buffer->used;
  168|    124|    int size;
  169|       |
  170|       |    // Try to format string.
  171|    124|    {
  172|       |      /* On Linux* OS Intel(R) 64, vsnprintf() modifies args argument, so
  173|       |         vsnprintf() crashes if it is called for the second time with the same
  174|       |         args. To prevent the crash, we have to pass a fresh intact copy of args
  175|       |         to vsnprintf() on each iteration.
  176|       |
  177|       |         Unfortunately, standard va_copy() macro is not available on Windows*
  178|       |         OS. However, it seems vsnprintf() does not modify args argument on
  179|       |         Windows* OS.
  180|       |      */
  181|       |
  182|    124|#if !KMP_OS_WINDOWS
  183|    124|      va_list _args;
  184|    124|      va_copy(_args, args); // Make copy of args.
  185|    124|#define args _args // Substitute args with its copy, _args.
  186|    124|#endif // KMP_OS_WINDOWS
  187|    124|      rc = KMP_VSNPRINTF(buffer->str + buffer->used, free, format, args);
  ------------------
  |  |   66|    124|#define KMP_VSNPRINTF vsnprintf
  ------------------
                    rc = KMP_VSNPRINTF(buffer->str + buffer->used, free, format, args);
  ------------------
  |  |  185|    124|#define args _args // Substitute args with its copy, _args.
  ------------------
  188|    124|#if !KMP_OS_WINDOWS
  189|    124|#undef args // Remove substitution.
  190|    124|      va_end(_args);
  191|    124|#endif // KMP_OS_WINDOWS
  192|    124|    }
  193|       |
  194|       |    // No errors, string has been formatted.
  195|    124|    if (rc >= 0 && rc < free) {
  ------------------
  |  Branch (195:9): [True: 124, False: 0]
  |  Branch (195:20): [True: 124, False: 0]
  ------------------
  196|    124|      buffer->used += rc;
  197|    124|      break;
  198|    124|    }
  199|       |
  200|       |    // Error occurred, buffer is too small.
  201|      0|    if (rc >= 0) {
  ------------------
  |  Branch (201:9): [True: 0, False: 0]
  ------------------
  202|       |      // C99-conforming implementation of vsnprintf returns required buffer size
  203|      0|      size = buffer->used + rc + 1;
  204|      0|    } else {
  205|       |      // Older implementations just return -1. Double buffer size.
  206|      0|      size = buffer->size * 2;
  207|      0|    }
  208|       |
  209|       |    // Enlarge buffer.
  210|      0|    __kmp_str_buf_reserve(buffer, size);
  211|       |
  212|       |    // And try again.
  213|      0|  }
  214|       |
  215|    124|  KMP_DEBUG_ASSERT(buffer->size > 0);
  216|    124|  KMP_STR_BUF_INVARIANT(buffer);
  ------------------
  |  |   60|    124|  {                                                                            \
  |  |   61|    124|    KMP_DEBUG_ASSERT((b)->str != NULL);                                        \
  |  |   62|    124|    KMP_DEBUG_ASSERT((b)->size >= sizeof((b)->bulk));                          \
  |  |   63|    124|    KMP_DEBUG_ASSERT((b)->size % sizeof((b)->bulk) == 0);                      \
  |  |   64|    124|    KMP_DEBUG_ASSERT((unsigned)(b)->used < (b)->size);                         \
  |  |   65|    124|    KMP_DEBUG_ASSERT(                                                          \
  |  |   66|    124|        (b)->size == sizeof((b)->bulk) ? (b)->str == &(b)->bulk[0] : 1);       \
  |  |   67|    124|    KMP_DEBUG_ASSERT((b)->size > sizeof((b)->bulk) ? (b)->str != &(b)->bulk[0] \
  |  |   68|    124|                                                   : 1);                       \
  |  |   69|    124|  }
  ------------------
  217|    124|  return rc;
  218|    124|} // __kmp_str_buf_vprint
__kmp_str_buf_print:
  221|    123|int __kmp_str_buf_print(kmp_str_buf_t *buffer, char const *format, ...) {
  222|    123|  int rc;
  223|    123|  va_list args;
  224|    123|  va_start(args, format);
  225|    123|  rc = __kmp_str_buf_vprint(buffer, format, args);
  226|       |  va_end(args);
  227|    123|  return rc;
  228|    123|} // __kmp_str_buf_print
__kmp_str_buf_print_size:
  232|      5|void __kmp_str_buf_print_size(kmp_str_buf_t *buf, size_t size) {
  233|      5|  char const *names[] = {"", "k", "M", "G", "T", "P", "E", "Z", "Y"};
  234|      5|  int const units = sizeof(names) / sizeof(char const *);
  235|      5|  int u = 0;
  236|      5|  if (size > 0) {
  ------------------
  |  Branch (236:7): [True: 5, False: 0]
  ------------------
  237|     11|    while ((size % 1024 == 0) && (u + 1 < units)) {
  ------------------
  |  Branch (237:12): [True: 6, False: 5]
  |  Branch (237:34): [True: 6, False: 0]
  ------------------
  238|      6|      size = size / 1024;
  239|      6|      ++u;
  240|      6|    }
  241|      5|  }
  242|       |
  243|      5|  __kmp_str_buf_print(buf, "%" KMP_SIZE_T_SPEC "%s", size, names[u]);
  244|      5|} // __kmp_str_buf_print_size
__kmp_str_format:
  451|      3|) {
  452|      3|  va_list args;
  453|      3|  int size = 512;
  454|      3|  char *buffer = NULL;
  455|      3|  int rc;
  456|       |
  457|       |  // Allocate buffer.
  458|      3|  buffer = (char *)KMP_INTERNAL_MALLOC(size);
  ------------------
  |  |  110|      3|#define KMP_INTERNAL_MALLOC(sz) malloc(sz)
  ------------------
  459|      3|  if (buffer == NULL) {
  ------------------
  |  Branch (459:7): [True: 0, False: 3]
  ------------------
  460|      0|    KMP_FATAL(MemoryAllocFailed);
  ------------------
  |  |  146|      0|#define KMP_FATAL(...) __kmp_fatal(KMP_MSG(__VA_ARGS__), __kmp_msg_null)
  |  |  ------------------
  |  |  |  |  121|      0|#define KMP_MSG(...) __kmp_msg_format(kmp_i18n_msg_##__VA_ARGS__)
  |  |  ------------------
  ------------------
  461|      0|  }
  462|       |
  463|      3|  for (;;) {
  464|       |    // Try to format string.
  465|      3|    va_start(args, format);
  466|      3|    rc = KMP_VSNPRINTF(buffer, size, format, args);
  ------------------
  |  |   66|      3|#define KMP_VSNPRINTF vsnprintf
  ------------------
  467|      3|    va_end(args);
  468|       |
  469|       |    // No errors, string has been formatted.
  470|      3|    if (rc >= 0 && rc < size) {
  ------------------
  |  Branch (470:9): [True: 3, False: 0]
  |  Branch (470:20): [True: 3, False: 0]
  ------------------
  471|      3|      break;
  472|      3|    }
  473|       |
  474|       |    // Error occurred, buffer is too small.
  475|      0|    if (rc >= 0) {
  ------------------
  |  Branch (475:9): [True: 0, False: 0]
  ------------------
  476|       |      // C99-conforming implementation of vsnprintf returns required buffer
  477|       |      // size.
  478|      0|      size = rc + 1;
  479|      0|    } else {
  480|       |      // Older implementations just return -1.
  481|      0|      size = size * 2;
  482|      0|    }
  483|       |
  484|       |    // Enlarge buffer and try again.
  485|      0|    buffer = (char *)KMP_INTERNAL_REALLOC(buffer, size);
  ------------------
  |  |  112|      0|#define KMP_INTERNAL_REALLOC(p, sz) realloc((p), (sz))
  ------------------
  486|      0|    if (buffer == NULL) {
  ------------------
  |  Branch (486:9): [True: 0, False: 0]
  ------------------
  487|      0|      KMP_FATAL(MemoryAllocFailed);
  ------------------
  |  |  146|      0|#define KMP_FATAL(...) __kmp_fatal(KMP_MSG(__VA_ARGS__), __kmp_msg_null)
  |  |  ------------------
  |  |  |  |  121|      0|#define KMP_MSG(...) __kmp_msg_format(kmp_i18n_msg_##__VA_ARGS__)
  |  |  ------------------
  ------------------
  488|      0|    }
  489|      0|  }
  490|       |
  491|      3|  return buffer;
  492|      3|} // func __kmp_str_format
__kmp_str_free:
  494|      3|void __kmp_str_free(char **str) {
  495|      3|  KMP_DEBUG_ASSERT(str != NULL);
  496|      3|  KMP_INTERNAL_FREE(*str);
  ------------------
  |  |  111|      3|#define KMP_INTERNAL_FREE(p) free(p)
  ------------------
  497|       |  *str = NULL;
  498|      3|} // func __kmp_str_free
__kmp_str_split:
  575|     67|) {
  576|     67|  char *h = str;
  577|     67|  char *t = NULL;
  578|     67|  if (str != NULL) {
  ------------------
  |  Branch (578:7): [True: 67, False: 0]
  ------------------
  579|     67|    char *ptr = strchr(str, delim);
  580|     67|    if (ptr != NULL) {
  ------------------
  |  Branch (580:9): [True: 67, False: 0]
  ------------------
  581|     67|      *ptr = 0;
  582|     67|      t = ptr + 1;
  583|     67|    }
  584|     67|  }
  585|     67|  if (head != NULL) {
  ------------------
  |  Branch (585:7): [True: 67, False: 0]
  ------------------
  586|     67|    *head = h;
  587|     67|  }
  588|     67|  if (tail != NULL) {
  ------------------
  |  Branch (588:7): [True: 67, False: 0]
  ------------------
  589|     67|    *tail = t;
  590|     67|  }
  591|     67|} // __kmp_str_split

__kmp_pop_current_task_from_thread:
  612|  4.36k|void __kmp_pop_current_task_from_thread(kmp_info_t *this_thr) {
  613|  4.36k|  KF_TRACE(10, ("__kmp_pop_current_task_from_thread(enter): T#%d "
  614|  4.36k|                "this_thread=%p, curtask=%p, "
  615|  4.36k|                "curtask_parent=%p\n",
  616|  4.36k|                0, this_thr, this_thr->th.th_current_task,
  617|  4.36k|                this_thr->th.th_current_task->td_parent));
  618|       |
  619|  4.36k|  this_thr->th.th_current_task = this_thr->th.th_current_task->td_parent;
  620|       |
  621|  4.36k|  KF_TRACE(10, ("__kmp_pop_current_task_from_thread(exit): T#%d "
  622|  4.36k|                "this_thread=%p, curtask=%p, "
  623|  4.36k|                "curtask_parent=%p\n",
  624|  4.36k|                0, this_thr, this_thr->th.th_current_task,
  625|  4.36k|                this_thr->th.th_current_task->td_parent));
  626|  4.36k|}
__kmp_push_current_task_to_thread:
  635|  4.42k|                                       int tid) {
  636|       |  // current task of the thread is a parent of the new just created implicit
  637|       |  // tasks of new team
  638|  4.42k|  KF_TRACE(10, ("__kmp_push_current_task_to_thread(enter): T#%d this_thread=%p "
  639|  4.42k|                "curtask=%p "
  640|  4.42k|                "parent_task=%p\n",
  641|  4.42k|                tid, this_thr, this_thr->th.th_current_task,
  642|  4.42k|                team->t.t_implicit_task_taskdata[tid].td_parent));
  643|       |
  644|  4.42k|  KMP_DEBUG_ASSERT(this_thr != NULL);
  645|       |
  646|  4.42k|  if (tid == 0) {
  ------------------
  |  Branch (646:7): [True: 4.36k, False: 62]
  ------------------
  647|  4.36k|    if (this_thr->th.th_current_task != &team->t.t_implicit_task_taskdata[0]) {
  ------------------
  |  Branch (647:9): [True: 4.36k, False: 0]
  ------------------
  648|  4.36k|      team->t.t_implicit_task_taskdata[0].td_parent =
  649|  4.36k|          this_thr->th.th_current_task;
  650|  4.36k|      this_thr->th.th_current_task = &team->t.t_implicit_task_taskdata[0];
  651|  4.36k|    }
  652|  4.36k|  } else {
  653|     62|    team->t.t_implicit_task_taskdata[tid].td_parent =
  654|     62|        team->t.t_implicit_task_taskdata[0].td_parent;
  655|     62|    this_thr->th.th_current_task = &team->t.t_implicit_task_taskdata[tid];
  656|     62|  }
  657|       |
  658|  4.42k|  KF_TRACE(10, ("__kmp_push_current_task_to_thread(exit): T#%d this_thread=%p "
  659|  4.42k|                "curtask=%p "
  660|  4.42k|                "parent_task=%p\n",
  661|  4.42k|                tid, this_thr, this_thr->th.th_current_task,
  662|  4.42k|                team->t.t_implicit_task_taskdata[tid].td_parent));
  663|  4.42k|}
__kmp_init_implicit_task:
 1320|  42.5k|                              kmp_team_t *team, int tid, int set_curr_task) {
 1321|  42.5k|  kmp_taskdata_t *task = &team->t.t_implicit_task_taskdata[tid];
 1322|       |
 1323|  42.5k|  KF_TRACE(
 1324|  42.5k|      10,
 1325|  42.5k|      ("__kmp_init_implicit_task(enter): T#:%d team=%p task=%p, reinit=%s\n",
 1326|  42.5k|       tid, team, task, set_curr_task ? "TRUE" : "FALSE"));
 1327|       |
 1328|  42.5k|  task->td_task_id = KMP_GEN_TASK_ID();
  ------------------
  |  | 3546|  42.5k|#define KMP_GEN_TASK_ID() _KMP_GEN_ID(__kmp_task_counter)
  |  |  ------------------
  |  |  |  | 3543|  42.5k|#define _KMP_GEN_ID(counter) (~0)
  |  |  ------------------
  ------------------
 1329|  42.5k|  task->td_team = team;
 1330|       |  //    task->td_parent   = NULL;  // fix for CQ230101 (broken parent task info
 1331|       |  //    in debugger)
 1332|  42.5k|  task->td_ident = loc_ref;
 1333|  42.5k|  task->td_taskwait_ident = NULL;
 1334|  42.5k|  task->td_taskwait_counter = 0;
 1335|  42.5k|  task->td_taskwait_thread = 0;
 1336|       |
 1337|  42.5k|  task->td_flags.tiedness = TASK_TIED;
  ------------------
  |  |   45|  42.5k|#define TASK_TIED 1
  ------------------
 1338|  42.5k|  task->td_flags.tasktype = TASK_IMPLICIT;
  ------------------
  |  |   48|  42.5k|#define TASK_IMPLICIT 0
  ------------------
 1339|  42.5k|  task->td_flags.proxy = TASK_FULL;
  ------------------
  |  |   50|  42.5k|#define TASK_FULL 0
  ------------------
 1340|       |
 1341|       |  // All implicit tasks are executed immediately, not deferred
 1342|  42.5k|  task->td_flags.task_serial = 1;
 1343|  42.5k|  task->td_flags.tasking_ser = (__kmp_tasking_mode == tskm_immediate_exec);
 1344|  42.5k|  task->td_flags.team_serial = (team->t.t_serialized) ? 1 : 0;
  ------------------
  |  Branch (1344:32): [True: 66, False: 42.5k]
  ------------------
 1345|       |
 1346|  42.5k|  task->td_flags.started = 1;
 1347|  42.5k|  task->td_flags.executing = 1;
 1348|  42.5k|  task->td_flags.complete = 0;
 1349|  42.5k|  task->td_flags.freed = 0;
 1350|       |#if OMPX_TASKGRAPH
 1351|       |  task->td_flags.onced = 0;
 1352|       |#endif
 1353|       |
 1354|  42.5k|  task->td_depnode = NULL;
 1355|  42.5k|  task->td_last_tied = task;
 1356|  42.5k|  task->td_allow_completion_event.type = KMP_EVENT_UNINITIALIZED;
 1357|       |
 1358|  42.5k|  if (set_curr_task) { // only do this init first time thread is created
  ------------------
  |  Branch (1358:7): [True: 64, False: 42.5k]
  ------------------
 1359|     64|    KMP_ATOMIC_ST_REL(&task->td_incomplete_child_tasks, 0);
  ------------------
  |  | 1251|     64|#define KMP_ATOMIC_ST_REL(p, v) KMP_ATOMIC_OP(store, p, v, release)
  |  |  ------------------
  |  |  |  | 1246|     64|#define KMP_ATOMIC_OP(op, p, v, order) (p)->op(v, std::memory_order_##order)
  |  |  ------------------
  ------------------
 1360|       |    // Not used: don't need to deallocate implicit task
 1361|     64|    KMP_ATOMIC_ST_REL(&task->td_allocated_child_tasks, 0);
  ------------------
  |  | 1251|     64|#define KMP_ATOMIC_ST_REL(p, v) KMP_ATOMIC_OP(store, p, v, release)
  |  |  ------------------
  |  |  |  | 1246|     64|#define KMP_ATOMIC_OP(op, p, v, order) (p)->op(v, std::memory_order_##order)
  |  |  ------------------
  ------------------
 1362|     64|    task->td_taskgroup = NULL; // An implicit task does not have taskgroup
 1363|     64|    task->td_dephash = NULL;
 1364|     64|    __kmp_push_current_task_to_thread(this_thr, team, tid);
 1365|  42.5k|  } else {
 1366|  42.5k|    KMP_DEBUG_ASSERT(task->td_incomplete_child_tasks == 0);
 1367|  42.5k|    KMP_DEBUG_ASSERT(task->td_allocated_child_tasks == 0);
 1368|  42.5k|  }
 1369|       |
 1370|  42.5k|#if OMPT_SUPPORT
 1371|  42.5k|  if (UNLIKELY(ompt_enabled.enabled))
  ------------------
  |  |  119|  42.5k|#define UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (119:21): [True: 0, False: 42.5k]
  |  |  ------------------
  ------------------
 1372|      0|    __ompt_task_init(task, tid);
 1373|  42.5k|#endif
 1374|       |
 1375|  42.5k|  KF_TRACE(10, ("__kmp_init_implicit_task(exit): T#:%d team=%p task=%p\n", tid,
 1376|  42.5k|                team, task));
 1377|  42.5k|}
__kmp_finish_implicit_task:
 1384|  42.2k|void __kmp_finish_implicit_task(kmp_info_t *thread) {
 1385|  42.2k|  kmp_taskdata_t *task = thread->th.th_current_task;
 1386|  42.2k|  if (task->td_dephash) {
  ------------------
  |  Branch (1386:7): [True: 0, False: 42.2k]
  ------------------
 1387|      0|    int children;
 1388|      0|    task->td_flags.complete = 1;
 1389|       |#if OMPX_TASKGRAPH
 1390|       |    task->td_flags.onced = 1;
 1391|       |#endif
 1392|      0|    children = KMP_ATOMIC_LD_ACQ(&task->td_incomplete_child_tasks);
  ------------------
  |  | 1249|      0|#define KMP_ATOMIC_LD_ACQ(p) KMP_ATOMIC_LD(p, acquire)
  |  |  ------------------
  |  |  |  | 1245|      0|#define KMP_ATOMIC_LD(p, order) (p)->load(std::memory_order_##order)
  |  |  ------------------
  ------------------
 1393|      0|    kmp_tasking_flags_t flags_old = task->td_flags;
 1394|      0|    if (children == 0 && flags_old.complete == 1) {
  ------------------
  |  Branch (1394:9): [True: 0, False: 0]
  |  Branch (1394:26): [True: 0, False: 0]
  ------------------
 1395|      0|      kmp_tasking_flags_t flags_new = flags_old;
 1396|      0|      flags_new.complete = 0;
 1397|      0|      if (KMP_COMPARE_AND_STORE_ACQ32(RCAST(kmp_int32 *, &task->td_flags),
  ------------------
  |  |  807|      0|  __sync_bool_compare_and_swap((volatile kmp_uint32 *)(p), (kmp_uint32)(cv),   \
  |  |  ------------------
  |  |  |  Branch (807:3): [True: 0, False: 0]
  |  |  ------------------
  |  |  808|      0|                               (kmp_uint32)(sv))
  ------------------
 1398|      0|                                      *RCAST(kmp_int32 *, &flags_old),
 1399|      0|                                      *RCAST(kmp_int32 *, &flags_new))) {
 1400|      0|        KA_TRACE(100, ("__kmp_finish_implicit_task: T#%d cleans "
 1401|      0|                       "dephash of implicit task %p\n",
 1402|      0|                       thread->th.th_info.ds.ds_gtid, task));
 1403|      0|        __kmp_dephash_free_entries(thread, task->td_dephash);
 1404|      0|      }
 1405|      0|    }
 1406|      0|  }
 1407|  42.2k|}
__kmp_free_implicit_task:
 1413|     63|void __kmp_free_implicit_task(kmp_info_t *thread) {
 1414|     63|  kmp_taskdata_t *task = thread->th.th_current_task;
 1415|     63|  if (task && task->td_dephash) {
  ------------------
  |  Branch (1415:7): [True: 32, False: 31]
  |  Branch (1415:15): [True: 0, False: 32]
  ------------------
 1416|      0|    __kmp_dephash_free(thread, task->td_dephash);
 1417|       |    task->td_dephash = NULL;
 1418|      0|  }
 1419|     63|}
__kmp_free_task_team:
 3995|      2|void __kmp_free_task_team(kmp_info_t *thread, kmp_task_team_t *task_team) {
 3996|      2|  KA_TRACE(20, ("__kmp_free_task_team: T#%d task_team = %p\n",
 3997|      2|                thread ? __kmp_gtid_from_thread(thread) : -1, task_team));
 3998|       |
 3999|       |  // Put task team back on free list
 4000|      2|  __kmp_acquire_bootstrap_lock(&__kmp_task_team_lock);
 4001|       |
 4002|      2|  KMP_DEBUG_ASSERT(task_team->tt.tt_next == NULL);
 4003|      2|  task_team->tt.tt_next = __kmp_free_task_teams;
 4004|      2|  TCW_PTR(__kmp_free_task_teams, task_team);
  ------------------
  |  | 1157|      2|#define TCW_PTR(a, b) TCW_8((a), (b))
  |  |  ------------------
  |  |  |  | 1132|      2|#define TCW_8(a, b) (a) = (b)
  |  |  ------------------
  ------------------
 4005|       |
 4006|      2|  __kmp_release_bootstrap_lock(&__kmp_task_team_lock);
 4007|      2|}
__kmp_reap_task_teams:
 4014|      1|void __kmp_reap_task_teams(void) {
 4015|      1|  kmp_task_team_t *task_team;
 4016|       |
 4017|      1|  if (TCR_PTR(__kmp_free_task_teams) != NULL) {
  ------------------
  |  | 1156|      1|#define TCR_PTR(a) ((void *)TCR_8(a))
  |  |  ------------------
  |  |  |  | 1131|      1|#define TCR_8(a) (a)
  |  |  ------------------
  ------------------
  |  Branch (4017:7): [True: 1, False: 0]
  ------------------
 4018|       |    // Free all task_teams on the free list
 4019|      1|    __kmp_acquire_bootstrap_lock(&__kmp_task_team_lock);
 4020|      3|    while ((task_team = __kmp_free_task_teams) != NULL) {
  ------------------
  |  Branch (4020:12): [True: 2, False: 1]
  ------------------
 4021|      2|      __kmp_free_task_teams = task_team->tt.tt_next;
 4022|      2|      task_team->tt.tt_next = NULL;
 4023|       |
 4024|       |      // Free threads_data if necessary
 4025|      2|      if (task_team->tt.tt_threads_data != NULL) {
  ------------------
  |  Branch (4025:11): [True: 0, False: 2]
  ------------------
 4026|      0|        __kmp_free_task_threads_data(task_team);
 4027|      0|      }
 4028|      2|      if (task_team->tt.tt_task_pri_list != NULL) {
  ------------------
  |  Branch (4028:11): [True: 0, False: 2]
  ------------------
 4029|      0|        __kmp_free_task_pri_list(task_team);
 4030|      0|      }
 4031|      2|      __kmp_free(task_team);
  ------------------
  |  | 3619|      2|#define __kmp_free(ptr) ___kmp_free((ptr)KMP_SRC_LOC_CURR)
  ------------------
 4032|      2|    }
 4033|      1|    __kmp_release_bootstrap_lock(&__kmp_task_team_lock);
 4034|      1|  }
 4035|      1|}
__kmp_wait_to_unref_task_teams:
 4040|      1|void __kmp_wait_to_unref_task_teams(void) {
 4041|      1|  kmp_info_t *thread;
 4042|      1|  kmp_uint32 spins;
 4043|      1|  kmp_uint64 time;
 4044|      1|  int done;
 4045|       |
 4046|      1|  KMP_INIT_YIELD(spins);
  ------------------
  |  | 1514|      1|  { (count) = __kmp_yield_init; }
  ------------------
 4047|      1|  KMP_INIT_BACKOFF(time);
  ------------------
  |  | 1517|      1|  { (time) = __kmp_pause_init; }
  ------------------
 4048|       |
 4049|      1|  for (;;) {
 4050|      1|    done = TRUE;
  ------------------
  |  | 1280|      1|#define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  | 1279|      1|#define FALSE 0
  |  |  ------------------
  ------------------
 4051|       |
 4052|       |    // TODO: GEH - this may be is wrong because some sync would be necessary
 4053|       |    // in case threads are added to the pool during the traversal. Need to
 4054|       |    // verify that lock for thread pool is held when calling this routine.
 4055|     32|    for (thread = CCAST(kmp_info_t *, __kmp_thread_pool); thread != NULL;
  ------------------
  |  |  229|      1|#define CCAST(type, var) const_cast<type>(var)
  ------------------
  |  Branch (4055:59): [True: 31, False: 1]
  ------------------
 4056|     31|         thread = thread->th.th_next_pool) {
 4057|       |#if KMP_OS_WINDOWS
 4058|       |      DWORD exit_val;
 4059|       |#endif
 4060|     31|      if (TCR_PTR(thread->th.th_task_team) == NULL) {
  ------------------
  |  | 1156|     31|#define TCR_PTR(a) ((void *)TCR_8(a))
  |  |  ------------------
  |  |  |  | 1131|     31|#define TCR_8(a) (a)
  |  |  ------------------
  ------------------
  |  Branch (4060:11): [True: 31, False: 0]
  ------------------
 4061|     31|        KA_TRACE(10, ("__kmp_wait_to_unref_task_team: T#%d task_team == NULL\n",
 4062|     31|                      __kmp_gtid_from_thread(thread)));
 4063|     31|        continue;
 4064|     31|      }
 4065|       |#if KMP_OS_WINDOWS
 4066|       |      // TODO: GEH - add this check for Linux* OS / OS X* as well?
 4067|       |      if (!__kmp_is_thread_alive(thread, &exit_val)) {
 4068|       |        thread->th.th_task_team = NULL;
 4069|       |        continue;
 4070|       |      }
 4071|       |#endif
 4072|       |
 4073|      0|      done = FALSE; // Because th_task_team pointer is not NULL for this thread
  ------------------
  |  | 1279|      0|#define FALSE 0
  ------------------
 4074|       |
 4075|      0|      KA_TRACE(10, ("__kmp_wait_to_unref_task_team: Waiting for T#%d to "
 4076|      0|                    "unreference task_team\n",
 4077|      0|                    __kmp_gtid_from_thread(thread)));
 4078|       |
 4079|      0|      if (__kmp_dflt_blocktime != KMP_MAX_BLOCKTIME) {
  ------------------
  |  | 1184|      0|  (INT_MAX) /* Must be this for "infinite" setting the work */
  ------------------
  |  Branch (4079:11): [True: 0, False: 0]
  ------------------
 4080|      0|        void *sleep_loc;
 4081|       |        // If the thread is sleeping, awaken it.
 4082|      0|        if ((sleep_loc = TCR_PTR(CCAST(void *, thread->th.th_sleep_loc))) !=
  ------------------
  |  | 1156|      0|#define TCR_PTR(a) ((void *)TCR_8(a))
  |  |  ------------------
  |  |  |  | 1131|      0|#define TCR_8(a) (a)
  |  |  ------------------
  ------------------
  |  Branch (4082:13): [True: 0, False: 0]
  ------------------
 4083|      0|            NULL) {
 4084|      0|          KA_TRACE(
 4085|      0|              10,
 4086|      0|              ("__kmp_wait_to_unref_task_team: T#%d waking up thread T#%d\n",
 4087|      0|               __kmp_gtid_from_thread(thread), __kmp_gtid_from_thread(thread)));
 4088|      0|          __kmp_null_resume_wrapper(thread);
 4089|      0|        }
 4090|      0|      }
 4091|      0|    }
 4092|      1|    if (done) {
  ------------------
  |  Branch (4092:9): [True: 1, False: 0]
  ------------------
 4093|      1|      break;
 4094|      1|    }
 4095|       |
 4096|       |    // If oversubscribed or have waited a bit, yield.
 4097|      0|    KMP_YIELD_OVERSUB_ELSE_SPIN(spins, time);
  ------------------
  |  | 1564|      0|  {                                                                            \
  |  | 1565|      0|    if (__kmp_tpause_enabled) {                                                \
  |  |  ------------------
  |  |  |  Branch (1565:9): [True: 0, False: 0]
  |  |  ------------------
  |  | 1566|      0|      if (KMP_OVERSUBSCRIBED) {                                                \
  |  |  ------------------
  |  |  |  | 1520|      0|  (TCR_4(__kmp_nth) > (__kmp_avail_proc ? __kmp_avail_proc : __kmp_xproc))
  |  |  |  |  ------------------
  |  |  |  |  |  | 1127|      0|#define TCR_4(a) (a)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1520:3): [True: 0, False: 0]
  |  |  |  |  |  Branch (1520:24): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1567|      0|        __kmp_tpause(0, (time));                                               \
  |  | 1568|      0|      } else {                                                                 \
  |  | 1569|      0|        __kmp_tpause(__kmp_tpause_hint, (time));                               \
  |  | 1570|      0|      }                                                                        \
  |  | 1571|      0|      (time) = (time << 1 | 1) & KMP_TPAUSE_MAX_MASK;                          \
  |  |  ------------------
  |  |  |  | 1562|      0|#define KMP_TPAUSE_MAX_MASK ((kmp_uint64)0xFFFF)
  |  |  ------------------
  |  | 1572|      0|    } else {                                                                   \
  |  | 1573|      0|      KMP_CPU_PAUSE();                                                         \
  |  |  ------------------
  |  |  |  | 1498|      0|#define KMP_CPU_PAUSE() __kmp_x86_pause()
  |  |  ------------------
  |  | 1574|      0|      if ((KMP_TRY_YIELD_OVERSUB)) {                                           \
  |  |  ------------------
  |  |  |  | 1526|      0|  ((__kmp_use_yield == 1 || __kmp_use_yield == 2) && (KMP_OVERSUBSCRIBED))
  |  |  |  |  ------------------
  |  |  |  |  |  | 1520|      0|  (TCR_4(__kmp_nth) > (__kmp_avail_proc ? __kmp_avail_proc : __kmp_xproc))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 1127|      0|#define TCR_4(a) (a)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1520:24): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1526:5): [True: 0, False: 0]
  |  |  |  |  |  Branch (1526:29): [True: 0, False: 0]
  |  |  |  |  |  Branch (1526:54): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1575|      0|        __kmp_yield();                                                         \
  |  | 1576|      0|      } else if (__kmp_use_yield == 1) {                                       \
  |  |  ------------------
  |  |  |  Branch (1576:18): [True: 0, False: 0]
  |  |  ------------------
  |  | 1577|      0|        (count) -= 2;                                                          \
  |  | 1578|      0|        if (!(count)) {                                                        \
  |  |  ------------------
  |  |  |  Branch (1578:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 1579|      0|          __kmp_yield();                                                       \
  |  | 1580|      0|          (count) = __kmp_yield_next;                                          \
  |  | 1581|      0|        }                                                                      \
  |  | 1582|      0|      }                                                                        \
  |  | 1583|      0|    }                                                                          \
  |  | 1584|      0|  }
  ------------------
 4098|      0|  }
 4099|      1|}
__kmp_task_team_setup:
 4141|  2.42k|void __kmp_task_team_setup(kmp_info_t *this_thr, kmp_team_t *team, int always) {
 4142|  2.42k|  KMP_DEBUG_ASSERT(__kmp_tasking_mode != tskm_immediate_exec);
 4143|       |
 4144|       |  // If this task_team hasn't been created yet, allocate it. It will be used in
 4145|       |  // the region after the next.
 4146|       |  // If it exists, it is the current task team and shouldn't be touched yet as
 4147|       |  // it may still be in use.
 4148|  2.42k|  if (team->t.t_task_team[this_thr->th.th_task_state] == NULL &&
  ------------------
  |  Branch (4148:7): [True: 1, False: 2.42k]
  ------------------
 4149|      1|      (always || team->t.t_nproc > 1)) {
  ------------------
  |  Branch (4149:8): [True: 0, False: 1]
  |  Branch (4149:18): [True: 1, False: 0]
  ------------------
 4150|      1|    team->t.t_task_team[this_thr->th.th_task_state] =
 4151|      1|        __kmp_allocate_task_team(this_thr, team);
 4152|      1|    KA_TRACE(20, ("__kmp_task_team_setup: Primary T#%d created new task_team %p"
 4153|      1|                  " for team %d at parity=%d\n",
 4154|      1|                  __kmp_gtid_from_thread(this_thr),
 4155|      1|                  team->t.t_task_team[this_thr->th.th_task_state], team->t.t_id,
 4156|      1|                  this_thr->th.th_task_state));
 4157|      1|  }
 4158|  2.42k|  if (this_thr->th.th_task_state == 1 && always && team->t.t_nproc == 1) {
  ------------------
  |  Branch (4158:7): [True: 1.21k, False: 1.21k]
  |  Branch (4158:42): [True: 0, False: 1.21k]
  |  Branch (4158:52): [True: 0, False: 0]
  ------------------
 4159|       |    // fix task state stack to adjust for proxy and helper tasks
 4160|      0|    KA_TRACE(20, ("__kmp_task_team_setup: Primary T#%d needs to shift stack"
 4161|      0|                  " for team %d at parity=%d\n",
 4162|      0|                  __kmp_gtid_from_thread(this_thr), team->t.t_id,
 4163|      0|                  this_thr->th.th_task_state));
 4164|      0|    __kmp_shift_task_state_stack(this_thr, this_thr->th.th_task_state);
 4165|      0|  }
 4166|       |
 4167|       |  // After threads exit the release, they will call sync, and then point to this
 4168|       |  // other task_team; make sure it is allocated and properly initialized. As
 4169|       |  // threads spin in the barrier release phase, they will continue to use the
 4170|       |  // previous task_team struct(above), until they receive the signal to stop
 4171|       |  // checking for tasks (they can't safely reference the kmp_team_t struct,
 4172|       |  // which could be reallocated by the primary thread). No task teams are formed
 4173|       |  // for serialized teams.
 4174|  2.42k|  if (team->t.t_nproc > 1) {
  ------------------
  |  Branch (4174:7): [True: 2.42k, False: 0]
  ------------------
 4175|  2.42k|    int other_team = 1 - this_thr->th.th_task_state;
 4176|  2.42k|    KMP_DEBUG_ASSERT(other_team >= 0 && other_team < 2);
 4177|  2.42k|    if (team->t.t_task_team[other_team] == NULL) { // setup other team as well
  ------------------
  |  Branch (4177:9): [True: 1, False: 2.42k]
  ------------------
 4178|      1|      team->t.t_task_team[other_team] =
 4179|      1|          __kmp_allocate_task_team(this_thr, team);
 4180|      1|      KA_TRACE(20, ("__kmp_task_team_setup: Primary T#%d created second new "
 4181|      1|                    "task_team %p for team %d at parity=%d\n",
 4182|      1|                    __kmp_gtid_from_thread(this_thr),
 4183|      1|                    team->t.t_task_team[other_team], team->t.t_id, other_team));
 4184|  2.42k|    } else { // Leave the old task team struct in place for the upcoming region;
 4185|       |      // adjust as needed
 4186|  2.42k|      kmp_task_team_t *task_team = team->t.t_task_team[other_team];
 4187|  2.42k|      if (!task_team->tt.tt_active ||
  ------------------
  |  Branch (4187:11): [True: 0, False: 2.42k]
  ------------------
 4188|  2.42k|          team->t.t_nproc != task_team->tt.tt_nproc) {
  ------------------
  |  Branch (4188:11): [True: 0, False: 2.42k]
  ------------------
 4189|      0|        TCW_4(task_team->tt.tt_nproc, team->t.t_nproc);
  ------------------
  |  | 1128|      0|#define TCW_4(a, b) (a) = (b)
  ------------------
 4190|      0|        TCW_4(task_team->tt.tt_found_tasks, FALSE);
  ------------------
  |  | 1128|      0|#define TCW_4(a, b) (a) = (b)
  ------------------
 4191|      0|        TCW_4(task_team->tt.tt_found_proxy_tasks, FALSE);
  ------------------
  |  | 1128|      0|#define TCW_4(a, b) (a) = (b)
  ------------------
 4192|      0|        TCW_4(task_team->tt.tt_hidden_helper_task_encountered, FALSE);
  ------------------
  |  | 1128|      0|#define TCW_4(a, b) (a) = (b)
  ------------------
 4193|      0|        KMP_ATOMIC_ST_REL(&task_team->tt.tt_unfinished_threads,
  ------------------
  |  | 1251|      0|#define KMP_ATOMIC_ST_REL(p, v) KMP_ATOMIC_OP(store, p, v, release)
  |  |  ------------------
  |  |  |  | 1246|      0|#define KMP_ATOMIC_OP(op, p, v, order) (p)->op(v, std::memory_order_##order)
  |  |  ------------------
  ------------------
 4194|      0|                          team->t.t_nproc);
 4195|      0|        TCW_4(task_team->tt.tt_active, TRUE);
  ------------------
  |  | 1128|      0|#define TCW_4(a, b) (a) = (b)
  ------------------
 4196|      0|      }
 4197|       |      // if team size has changed, the first thread to enable tasking will
 4198|       |      // realloc threads_data if necessary
 4199|  2.42k|      KA_TRACE(20, ("__kmp_task_team_setup: Primary T#%d reset next task_team "
 4200|  2.42k|                    "%p for team %d at parity=%d\n",
 4201|  2.42k|                    __kmp_gtid_from_thread(this_thr),
 4202|  2.42k|                    team->t.t_task_team[other_team], team->t.t_id, other_team));
 4203|  2.42k|    }
 4204|  2.42k|  }
 4205|       |
 4206|       |  // For regular thread, task enabling should be called when the task is going
 4207|       |  // to be pushed to a dequeue. However, for the hidden helper thread, we need
 4208|       |  // it ahead of time so that some operations can be performed without race
 4209|       |  // condition.
 4210|  2.42k|  if (this_thr == __kmp_hidden_helper_main_thread) {
  ------------------
  |  Branch (4210:7): [True: 0, False: 2.42k]
  ------------------
 4211|      0|    for (int i = 0; i < 2; ++i) {
  ------------------
  |  Branch (4211:21): [True: 0, False: 0]
  ------------------
 4212|      0|      kmp_task_team_t *task_team = team->t.t_task_team[i];
 4213|      0|      if (KMP_TASKING_ENABLED(task_team)) {
  ------------------
  |  | 2368|      0|  (TRUE == TCR_SYNC_4((task_team)->tt.tt_found_tasks))
  |  |  ------------------
  |  |  |  | 1280|      0|#define TRUE (!FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1279|      0|#define FALSE 0
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 (TRUE == TCR_SYNC_4((task_team)->tt.tt_found_tasks))
  |  |  ------------------
  |  |  |  | 1135|      0|#define TCR_SYNC_4(a) (a)
  |  |  ------------------
  |  |  |  Branch (2368:3): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 4214|      0|        continue;
 4215|      0|      }
 4216|      0|      __kmp_enable_tasking(task_team, this_thr);
 4217|      0|      for (int j = 0; j < task_team->tt.tt_nproc; ++j) {
  ------------------
  |  Branch (4217:23): [True: 0, False: 0]
  ------------------
 4218|      0|        kmp_thread_data_t *thread_data = &task_team->tt.tt_threads_data[j];
 4219|      0|        if (thread_data->td.td_deque == NULL) {
  ------------------
  |  Branch (4219:13): [True: 0, False: 0]
  ------------------
 4220|      0|          __kmp_alloc_task_deque(__kmp_hidden_helper_threads[j], thread_data);
 4221|      0|        }
 4222|      0|      }
 4223|      0|    }
 4224|      0|  }
 4225|  2.42k|}
__kmp_task_team_sync:
 4230|  75.4k|void __kmp_task_team_sync(kmp_info_t *this_thr, kmp_team_t *team) {
 4231|  75.4k|  KMP_DEBUG_ASSERT(__kmp_tasking_mode != tskm_immediate_exec);
 4232|       |
 4233|       |  // Toggle the th_task_state field, to switch which task_team this thread
 4234|       |  // refers to
 4235|  75.4k|  this_thr->th.th_task_state = (kmp_uint8)(1 - this_thr->th.th_task_state);
 4236|       |
 4237|       |  // It is now safe to propagate the task team pointer from the team struct to
 4238|       |  // the current thread.
 4239|  75.4k|  TCW_PTR(this_thr->th.th_task_team,
  ------------------
  |  | 1157|  75.4k|#define TCW_PTR(a, b) TCW_8((a), (b))
  |  |  ------------------
  |  |  |  | 1132|  75.4k|#define TCW_8(a, b) (a) = (b)
  |  |  ------------------
  ------------------
 4240|  75.4k|          team->t.t_task_team[this_thr->th.th_task_state]);
 4241|  75.4k|  KA_TRACE(20,
 4242|  75.4k|           ("__kmp_task_team_sync: Thread T#%d task team switched to task_team "
 4243|  75.4k|            "%p from Team #%d (parity=%d)\n",
 4244|  75.4k|            __kmp_gtid_from_thread(this_thr), this_thr->th.th_task_team,
 4245|  75.4k|            team->t.t_id, this_thr->th.th_task_state));
 4246|  75.4k|}
__kmp_task_team_wait:
 4257|  2.42k|    kmp_team_t *team USE_ITT_BUILD_ARG(void *itt_sync_obj), int wait) {
 4258|  2.42k|  kmp_task_team_t *task_team = team->t.t_task_team[this_thr->th.th_task_state];
 4259|       |
 4260|  2.42k|  KMP_DEBUG_ASSERT(__kmp_tasking_mode != tskm_immediate_exec);
 4261|  2.42k|  KMP_DEBUG_ASSERT(task_team == this_thr->th.th_task_team);
 4262|       |
 4263|  2.42k|  if ((task_team != NULL) && KMP_TASKING_ENABLED(task_team)) {
  ------------------
  |  | 2368|  2.42k|  (TRUE == TCR_SYNC_4((task_team)->tt.tt_found_tasks))
  |  |  ------------------
  |  |  |  | 1280|  2.42k|#define TRUE (!FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1279|  2.42k|#define FALSE 0
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 (TRUE == TCR_SYNC_4((task_team)->tt.tt_found_tasks))
  |  |  ------------------
  |  |  |  | 1135|  2.42k|#define TCR_SYNC_4(a) (a)
  |  |  ------------------
  |  |  |  Branch (2368:3): [True: 0, False: 2.42k]
  |  |  ------------------
  ------------------
  |  Branch (4263:7): [True: 2.42k, False: 0]
  ------------------
 4264|      0|    if (wait) {
  ------------------
  |  Branch (4264:9): [True: 0, False: 0]
  ------------------
 4265|      0|      KA_TRACE(20, ("__kmp_task_team_wait: Primary T#%d waiting for all tasks "
 4266|      0|                    "(for unfinished_threads to reach 0) on task_team = %p\n",
 4267|      0|                    __kmp_gtid_from_thread(this_thr), task_team));
 4268|       |      // Worker threads may have dropped through to release phase, but could
 4269|       |      // still be executing tasks. Wait here for tasks to complete. To avoid
 4270|       |      // memory contention, only primary thread checks termination condition.
 4271|      0|      kmp_flag_32<false, false> flag(
 4272|      0|          RCAST(std::atomic<kmp_uint32> *,
  ------------------
  |  |  230|      0|#define RCAST(type, var) reinterpret_cast<type>(var)
  ------------------
 4273|      0|                &task_team->tt.tt_unfinished_threads),
 4274|      0|          0U);
 4275|      0|      flag.wait(this_thr, TRUE USE_ITT_BUILD_ARG(itt_sync_obj));
  ------------------
  |  | 1280|      0|#define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  | 1279|      0|#define FALSE 0
  |  |  ------------------
  ------------------
 4276|      0|    }
 4277|       |    // Deactivate the old task team, so that the worker threads will stop
 4278|       |    // referencing it while spinning.
 4279|      0|    KA_TRACE(
 4280|      0|        20,
 4281|      0|        ("__kmp_task_team_wait: Primary T#%d deactivating task_team %p: "
 4282|      0|         "setting active to false, setting local and team's pointer to NULL\n",
 4283|      0|         __kmp_gtid_from_thread(this_thr), task_team));
 4284|      0|    KMP_DEBUG_ASSERT(task_team->tt.tt_nproc > 1 ||
 4285|      0|                     task_team->tt.tt_found_proxy_tasks == TRUE ||
 4286|      0|                     task_team->tt.tt_hidden_helper_task_encountered == TRUE);
 4287|      0|    TCW_SYNC_4(task_team->tt.tt_found_proxy_tasks, FALSE);
  ------------------
  |  | 1136|      0|#define TCW_SYNC_4(a, b) (a) = (b)
  ------------------
 4288|      0|    TCW_SYNC_4(task_team->tt.tt_hidden_helper_task_encountered, FALSE);
  ------------------
  |  | 1136|      0|#define TCW_SYNC_4(a, b) (a) = (b)
  ------------------
 4289|      0|    KMP_CHECK_UPDATE(task_team->tt.tt_untied_task_encountered, 0);
  ------------------
  |  | 2280|      0|  if ((a) != (b))                                                              \
  |  |  ------------------
  |  |  |  Branch (2280:7): [True: 0, False: 0]
  |  |  ------------------
  |  | 2281|      0|  (a) = (b)
  ------------------
 4290|      0|    TCW_SYNC_4(task_team->tt.tt_active, FALSE);
  ------------------
  |  | 1136|      0|#define TCW_SYNC_4(a, b) (a) = (b)
  ------------------
 4291|      0|    KMP_MB();
 4292|       |
 4293|      0|    TCW_PTR(this_thr->th.th_task_team, NULL);
  ------------------
  |  | 1157|      0|#define TCW_PTR(a, b) TCW_8((a), (b))
  |  |  ------------------
  |  |  |  | 1132|      0|#define TCW_8(a, b) (a) = (b)
  |  |  ------------------
  ------------------
 4294|      0|  }
 4295|  2.42k|}
kmp_tasking.cpp:_ZL24__kmp_allocate_task_teamP8kmp_infoP8kmp_team:
 3932|      2|                                                 kmp_team_t *team) {
 3933|      2|  kmp_task_team_t *task_team = NULL;
 3934|      2|  int nthreads;
 3935|       |
 3936|      2|  KA_TRACE(20, ("__kmp_allocate_task_team: T#%d entering; team = %p\n",
 3937|      2|                (thread ? __kmp_gtid_from_thread(thread) : -1), team));
 3938|       |
 3939|      2|  if (TCR_PTR(__kmp_free_task_teams) != NULL) {
  ------------------
  |  | 1156|      2|#define TCR_PTR(a) ((void *)TCR_8(a))
  |  |  ------------------
  |  |  |  | 1131|      2|#define TCR_8(a) (a)
  |  |  ------------------
  ------------------
  |  Branch (3939:7): [True: 0, False: 2]
  ------------------
 3940|       |    // Take a task team from the task team pool
 3941|      0|    __kmp_acquire_bootstrap_lock(&__kmp_task_team_lock);
 3942|      0|    if (__kmp_free_task_teams != NULL) {
  ------------------
  |  Branch (3942:9): [True: 0, False: 0]
  ------------------
 3943|      0|      task_team = __kmp_free_task_teams;
 3944|      0|      TCW_PTR(__kmp_free_task_teams, task_team->tt.tt_next);
  ------------------
  |  | 1157|      0|#define TCW_PTR(a, b) TCW_8((a), (b))
  |  |  ------------------
  |  |  |  | 1132|      0|#define TCW_8(a, b) (a) = (b)
  |  |  ------------------
  ------------------
 3945|      0|      task_team->tt.tt_next = NULL;
 3946|      0|    }
 3947|      0|    __kmp_release_bootstrap_lock(&__kmp_task_team_lock);
 3948|      0|  }
 3949|       |
 3950|      2|  if (task_team == NULL) {
  ------------------
  |  Branch (3950:7): [True: 2, False: 0]
  ------------------
 3951|      2|    KE_TRACE(10, ("__kmp_allocate_task_team: T#%d allocating "
 3952|      2|                  "task team for team %p\n",
 3953|      2|                  __kmp_gtid_from_thread(thread), team));
 3954|       |    // Allocate a new task team if one is not available. Cannot use
 3955|       |    // __kmp_thread_malloc because threads not around for kmp_reap_task_team.
 3956|      2|    task_team = (kmp_task_team_t *)__kmp_allocate(sizeof(kmp_task_team_t));
  ------------------
  |  | 3617|      2|#define __kmp_allocate(size) ___kmp_allocate((size)KMP_SRC_LOC_CURR)
  ------------------
 3957|      2|    __kmp_init_bootstrap_lock(&task_team->tt.tt_threads_lock);
 3958|      2|    __kmp_init_bootstrap_lock(&task_team->tt.tt_task_pri_lock);
 3959|       |#if USE_ITT_BUILD && USE_ITT_NOTIFY && KMP_DEBUG
 3960|       |    // suppress race conditions detection on synchronization flags in debug mode
 3961|       |    // this helps to analyze library internals eliminating false positives
 3962|       |    __itt_suppress_mark_range(
 3963|       |        __itt_suppress_range, __itt_suppress_threading_errors,
 3964|       |        &task_team->tt.tt_found_tasks, sizeof(task_team->tt.tt_found_tasks));
 3965|       |    __itt_suppress_mark_range(__itt_suppress_range,
 3966|       |                              __itt_suppress_threading_errors,
 3967|       |                              CCAST(kmp_uint32 *, &task_team->tt.tt_active),
 3968|       |                              sizeof(task_team->tt.tt_active));
 3969|       |#endif /* USE_ITT_BUILD && USE_ITT_NOTIFY && KMP_DEBUG */
 3970|       |    // Note: __kmp_allocate zeroes returned memory, othewise we would need:
 3971|       |    // task_team->tt.tt_threads_data = NULL;
 3972|       |    // task_team->tt.tt_max_threads = 0;
 3973|       |    // task_team->tt.tt_next = NULL;
 3974|      2|  }
 3975|       |
 3976|      2|  TCW_4(task_team->tt.tt_found_tasks, FALSE);
  ------------------
  |  | 1128|      2|#define TCW_4(a, b) (a) = (b)
  ------------------
 3977|      2|  TCW_4(task_team->tt.tt_found_proxy_tasks, FALSE);
  ------------------
  |  | 1128|      2|#define TCW_4(a, b) (a) = (b)
  ------------------
 3978|      2|  TCW_4(task_team->tt.tt_hidden_helper_task_encountered, FALSE);
  ------------------
  |  | 1128|      2|#define TCW_4(a, b) (a) = (b)
  ------------------
 3979|      2|  task_team->tt.tt_nproc = nthreads = team->t.t_nproc;
 3980|       |
 3981|      2|  KMP_ATOMIC_ST_REL(&task_team->tt.tt_unfinished_threads, nthreads);
  ------------------
  |  | 1251|      2|#define KMP_ATOMIC_ST_REL(p, v) KMP_ATOMIC_OP(store, p, v, release)
  |  |  ------------------
  |  |  |  | 1246|      2|#define KMP_ATOMIC_OP(op, p, v, order) (p)->op(v, std::memory_order_##order)
  |  |  ------------------
  ------------------
 3982|      2|  TCW_4(task_team->tt.tt_hidden_helper_task_encountered, FALSE);
  ------------------
  |  | 1128|      2|#define TCW_4(a, b) (a) = (b)
  ------------------
 3983|      2|  TCW_4(task_team->tt.tt_active, TRUE);
  ------------------
  |  | 1128|      2|#define TCW_4(a, b) (a) = (b)
  ------------------
 3984|       |
 3985|      2|  KA_TRACE(20, ("__kmp_allocate_task_team: T#%d exiting; task_team = %p "
 3986|      2|                "unfinished_threads init'd to %d\n",
 3987|      2|                (thread ? __kmp_gtid_from_thread(thread) : -1), task_team,
 3988|      2|                KMP_ATOMIC_LD_RLX(&task_team->tt.tt_unfinished_threads)));
 3989|      2|  return task_team;
 3990|      2|}

__kmp_common_initialize:
  129|      1|void __kmp_common_initialize(void) {
  130|      1|  if (!TCR_4(__kmp_init_common)) {
  ------------------
  |  | 1127|      1|#define TCR_4(a) (a)
  ------------------
  |  Branch (130:7): [True: 1, False: 0]
  ------------------
  131|      1|    int q;
  132|       |#ifdef KMP_DEBUG
  133|       |    int gtid;
  134|       |#endif
  135|       |
  136|      1|    __kmp_threadpriv_cache_list = NULL;
  137|       |
  138|       |#ifdef KMP_DEBUG
  139|       |    /* verify the uber masters were initialized */
  140|       |    for (gtid = 0; gtid < __kmp_threads_capacity; gtid++)
  141|       |      if (__kmp_root[gtid]) {
  142|       |        KMP_DEBUG_ASSERT(__kmp_root[gtid]->r.r_uber_thread);
  143|       |        for (q = 0; q < KMP_HASH_TABLE_SIZE; ++q)
  144|       |          KMP_DEBUG_ASSERT(
  145|       |              !__kmp_root[gtid]->r.r_uber_thread->th.th_pri_common->data[q]);
  146|       |        /*                    __kmp_root[ gitd ]-> r.r_uber_thread ->
  147|       |         * th.th_pri_common -> data[ q ] = 0;*/
  148|       |      }
  149|       |#endif /* KMP_DEBUG */
  150|       |
  151|    513|    for (q = 0; q < KMP_HASH_TABLE_SIZE; ++q)
  ------------------
  |  | 1796|    513|  (1 << KMP_HASH_TABLE_LOG2) /* size of the hash table */
  |  |  ------------------
  |  |  |  | 1794|    513|#define KMP_HASH_TABLE_LOG2 9 /* log2 of the hash table size */
  |  |  ------------------
  ------------------
  |  Branch (151:17): [True: 512, False: 1]
  ------------------
  152|    512|      __kmp_threadprivate_d_table.data[q] = 0;
  153|       |
  154|      1|    TCW_4(__kmp_init_common, TRUE);
  ------------------
  |  | 1128|      1|#define TCW_4(a, b) (a) = (b)
  ------------------
  155|      1|  }
  156|      1|}
__kmp_common_destroy_gtid:
  223|     31|void __kmp_common_destroy_gtid(int gtid) {
  224|     31|  struct private_common *tn;
  225|     31|  struct shared_common *d_tn;
  226|       |
  227|     31|  if (!TCR_4(__kmp_init_gtid)) {
  ------------------
  |  | 1127|     31|#define TCR_4(a) (a)
  ------------------
  |  Branch (227:7): [True: 0, False: 31]
  ------------------
  228|       |    // This is possible when one of multiple roots initiates early library
  229|       |    // termination in a sequential region while other teams are active, and its
  230|       |    // child threads are about to end.
  231|      0|    return;
  232|      0|  }
  233|       |
  234|     31|  KC_TRACE(10, ("__kmp_common_destroy_gtid: T#%d called\n", gtid));
  235|     31|  if ((__kmp_foreign_tp) ? (!KMP_INITIAL_GTID(gtid)) : (!KMP_UBER_GTID(gtid))) {
  ------------------
  |  | 1276|     31|#define KMP_INITIAL_GTID(gtid) (0 == (gtid))
  ------------------
  |  Branch (235:7): [True: 31, False: 0]
  |  Branch (235:7): [True: 31, False: 0]
  ------------------
  236|       |
  237|     31|    if (TCR_4(__kmp_init_common)) {
  ------------------
  |  | 1127|     31|#define TCR_4(a) (a)
  |  |  ------------------
  |  |  |  Branch (1127:18): [True: 31, False: 0]
  |  |  ------------------
  ------------------
  238|       |
  239|       |      /* Cannot do this here since not all threads have destroyed their data */
  240|       |      /* TCW_4(__kmp_init_common, FALSE); */
  241|       |
  242|     31|      for (tn = __kmp_threads[gtid]->th.th_pri_head; tn; tn = tn->link) {
  ------------------
  |  Branch (242:54): [True: 0, False: 31]
  ------------------
  243|       |
  244|      0|        d_tn = __kmp_find_shared_task_common(&__kmp_threadprivate_d_table, gtid,
  245|      0|                                             tn->gbl_addr);
  246|      0|        if (d_tn == NULL)
  ------------------
  |  Branch (246:13): [True: 0, False: 0]
  ------------------
  247|      0|          continue;
  248|      0|        if (d_tn->is_vec) {
  ------------------
  |  Branch (248:13): [True: 0, False: 0]
  ------------------
  249|      0|          if (d_tn->dt.dtorv != 0) {
  ------------------
  |  Branch (249:15): [True: 0, False: 0]
  ------------------
  250|      0|            (void)(*d_tn->dt.dtorv)(tn->par_addr, d_tn->vec_len);
  251|      0|          }
  252|      0|          if (d_tn->obj_init != 0) {
  ------------------
  |  Branch (252:15): [True: 0, False: 0]
  ------------------
  253|      0|            (void)(*d_tn->dt.dtorv)(d_tn->obj_init, d_tn->vec_len);
  254|      0|          }
  255|      0|        } else {
  256|      0|          if (d_tn->dt.dtor != 0) {
  ------------------
  |  Branch (256:15): [True: 0, False: 0]
  ------------------
  257|      0|            (void)(*d_tn->dt.dtor)(tn->par_addr);
  258|      0|          }
  259|      0|          if (d_tn->obj_init != 0) {
  ------------------
  |  Branch (259:15): [True: 0, False: 0]
  ------------------
  260|      0|            (void)(*d_tn->dt.dtor)(d_tn->obj_init);
  261|      0|          }
  262|      0|        }
  263|      0|      }
  264|     31|      KC_TRACE(30, ("__kmp_common_destroy_gtid: T#%d threadprivate destructors "
  265|     31|                    "complete\n",
  266|     31|                    gtid));
  267|     31|    }
  268|     31|  }
  269|     31|}
__kmp_cleanup_threadprivate_caches:
  781|      1|void __kmp_cleanup_threadprivate_caches() {
  782|      1|  kmp_cached_addr_t *ptr = __kmp_threadpriv_cache_list;
  783|       |
  784|      1|  while (ptr) {
  ------------------
  |  Branch (784:10): [True: 0, False: 1]
  ------------------
  785|      0|    void **cache = ptr->addr;
  786|      0|    __kmp_threadpriv_cache_list = ptr->next;
  787|      0|    if (*ptr->compiler_cache)
  ------------------
  |  Branch (787:9): [True: 0, False: 0]
  ------------------
  788|      0|      *ptr->compiler_cache = NULL;
  789|      0|    ptr->compiler_cache = NULL;
  790|      0|    ptr->data = NULL;
  791|      0|    ptr->addr = NULL;
  792|      0|    ptr->next = NULL;
  793|       |    // Threadprivate data pointed at by cache entries are destroyed at end of
  794|       |    // __kmp_launch_thread with __kmp_common_destroy_gtid.
  795|      0|    __kmp_free(cache); // implicitly frees ptr too
  ------------------
  |  | 3619|      0|#define __kmp_free(ptr) ___kmp_free((ptr)KMP_SRC_LOC_CURR)
  ------------------
  796|      0|    ptr = __kmp_threadpriv_cache_list;
  797|      0|  }
  798|      1|}

_Z21__kmp_get_physical_idii:
   35|      1|int __kmp_get_physical_id(int log_per_phy, int apic_id) {
   36|      1|  int index_lsb, index_msb, temp;
   37|       |
   38|      1|  if (log_per_phy > 1) {
  ------------------
  |  Branch (38:7): [True: 1, False: 0]
  ------------------
   39|      1|    index_lsb = 0;
   40|      1|    index_msb = 31;
   41|       |
   42|      1|    temp = log_per_phy;
   43|      6|    while ((temp & 1) == 0) {
  ------------------
  |  Branch (43:12): [True: 5, False: 1]
  ------------------
   44|      5|      temp >>= 1;
   45|      5|      index_lsb++;
   46|      5|    }
   47|       |
   48|      1|    temp = log_per_phy;
   49|     27|    while ((temp & 0x80000000) == 0) {
  ------------------
  |  Branch (49:12): [True: 26, False: 1]
  ------------------
   50|     26|      temp <<= 1;
   51|     26|      index_msb--;
   52|     26|    }
   53|       |
   54|       |    /* If >1 bits were set in log_per_phy, choose next higher power of 2 */
   55|      1|    if (index_lsb != index_msb)
  ------------------
  |  Branch (55:9): [True: 0, False: 1]
  ------------------
   56|      0|      index_msb++;
   57|       |
   58|      1|    return ((int)(apic_id >> index_msb));
   59|      1|  }
   60|       |
   61|      0|  return apic_id;
   62|      1|}
_Z20__kmp_get_logical_idii:
   69|      1|int __kmp_get_logical_id(int log_per_phy, int apic_id) {
   70|      1|  unsigned current_bit;
   71|      1|  int bits_seen;
   72|       |
   73|      1|  if (log_per_phy <= 1)
  ------------------
  |  Branch (73:7): [True: 0, False: 1]
  ------------------
   74|      0|    return (0);
   75|       |
   76|      1|  bits_seen = 0;
   77|       |
   78|      7|  for (current_bit = 1; log_per_phy != 0; current_bit <<= 1) {
  ------------------
  |  Branch (78:25): [True: 6, False: 1]
  ------------------
   79|      6|    if (log_per_phy & current_bit) {
  ------------------
  |  Branch (79:9): [True: 1, False: 5]
  ------------------
   80|      1|      log_per_phy &= ~current_bit;
   81|      1|      bits_seen++;
   82|      1|    }
   83|      6|  }
   84|       |
   85|       |  /* If exactly 1 bit was set in log_per_phy, choose next lower power of 2 */
   86|      1|  if (bits_seen == 1) {
  ------------------
  |  Branch (86:7): [True: 1, False: 0]
  ------------------
   87|      1|    current_bit >>= 1;
   88|      1|  }
   89|       |
   90|      1|  return ((int)((current_bit - 1) & apic_id));
   91|      1|}
__kmp_query_cpuid:
  122|      1|void __kmp_query_cpuid(kmp_cpuinfo_t *p) {
  123|      1|  struct kmp_cpuid buf;
  124|      1|  int max_arg;
  125|      1|  int log_per_phy;
  126|       |#ifdef KMP_DEBUG
  127|       |  int cflush_size;
  128|       |#endif
  129|       |
  130|      1|  p->initialized = 1;
  131|       |
  132|      1|  p->flags.sse2 = 1; // Assume SSE2 by default.
  133|       |
  134|      1|  __kmp_x86_cpuid(0, 0, &buf);
  135|       |
  136|      1|  KA_TRACE(trace_level,
  137|      1|           ("INFO: CPUID %d: EAX=0x%08X EBX=0x%08X ECX=0x%08X EDX=0x%08X\n", 0,
  138|      1|            buf.eax, buf.ebx, buf.ecx, buf.edx));
  139|       |
  140|      1|  max_arg = buf.eax;
  141|       |
  142|      1|  p->apic_id = -1;
  143|       |
  144|      1|  if (max_arg >= 1) {
  ------------------
  |  Branch (144:7): [True: 1, False: 0]
  ------------------
  145|      1|    int i;
  146|      1|    kmp_uint32 t, data[4];
  147|       |
  148|      1|    __kmp_x86_cpuid(1, 0, &buf);
  149|      1|    KA_TRACE(trace_level,
  150|      1|             ("INFO: CPUID %d: EAX=0x%08X EBX=0x%08X ECX=0x%08X EDX=0x%08X\n",
  151|      1|              1, buf.eax, buf.ebx, buf.ecx, buf.edx));
  152|       |
  153|      1|    {
  154|      1|#define get_value(reg, lo, mask) (((reg) >> (lo)) & (mask))
  155|       |
  156|      1|      p->signature = buf.eax;
  157|      1|      p->family = get_value(buf.eax, 20, 0xff) + get_value(buf.eax, 8, 0x0f);
  ------------------
  |  |  154|      1|#define get_value(reg, lo, mask) (((reg) >> (lo)) & (mask))
  ------------------
                    p->family = get_value(buf.eax, 20, 0xff) + get_value(buf.eax, 8, 0x0f);
  ------------------
  |  |  154|      1|#define get_value(reg, lo, mask) (((reg) >> (lo)) & (mask))
  ------------------
  158|      1|      p->model =
  159|      1|          (get_value(buf.eax, 16, 0x0f) << 4) + get_value(buf.eax, 4, 0x0f);
  ------------------
  |  |  154|      1|#define get_value(reg, lo, mask) (((reg) >> (lo)) & (mask))
  ------------------
                        (get_value(buf.eax, 16, 0x0f) << 4) + get_value(buf.eax, 4, 0x0f);
  ------------------
  |  |  154|      1|#define get_value(reg, lo, mask) (((reg) >> (lo)) & (mask))
  ------------------
  160|      1|      p->stepping = get_value(buf.eax, 0, 0x0f);
  ------------------
  |  |  154|      1|#define get_value(reg, lo, mask) (((reg) >> (lo)) & (mask))
  ------------------
  161|       |
  162|      1|#undef get_value
  163|       |
  164|      1|      KA_TRACE(trace_level, (" family = %d, model = %d, stepping = %d\n",
  165|      1|                             p->family, p->model, p->stepping));
  166|      1|    }
  167|       |
  168|      5|    for (t = buf.ebx, i = 0; i < 4; t >>= 8, ++i) {
  ------------------
  |  Branch (168:30): [True: 4, False: 1]
  ------------------
  169|      4|      data[i] = (t & 0xff);
  170|      4|    }
  171|       |
  172|      1|    p->flags.sse2 = (buf.edx >> 26) & 1;
  173|       |
  174|       |#ifdef KMP_DEBUG
  175|       |
  176|       |    if ((buf.edx >> 4) & 1) {
  177|       |      /* TSC - Timestamp Counter Available */
  178|       |      KA_TRACE(trace_level, (" TSC"));
  179|       |    }
  180|       |    if ((buf.edx >> 8) & 1) {
  181|       |      /* CX8 - CMPXCHG8B Instruction Available */
  182|       |      KA_TRACE(trace_level, (" CX8"));
  183|       |    }
  184|       |    if ((buf.edx >> 9) & 1) {
  185|       |      /* APIC - Local APIC Present (multi-processor operation support */
  186|       |      KA_TRACE(trace_level, (" APIC"));
  187|       |    }
  188|       |    if ((buf.edx >> 15) & 1) {
  189|       |      /* CMOV - Conditional MOVe Instruction Available */
  190|       |      KA_TRACE(trace_level, (" CMOV"));
  191|       |    }
  192|       |    if ((buf.edx >> 18) & 1) {
  193|       |      /* PSN - Processor Serial Number Available */
  194|       |      KA_TRACE(trace_level, (" PSN"));
  195|       |    }
  196|       |    if ((buf.edx >> 19) & 1) {
  197|       |      /* CLFLUSH - Cache Flush Instruction Available */
  198|       |      cflush_size =
  199|       |          data[1] * 8; /* Bits 15-08: CLFLUSH line size = 8 (64 bytes) */
  200|       |      KA_TRACE(trace_level, (" CLFLUSH(%db)", cflush_size));
  201|       |    }
  202|       |    if ((buf.edx >> 21) & 1) {
  203|       |      /* DTES - Debug Trace & EMON Store */
  204|       |      KA_TRACE(trace_level, (" DTES"));
  205|       |    }
  206|       |    if ((buf.edx >> 22) & 1) {
  207|       |      /* ACPI - ACPI Support Available */
  208|       |      KA_TRACE(trace_level, (" ACPI"));
  209|       |    }
  210|       |    if ((buf.edx >> 23) & 1) {
  211|       |      /* MMX - Multimedia Extensions */
  212|       |      KA_TRACE(trace_level, (" MMX"));
  213|       |    }
  214|       |    if ((buf.edx >> 25) & 1) {
  215|       |      /* SSE - SSE Instructions */
  216|       |      KA_TRACE(trace_level, (" SSE"));
  217|       |    }
  218|       |    if ((buf.edx >> 26) & 1) {
  219|       |      /* SSE2 - SSE2 Instructions */
  220|       |      KA_TRACE(trace_level, (" SSE2"));
  221|       |    }
  222|       |    if ((buf.edx >> 27) & 1) {
  223|       |      /* SLFSNP - Self-Snooping Cache */
  224|       |      KA_TRACE(trace_level, (" SLFSNP"));
  225|       |    }
  226|       |#endif /* KMP_DEBUG */
  227|       |
  228|      1|    if ((buf.edx >> 28) & 1) {
  ------------------
  |  Branch (228:9): [True: 1, False: 0]
  ------------------
  229|       |      /* Bits 23-16: Logical Processors per Physical Processor (1 for P4) */
  230|      1|      log_per_phy = data[2];
  231|      1|      p->apic_id = data[3]; /* Bits 31-24: Processor Initial APIC ID (X) */
  232|      1|      KA_TRACE(trace_level, (" HT(%d TPUs)", log_per_phy));
  233|      1|      p->physical_id = __kmp_get_physical_id(log_per_phy, p->apic_id);
  234|      1|      p->logical_id = __kmp_get_logical_id(log_per_phy, p->apic_id);
  235|      1|    }
  236|       |#ifdef KMP_DEBUG
  237|       |    if ((buf.edx >> 29) & 1) {
  238|       |      /* ATHROTL - Automatic Throttle Control */
  239|       |      KA_TRACE(trace_level, (" ATHROTL"));
  240|       |    }
  241|       |    KA_TRACE(trace_level, (" ]\n"));
  242|       |
  243|       |    for (i = 2; i <= max_arg; ++i) {
  244|       |      __kmp_x86_cpuid(i, 0, &buf);
  245|       |      KA_TRACE(trace_level,
  246|       |               ("INFO: CPUID %d: EAX=0x%08X EBX=0x%08X ECX=0x%08X EDX=0x%08X\n",
  247|       |                i, buf.eax, buf.ebx, buf.ecx, buf.edx));
  248|       |    }
  249|       |#endif
  250|      1|    p->flags.rtm = 0;
  251|      1|    p->flags.hybrid = 0;
  252|      1|    if (max_arg > 7) {
  ------------------
  |  Branch (252:9): [True: 1, False: 0]
  ------------------
  253|       |      /* RTM bit CPUID.07:EBX, bit 11 */
  254|       |      /* HYRBID bit CPUID.07:EDX, bit 15 */
  255|      1|      __kmp_x86_cpuid(7, 0, &buf);
  256|      1|      p->flags.rtm = (buf.ebx >> 11) & 1;
  257|      1|      p->flags.hybrid = (buf.edx >> 15) & 1;
  258|      1|      if (p->flags.rtm) {
  ------------------
  |  Branch (258:11): [True: 0, False: 1]
  ------------------
  259|      0|        KA_TRACE(trace_level, (" RTM"));
  260|      0|      }
  261|      1|      if (p->flags.hybrid) {
  ------------------
  |  Branch (261:11): [True: 0, False: 1]
  ------------------
  262|      0|        KA_TRACE(trace_level, (" HYBRID"));
  263|      0|      }
  264|      1|    }
  265|      1|  }
  266|       |
  267|      1|  { // Parse CPU brand string for frequency, saving the string for later.
  268|      1|    int i;
  269|      1|    kmp_cpuid_t *base = (kmp_cpuid_t *)&p->name[0];
  270|       |
  271|       |    // Get CPU brand string.
  272|      4|    for (i = 0; i < 3; ++i) {
  ------------------
  |  Branch (272:17): [True: 3, False: 1]
  ------------------
  273|      3|      __kmp_x86_cpuid(0x80000002 + i, 0, base + i);
  274|      3|    }
  275|      1|    p->name[sizeof(p->name) - 1] = 0; // Just in case. ;-)
  276|      1|    KA_TRACE(trace_level, ("cpu brand string: \"%s\"\n", &p->name[0]));
  277|       |
  278|       |    // Parse frequency.
  279|      1|    p->frequency = __kmp_parse_frequency(strrchr(&p->name[0], ' '));
  280|      1|    KA_TRACE(trace_level,
  281|      1|             ("cpu frequency from brand string: %" KMP_UINT64_SPEC "\n",
  282|      1|              p->frequency));
  283|      1|  }
  284|      1|}
kmp_utility.cpp:_ZL21__kmp_parse_frequencyPKc:
   95|      1|) {
   96|       |
   97|      1|  double value = 0.0;
   98|      1|  char *unit = NULL;
   99|      1|  kmp_uint64 result = 0; /* Zero is a better unknown value than all ones. */
  100|       |
  101|      1|  if (frequency == NULL) {
  ------------------
  |  Branch (101:7): [True: 0, False: 1]
  ------------------
  102|      0|    return result;
  103|      0|  }
  104|      1|  value = strtod(frequency, &unit);
  105|      1|  if (0 < value &&
  ------------------
  |  Branch (105:7): [True: 1, False: 0]
  ------------------
  106|      1|      value <= DBL_MAX) { // Good value (not overflow, underflow, etc).
  ------------------
  |  Branch (106:7): [True: 1, False: 0]
  ------------------
  107|      1|    if (strcmp(unit, "MHz") == 0) {
  ------------------
  |  Branch (107:9): [True: 0, False: 1]
  ------------------
  108|      0|      value = value * 1.0E+6;
  109|      1|    } else if (strcmp(unit, "GHz") == 0) {
  ------------------
  |  Branch (109:16): [True: 0, False: 1]
  ------------------
  110|      0|      value = value * 1.0E+9;
  111|      1|    } else if (strcmp(unit, "THz") == 0) {
  ------------------
  |  Branch (111:16): [True: 0, False: 1]
  ------------------
  112|      0|      value = value * 1.0E+12;
  113|      1|    } else { // Wrong unit.
  114|      1|      return result;
  115|      1|    }
  116|      0|    result = (kmp_uint64)value; // rounds down
  117|      0|  }
  118|      0|  return result;
  119|       |
  120|      1|} // func __kmp_parse_cpu_frequency

__kmp_release_64:
   25|     31|void __kmp_release_64(kmp_flag_64<> *flag) { __kmp_release_template(flag); }

_ZN15kmp_flag_nativeIyL9flag_type1ELb1EED2Ev:
  157|   297k|  virtual ~kmp_flag_native() {}
_ZN11kmp_flag_64ILb0ELb1EEC2EPVyP8kmp_info:
  861|  72.8k|      : kmp_flag_native<kmp_uint64, flag64, Sleepable>(p, thr) {}
_ZN15kmp_flag_nativeIyL9flag_type1ELb1EEC2EPVyP8kmp_info:
  150|  72.9k|      : kmp_flag<FlagType>(1), loc(p) {
  151|  72.9k|    this->waiting_threads[0] = thr;
  152|  72.9k|  }
_ZN8kmp_flagIL9flag_type1EEC2Ei:
  115|  72.8k|      : t({FlagType, 0U}), num_waiting_threads(nwaiters), sleepLoc(nullptr) {}
_ZN15kmp_flag_nativeIyL9flag_type1ELb1EE10done_checkEv:
  166|   150k|  virtual bool done_check() {
  167|   150k|    if (Sleepable && !(this->sleepLoc))
  ------------------
  |  Branch (167:9): [True: 149k, Folded]
  |  Branch (167:22): [True: 150k, False: 18.4E]
  ------------------
  168|   149k|      return (traits_type::tcr(*(this->get())) & ~KMP_BARRIER_SLEEP_STATE) ==
  ------------------
  |  | 2023|   149k|#define KMP_BARRIER_SLEEP_STATE (1 << KMP_BARRIER_SLEEP_BIT)
  |  |  ------------------
  |  |  |  | 2019|   149k|#define KMP_BARRIER_SLEEP_BIT 0 /* bit used for suspend/sleep part of state */
  |  |  ------------------
  ------------------
  169|   149k|             checker;
  170|    233|    else
  171|    233|      return traits_type::tcr(*(this->get())) == checker;
  172|   150k|  }
_ZN11flag_traitsIL9flag_type1EE3tcrEy:
   76|   423M|  static inline flag_t tcr(flag_t f) { return TCR_8(f); }
  ------------------
  |  | 1131|   423M|#define TCR_8(a) (a)
  ------------------
_ZN15kmp_flag_nativeIyL9flag_type1ELb1EE3getEv:
  160|   422M|  volatile PtrType *get() { return loc; }
_ZN15kmp_flag_nativeIyL9flag_type1ELb1EE14done_check_valEy:
  175|  1.62k|  virtual bool done_check_val(PtrType old_loc) { return old_loc == checker; }
_ZN15kmp_flag_nativeIyL9flag_type1ELb1EE13notdone_checkEv:
  181|   418M|  virtual bool notdone_check() {
  182|   418M|    return traits_type::tcr(*(this->get())) != checker;
  183|   418M|  }
_ZN15kmp_flag_nativeIyL9flag_type1ELb1EE11is_sleepingEv:
  219|  6.31k|  bool is_sleeping() {
  220|  6.31k|    if (this->sleepLoc)
  ------------------
  |  Branch (220:9): [True: 0, False: 6.31k]
  ------------------
  221|      0|      return this->sleepLoc->load();
  222|  6.31k|    return is_sleeping_val(*(this->get()));
  223|  6.31k|  }
_ZN15kmp_flag_nativeIyL9flag_type1ELb1EE15is_sleeping_valEy:
  213|   155k|  bool is_sleeping_val(PtrType old_loc) {
  214|   155k|    if (this->sleepLoc)
  ------------------
  |  Branch (214:9): [True: 0, False: 155k]
  ------------------
  215|      0|      return this->sleepLoc->load();
  216|   155k|    return old_loc & KMP_BARRIER_SLEEP_STATE;
  ------------------
  |  | 2023|   155k|#define KMP_BARRIER_SLEEP_STATE (1 << KMP_BARRIER_SLEEP_BIT)
  |  |  ------------------
  |  |  |  | 2019|   155k|#define KMP_BARRIER_SLEEP_BIT 0 /* bit used for suspend/sleep part of state */
  |  |  ------------------
  ------------------
  217|   155k|  }
_ZN11kmp_flag_64ILb0ELb1EE6resumeEi:
  870|  1.55k|  void resume(int th_gtid) { __kmp_resume_64(th_gtid, this); }
_ZN11flag_traitsIL9flag_type1EE14test_then_add4EPVy:
   77|   147k|  static inline flag_t test_then_add4(volatile flag_t *f) {
   78|   147k|    return KMP_TEST_THEN_ADD4_64(RCAST(volatile kmp_int64 *, f));
  ------------------
  |  |  747|   147k|  __sync_fetch_and_add((volatile kmp_int64 *)(p), 4LL)
  ------------------
   79|   147k|  }
_ZN11flag_traitsIL9flag_type1EE12test_then_orEPVyy:
   80|  1.62k|  static inline flag_t test_then_or(volatile flag_t *f, flag_t v) {
   81|  1.62k|    return KMP_TEST_THEN_OR64(f, v);
  ------------------
  |  |  789|  1.62k|  __sync_fetch_and_or((volatile kmp_uint64 *)(p), (kmp_uint64)(v))
  ------------------
   82|  1.62k|  }
_ZN11flag_traitsIL9flag_type1EE13test_then_andEPVyy:
   83|  1.62k|  static inline flag_t test_then_and(volatile flag_t *f, flag_t v) {
   84|  1.62k|    return KMP_TEST_THEN_AND64(f, v);
  ------------------
  |  |  791|  1.62k|  __sync_fetch_and_and((volatile kmp_uint64 *)(p), (kmp_uint64)(v))
  ------------------
   85|  1.62k|  }
_ZN11kmp_flag_64ILb0ELb1EEC2EPVyy:
  863|   148k|      : kmp_flag_native<kmp_uint64, flag64, Sleepable>(p, c) {}
_ZN15kmp_flag_nativeIyL9flag_type1ELb1EEC2EPVyy:
  154|   148k|      : kmp_flag<FlagType>(), loc(p), checker(c) {}
_ZN8kmp_flagIL9flag_type1EEC2Ev:
  113|   223k|  kmp_flag() : t({FlagType, 0U}), num_waiting_threads(0), sleepLoc(nullptr) {}
_ZN11kmp_flag_64ILb0ELb1EE4waitEP8kmp_infoi:
  879|   148k|            int final_spin USE_ITT_BUILD_ARG(void *itt_sync_obj)) {
  880|   148k|    if (final_spin)
  ------------------
  |  Branch (880:9): [True: 75.0k, False: 73.2k]
  ------------------
  881|  75.0k|      return __kmp_wait_template<kmp_flag_64, TRUE, Cancellable, Sleepable>(
  882|  75.0k|          this_thr, this USE_ITT_BUILD_ARG(itt_sync_obj));
  883|  73.2k|    else
  884|  73.2k|      return __kmp_wait_template<kmp_flag_64, FALSE, Cancellable, Sleepable>(
  885|  73.2k|          this_thr, this USE_ITT_BUILD_ARG(itt_sync_obj));
  886|   148k|  }
kmp_barrier.cpp:_ZL19__kmp_wait_templateI11kmp_flag_64ILb0ELb1EELb1ELb0ELb1EEbP8kmp_infoPT_:
  367|  75.1k|                    C *flag USE_ITT_BUILD_ARG(void *itt_sync_obj)) {
  368|       |#if USE_ITT_BUILD && USE_ITT_NOTIFY
  369|       |  volatile void *spin = flag->get();
  370|       |#endif
  371|  75.1k|  kmp_uint32 spins;
  372|  75.1k|  int th_gtid;
  373|  75.1k|  int tasks_completed = FALSE;
  ------------------
  |  | 1279|  75.1k|#define FALSE 0
  ------------------
  374|  75.1k|#if !KMP_USE_MONITOR
  375|  75.1k|  kmp_uint64 poll_count;
  376|  75.1k|  kmp_uint64 hibernate_goal;
  377|       |#else
  378|       |  kmp_uint32 hibernate;
  379|       |#endif
  380|  75.1k|  kmp_uint64 time;
  381|       |
  382|  75.1k|  KMP_FSYNC_SPIN_INIT(spin, NULL);
  ------------------
  |  |  337|  75.1k|#define KMP_FSYNC_SPIN_INIT(obj, spin) ((void)0)
  ------------------
  383|  75.1k|  if (flag->done_check()) {
  ------------------
  |  Branch (383:7): [True: 58, False: 75.0k]
  ------------------
  384|     58|    KMP_FSYNC_SPIN_ACQUIRED(CCAST(void *, spin));
  ------------------
  |  |  339|     58|#define KMP_FSYNC_SPIN_ACQUIRED(obj) ((void)0)
  ------------------
  385|     58|    return false;
  386|     58|  }
  387|  75.0k|  th_gtid = this_thr->th.th_info.ds.ds_gtid;
  388|  75.0k|  if (Cancellable) {
  ------------------
  |  Branch (388:7): [Folded, False: 75.0k]
  ------------------
  389|      0|    kmp_team_t *team = this_thr->th.th_team;
  390|      0|    if (team && team->t.t_cancel_request == cancel_parallel)
  ------------------
  |  Branch (390:9): [True: 0, False: 0]
  |  Branch (390:17): [True: 0, False: 0]
  ------------------
  391|      0|      return true;
  392|      0|  }
  393|  75.0k|#if KMP_OS_UNIX
  394|  75.0k|  if (final_spin)
  ------------------
  |  Branch (394:7): [True: 74.9k, Folded]
  ------------------
  395|  75.0k|    KMP_ATOMIC_ST_REL(&this_thr->th.th_blocking, true);
  ------------------
  |  | 1251|  74.9k|#define KMP_ATOMIC_ST_REL(p, v) KMP_ATOMIC_OP(store, p, v, release)
  |  |  ------------------
  |  |  |  | 1246|  74.9k|#define KMP_ATOMIC_OP(op, p, v, order) (p)->op(v, std::memory_order_##order)
  |  |  ------------------
  ------------------
  396|  75.0k|#endif
  397|  75.0k|  KA_TRACE(20,
  398|  75.0k|           ("__kmp_wait_sleep: T#%d waiting for flag(%p)\n", th_gtid, flag));
  399|       |#if KMP_STATS_ENABLED
  400|       |  stats_state_e thread_state = KMP_GET_THREAD_STATE();
  401|       |#endif
  402|       |
  403|       |/* OMPT Behavior:
  404|       |THIS function is called from
  405|       |  __kmp_barrier (2 times)  (implicit or explicit barrier in parallel regions)
  406|       |            these have join / fork behavior
  407|       |
  408|       |       In these cases, we don't change the state or trigger events in THIS
  409|       |function.
  410|       |       Events are triggered in the calling code (__kmp_barrier):
  411|       |
  412|       |                state := ompt_state_overhead
  413|       |            barrier-begin
  414|       |            barrier-wait-begin
  415|       |                state := ompt_state_wait_barrier
  416|       |          call join-barrier-implementation (finally arrive here)
  417|       |          {}
  418|       |          call fork-barrier-implementation (finally arrive here)
  419|       |          {}
  420|       |                state := ompt_state_overhead
  421|       |            barrier-wait-end
  422|       |            barrier-end
  423|       |                state := ompt_state_work_parallel
  424|       |
  425|       |
  426|       |  __kmp_fork_barrier  (after thread creation, before executing implicit task)
  427|       |          call fork-barrier-implementation (finally arrive here)
  428|       |          {} // worker arrive here with state = ompt_state_idle
  429|       |
  430|       |
  431|       |  __kmp_join_barrier  (implicit barrier at end of parallel region)
  432|       |                state := ompt_state_barrier_implicit
  433|       |            barrier-begin
  434|       |            barrier-wait-begin
  435|       |          call join-barrier-implementation (finally arrive here
  436|       |final_spin=FALSE)
  437|       |          {
  438|       |          }
  439|       |  __kmp_fork_barrier  (implicit barrier at end of parallel region)
  440|       |          call fork-barrier-implementation (finally arrive here final_spin=TRUE)
  441|       |
  442|       |       Worker after task-team is finished:
  443|       |            barrier-wait-end
  444|       |            barrier-end
  445|       |            implicit-task-end
  446|       |            idle-begin
  447|       |                state := ompt_state_idle
  448|       |
  449|       |       Before leaving, if state = ompt_state_idle
  450|       |            idle-end
  451|       |                state := ompt_state_overhead
  452|       |*/
  453|  75.0k|#if OMPT_SUPPORT
  454|  75.0k|  ompt_state_t ompt_entry_state;
  455|  75.0k|  ompt_data_t *tId;
  456|  75.0k|  if (ompt_enabled.enabled) {
  ------------------
  |  Branch (456:7): [True: 0, False: 75.0k]
  ------------------
  457|      0|    ompt_entry_state = this_thr->th.ompt_thread_info.state;
  458|      0|    if (!final_spin || ompt_entry_state != ompt_state_wait_barrier_implicit ||
  ------------------
  |  Branch (458:9): [Folded, False: 0]
  |  Branch (458:24): [True: 0, False: 0]
  ------------------
  459|      0|        KMP_MASTER_TID(this_thr->th.th_info.ds.ds_tid)) {
  ------------------
  |  | 1271|      0|#define KMP_MASTER_TID(tid) (0 == (tid))
  |  |  ------------------
  |  |  |  Branch (1271:29): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  460|      0|      ompt_lw_taskteam_t *team = NULL;
  461|      0|      if (this_thr->th.th_team)
  ------------------
  |  Branch (461:11): [True: 0, False: 0]
  ------------------
  462|      0|        team = this_thr->th.th_team->t.ompt_serialized_team_info;
  463|      0|      if (team) {
  ------------------
  |  Branch (463:11): [True: 0, False: 0]
  ------------------
  464|      0|        tId = &(team->ompt_task_info.task_data);
  465|      0|      } else {
  466|      0|        tId = OMPT_CUR_TASK_DATA(this_thr);
  ------------------
  |  |   70|      0|  (&((thr)->th.th_current_task->ompt_task_info.task_data))
  ------------------
  467|      0|      }
  468|      0|    } else {
  469|      0|      tId = &(this_thr->th.ompt_thread_info.task_data);
  470|      0|    }
  471|      0|    if (final_spin && (__kmp_tasking_mode == tskm_immediate_exec ||
  ------------------
  |  Branch (471:9): [True: 0, Folded]
  |  Branch (471:24): [True: 0, False: 0]
  ------------------
  472|      0|                       this_thr->th.th_task_team == NULL)) {
  ------------------
  |  Branch (472:24): [True: 0, False: 0]
  ------------------
  473|       |      // implicit task is done. Either no taskqueue, or task-team finished
  474|      0|      __ompt_implicit_task_end(this_thr, ompt_entry_state, tId);
  475|      0|    }
  476|      0|  }
  477|  75.0k|#endif
  478|       |
  479|  75.0k|  KMP_INIT_YIELD(spins); // Setup for waiting
  ------------------
  |  | 1514|  75.0k|  { (count) = __kmp_yield_init; }
  ------------------
  480|  75.0k|  KMP_INIT_BACKOFF(time);
  ------------------
  |  | 1517|  75.0k|  { (time) = __kmp_pause_init; }
  ------------------
  481|       |
  482|  75.0k|  if (__kmp_dflt_blocktime != KMP_MAX_BLOCKTIME ||
  ------------------
  |  | 1184|   150k|  (INT_MAX) /* Must be this for "infinite" setting the work */
  ------------------
  |  Branch (482:7): [True: 75.0k, False: 0]
  ------------------
  483|  75.0k|      __kmp_pause_status == kmp_soft_paused) {
  ------------------
  |  Branch (483:7): [True: 0, False: 0]
  ------------------
  484|       |#if KMP_USE_MONITOR
  485|       |// The worker threads cannot rely on the team struct existing at this point.
  486|       |// Use the bt values cached in the thread struct instead.
  487|       |#ifdef KMP_ADJUST_BLOCKTIME
  488|       |    if (__kmp_pause_status == kmp_soft_paused ||
  489|       |        (__kmp_zero_bt && !this_thr->th.th_team_bt_set))
  490|       |      // Force immediate suspend if not set by user and more threads than
  491|       |      // available procs
  492|       |      hibernate = 0;
  493|       |    else
  494|       |      hibernate = this_thr->th.th_team_bt_intervals;
  495|       |#else
  496|       |    hibernate = this_thr->th.th_team_bt_intervals;
  497|       |#endif /* KMP_ADJUST_BLOCKTIME */
  498|       |
  499|       |    /* If the blocktime is nonzero, we want to make sure that we spin wait for
  500|       |       the entirety of the specified #intervals, plus up to one interval more.
  501|       |       This increment make certain that this thread doesn't go to sleep too
  502|       |       soon.  */
  503|       |    if (hibernate != 0)
  504|       |      hibernate++;
  505|       |
  506|       |    // Add in the current time value.
  507|       |    hibernate += TCR_4(__kmp_global.g.g_time.dt.t_value);
  508|       |    KF_TRACE(20, ("__kmp_wait_sleep: T#%d now=%d, hibernate=%d, intervals=%d\n",
  509|       |                  th_gtid, __kmp_global.g.g_time.dt.t_value, hibernate,
  510|       |                  hibernate - __kmp_global.g.g_time.dt.t_value));
  511|       |#else
  512|  75.0k|    if (__kmp_pause_status == kmp_soft_paused) {
  ------------------
  |  Branch (512:9): [True: 0, False: 75.0k]
  ------------------
  513|       |      // Force immediate suspend
  514|      0|      hibernate_goal = KMP_NOW();
  ------------------
  |  | 1217|      0|#define KMP_NOW() __kmp_hardware_timestamp()
  ------------------
  515|      0|    } else
  516|  75.0k|      hibernate_goal = KMP_NOW() + this_thr->th.th_team_bt_intervals;
  ------------------
  |  | 1217|  75.0k|#define KMP_NOW() __kmp_hardware_timestamp()
  ------------------
  517|  75.0k|    poll_count = 0;
  518|  75.0k|    (void)poll_count;
  519|  75.0k|#endif // KMP_USE_MONITOR
  520|  75.0k|  }
  521|       |
  522|  75.0k|  KMP_MB();
  523|       |
  524|       |  // Main wait spin loop
  525|   370M|  while (flag->notdone_check()) {
  ------------------
  |  Branch (525:10): [True: 370M, False: 75.0k]
  ------------------
  526|   370M|    kmp_task_team_t *task_team = NULL;
  527|   370M|    if (__kmp_tasking_mode != tskm_immediate_exec) {
  ------------------
  |  Branch (527:9): [True: 370M, False: 18.4E]
  ------------------
  528|   370M|      task_team = this_thr->th.th_task_team;
  529|       |      /* If the thread's task team pointer is NULL, it means one of 3 things:
  530|       |         1) A newly-created thread is first being released by
  531|       |         __kmp_fork_barrier(), and its task team has not been set up yet.
  532|       |         2) All tasks have been executed to completion.
  533|       |         3) Tasking is off for this region.  This could be because we are in a
  534|       |         serialized region (perhaps the outer one), or else tasking was manually
  535|       |         disabled (KMP_TASKING=0).  */
  536|   370M|      if (task_team != NULL) {
  ------------------
  |  Branch (536:11): [True: 368M, False: 1.86M]
  ------------------
  537|   369M|        if (TCR_SYNC_4(task_team->tt.tt_active)) {
  ------------------
  |  | 1135|   368M|#define TCR_SYNC_4(a) (a)
  |  |  ------------------
  |  |  |  Branch (1135:23): [True: 369M, False: 18.4E]
  |  |  ------------------
  ------------------
  538|   369M|          if (KMP_TASKING_ENABLED(task_team)) {
  ------------------
  |  | 2368|   369M|  (TRUE == TCR_SYNC_4((task_team)->tt.tt_found_tasks))
  |  |  ------------------
  |  |  |  | 1280|   369M|#define TRUE (!FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1279|   369M|#define FALSE 0
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 (TRUE == TCR_SYNC_4((task_team)->tt.tt_found_tasks))
  |  |  ------------------
  |  |  |  | 1135|   369M|#define TCR_SYNC_4(a) (a)
  |  |  ------------------
  |  |  |  Branch (2368:3): [True: 0, False: 369M]
  |  |  ------------------
  ------------------
  539|      0|            flag->execute_tasks(
  540|      0|                this_thr, th_gtid, final_spin,
  541|      0|                &tasks_completed USE_ITT_BUILD_ARG(itt_sync_obj), 0);
  542|      0|          } else
  543|   369M|            this_thr->th.th_reap_state = KMP_SAFE_TO_REAP;
  ------------------
  |  | 2047|   369M|#define KMP_SAFE_TO_REAP 1 // Thread th_reap_state: safe to reap (not tasking)
  ------------------
  544|  18.4E|        } else {
  545|  18.4E|          KMP_DEBUG_ASSERT(!KMP_MASTER_TID(this_thr->th.th_info.ds.ds_tid));
  546|  18.4E|#if OMPT_SUPPORT
  547|       |          // task-team is done now, other cases should be catched above
  548|  18.4E|          if (final_spin && ompt_enabled.enabled)
  ------------------
  |  Branch (548:15): [True: 0, Folded]
  |  Branch (548:29): [True: 0, False: 0]
  ------------------
  549|      0|            __ompt_implicit_task_end(this_thr, ompt_entry_state, tId);
  550|  18.4E|#endif
  551|  18.4E|          this_thr->th.th_task_team = NULL;
  552|  18.4E|          this_thr->th.th_reap_state = KMP_SAFE_TO_REAP;
  ------------------
  |  | 2047|  18.4E|#define KMP_SAFE_TO_REAP 1 // Thread th_reap_state: safe to reap (not tasking)
  ------------------
  553|  18.4E|        }
  554|   368M|      } else {
  555|  1.86M|        this_thr->th.th_reap_state = KMP_SAFE_TO_REAP;
  ------------------
  |  | 2047|  1.86M|#define KMP_SAFE_TO_REAP 1 // Thread th_reap_state: safe to reap (not tasking)
  ------------------
  556|  1.86M|      } // if
  557|   370M|    } // if
  558|       |
  559|   370M|    KMP_FSYNC_SPIN_PREPARE(CCAST(void *, spin));
  ------------------
  |  |  338|   370M|#define KMP_FSYNC_SPIN_PREPARE(obj) ((void)0)
  ------------------
  560|   370M|    if (TCR_4(__kmp_global.g.g_done)) {
  ------------------
  |  | 1127|   370M|#define TCR_4(a) (a)
  |  |  ------------------
  |  |  |  Branch (1127:18): [True: 0, False: 370M]
  |  |  ------------------
  ------------------
  561|      0|      if (__kmp_global.g.g_abort)
  ------------------
  |  Branch (561:11): [True: 0, False: 0]
  ------------------
  562|      0|        __kmp_abort_thread();
  563|      0|      break;
  564|      0|    }
  565|       |
  566|       |    // If we are oversubscribed, or have waited a bit (and
  567|       |    // KMP_LIBRARY=throughput), then yield
  568|   370M|    KMP_YIELD_OVERSUB_ELSE_SPIN(spins, time);
  ------------------
  |  | 1564|   370M|  {                                                                            \
  |  | 1565|   370M|    if (__kmp_tpause_enabled) {                                                \
  |  |  ------------------
  |  |  |  Branch (1565:9): [True: 0, False: 370M]
  |  |  ------------------
  |  | 1566|      0|      if (KMP_OVERSUBSCRIBED) {                                                \
  |  |  ------------------
  |  |  |  | 1520|      0|  (TCR_4(__kmp_nth) > (__kmp_avail_proc ? __kmp_avail_proc : __kmp_xproc))
  |  |  |  |  ------------------
  |  |  |  |  |  | 1127|      0|#define TCR_4(a) (a)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1520:3): [True: 0, False: 0]
  |  |  |  |  |  Branch (1520:24): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1567|      0|        __kmp_tpause(0, (time));                                               \
  |  | 1568|      0|      } else {                                                                 \
  |  | 1569|      0|        __kmp_tpause(__kmp_tpause_hint, (time));                               \
  |  | 1570|      0|      }                                                                        \
  |  | 1571|      0|      (time) = (time << 1 | 1) & KMP_TPAUSE_MAX_MASK;                          \
  |  |  ------------------
  |  |  |  | 1562|      0|#define KMP_TPAUSE_MAX_MASK ((kmp_uint64)0xFFFF)
  |  |  ------------------
  |  | 1572|   370M|    } else {                                                                   \
  |  | 1573|   370M|      KMP_CPU_PAUSE();                                                         \
  |  |  ------------------
  |  |  |  | 1498|   370M|#define KMP_CPU_PAUSE() __kmp_x86_pause()
  |  |  ------------------
  |  | 1574|   370M|      if ((KMP_TRY_YIELD_OVERSUB)) {                                           \
  |  |  ------------------
  |  |  |  | 1526|   372M|  ((__kmp_use_yield == 1 || __kmp_use_yield == 2) && (KMP_OVERSUBSCRIBED))
  |  |  |  |  ------------------
  |  |  |  |  |  | 1520|  18.4E|  (TCR_4(__kmp_nth) > (__kmp_avail_proc ? __kmp_avail_proc : __kmp_xproc))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 1127|   372M|#define TCR_4(a) (a)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1520:24): [True: 373M, False: 18.4E]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1526:5): [True: 370M, False: 0]
  |  |  |  |  |  Branch (1526:29): [True: 0, False: 0]
  |  |  |  |  |  Branch (1526:54): [True: 0, False: 372M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1575|      0|        __kmp_yield();                                                         \
  |  | 1576|   371M|      } else if (__kmp_use_yield == 1) {                                       \
  |  |  ------------------
  |  |  |  Branch (1576:18): [True: 371M, False: 18.4E]
  |  |  ------------------
  |  | 1577|   371M|        (count) -= 2;                                                          \
  |  | 1578|   371M|        if (!(count)) {                                                        \
  |  |  ------------------
  |  |  |  Branch (1578:13): [True: 1.67M, False: 369M]
  |  |  ------------------
  |  | 1579|  1.67M|          __kmp_yield();                                                       \
  |  | 1580|  1.67M|          (count) = __kmp_yield_next;                                          \
  |  | 1581|  1.67M|        }                                                                      \
  |  | 1582|   371M|      }                                                                        \
  |  | 1583|   370M|    }                                                                          \
  |  | 1584|   370M|  }
  ------------------
  569|       |
  570|       |#if KMP_STATS_ENABLED
  571|       |    // Check if thread has been signalled to idle state
  572|       |    // This indicates that the logical "join-barrier" has finished
  573|       |    if (this_thr->th.th_stats->isIdle() &&
  574|       |        KMP_GET_THREAD_STATE() == FORK_JOIN_BARRIER) {
  575|       |      KMP_SET_THREAD_STATE(IDLE);
  576|       |      KMP_PUSH_PARTITIONED_TIMER(OMP_idle);
  577|       |    }
  578|       |#endif
  579|       |    // Check if the barrier surrounding this wait loop has been cancelled
  580|   370M|    if (Cancellable) {
  ------------------
  |  Branch (580:9): [Folded, False: 370M]
  ------------------
  581|      0|      kmp_team_t *team = this_thr->th.th_team;
  582|      0|      if (team && team->t.t_cancel_request == cancel_parallel)
  ------------------
  |  Branch (582:11): [True: 0, False: 0]
  |  Branch (582:19): [True: 0, False: 0]
  ------------------
  583|      0|        break;
  584|      0|    }
  585|       |
  586|       |    // For hidden helper thread, if task_team is nullptr, it means the main
  587|       |    // thread has not released the barrier. We cannot wait here because once the
  588|       |    // main thread releases all children barriers, all hidden helper threads are
  589|       |    // still sleeping. This leads to a problem that following configuration,
  590|       |    // such as task team sync, will not be performed such that this thread does
  591|       |    // not have task team. Usually it is not bad. However, a corner case is,
  592|       |    // when the first task encountered is an untied task, the check in
  593|       |    // __kmp_task_alloc will crash because it uses the task team pointer without
  594|       |    // checking whether it is nullptr. It is probably under some kind of
  595|       |    // assumption.
  596|   373M|    if (task_team && KMP_HIDDEN_HELPER_WORKER_THREAD(th_gtid) &&
  ------------------
  |  | 4420|   743M|  ((gtid) > 1 && (gtid) <= __kmp_hidden_helper_threads_num)
  |  |  ------------------
  |  |  |  Branch (4420:4): [True: 368M, False: 4.46M]
  |  |  |  Branch (4420:18): [True: 0, False: 368M]
  |  |  ------------------
  ------------------
  |  Branch (596:9): [True: 373M, False: 18.4E]
  ------------------
  597|      0|        !TCR_4(__kmp_hidden_helper_team_done)) {
  ------------------
  |  | 1127|      0|#define TCR_4(a) (a)
  ------------------
  |  Branch (597:9): [True: 0, False: 0]
  ------------------
  598|       |      // If there is still hidden helper tasks to be executed, the hidden helper
  599|       |      // thread will not enter a waiting status.
  600|      0|      if (KMP_ATOMIC_LD_ACQ(&__kmp_unexecuted_hidden_helper_tasks) == 0) {
  ------------------
  |  | 1249|      0|#define KMP_ATOMIC_LD_ACQ(p) KMP_ATOMIC_LD(p, acquire)
  |  |  ------------------
  |  |  |  | 1245|      0|#define KMP_ATOMIC_LD(p, order) (p)->load(std::memory_order_##order)
  |  |  ------------------
  ------------------
  |  Branch (600:11): [True: 0, False: 0]
  ------------------
  601|      0|        __kmp_hidden_helper_worker_thread_wait();
  602|      0|      }
  603|      0|      continue;
  604|      0|    }
  605|       |
  606|       |    // Don't suspend if KMP_BLOCKTIME is set to "infinite"
  607|   370M|    if (__kmp_dflt_blocktime == KMP_MAX_BLOCKTIME &&
  ------------------
  |  | 1184|   741M|  (INT_MAX) /* Must be this for "infinite" setting the work */
  ------------------
  |  Branch (607:9): [True: 0, False: 370M]
  ------------------
  608|      0|        __kmp_pause_status != kmp_soft_paused)
  ------------------
  |  Branch (608:9): [True: 0, False: 0]
  ------------------
  609|      0|      continue;
  610|       |
  611|       |    // Don't suspend if there is a likelihood of new tasks being spawned.
  612|   370M|    if (task_team != NULL && TCR_4(task_team->tt.tt_found_tasks) &&
  ------------------
  |  | 1127|   739M|#define TCR_4(a) (a)
  |  |  ------------------
  |  |  |  Branch (1127:18): [True: 0, False: 369M]
  |  |  ------------------
  ------------------
  |  Branch (612:9): [True: 369M, False: 1.27M]
  ------------------
  613|      0|        !__kmp_wpolicy_passive)
  ------------------
  |  Branch (613:9): [True: 0, False: 0]
  ------------------
  614|      0|      continue;
  615|       |
  616|       |#if KMP_USE_MONITOR
  617|       |    // If we have waited a bit more, fall asleep
  618|       |    if (TCR_4(__kmp_global.g.g_time.dt.t_value) < hibernate)
  619|       |      continue;
  620|       |#else
  621|   370M|    if (KMP_BLOCKING(hibernate_goal, poll_count++))
  ------------------
  |  | 1222|   370M|#define KMP_BLOCKING(goal, count) ((goal) > KMP_NOW())
  |  |  ------------------
  |  |  |  | 1217|   370M|#define KMP_NOW() __kmp_hardware_timestamp()
  |  |  ------------------
  |  |  |  Branch (1222:35): [True: 361M, False: 8.82M]
  |  |  ------------------
  ------------------
  622|   361M|      continue;
  623|  8.82M|#endif
  624|       |    // Don't suspend if wait loop designated non-sleepable
  625|       |    // in template parameters
  626|  8.82M|    if (!Sleepable)
  ------------------
  |  Branch (626:9): [Folded, False: 8.82M]
  ------------------
  627|      0|      continue;
  628|       |
  629|  8.82M|#if KMP_HAVE_MWAIT || KMP_HAVE_UMWAIT
  630|  8.82M|    if (__kmp_mwait_enabled || __kmp_umwait_enabled) {
  ------------------
  |  Branch (630:9): [True: 8.82M, False: 1.60k]
  |  Branch (630:32): [True: 0, False: 1.60k]
  ------------------
  631|      0|      KF_TRACE(50, ("__kmp_wait_sleep: T#%d using monitor/mwait\n", th_gtid));
  632|      0|      flag->mwait(th_gtid);
  633|  8.82M|    } else {
  634|  8.82M|#endif
  635|  8.82M|      KF_TRACE(50, ("__kmp_wait_sleep: T#%d suspend time reached\n", th_gtid));
  636|  8.82M|#if KMP_OS_UNIX
  637|  8.82M|      if (final_spin)
  ------------------
  |  Branch (637:11): [True: 1.60k, Folded]
  ------------------
  638|  8.82M|        KMP_ATOMIC_ST_REL(&this_thr->th.th_blocking, false);
  ------------------
  |  | 1251|  1.60k|#define KMP_ATOMIC_ST_REL(p, v) KMP_ATOMIC_OP(store, p, v, release)
  |  |  ------------------
  |  |  |  | 1246|  1.60k|#define KMP_ATOMIC_OP(op, p, v, order) (p)->op(v, std::memory_order_##order)
  |  |  ------------------
  ------------------
  639|  8.82M|#endif
  640|  8.82M|      flag->suspend(th_gtid);
  641|  8.82M|#if KMP_OS_UNIX
  642|  8.82M|      if (final_spin)
  ------------------
  |  Branch (642:11): [True: 1.60k, Folded]
  ------------------
  643|  8.82M|        KMP_ATOMIC_ST_REL(&this_thr->th.th_blocking, true);
  ------------------
  |  | 1251|  1.60k|#define KMP_ATOMIC_ST_REL(p, v) KMP_ATOMIC_OP(store, p, v, release)
  |  |  ------------------
  |  |  |  | 1246|  1.60k|#define KMP_ATOMIC_OP(op, p, v, order) (p)->op(v, std::memory_order_##order)
  |  |  ------------------
  ------------------
  644|  8.82M|#endif
  645|  8.82M|#if KMP_HAVE_MWAIT || KMP_HAVE_UMWAIT
  646|  8.82M|    }
  647|  8.82M|#endif
  648|       |
  649|  8.82M|    if (TCR_4(__kmp_global.g.g_done)) {
  ------------------
  |  | 1127|  8.82M|#define TCR_4(a) (a)
  |  |  ------------------
  |  |  |  Branch (1127:18): [True: 31, False: 8.82M]
  |  |  ------------------
  ------------------
  650|     31|      if (__kmp_global.g.g_abort)
  ------------------
  |  Branch (650:11): [True: 0, False: 31]
  ------------------
  651|      0|        __kmp_abort_thread();
  652|     31|      break;
  653|  8.82M|    } else if (__kmp_tasking_mode != tskm_immediate_exec &&
  ------------------
  |  Branch (653:16): [True: 1.57k, False: 8.82M]
  ------------------
  654|  1.57k|               this_thr->th.th_reap_state == KMP_SAFE_TO_REAP) {
  ------------------
  |  | 2047|  1.57k|#define KMP_SAFE_TO_REAP 1 // Thread th_reap_state: safe to reap (not tasking)
  ------------------
  |  Branch (654:16): [True: 1.56k, False: 8]
  ------------------
  655|  1.56k|      this_thr->th.th_reap_state = KMP_NOT_SAFE_TO_REAP;
  ------------------
  |  | 2046|  1.56k|  0 // Thread th_reap_state: not safe to reap (tasking)
  ------------------
  656|  1.56k|    }
  657|       |    // TODO: If thread is done with work and times out, disband/free
  658|  8.82M|  }
  659|       |
  660|  75.0k|#if OMPT_SUPPORT
  661|  75.0k|  ompt_state_t ompt_exit_state = this_thr->th.ompt_thread_info.state;
  662|  75.0k|  if (ompt_enabled.enabled && ompt_exit_state != ompt_state_undefined) {
  ------------------
  |  Branch (662:7): [True: 0, False: 75.0k]
  |  Branch (662:31): [True: 0, False: 0]
  ------------------
  663|      0|#if OMPT_OPTIONAL
  664|      0|    if (final_spin) {
  ------------------
  |  Branch (664:9): [True: 0, Folded]
  ------------------
  665|      0|      __ompt_implicit_task_end(this_thr, ompt_exit_state, tId);
  666|      0|      ompt_exit_state = this_thr->th.ompt_thread_info.state;
  667|      0|    }
  668|      0|#endif
  669|      0|    if (ompt_exit_state == ompt_state_idle) {
  ------------------
  |  Branch (669:9): [True: 0, False: 0]
  ------------------
  670|      0|      this_thr->th.ompt_thread_info.state = ompt_state_overhead;
  671|      0|    }
  672|      0|  }
  673|  75.0k|#endif
  674|       |#if KMP_STATS_ENABLED
  675|       |  // If we were put into idle state, pop that off the state stack
  676|       |  if (KMP_GET_THREAD_STATE() == IDLE) {
  677|       |    KMP_POP_PARTITIONED_TIMER();
  678|       |    KMP_SET_THREAD_STATE(thread_state);
  679|       |    this_thr->th.th_stats->resetIdleFlag();
  680|       |  }
  681|       |#endif
  682|       |
  683|  75.0k|#if KMP_OS_UNIX
  684|  75.0k|  if (final_spin)
  ------------------
  |  Branch (684:7): [True: 74.8k, Folded]
  ------------------
  685|  75.0k|    KMP_ATOMIC_ST_REL(&this_thr->th.th_blocking, false);
  ------------------
  |  | 1251|  74.8k|#define KMP_ATOMIC_ST_REL(p, v) KMP_ATOMIC_OP(store, p, v, release)
  |  |  ------------------
  |  |  |  | 1246|  74.8k|#define KMP_ATOMIC_OP(op, p, v, order) (p)->op(v, std::memory_order_##order)
  |  |  ------------------
  ------------------
  686|  75.0k|#endif
  687|  75.0k|  KMP_FSYNC_SPIN_ACQUIRED(CCAST(void *, spin));
  ------------------
  |  |  339|  75.0k|#define KMP_FSYNC_SPIN_ACQUIRED(obj) ((void)0)
  ------------------
  688|  75.0k|  if (Cancellable) {
  ------------------
  |  Branch (688:7): [Folded, False: 75.0k]
  ------------------
  689|      0|    kmp_team_t *team = this_thr->th.th_team;
  690|      0|    if (team && team->t.t_cancel_request == cancel_parallel) {
  ------------------
  |  Branch (690:9): [True: 0, False: 0]
  |  Branch (690:17): [True: 0, False: 0]
  ------------------
  691|      0|      if (tasks_completed) {
  ------------------
  |  Branch (691:11): [True: 0, False: 0]
  ------------------
  692|       |        // undo the previous decrement of unfinished_threads so that the
  693|       |        // thread can decrement at the join barrier with no problem
  694|      0|        kmp_task_team_t *task_team = this_thr->th.th_task_team;
  695|      0|        std::atomic<kmp_int32> *unfinished_threads =
  696|      0|            &(task_team->tt.tt_unfinished_threads);
  697|      0|        KMP_ATOMIC_INC(unfinished_threads);
  ------------------
  |  | 1259|      0|#define KMP_ATOMIC_INC(p) KMP_ATOMIC_OP(fetch_add, p, 1, acq_rel)
  |  |  ------------------
  |  |  |  | 1246|      0|#define KMP_ATOMIC_OP(op, p, v, order) (p)->op(v, std::memory_order_##order)
  |  |  ------------------
  ------------------
  698|      0|      }
  699|      0|      return true;
  700|      0|    }
  701|      0|  }
  702|  75.0k|  return false;
  703|  75.0k|}
_ZN11kmp_flag_64ILb0ELb1EE7suspendEi:
  866|  1.61k|  void suspend(int th_gtid) { __kmp_suspend_64(th_gtid, this); }
kmp_barrier.cpp:_ZL19__kmp_wait_templateI11kmp_flag_64ILb0ELb1EELb0ELb0ELb1EEbP8kmp_infoPT_:
  367|  74.9k|                    C *flag USE_ITT_BUILD_ARG(void *itt_sync_obj)) {
  368|       |#if USE_ITT_BUILD && USE_ITT_NOTIFY
  369|       |  volatile void *spin = flag->get();
  370|       |#endif
  371|  74.9k|  kmp_uint32 spins;
  372|  74.9k|  int th_gtid;
  373|  74.9k|  int tasks_completed = FALSE;
  ------------------
  |  | 1279|  74.9k|#define FALSE 0
  ------------------
  374|  74.9k|#if !KMP_USE_MONITOR
  375|  74.9k|  kmp_uint64 poll_count;
  376|  74.9k|  kmp_uint64 hibernate_goal;
  377|       |#else
  378|       |  kmp_uint32 hibernate;
  379|       |#endif
  380|  74.9k|  kmp_uint64 time;
  381|       |
  382|  74.9k|  KMP_FSYNC_SPIN_INIT(spin, NULL);
  ------------------
  |  |  337|  74.9k|#define KMP_FSYNC_SPIN_INIT(obj, spin) ((void)0)
  ------------------
  383|  74.9k|  if (flag->done_check()) {
  ------------------
  |  Branch (383:7): [True: 38.5k, False: 36.3k]
  ------------------
  384|  38.5k|    KMP_FSYNC_SPIN_ACQUIRED(CCAST(void *, spin));
  ------------------
  |  |  339|  38.5k|#define KMP_FSYNC_SPIN_ACQUIRED(obj) ((void)0)
  ------------------
  385|  38.5k|    return false;
  386|  38.5k|  }
  387|  36.3k|  th_gtid = this_thr->th.th_info.ds.ds_gtid;
  388|  36.3k|  if (Cancellable) {
  ------------------
  |  Branch (388:7): [Folded, False: 36.3k]
  ------------------
  389|      0|    kmp_team_t *team = this_thr->th.th_team;
  390|      0|    if (team && team->t.t_cancel_request == cancel_parallel)
  ------------------
  |  Branch (390:9): [True: 0, False: 0]
  |  Branch (390:17): [True: 0, False: 0]
  ------------------
  391|      0|      return true;
  392|      0|  }
  393|  36.3k|#if KMP_OS_UNIX
  394|  36.3k|  if (final_spin)
  ------------------
  |  Branch (394:7): [Folded, False: 36.3k]
  ------------------
  395|  36.3k|    KMP_ATOMIC_ST_REL(&this_thr->th.th_blocking, true);
  ------------------
  |  | 1251|      0|#define KMP_ATOMIC_ST_REL(p, v) KMP_ATOMIC_OP(store, p, v, release)
  |  |  ------------------
  |  |  |  | 1246|      0|#define KMP_ATOMIC_OP(op, p, v, order) (p)->op(v, std::memory_order_##order)
  |  |  ------------------
  ------------------
  396|  36.3k|#endif
  397|  36.3k|  KA_TRACE(20,
  398|  36.3k|           ("__kmp_wait_sleep: T#%d waiting for flag(%p)\n", th_gtid, flag));
  399|       |#if KMP_STATS_ENABLED
  400|       |  stats_state_e thread_state = KMP_GET_THREAD_STATE();
  401|       |#endif
  402|       |
  403|       |/* OMPT Behavior:
  404|       |THIS function is called from
  405|       |  __kmp_barrier (2 times)  (implicit or explicit barrier in parallel regions)
  406|       |            these have join / fork behavior
  407|       |
  408|       |       In these cases, we don't change the state or trigger events in THIS
  409|       |function.
  410|       |       Events are triggered in the calling code (__kmp_barrier):
  411|       |
  412|       |                state := ompt_state_overhead
  413|       |            barrier-begin
  414|       |            barrier-wait-begin
  415|       |                state := ompt_state_wait_barrier
  416|       |          call join-barrier-implementation (finally arrive here)
  417|       |          {}
  418|       |          call fork-barrier-implementation (finally arrive here)
  419|       |          {}
  420|       |                state := ompt_state_overhead
  421|       |            barrier-wait-end
  422|       |            barrier-end
  423|       |                state := ompt_state_work_parallel
  424|       |
  425|       |
  426|       |  __kmp_fork_barrier  (after thread creation, before executing implicit task)
  427|       |          call fork-barrier-implementation (finally arrive here)
  428|       |          {} // worker arrive here with state = ompt_state_idle
  429|       |
  430|       |
  431|       |  __kmp_join_barrier  (implicit barrier at end of parallel region)
  432|       |                state := ompt_state_barrier_implicit
  433|       |            barrier-begin
  434|       |            barrier-wait-begin
  435|       |          call join-barrier-implementation (finally arrive here
  436|       |final_spin=FALSE)
  437|       |          {
  438|       |          }
  439|       |  __kmp_fork_barrier  (implicit barrier at end of parallel region)
  440|       |          call fork-barrier-implementation (finally arrive here final_spin=TRUE)
  441|       |
  442|       |       Worker after task-team is finished:
  443|       |            barrier-wait-end
  444|       |            barrier-end
  445|       |            implicit-task-end
  446|       |            idle-begin
  447|       |                state := ompt_state_idle
  448|       |
  449|       |       Before leaving, if state = ompt_state_idle
  450|       |            idle-end
  451|       |                state := ompt_state_overhead
  452|       |*/
  453|  36.3k|#if OMPT_SUPPORT
  454|  36.3k|  ompt_state_t ompt_entry_state;
  455|  36.3k|  ompt_data_t *tId;
  456|  36.3k|  if (ompt_enabled.enabled) {
  ------------------
  |  Branch (456:7): [True: 0, False: 36.3k]
  ------------------
  457|      0|    ompt_entry_state = this_thr->th.ompt_thread_info.state;
  458|      0|    if (!final_spin || ompt_entry_state != ompt_state_wait_barrier_implicit ||
  ------------------
  |  Branch (458:9): [True: 0, Folded]
  |  Branch (458:24): [True: 0, False: 0]
  ------------------
  459|      0|        KMP_MASTER_TID(this_thr->th.th_info.ds.ds_tid)) {
  ------------------
  |  | 1271|      0|#define KMP_MASTER_TID(tid) (0 == (tid))
  |  |  ------------------
  |  |  |  Branch (1271:29): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  460|      0|      ompt_lw_taskteam_t *team = NULL;
  461|      0|      if (this_thr->th.th_team)
  ------------------
  |  Branch (461:11): [True: 0, False: 0]
  ------------------
  462|      0|        team = this_thr->th.th_team->t.ompt_serialized_team_info;
  463|      0|      if (team) {
  ------------------
  |  Branch (463:11): [True: 0, False: 0]
  ------------------
  464|      0|        tId = &(team->ompt_task_info.task_data);
  465|      0|      } else {
  466|      0|        tId = OMPT_CUR_TASK_DATA(this_thr);
  ------------------
  |  |   70|      0|  (&((thr)->th.th_current_task->ompt_task_info.task_data))
  ------------------
  467|      0|      }
  468|      0|    } else {
  469|      0|      tId = &(this_thr->th.ompt_thread_info.task_data);
  470|      0|    }
  471|      0|    if (final_spin && (__kmp_tasking_mode == tskm_immediate_exec ||
  ------------------
  |  Branch (471:9): [Folded, False: 0]
  |  Branch (471:24): [True: 0, False: 0]
  ------------------
  472|      0|                       this_thr->th.th_task_team == NULL)) {
  ------------------
  |  Branch (472:24): [True: 0, False: 0]
  ------------------
  473|       |      // implicit task is done. Either no taskqueue, or task-team finished
  474|      0|      __ompt_implicit_task_end(this_thr, ompt_entry_state, tId);
  475|      0|    }
  476|      0|  }
  477|  36.3k|#endif
  478|       |
  479|  36.3k|  KMP_INIT_YIELD(spins); // Setup for waiting
  ------------------
  |  | 1514|  36.3k|  { (count) = __kmp_yield_init; }
  ------------------
  480|  36.3k|  KMP_INIT_BACKOFF(time);
  ------------------
  |  | 1517|  36.3k|  { (time) = __kmp_pause_init; }
  ------------------
  481|       |
  482|  36.3k|  if (__kmp_dflt_blocktime != KMP_MAX_BLOCKTIME ||
  ------------------
  |  | 1184|  72.7k|  (INT_MAX) /* Must be this for "infinite" setting the work */
  ------------------
  |  Branch (482:7): [True: 36.3k, False: 0]
  ------------------
  483|  36.4k|      __kmp_pause_status == kmp_soft_paused) {
  ------------------
  |  Branch (483:7): [True: 0, False: 0]
  ------------------
  484|       |#if KMP_USE_MONITOR
  485|       |// The worker threads cannot rely on the team struct existing at this point.
  486|       |// Use the bt values cached in the thread struct instead.
  487|       |#ifdef KMP_ADJUST_BLOCKTIME
  488|       |    if (__kmp_pause_status == kmp_soft_paused ||
  489|       |        (__kmp_zero_bt && !this_thr->th.th_team_bt_set))
  490|       |      // Force immediate suspend if not set by user and more threads than
  491|       |      // available procs
  492|       |      hibernate = 0;
  493|       |    else
  494|       |      hibernate = this_thr->th.th_team_bt_intervals;
  495|       |#else
  496|       |    hibernate = this_thr->th.th_team_bt_intervals;
  497|       |#endif /* KMP_ADJUST_BLOCKTIME */
  498|       |
  499|       |    /* If the blocktime is nonzero, we want to make sure that we spin wait for
  500|       |       the entirety of the specified #intervals, plus up to one interval more.
  501|       |       This increment make certain that this thread doesn't go to sleep too
  502|       |       soon.  */
  503|       |    if (hibernate != 0)
  504|       |      hibernate++;
  505|       |
  506|       |    // Add in the current time value.
  507|       |    hibernate += TCR_4(__kmp_global.g.g_time.dt.t_value);
  508|       |    KF_TRACE(20, ("__kmp_wait_sleep: T#%d now=%d, hibernate=%d, intervals=%d\n",
  509|       |                  th_gtid, __kmp_global.g.g_time.dt.t_value, hibernate,
  510|       |                  hibernate - __kmp_global.g.g_time.dt.t_value));
  511|       |#else
  512|  36.4k|    if (__kmp_pause_status == kmp_soft_paused) {
  ------------------
  |  Branch (512:9): [True: 0, False: 36.4k]
  ------------------
  513|       |      // Force immediate suspend
  514|      0|      hibernate_goal = KMP_NOW();
  ------------------
  |  | 1217|      0|#define KMP_NOW() __kmp_hardware_timestamp()
  ------------------
  515|      0|    } else
  516|  36.4k|      hibernate_goal = KMP_NOW() + this_thr->th.th_team_bt_intervals;
  ------------------
  |  | 1217|  36.4k|#define KMP_NOW() __kmp_hardware_timestamp()
  ------------------
  517|  36.4k|    poll_count = 0;
  518|  36.4k|    (void)poll_count;
  519|  36.4k|#endif // KMP_USE_MONITOR
  520|  36.4k|  }
  521|       |
  522|  36.3k|  KMP_MB();
  523|       |
  524|       |  // Main wait spin loop
  525|  88.0M|  while (flag->notdone_check()) {
  ------------------
  |  Branch (525:10): [True: 87.9M, False: 36.3k]
  ------------------
  526|  87.9M|    kmp_task_team_t *task_team = NULL;
  527|  87.9M|    if (__kmp_tasking_mode != tskm_immediate_exec) {
  ------------------
  |  Branch (527:9): [True: 87.9M, False: 18.4E]
  ------------------
  528|  87.9M|      task_team = this_thr->th.th_task_team;
  529|       |      /* If the thread's task team pointer is NULL, it means one of 3 things:
  530|       |         1) A newly-created thread is first being released by
  531|       |         __kmp_fork_barrier(), and its task team has not been set up yet.
  532|       |         2) All tasks have been executed to completion.
  533|       |         3) Tasking is off for this region.  This could be because we are in a
  534|       |         serialized region (perhaps the outer one), or else tasking was manually
  535|       |         disabled (KMP_TASKING=0).  */
  536|  88.0M|      if (task_team != NULL) {
  ------------------
  |  Branch (536:11): [True: 88.0M, False: 18.4E]
  ------------------
  537|  88.0M|        if (TCR_SYNC_4(task_team->tt.tt_active)) {
  ------------------
  |  | 1135|  88.0M|#define TCR_SYNC_4(a) (a)
  |  |  ------------------
  |  |  |  Branch (1135:23): [True: 87.9M, False: 8.47k]
  |  |  ------------------
  ------------------
  538|  87.9M|          if (KMP_TASKING_ENABLED(task_team)) {
  ------------------
  |  | 2368|  87.9M|  (TRUE == TCR_SYNC_4((task_team)->tt.tt_found_tasks))
  |  |  ------------------
  |  |  |  | 1280|  87.9M|#define TRUE (!FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1279|  87.9M|#define FALSE 0
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 (TRUE == TCR_SYNC_4((task_team)->tt.tt_found_tasks))
  |  |  ------------------
  |  |  |  | 1135|  87.9M|#define TCR_SYNC_4(a) (a)
  |  |  ------------------
  |  |  |  Branch (2368:3): [True: 0, False: 87.9M]
  |  |  ------------------
  ------------------
  539|      0|            flag->execute_tasks(
  540|      0|                this_thr, th_gtid, final_spin,
  541|      0|                &tasks_completed USE_ITT_BUILD_ARG(itt_sync_obj), 0);
  542|      0|          } else
  543|  87.9M|            this_thr->th.th_reap_state = KMP_SAFE_TO_REAP;
  ------------------
  |  | 2047|  87.9M|#define KMP_SAFE_TO_REAP 1 // Thread th_reap_state: safe to reap (not tasking)
  ------------------
  544|  87.9M|        } else {
  545|  8.47k|          KMP_DEBUG_ASSERT(!KMP_MASTER_TID(this_thr->th.th_info.ds.ds_tid));
  546|  8.47k|#if OMPT_SUPPORT
  547|       |          // task-team is done now, other cases should be catched above
  548|  8.47k|          if (final_spin && ompt_enabled.enabled)
  ------------------
  |  Branch (548:15): [Folded, False: 8.47k]
  |  Branch (548:29): [True: 0, False: 0]
  ------------------
  549|      0|            __ompt_implicit_task_end(this_thr, ompt_entry_state, tId);
  550|  8.47k|#endif
  551|  8.47k|          this_thr->th.th_task_team = NULL;
  552|  8.47k|          this_thr->th.th_reap_state = KMP_SAFE_TO_REAP;
  ------------------
  |  | 2047|  8.47k|#define KMP_SAFE_TO_REAP 1 // Thread th_reap_state: safe to reap (not tasking)
  ------------------
  553|  8.47k|        }
  554|  18.4E|      } else {
  555|  18.4E|        this_thr->th.th_reap_state = KMP_SAFE_TO_REAP;
  ------------------
  |  | 2047|  18.4E|#define KMP_SAFE_TO_REAP 1 // Thread th_reap_state: safe to reap (not tasking)
  ------------------
  556|  18.4E|      } // if
  557|  87.9M|    } // if
  558|       |
  559|  87.9M|    KMP_FSYNC_SPIN_PREPARE(CCAST(void *, spin));
  ------------------
  |  |  338|  87.9M|#define KMP_FSYNC_SPIN_PREPARE(obj) ((void)0)
  ------------------
  560|  87.9M|    if (TCR_4(__kmp_global.g.g_done)) {
  ------------------
  |  | 1127|  87.9M|#define TCR_4(a) (a)
  |  |  ------------------
  |  |  |  Branch (1127:18): [True: 0, False: 87.9M]
  |  |  ------------------
  ------------------
  561|      0|      if (__kmp_global.g.g_abort)
  ------------------
  |  Branch (561:11): [True: 0, False: 0]
  ------------------
  562|      0|        __kmp_abort_thread();
  563|      0|      break;
  564|      0|    }
  565|       |
  566|       |    // If we are oversubscribed, or have waited a bit (and
  567|       |    // KMP_LIBRARY=throughput), then yield
  568|  87.9M|    KMP_YIELD_OVERSUB_ELSE_SPIN(spins, time);
  ------------------
  |  | 1564|  87.9M|  {                                                                            \
  |  | 1565|  87.9M|    if (__kmp_tpause_enabled) {                                                \
  |  |  ------------------
  |  |  |  Branch (1565:9): [True: 0, False: 87.9M]
  |  |  ------------------
  |  | 1566|      0|      if (KMP_OVERSUBSCRIBED) {                                                \
  |  |  ------------------
  |  |  |  | 1520|      0|  (TCR_4(__kmp_nth) > (__kmp_avail_proc ? __kmp_avail_proc : __kmp_xproc))
  |  |  |  |  ------------------
  |  |  |  |  |  | 1127|      0|#define TCR_4(a) (a)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1520:3): [True: 0, False: 0]
  |  |  |  |  |  Branch (1520:24): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1567|      0|        __kmp_tpause(0, (time));                                               \
  |  | 1568|      0|      } else {                                                                 \
  |  | 1569|      0|        __kmp_tpause(__kmp_tpause_hint, (time));                               \
  |  | 1570|      0|      }                                                                        \
  |  | 1571|      0|      (time) = (time << 1 | 1) & KMP_TPAUSE_MAX_MASK;                          \
  |  |  ------------------
  |  |  |  | 1562|      0|#define KMP_TPAUSE_MAX_MASK ((kmp_uint64)0xFFFF)
  |  |  ------------------
  |  | 1572|  87.9M|    } else {                                                                   \
  |  | 1573|  87.9M|      KMP_CPU_PAUSE();                                                         \
  |  |  ------------------
  |  |  |  | 1498|  87.9M|#define KMP_CPU_PAUSE() __kmp_x86_pause()
  |  |  ------------------
  |  | 1574|  87.9M|      if ((KMP_TRY_YIELD_OVERSUB)) {                                           \
  |  |  ------------------
  |  |  |  | 1526|  88.2M|  ((__kmp_use_yield == 1 || __kmp_use_yield == 2) && (KMP_OVERSUBSCRIBED))
  |  |  |  |  ------------------
  |  |  |  |  |  | 1520|  88.2M|  (TCR_4(__kmp_nth) > (__kmp_avail_proc ? __kmp_avail_proc : __kmp_xproc))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 1127|  88.2M|#define TCR_4(a) (a)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1520:24): [True: 88.2M, False: 8.37k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1526:5): [True: 87.9M, False: 0]
  |  |  |  |  |  Branch (1526:29): [True: 0, False: 0]
  |  |  |  |  |  Branch (1526:54): [True: 0, False: 88.2M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1575|      0|        __kmp_yield();                                                         \
  |  | 1576|  88.1M|      } else if (__kmp_use_yield == 1) {                                       \
  |  |  ------------------
  |  |  |  Branch (1576:18): [True: 88.1M, False: 18.4E]
  |  |  ------------------
  |  | 1577|  88.1M|        (count) -= 2;                                                          \
  |  | 1578|  88.1M|        if (!(count)) {                                                        \
  |  |  ------------------
  |  |  |  Branch (1578:13): [True: 326k, False: 87.8M]
  |  |  ------------------
  |  | 1579|   326k|          __kmp_yield();                                                       \
  |  | 1580|   326k|          (count) = __kmp_yield_next;                                          \
  |  | 1581|   326k|        }                                                                      \
  |  | 1582|  88.1M|      }                                                                        \
  |  | 1583|  87.9M|    }                                                                          \
  |  | 1584|  87.9M|  }
  ------------------
  569|       |
  570|       |#if KMP_STATS_ENABLED
  571|       |    // Check if thread has been signalled to idle state
  572|       |    // This indicates that the logical "join-barrier" has finished
  573|       |    if (this_thr->th.th_stats->isIdle() &&
  574|       |        KMP_GET_THREAD_STATE() == FORK_JOIN_BARRIER) {
  575|       |      KMP_SET_THREAD_STATE(IDLE);
  576|       |      KMP_PUSH_PARTITIONED_TIMER(OMP_idle);
  577|       |    }
  578|       |#endif
  579|       |    // Check if the barrier surrounding this wait loop has been cancelled
  580|  87.9M|    if (Cancellable) {
  ------------------
  |  Branch (580:9): [Folded, False: 87.9M]
  ------------------
  581|      0|      kmp_team_t *team = this_thr->th.th_team;
  582|      0|      if (team && team->t.t_cancel_request == cancel_parallel)
  ------------------
  |  Branch (582:11): [True: 0, False: 0]
  |  Branch (582:19): [True: 0, False: 0]
  ------------------
  583|      0|        break;
  584|      0|    }
  585|       |
  586|       |    // For hidden helper thread, if task_team is nullptr, it means the main
  587|       |    // thread has not released the barrier. We cannot wait here because once the
  588|       |    // main thread releases all children barriers, all hidden helper threads are
  589|       |    // still sleeping. This leads to a problem that following configuration,
  590|       |    // such as task team sync, will not be performed such that this thread does
  591|       |    // not have task team. Usually it is not bad. However, a corner case is,
  592|       |    // when the first task encountered is an untied task, the check in
  593|       |    // __kmp_task_alloc will crash because it uses the task team pointer without
  594|       |    // checking whether it is nullptr. It is probably under some kind of
  595|       |    // assumption.
  596|  88.1M|    if (task_team && KMP_HIDDEN_HELPER_WORKER_THREAD(th_gtid) &&
  ------------------
  |  | 4420|   176M|  ((gtid) > 1 && (gtid) <= __kmp_hidden_helper_threads_num)
  |  |  ------------------
  |  |  |  Branch (4420:4): [True: 63.3M, False: 24.8M]
  |  |  |  Branch (4420:18): [True: 0, False: 63.3M]
  |  |  ------------------
  ------------------
  |  Branch (596:9): [True: 88.1M, False: 18.4E]
  ------------------
  597|      0|        !TCR_4(__kmp_hidden_helper_team_done)) {
  ------------------
  |  | 1127|      0|#define TCR_4(a) (a)
  ------------------
  |  Branch (597:9): [True: 0, False: 0]
  ------------------
  598|       |      // If there is still hidden helper tasks to be executed, the hidden helper
  599|       |      // thread will not enter a waiting status.
  600|      0|      if (KMP_ATOMIC_LD_ACQ(&__kmp_unexecuted_hidden_helper_tasks) == 0) {
  ------------------
  |  | 1249|      0|#define KMP_ATOMIC_LD_ACQ(p) KMP_ATOMIC_LD(p, acquire)
  |  |  ------------------
  |  |  |  | 1245|      0|#define KMP_ATOMIC_LD(p, order) (p)->load(std::memory_order_##order)
  |  |  ------------------
  ------------------
  |  Branch (600:11): [True: 0, False: 0]
  ------------------
  601|      0|        __kmp_hidden_helper_worker_thread_wait();
  602|      0|      }
  603|      0|      continue;
  604|      0|    }
  605|       |
  606|       |    // Don't suspend if KMP_BLOCKTIME is set to "infinite"
  607|  87.9M|    if (__kmp_dflt_blocktime == KMP_MAX_BLOCKTIME &&
  ------------------
  |  | 1184|   175M|  (INT_MAX) /* Must be this for "infinite" setting the work */
  ------------------
  |  Branch (607:9): [True: 0, False: 87.9M]
  ------------------
  608|      0|        __kmp_pause_status != kmp_soft_paused)
  ------------------
  |  Branch (608:9): [True: 0, False: 0]
  ------------------
  609|      0|      continue;
  610|       |
  611|       |    // Don't suspend if there is a likelihood of new tasks being spawned.
  612|  88.1M|    if (task_team != NULL && TCR_4(task_team->tt.tt_found_tasks) &&
  ------------------
  |  | 1127|   176M|#define TCR_4(a) (a)
  |  |  ------------------
  |  |  |  Branch (1127:18): [True: 0, False: 88.1M]
  |  |  ------------------
  ------------------
  |  Branch (612:9): [True: 88.1M, False: 18.4E]
  ------------------
  613|      0|        !__kmp_wpolicy_passive)
  ------------------
  |  Branch (613:9): [True: 0, False: 0]
  ------------------
  614|      0|      continue;
  615|       |
  616|       |#if KMP_USE_MONITOR
  617|       |    // If we have waited a bit more, fall asleep
  618|       |    if (TCR_4(__kmp_global.g.g_time.dt.t_value) < hibernate)
  619|       |      continue;
  620|       |#else
  621|  87.9M|    if (KMP_BLOCKING(hibernate_goal, poll_count++))
  ------------------
  |  | 1222|  87.9M|#define KMP_BLOCKING(goal, count) ((goal) > KMP_NOW())
  |  |  ------------------
  |  |  |  | 1217|  87.9M|#define KMP_NOW() __kmp_hardware_timestamp()
  |  |  ------------------
  |  |  |  Branch (1222:35): [True: 87.7M, False: 269k]
  |  |  ------------------
  ------------------
  622|  87.7M|      continue;
  623|   269k|#endif
  624|       |    // Don't suspend if wait loop designated non-sleepable
  625|       |    // in template parameters
  626|   269k|    if (!Sleepable)
  ------------------
  |  Branch (626:9): [Folded, False: 269k]
  ------------------
  627|      0|      continue;
  628|       |
  629|   269k|#if KMP_HAVE_MWAIT || KMP_HAVE_UMWAIT
  630|   269k|    if (__kmp_mwait_enabled || __kmp_umwait_enabled) {
  ------------------
  |  Branch (630:9): [True: 269k, False: 18]
  |  Branch (630:32): [True: 0, False: 18]
  ------------------
  631|      0|      KF_TRACE(50, ("__kmp_wait_sleep: T#%d using monitor/mwait\n", th_gtid));
  632|      0|      flag->mwait(th_gtid);
  633|   269k|    } else {
  634|   269k|#endif
  635|   269k|      KF_TRACE(50, ("__kmp_wait_sleep: T#%d suspend time reached\n", th_gtid));
  636|   269k|#if KMP_OS_UNIX
  637|   269k|      if (final_spin)
  ------------------
  |  Branch (637:11): [Folded, False: 269k]
  ------------------
  638|   269k|        KMP_ATOMIC_ST_REL(&this_thr->th.th_blocking, false);
  ------------------
  |  | 1251|      0|#define KMP_ATOMIC_ST_REL(p, v) KMP_ATOMIC_OP(store, p, v, release)
  |  |  ------------------
  |  |  |  | 1246|      0|#define KMP_ATOMIC_OP(op, p, v, order) (p)->op(v, std::memory_order_##order)
  |  |  ------------------
  ------------------
  639|   269k|#endif
  640|   269k|      flag->suspend(th_gtid);
  641|   269k|#if KMP_OS_UNIX
  642|   269k|      if (final_spin)
  ------------------
  |  Branch (642:11): [Folded, False: 269k]
  ------------------
  643|   269k|        KMP_ATOMIC_ST_REL(&this_thr->th.th_blocking, true);
  ------------------
  |  | 1251|      0|#define KMP_ATOMIC_ST_REL(p, v) KMP_ATOMIC_OP(store, p, v, release)
  |  |  ------------------
  |  |  |  | 1246|      0|#define KMP_ATOMIC_OP(op, p, v, order) (p)->op(v, std::memory_order_##order)
  |  |  ------------------
  ------------------
  644|   269k|#endif
  645|   269k|#if KMP_HAVE_MWAIT || KMP_HAVE_UMWAIT
  646|   269k|    }
  647|   269k|#endif
  648|       |
  649|   269k|    if (TCR_4(__kmp_global.g.g_done)) {
  ------------------
  |  | 1127|   269k|#define TCR_4(a) (a)
  |  |  ------------------
  |  |  |  Branch (1127:18): [True: 0, False: 269k]
  |  |  ------------------
  ------------------
  650|      0|      if (__kmp_global.g.g_abort)
  ------------------
  |  Branch (650:11): [True: 0, False: 0]
  ------------------
  651|      0|        __kmp_abort_thread();
  652|      0|      break;
  653|   269k|    } else if (__kmp_tasking_mode != tskm_immediate_exec &&
  ------------------
  |  Branch (653:16): [True: 18, False: 269k]
  ------------------
  654|     18|               this_thr->th.th_reap_state == KMP_SAFE_TO_REAP) {
  ------------------
  |  | 2047|     18|#define KMP_SAFE_TO_REAP 1 // Thread th_reap_state: safe to reap (not tasking)
  ------------------
  |  Branch (654:16): [True: 18, False: 0]
  ------------------
  655|     18|      this_thr->th.th_reap_state = KMP_NOT_SAFE_TO_REAP;
  ------------------
  |  | 2046|     18|  0 // Thread th_reap_state: not safe to reap (tasking)
  ------------------
  656|     18|    }
  657|       |    // TODO: If thread is done with work and times out, disband/free
  658|   269k|  }
  659|       |
  660|  36.3k|#if OMPT_SUPPORT
  661|  36.3k|  ompt_state_t ompt_exit_state = this_thr->th.ompt_thread_info.state;
  662|  36.3k|  if (ompt_enabled.enabled && ompt_exit_state != ompt_state_undefined) {
  ------------------
  |  Branch (662:7): [True: 0, False: 36.3k]
  |  Branch (662:31): [True: 0, False: 0]
  ------------------
  663|      0|#if OMPT_OPTIONAL
  664|      0|    if (final_spin) {
  ------------------
  |  Branch (664:9): [Folded, False: 0]
  ------------------
  665|      0|      __ompt_implicit_task_end(this_thr, ompt_exit_state, tId);
  666|      0|      ompt_exit_state = this_thr->th.ompt_thread_info.state;
  667|      0|    }
  668|      0|#endif
  669|      0|    if (ompt_exit_state == ompt_state_idle) {
  ------------------
  |  Branch (669:9): [True: 0, False: 0]
  ------------------
  670|      0|      this_thr->th.ompt_thread_info.state = ompt_state_overhead;
  671|      0|    }
  672|      0|  }
  673|  36.3k|#endif
  674|       |#if KMP_STATS_ENABLED
  675|       |  // If we were put into idle state, pop that off the state stack
  676|       |  if (KMP_GET_THREAD_STATE() == IDLE) {
  677|       |    KMP_POP_PARTITIONED_TIMER();
  678|       |    KMP_SET_THREAD_STATE(thread_state);
  679|       |    this_thr->th.th_stats->resetIdleFlag();
  680|       |  }
  681|       |#endif
  682|       |
  683|  36.3k|#if KMP_OS_UNIX
  684|  36.3k|  if (final_spin)
  ------------------
  |  Branch (684:7): [Folded, False: 36.3k]
  ------------------
  685|  36.3k|    KMP_ATOMIC_ST_REL(&this_thr->th.th_blocking, false);
  ------------------
  |  | 1251|      0|#define KMP_ATOMIC_ST_REL(p, v) KMP_ATOMIC_OP(store, p, v, release)
  |  |  ------------------
  |  |  |  | 1246|      0|#define KMP_ATOMIC_OP(op, p, v, order) (p)->op(v, std::memory_order_##order)
  |  |  ------------------
  ------------------
  686|  36.3k|#endif
  687|  36.3k|  KMP_FSYNC_SPIN_ACQUIRED(CCAST(void *, spin));
  ------------------
  |  |  339|  36.3k|#define KMP_FSYNC_SPIN_ACQUIRED(obj) ((void)0)
  ------------------
  688|  36.3k|  if (Cancellable) {
  ------------------
  |  Branch (688:7): [Folded, False: 36.3k]
  ------------------
  689|      0|    kmp_team_t *team = this_thr->th.th_team;
  690|      0|    if (team && team->t.t_cancel_request == cancel_parallel) {
  ------------------
  |  Branch (690:9): [True: 0, False: 0]
  |  Branch (690:17): [True: 0, False: 0]
  ------------------
  691|      0|      if (tasks_completed) {
  ------------------
  |  Branch (691:11): [True: 0, False: 0]
  ------------------
  692|       |        // undo the previous decrement of unfinished_threads so that the
  693|       |        // thread can decrement at the join barrier with no problem
  694|      0|        kmp_task_team_t *task_team = this_thr->th.th_task_team;
  695|      0|        std::atomic<kmp_int32> *unfinished_threads =
  696|      0|            &(task_team->tt.tt_unfinished_threads);
  697|      0|        KMP_ATOMIC_INC(unfinished_threads);
  ------------------
  |  | 1259|      0|#define KMP_ATOMIC_INC(p) KMP_ATOMIC_OP(fetch_add, p, 1, acq_rel)
  |  |  ------------------
  |  |  |  | 1246|      0|#define KMP_ATOMIC_OP(op, p, v, order) (p)->op(v, std::memory_order_##order)
  |  |  ------------------
  ------------------
  698|      0|      }
  699|      0|      return true;
  700|      0|    }
  701|      0|  }
  702|  36.3k|  return false;
  703|  36.3k|}
_ZN11kmp_flag_64ILb0ELb1EE7releaseEv:
  887|   147k|  void release() { __kmp_release_template(this); }
kmp_barrier.cpp:_ZL22__kmp_release_templateI11kmp_flag_64ILb0ELb1EEEvPT_:
  788|   147k|template <class C> static inline void __kmp_release_template(C *flag) {
  789|       |#ifdef KMP_DEBUG
  790|       |  int gtid = TCR_4(__kmp_init_gtid) ? __kmp_get_gtid() : -1;
  791|       |#endif
  792|   147k|  KF_TRACE(20, ("__kmp_release: T#%d releasing flag(%x)\n", gtid, flag->get()));
  793|   147k|  KMP_DEBUG_ASSERT(flag->get());
  794|   147k|  KMP_FSYNC_RELEASING(flag->get_void_p());
  ------------------
  |  |  335|   147k|#define KMP_FSYNC_RELEASING(obj) ((void)0)
  ------------------
  795|       |
  796|   147k|  flag->internal_release();
  797|       |
  798|   147k|  KF_TRACE(100, ("__kmp_release: T#%d set new spin=%d\n", gtid, flag->get(),
  799|   147k|                 flag->load()));
  800|       |
  801|   150k|  if (__kmp_dflt_blocktime != KMP_MAX_BLOCKTIME) {
  ------------------
  |  | 1184|   147k|  (INT_MAX) /* Must be this for "infinite" setting the work */
  ------------------
  |  Branch (801:7): [True: 150k, False: 18.4E]
  ------------------
  802|       |    // Only need to check sleep stuff if infinite block time not set.
  803|       |    // Are *any* threads waiting on flag sleeping?
  804|   150k|    if (flag->is_any_sleeping()) {
  ------------------
  |  Branch (804:9): [True: 1.54k, False: 148k]
  ------------------
  805|  3.07k|      for (unsigned int i = 0; i < flag->get_num_waiters(); ++i) {
  ------------------
  |  Branch (805:32): [True: 1.53k, False: 1.54k]
  ------------------
  806|       |        // if sleeping waiter exists at i, sets current_waiter to i inside flag
  807|  1.53k|        kmp_info_t *waiter = flag->get_waiter(i);
  808|  1.53k|        if (waiter) {
  ------------------
  |  Branch (808:13): [True: 1.52k, False: 6]
  ------------------
  809|  1.52k|          int wait_gtid = waiter->th.th_info.ds.ds_gtid;
  810|       |          // Wake up thread if needed
  811|  1.52k|          KF_TRACE(50, ("__kmp_release: T#%d waking up thread T#%d since sleep "
  812|  1.52k|                        "flag(%p) set\n",
  813|  1.52k|                        gtid, wait_gtid, flag->get()));
  814|  1.52k|          flag->resume(wait_gtid); // unsets flag's current_waiter when done
  815|  1.52k|        }
  816|  1.53k|      }
  817|  1.54k|    }
  818|   150k|  }
  819|   147k|}
_ZN15kmp_flag_nativeIyL9flag_type1ELb1EE16internal_releaseEv:
  186|   147k|  void internal_release() {
  187|   147k|    (void)traits_type::test_then_add4((volatile PtrType *)this->get());
  188|   147k|  }
_ZN15kmp_flag_nativeIyL9flag_type1ELb1EE15is_any_sleepingEv:
  224|   150k|  bool is_any_sleeping() {
  225|   150k|    if (this->sleepLoc)
  ------------------
  |  Branch (225:9): [True: 0, False: 150k]
  ------------------
  226|      0|      return this->sleepLoc->load();
  227|   150k|    return is_sleeping_val(*(this->get()));
  228|   150k|  }
_ZN8kmp_flagIL9flag_type1EE15get_num_waitersEv:
  128|  3.14k|  kmp_uint32 get_num_waiters() { return num_waiting_threads; }
_ZN8kmp_flagIL9flag_type1EE10get_waiterEj:
  123|  1.55k|  kmp_info_t *get_waiter(kmp_uint32 i) {
  124|  1.55k|    KMP_DEBUG_ASSERT(i < num_waiting_threads);
  125|  1.55k|    return waiting_threads[i];
  126|  1.55k|  }
_ZN11kmp_flag_64ILb0ELb1EEC2EPVy:
  859|  76.5k|      : kmp_flag_native<kmp_uint64, flag64, Sleepable>(p) {}
_ZN15kmp_flag_nativeIyL9flag_type1ELb1EEC2EPVy:
  148|  76.4k|  kmp_flag_native(volatile PtrType *p) : kmp_flag<FlagType>(), loc(p) {}
_ZN8kmp_flagIL9flag_type1EE10set_waiterEP8kmp_info:
  131|  75.0k|  void set_waiter(kmp_info_t *thr) {
  132|  75.0k|    waiting_threads[0] = thr;
  133|  75.0k|    num_waiting_threads = 1;
  134|  75.0k|  }
kmp_wait_release.cpp:_ZL22__kmp_release_templateI11kmp_flag_64ILb0ELb1EEEvPT_:
  788|     31|template <class C> static inline void __kmp_release_template(C *flag) {
  789|       |#ifdef KMP_DEBUG
  790|       |  int gtid = TCR_4(__kmp_init_gtid) ? __kmp_get_gtid() : -1;
  791|       |#endif
  792|     31|  KF_TRACE(20, ("__kmp_release: T#%d releasing flag(%x)\n", gtid, flag->get()));
  793|     31|  KMP_DEBUG_ASSERT(flag->get());
  794|     31|  KMP_FSYNC_RELEASING(flag->get_void_p());
  ------------------
  |  |  335|     31|#define KMP_FSYNC_RELEASING(obj) ((void)0)
  ------------------
  795|       |
  796|     31|  flag->internal_release();
  797|       |
  798|     31|  KF_TRACE(100, ("__kmp_release: T#%d set new spin=%d\n", gtid, flag->get(),
  799|     31|                 flag->load()));
  800|       |
  801|     31|  if (__kmp_dflt_blocktime != KMP_MAX_BLOCKTIME) {
  ------------------
  |  | 1184|     31|  (INT_MAX) /* Must be this for "infinite" setting the work */
  ------------------
  |  Branch (801:7): [True: 31, False: 0]
  ------------------
  802|       |    // Only need to check sleep stuff if infinite block time not set.
  803|       |    // Are *any* threads waiting on flag sleeping?
  804|     31|    if (flag->is_any_sleeping()) {
  ------------------
  |  Branch (804:9): [True: 31, False: 0]
  ------------------
  805|     62|      for (unsigned int i = 0; i < flag->get_num_waiters(); ++i) {
  ------------------
  |  Branch (805:32): [True: 31, False: 31]
  ------------------
  806|       |        // if sleeping waiter exists at i, sets current_waiter to i inside flag
  807|     31|        kmp_info_t *waiter = flag->get_waiter(i);
  808|     31|        if (waiter) {
  ------------------
  |  Branch (808:13): [True: 31, False: 0]
  ------------------
  809|     31|          int wait_gtid = waiter->th.th_info.ds.ds_gtid;
  810|       |          // Wake up thread if needed
  811|     31|          KF_TRACE(50, ("__kmp_release: T#%d waking up thread T#%d since sleep "
  812|     31|                        "flag(%p) set\n",
  813|     31|                        gtid, wait_gtid, flag->get()));
  814|     31|          flag->resume(wait_gtid); // unsets flag's current_waiter when done
  815|     31|        }
  816|     31|      }
  817|     31|    }
  818|     31|  }
  819|     31|}
_ZN15kmp_flag_nativeIyL9flag_type1ELb1EE12set_sleepingEv:
  192|  1.62k|  PtrType set_sleeping() {
  193|  1.62k|    if (this->sleepLoc) {
  ------------------
  |  Branch (193:9): [True: 0, False: 1.62k]
  ------------------
  194|      0|      this->sleepLoc->store(true);
  195|      0|      return *(this->get());
  196|      0|    }
  197|  1.62k|    return traits_type::test_then_or((volatile PtrType *)this->get(),
  198|  1.62k|                                     KMP_BARRIER_SLEEP_STATE);
  ------------------
  |  | 2023|  1.62k|#define KMP_BARRIER_SLEEP_STATE (1 << KMP_BARRIER_SLEEP_BIT)
  |  |  ------------------
  |  |  |  | 2019|  1.62k|#define KMP_BARRIER_SLEEP_BIT 0 /* bit used for suspend/sleep part of state */
  |  |  ------------------
  ------------------
  199|  1.62k|  }
_ZN15kmp_flag_nativeIyL9flag_type1ELb1EE14unset_sleepingEv:
  203|  1.62k|  void unset_sleeping() {
  204|  1.62k|    if (this->sleepLoc) {
  ------------------
  |  Branch (204:9): [True: 0, False: 1.62k]
  ------------------
  205|      0|      this->sleepLoc->store(false);
  206|      0|      return;
  207|      0|    }
  208|  1.62k|    traits_type::test_then_and((volatile PtrType *)this->get(),
  209|  1.62k|                               ~KMP_BARRIER_SLEEP_STATE);
  ------------------
  |  | 2023|  1.62k|#define KMP_BARRIER_SLEEP_STATE (1 << KMP_BARRIER_SLEEP_BIT)
  |  |  ------------------
  |  |  |  | 2019|  1.62k|#define KMP_BARRIER_SLEEP_BIT 0 /* bit used for suspend/sleep part of state */
  |  |  ------------------
  ------------------
  210|  1.62k|  }
_ZN8kmp_flagIL9flag_type1EE8get_typeEv:
  119|  3.20k|  flag_type get_type() { return (flag_type)(t.type); }

_Z9ompd_initv:
   43|      1|void ompd_init() {
   44|       |
   45|      1|  static int ompd_initialized = 0;
   46|       |
   47|      1|  if (ompd_initialized)
  ------------------
  |  Branch (47:7): [True: 0, False: 1]
  ------------------
   48|      0|    return;
   49|       |
   50|       |    /**
   51|       |     * Calculate member offsets for structs and unions
   52|       |     */
   53|       |
   54|      1|#define ompd_init_access(t, m)                                                 \
   55|      1|  ompd_access__##t##__##m = (uint64_t) & (((t *)0)->m);
   56|      1|  OMPD_FOREACH_ACCESS(ompd_init_access)
  ------------------
  |  |   38|      1|  OMPD_ACCESS(kmp_base_info_t, th_current_task)                                \
  |  |  ------------------
  |  |  |  |   56|      1|  OMPD_FOREACH_ACCESS(ompd_init_access)
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|      1|  ompd_access__##t##__##m = (uint64_t) & (((t *)0)->m);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   39|      1|  OMPD_ACCESS(kmp_base_info_t, th_team)                                        \
  |  |  ------------------
  |  |  |  |   56|      1|  OMPD_FOREACH_ACCESS(ompd_init_access)
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|      1|  ompd_access__##t##__##m = (uint64_t) & (((t *)0)->m);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   40|      1|  OMPD_ACCESS(kmp_base_info_t, th_info)                                        \
  |  |  ------------------
  |  |  |  |   56|      1|  OMPD_FOREACH_ACCESS(ompd_init_access)
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|      1|  ompd_access__##t##__##m = (uint64_t) & (((t *)0)->m);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|      1|  OMPD_ACCESS(kmp_base_info_t, ompt_thread_info)                               \
  |  |  ------------------
  |  |  |  |   56|      1|  OMPD_FOREACH_ACCESS(ompd_init_access)
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|      1|  ompd_access__##t##__##m = (uint64_t) & (((t *)0)->m);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|      1|                                                                               \
  |  |   43|      1|  OMPD_ACCESS(kmp_base_root_t, r_in_parallel)                                  \
  |  |  ------------------
  |  |  |  |   56|      1|  OMPD_FOREACH_ACCESS(ompd_init_access)
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|      1|  ompd_access__##t##__##m = (uint64_t) & (((t *)0)->m);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   44|      1|                                                                               \
  |  |   45|      1|  OMPD_ACCESS(kmp_base_team_t, ompt_team_info)                                 \
  |  |  ------------------
  |  |  |  |   56|      1|  OMPD_FOREACH_ACCESS(ompd_init_access)
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|      1|  ompd_access__##t##__##m = (uint64_t) & (((t *)0)->m);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   46|      1|  OMPD_ACCESS(kmp_base_team_t, ompt_serialized_team_info)                      \
  |  |  ------------------
  |  |  |  |   56|      1|  OMPD_FOREACH_ACCESS(ompd_init_access)
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|      1|  ompd_access__##t##__##m = (uint64_t) & (((t *)0)->m);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      1|  OMPD_ACCESS(kmp_base_team_t, t_active_level)                                 \
  |  |  ------------------
  |  |  |  |   56|      1|  OMPD_FOREACH_ACCESS(ompd_init_access)
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|      1|  ompd_access__##t##__##m = (uint64_t) & (((t *)0)->m);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   48|      1|  OMPD_ACCESS(kmp_base_team_t, t_implicit_task_taskdata)                       \
  |  |  ------------------
  |  |  |  |   56|      1|  OMPD_FOREACH_ACCESS(ompd_init_access)
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|      1|  ompd_access__##t##__##m = (uint64_t) & (((t *)0)->m);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   49|      1|  OMPD_ACCESS(kmp_base_team_t, t_master_tid)                                   \
  |  |  ------------------
  |  |  |  |   56|      1|  OMPD_FOREACH_ACCESS(ompd_init_access)
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|      1|  ompd_access__##t##__##m = (uint64_t) & (((t *)0)->m);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   50|      1|  OMPD_ACCESS(kmp_base_team_t, t_nproc)                                        \
  |  |  ------------------
  |  |  |  |   56|      1|  OMPD_FOREACH_ACCESS(ompd_init_access)
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|      1|  ompd_access__##t##__##m = (uint64_t) & (((t *)0)->m);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   51|      1|  OMPD_ACCESS(kmp_base_team_t, t_level)                                        \
  |  |  ------------------
  |  |  |  |   56|      1|  OMPD_FOREACH_ACCESS(ompd_init_access)
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|      1|  ompd_access__##t##__##m = (uint64_t) & (((t *)0)->m);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   52|      1|  OMPD_ACCESS(kmp_base_team_t, t_parent)                                       \
  |  |  ------------------
  |  |  |  |   56|      1|  OMPD_FOREACH_ACCESS(ompd_init_access)
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|      1|  ompd_access__##t##__##m = (uint64_t) & (((t *)0)->m);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   53|      1|  OMPD_ACCESS(kmp_base_team_t, t_pkfn)                                         \
  |  |  ------------------
  |  |  |  |   56|      1|  OMPD_FOREACH_ACCESS(ompd_init_access)
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|      1|  ompd_access__##t##__##m = (uint64_t) & (((t *)0)->m);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   54|      1|  OMPD_ACCESS(kmp_base_team_t, t_threads)                                      \
  |  |  ------------------
  |  |  |  |   56|      1|  OMPD_FOREACH_ACCESS(ompd_init_access)
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|      1|  ompd_access__##t##__##m = (uint64_t) & (((t *)0)->m);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   55|      1|                                                                               \
  |  |   56|      1|  OMPD_ACCESS(kmp_desc_t, ds)                                                  \
  |  |  ------------------
  |  |  |  |   56|      1|  OMPD_FOREACH_ACCESS(ompd_init_access)
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|      1|  ompd_access__##t##__##m = (uint64_t) & (((t *)0)->m);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   57|      1|                                                                               \
  |  |   58|      1|  OMPD_ACCESS(kmp_desc_base_t, ds_thread)                                      \
  |  |  ------------------
  |  |  |  |   56|      1|  OMPD_FOREACH_ACCESS(ompd_init_access)
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|      1|  ompd_access__##t##__##m = (uint64_t) & (((t *)0)->m);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   59|      1|  OMPD_ACCESS(kmp_desc_base_t, ds_tid)                                         \
  |  |  ------------------
  |  |  |  |   56|      1|  OMPD_FOREACH_ACCESS(ompd_init_access)
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|      1|  ompd_access__##t##__##m = (uint64_t) & (((t *)0)->m);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   60|      1|                                                                               \
  |  |   61|      1|  OMPD_ACCESS(kmp_info_t, th)                                                  \
  |  |  ------------------
  |  |  |  |   56|      1|  OMPD_FOREACH_ACCESS(ompd_init_access)
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|      1|  ompd_access__##t##__##m = (uint64_t) & (((t *)0)->m);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   62|      1|                                                                               \
  |  |   63|      1|  OMPD_ACCESS(kmp_r_sched_t, r_sched_type)                                     \
  |  |  ------------------
  |  |  |  |   56|      1|  OMPD_FOREACH_ACCESS(ompd_init_access)
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|      1|  ompd_access__##t##__##m = (uint64_t) & (((t *)0)->m);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   64|      1|  OMPD_ACCESS(kmp_r_sched_t, chunk)                                            \
  |  |  ------------------
  |  |  |  |   56|      1|  OMPD_FOREACH_ACCESS(ompd_init_access)
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|      1|  ompd_access__##t##__##m = (uint64_t) & (((t *)0)->m);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   65|      1|                                                                               \
  |  |   66|      1|  OMPD_ACCESS(kmp_root_t, r)                                                   \
  |  |  ------------------
  |  |  |  |   56|      1|  OMPD_FOREACH_ACCESS(ompd_init_access)
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|      1|  ompd_access__##t##__##m = (uint64_t) & (((t *)0)->m);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   67|      1|                                                                               \
  |  |   68|      1|  OMPD_ACCESS(kmp_internal_control_t, dynamic)                                 \
  |  |  ------------------
  |  |  |  |   56|      1|  OMPD_FOREACH_ACCESS(ompd_init_access)
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|      1|  ompd_access__##t##__##m = (uint64_t) & (((t *)0)->m);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   69|      1|  OMPD_ACCESS(kmp_internal_control_t, max_active_levels)                       \
  |  |  ------------------
  |  |  |  |   56|      1|  OMPD_FOREACH_ACCESS(ompd_init_access)
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|      1|  ompd_access__##t##__##m = (uint64_t) & (((t *)0)->m);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   70|      1|  OMPD_ACCESS(kmp_internal_control_t, nproc)                                   \
  |  |  ------------------
  |  |  |  |   56|      1|  OMPD_FOREACH_ACCESS(ompd_init_access)
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|      1|  ompd_access__##t##__##m = (uint64_t) & (((t *)0)->m);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   71|      1|  OMPD_ACCESS(kmp_internal_control_t, proc_bind)                               \
  |  |  ------------------
  |  |  |  |   56|      1|  OMPD_FOREACH_ACCESS(ompd_init_access)
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|      1|  ompd_access__##t##__##m = (uint64_t) & (((t *)0)->m);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   72|      1|  OMPD_ACCESS(kmp_internal_control_t, sched)                                   \
  |  |  ------------------
  |  |  |  |   56|      1|  OMPD_FOREACH_ACCESS(ompd_init_access)
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|      1|  ompd_access__##t##__##m = (uint64_t) & (((t *)0)->m);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   73|      1|  OMPD_ACCESS(kmp_internal_control_t, default_device)                          \
  |  |  ------------------
  |  |  |  |   56|      1|  OMPD_FOREACH_ACCESS(ompd_init_access)
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|      1|  ompd_access__##t##__##m = (uint64_t) & (((t *)0)->m);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   74|      1|  OMPD_ACCESS(kmp_internal_control_t, thread_limit)                            \
  |  |  ------------------
  |  |  |  |   56|      1|  OMPD_FOREACH_ACCESS(ompd_init_access)
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|      1|  ompd_access__##t##__##m = (uint64_t) & (((t *)0)->m);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   75|      1|                                                                               \
  |  |   76|      1|  OMPD_ACCESS(kmp_taskdata_t, ompt_task_info)                                  \
  |  |  ------------------
  |  |  |  |   56|      1|  OMPD_FOREACH_ACCESS(ompd_init_access)
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|      1|  ompd_access__##t##__##m = (uint64_t) & (((t *)0)->m);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   77|      1|  OMPD_ACCESS(kmp_taskdata_t, td_flags)                                        \
  |  |  ------------------
  |  |  |  |   56|      1|  OMPD_FOREACH_ACCESS(ompd_init_access)
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|      1|  ompd_access__##t##__##m = (uint64_t) & (((t *)0)->m);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   78|      1|  OMPD_ACCESS(kmp_taskdata_t, td_icvs)                                         \
  |  |  ------------------
  |  |  |  |   56|      1|  OMPD_FOREACH_ACCESS(ompd_init_access)
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|      1|  ompd_access__##t##__##m = (uint64_t) & (((t *)0)->m);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   79|      1|  OMPD_ACCESS(kmp_taskdata_t, td_parent)                                       \
  |  |  ------------------
  |  |  |  |   56|      1|  OMPD_FOREACH_ACCESS(ompd_init_access)
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|      1|  ompd_access__##t##__##m = (uint64_t) & (((t *)0)->m);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   80|      1|  OMPD_ACCESS(kmp_taskdata_t, td_team)                                         \
  |  |  ------------------
  |  |  |  |   56|      1|  OMPD_FOREACH_ACCESS(ompd_init_access)
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|      1|  ompd_access__##t##__##m = (uint64_t) & (((t *)0)->m);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   81|      1|                                                                               \
  |  |   82|      1|  OMPD_ACCESS(kmp_task_t, routine)                                             \
  |  |  ------------------
  |  |  |  |   56|      1|  OMPD_FOREACH_ACCESS(ompd_init_access)
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|      1|  ompd_access__##t##__##m = (uint64_t) & (((t *)0)->m);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   83|      1|                                                                               \
  |  |   84|      1|  OMPD_ACCESS(kmp_team_p, t)                                                   \
  |  |  ------------------
  |  |  |  |   56|      1|  OMPD_FOREACH_ACCESS(ompd_init_access)
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|      1|  ompd_access__##t##__##m = (uint64_t) & (((t *)0)->m);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   85|      1|                                                                               \
  |  |   86|      1|  OMPD_ACCESS(kmp_nested_nthreads_t, used)                                     \
  |  |  ------------------
  |  |  |  |   56|      1|  OMPD_FOREACH_ACCESS(ompd_init_access)
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|      1|  ompd_access__##t##__##m = (uint64_t) & (((t *)0)->m);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   87|      1|  OMPD_ACCESS(kmp_nested_nthreads_t, nth)                                      \
  |  |  ------------------
  |  |  |  |   56|      1|  OMPD_FOREACH_ACCESS(ompd_init_access)
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|      1|  ompd_access__##t##__##m = (uint64_t) & (((t *)0)->m);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   88|      1|                                                                               \
  |  |   89|      1|  OMPD_ACCESS(kmp_nested_proc_bind_t, used)                                    \
  |  |  ------------------
  |  |  |  |   56|      1|  OMPD_FOREACH_ACCESS(ompd_init_access)
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|      1|  ompd_access__##t##__##m = (uint64_t) & (((t *)0)->m);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   90|      1|  OMPD_ACCESS(kmp_nested_proc_bind_t, bind_types)                              \
  |  |  ------------------
  |  |  |  |   56|      1|  OMPD_FOREACH_ACCESS(ompd_init_access)
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|      1|  ompd_access__##t##__##m = (uint64_t) & (((t *)0)->m);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   91|      1|                                                                               \
  |  |   92|      1|  OMPD_ACCESS(ompt_task_info_t, frame)                                         \
  |  |  ------------------
  |  |  |  |   56|      1|  OMPD_FOREACH_ACCESS(ompd_init_access)
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|      1|  ompd_access__##t##__##m = (uint64_t) & (((t *)0)->m);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   93|      1|  OMPD_ACCESS(ompt_task_info_t, scheduling_parent)                             \
  |  |  ------------------
  |  |  |  |   56|      1|  OMPD_FOREACH_ACCESS(ompd_init_access)
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|      1|  ompd_access__##t##__##m = (uint64_t) & (((t *)0)->m);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   94|      1|  OMPD_ACCESS(ompt_task_info_t, task_data)                                     \
  |  |  ------------------
  |  |  |  |   56|      1|  OMPD_FOREACH_ACCESS(ompd_init_access)
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|      1|  ompd_access__##t##__##m = (uint64_t) & (((t *)0)->m);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   95|      1|                                                                               \
  |  |   96|      1|  OMPD_ACCESS(ompt_team_info_t, parallel_data)                                 \
  |  |  ------------------
  |  |  |  |   56|      1|  OMPD_FOREACH_ACCESS(ompd_init_access)
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|      1|  ompd_access__##t##__##m = (uint64_t) & (((t *)0)->m);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   97|      1|                                                                               \
  |  |   98|      1|  OMPD_ACCESS(ompt_thread_info_t, state)                                       \
  |  |  ------------------
  |  |  |  |   56|      1|  OMPD_FOREACH_ACCESS(ompd_init_access)
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|      1|  ompd_access__##t##__##m = (uint64_t) & (((t *)0)->m);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   99|      1|  OMPD_ACCESS(ompt_thread_info_t, wait_id)                                     \
  |  |  ------------------
  |  |  |  |   56|      1|  OMPD_FOREACH_ACCESS(ompd_init_access)
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|      1|  ompd_access__##t##__##m = (uint64_t) & (((t *)0)->m);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  100|      1|  OMPD_ACCESS(ompt_thread_info_t, thread_data)                                 \
  |  |  ------------------
  |  |  |  |   56|      1|  OMPD_FOREACH_ACCESS(ompd_init_access)
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|      1|  ompd_access__##t##__##m = (uint64_t) & (((t *)0)->m);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  101|      1|                                                                               \
  |  |  102|      1|  OMPD_ACCESS(ompt_data_t, value)                                              \
  |  |  ------------------
  |  |  |  |   56|      1|  OMPD_FOREACH_ACCESS(ompd_init_access)
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|      1|  ompd_access__##t##__##m = (uint64_t) & (((t *)0)->m);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  103|      1|  OMPD_ACCESS(ompt_data_t, ptr)                                                \
  |  |  ------------------
  |  |  |  |   56|      1|  OMPD_FOREACH_ACCESS(ompd_init_access)
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|      1|  ompd_access__##t##__##m = (uint64_t) & (((t *)0)->m);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  104|      1|                                                                               \
  |  |  105|      1|  OMPD_ACCESS(ompt_frame_t, exit_frame)                                        \
  |  |  ------------------
  |  |  |  |   56|      1|  OMPD_FOREACH_ACCESS(ompd_init_access)
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|      1|  ompd_access__##t##__##m = (uint64_t) & (((t *)0)->m);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  106|      1|  OMPD_ACCESS(ompt_frame_t, enter_frame)                                       \
  |  |  ------------------
  |  |  |  |   56|      1|  OMPD_FOREACH_ACCESS(ompd_init_access)
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|      1|  ompd_access__##t##__##m = (uint64_t) & (((t *)0)->m);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  107|      1|                                                                               \
  |  |  108|      1|  OMPD_ACCESS(ompt_lw_taskteam_t, parent)                                      \
  |  |  ------------------
  |  |  |  |   56|      1|  OMPD_FOREACH_ACCESS(ompd_init_access)
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|      1|  ompd_access__##t##__##m = (uint64_t) & (((t *)0)->m);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  109|      1|  OMPD_ACCESS(ompt_lw_taskteam_t, ompt_team_info)                              \
  |  |  ------------------
  |  |  |  |   56|      1|  OMPD_FOREACH_ACCESS(ompd_init_access)
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|      1|  ompd_access__##t##__##m = (uint64_t) & (((t *)0)->m);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|      1|  OMPD_ACCESS(ompt_lw_taskteam_t, ompt_task_info)
  |  |  ------------------
  |  |  |  |   56|      1|  OMPD_FOREACH_ACCESS(ompd_init_access)
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|      1|  ompd_access__##t##__##m = (uint64_t) & (((t *)0)->m);
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   57|      1|#undef ompd_init_access
   58|       |
   59|       |  /**
   60|       |   * Create bit mask for bitfield access
   61|       |   */
   62|       |
   63|      1|#define ompd_init_bitfield(t, m)                                               \
   64|      1|  ompd_bitfield__##t##__##m = 0;                                               \
   65|      1|  ((t *)(&ompd_bitfield__##t##__##m))->m = 1;
   66|      1|  OMPD_FOREACH_BITFIELD(ompd_init_bitfield)
  ------------------
  |  |  113|      1|  OMPD_BITFIELD(kmp_tasking_flags_t, final)                                    \
  |  |  ------------------
  |  |  |  |   66|      1|  OMPD_FOREACH_BITFIELD(ompd_init_bitfield)
  |  |  |  |  ------------------
  |  |  |  |  |  |   64|      1|  ompd_bitfield__##t##__##m = 0;                                               \
  |  |  |  |  |  |   65|      1|  ((t *)(&ompd_bitfield__##t##__##m))->m = 1;
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  114|      1|  OMPD_BITFIELD(kmp_tasking_flags_t, tiedness)                                 \
  |  |  ------------------
  |  |  |  |   66|      1|  OMPD_FOREACH_BITFIELD(ompd_init_bitfield)
  |  |  |  |  ------------------
  |  |  |  |  |  |   64|      1|  ompd_bitfield__##t##__##m = 0;                                               \
  |  |  |  |  |  |   65|      1|  ((t *)(&ompd_bitfield__##t##__##m))->m = 1;
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  115|      1|  OMPD_BITFIELD(kmp_tasking_flags_t, tasktype)                                 \
  |  |  ------------------
  |  |  |  |   66|      1|  OMPD_FOREACH_BITFIELD(ompd_init_bitfield)
  |  |  |  |  ------------------
  |  |  |  |  |  |   64|      1|  ompd_bitfield__##t##__##m = 0;                                               \
  |  |  |  |  |  |   65|      1|  ((t *)(&ompd_bitfield__##t##__##m))->m = 1;
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  116|      1|  OMPD_BITFIELD(kmp_tasking_flags_t, task_serial)                              \
  |  |  ------------------
  |  |  |  |   66|      1|  OMPD_FOREACH_BITFIELD(ompd_init_bitfield)
  |  |  |  |  ------------------
  |  |  |  |  |  |   64|      1|  ompd_bitfield__##t##__##m = 0;                                               \
  |  |  |  |  |  |   65|      1|  ((t *)(&ompd_bitfield__##t##__##m))->m = 1;
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|      1|  OMPD_BITFIELD(kmp_tasking_flags_t, tasking_ser)                              \
  |  |  ------------------
  |  |  |  |   66|      1|  OMPD_FOREACH_BITFIELD(ompd_init_bitfield)
  |  |  |  |  ------------------
  |  |  |  |  |  |   64|      1|  ompd_bitfield__##t##__##m = 0;                                               \
  |  |  |  |  |  |   65|      1|  ((t *)(&ompd_bitfield__##t##__##m))->m = 1;
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  118|      1|  OMPD_BITFIELD(kmp_tasking_flags_t, team_serial)                              \
  |  |  ------------------
  |  |  |  |   66|      1|  OMPD_FOREACH_BITFIELD(ompd_init_bitfield)
  |  |  |  |  ------------------
  |  |  |  |  |  |   64|      1|  ompd_bitfield__##t##__##m = 0;                                               \
  |  |  |  |  |  |   65|      1|  ((t *)(&ompd_bitfield__##t##__##m))->m = 1;
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|      1|  OMPD_BITFIELD(kmp_tasking_flags_t, started)                                  \
  |  |  ------------------
  |  |  |  |   66|      1|  OMPD_FOREACH_BITFIELD(ompd_init_bitfield)
  |  |  |  |  ------------------
  |  |  |  |  |  |   64|      1|  ompd_bitfield__##t##__##m = 0;                                               \
  |  |  |  |  |  |   65|      1|  ((t *)(&ompd_bitfield__##t##__##m))->m = 1;
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      1|  OMPD_BITFIELD(kmp_tasking_flags_t, executing)                                \
  |  |  ------------------
  |  |  |  |   66|      1|  OMPD_FOREACH_BITFIELD(ompd_init_bitfield)
  |  |  |  |  ------------------
  |  |  |  |  |  |   64|      1|  ompd_bitfield__##t##__##m = 0;                                               \
  |  |  |  |  |  |   65|      1|  ((t *)(&ompd_bitfield__##t##__##m))->m = 1;
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|      1|  OMPD_BITFIELD(kmp_tasking_flags_t, complete)                                 \
  |  |  ------------------
  |  |  |  |   66|      1|  OMPD_FOREACH_BITFIELD(ompd_init_bitfield)
  |  |  |  |  ------------------
  |  |  |  |  |  |   64|      1|  ompd_bitfield__##t##__##m = 0;                                               \
  |  |  |  |  |  |   65|      1|  ((t *)(&ompd_bitfield__##t##__##m))->m = 1;
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|      1|  OMPD_BITFIELD(kmp_tasking_flags_t, freed)                                    \
  |  |  ------------------
  |  |  |  |   66|      1|  OMPD_FOREACH_BITFIELD(ompd_init_bitfield)
  |  |  |  |  ------------------
  |  |  |  |  |  |   64|      1|  ompd_bitfield__##t##__##m = 0;                                               \
  |  |  |  |  |  |   65|      1|  ((t *)(&ompd_bitfield__##t##__##m))->m = 1;
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  123|      1|  OMPD_BITFIELD(kmp_tasking_flags_t, native)
  |  |  ------------------
  |  |  |  |   66|      1|  OMPD_FOREACH_BITFIELD(ompd_init_bitfield)
  |  |  |  |  ------------------
  |  |  |  |  |  |   64|      1|  ompd_bitfield__##t##__##m = 0;                                               \
  |  |  |  |  |  |   65|      1|  ((t *)(&ompd_bitfield__##t##__##m))->m = 1;
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   67|      1|#undef ompd_init_bitfield
   68|       |
   69|       |  /**
   70|       |   * Calculate type size information
   71|       |   */
   72|       |
   73|      1|#define ompd_init_sizeof_member(t, m)                                          \
   74|      1|  ompd_sizeof__##t##__##m = sizeof(((t *)0)->m);
   75|      1|  OMPD_FOREACH_ACCESS(ompd_init_sizeof_member)
  ------------------
  |  |   38|      1|  OMPD_ACCESS(kmp_base_info_t, th_current_task)                                \
  |  |  ------------------
  |  |  |  |   75|      1|  OMPD_FOREACH_ACCESS(ompd_init_sizeof_member)
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|      1|  ompd_sizeof__##t##__##m = sizeof(((t *)0)->m);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   39|      1|  OMPD_ACCESS(kmp_base_info_t, th_team)                                        \
  |  |  ------------------
  |  |  |  |   75|      1|  OMPD_FOREACH_ACCESS(ompd_init_sizeof_member)
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|      1|  ompd_sizeof__##t##__##m = sizeof(((t *)0)->m);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   40|      1|  OMPD_ACCESS(kmp_base_info_t, th_info)                                        \
  |  |  ------------------
  |  |  |  |   75|      1|  OMPD_FOREACH_ACCESS(ompd_init_sizeof_member)
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|      1|  ompd_sizeof__##t##__##m = sizeof(((t *)0)->m);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|      1|  OMPD_ACCESS(kmp_base_info_t, ompt_thread_info)                               \
  |  |  ------------------
  |  |  |  |   75|      1|  OMPD_FOREACH_ACCESS(ompd_init_sizeof_member)
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|      1|  ompd_sizeof__##t##__##m = sizeof(((t *)0)->m);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|      1|                                                                               \
  |  |   43|      1|  OMPD_ACCESS(kmp_base_root_t, r_in_parallel)                                  \
  |  |  ------------------
  |  |  |  |   75|      1|  OMPD_FOREACH_ACCESS(ompd_init_sizeof_member)
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|      1|  ompd_sizeof__##t##__##m = sizeof(((t *)0)->m);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   44|      1|                                                                               \
  |  |   45|      1|  OMPD_ACCESS(kmp_base_team_t, ompt_team_info)                                 \
  |  |  ------------------
  |  |  |  |   75|      1|  OMPD_FOREACH_ACCESS(ompd_init_sizeof_member)
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|      1|  ompd_sizeof__##t##__##m = sizeof(((t *)0)->m);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   46|      1|  OMPD_ACCESS(kmp_base_team_t, ompt_serialized_team_info)                      \
  |  |  ------------------
  |  |  |  |   75|      1|  OMPD_FOREACH_ACCESS(ompd_init_sizeof_member)
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|      1|  ompd_sizeof__##t##__##m = sizeof(((t *)0)->m);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      1|  OMPD_ACCESS(kmp_base_team_t, t_active_level)                                 \
  |  |  ------------------
  |  |  |  |   75|      1|  OMPD_FOREACH_ACCESS(ompd_init_sizeof_member)
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|      1|  ompd_sizeof__##t##__##m = sizeof(((t *)0)->m);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   48|      1|  OMPD_ACCESS(kmp_base_team_t, t_implicit_task_taskdata)                       \
  |  |  ------------------
  |  |  |  |   75|      1|  OMPD_FOREACH_ACCESS(ompd_init_sizeof_member)
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|      1|  ompd_sizeof__##t##__##m = sizeof(((t *)0)->m);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   49|      1|  OMPD_ACCESS(kmp_base_team_t, t_master_tid)                                   \
  |  |  ------------------
  |  |  |  |   75|      1|  OMPD_FOREACH_ACCESS(ompd_init_sizeof_member)
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|      1|  ompd_sizeof__##t##__##m = sizeof(((t *)0)->m);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   50|      1|  OMPD_ACCESS(kmp_base_team_t, t_nproc)                                        \
  |  |  ------------------
  |  |  |  |   75|      1|  OMPD_FOREACH_ACCESS(ompd_init_sizeof_member)
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|      1|  ompd_sizeof__##t##__##m = sizeof(((t *)0)->m);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   51|      1|  OMPD_ACCESS(kmp_base_team_t, t_level)                                        \
  |  |  ------------------
  |  |  |  |   75|      1|  OMPD_FOREACH_ACCESS(ompd_init_sizeof_member)
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|      1|  ompd_sizeof__##t##__##m = sizeof(((t *)0)->m);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   52|      1|  OMPD_ACCESS(kmp_base_team_t, t_parent)                                       \
  |  |  ------------------
  |  |  |  |   75|      1|  OMPD_FOREACH_ACCESS(ompd_init_sizeof_member)
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|      1|  ompd_sizeof__##t##__##m = sizeof(((t *)0)->m);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   53|      1|  OMPD_ACCESS(kmp_base_team_t, t_pkfn)                                         \
  |  |  ------------------
  |  |  |  |   75|      1|  OMPD_FOREACH_ACCESS(ompd_init_sizeof_member)
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|      1|  ompd_sizeof__##t##__##m = sizeof(((t *)0)->m);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   54|      1|  OMPD_ACCESS(kmp_base_team_t, t_threads)                                      \
  |  |  ------------------
  |  |  |  |   75|      1|  OMPD_FOREACH_ACCESS(ompd_init_sizeof_member)
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|      1|  ompd_sizeof__##t##__##m = sizeof(((t *)0)->m);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   55|      1|                                                                               \
  |  |   56|      1|  OMPD_ACCESS(kmp_desc_t, ds)                                                  \
  |  |  ------------------
  |  |  |  |   75|      1|  OMPD_FOREACH_ACCESS(ompd_init_sizeof_member)
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|      1|  ompd_sizeof__##t##__##m = sizeof(((t *)0)->m);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   57|      1|                                                                               \
  |  |   58|      1|  OMPD_ACCESS(kmp_desc_base_t, ds_thread)                                      \
  |  |  ------------------
  |  |  |  |   75|      1|  OMPD_FOREACH_ACCESS(ompd_init_sizeof_member)
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|      1|  ompd_sizeof__##t##__##m = sizeof(((t *)0)->m);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   59|      1|  OMPD_ACCESS(kmp_desc_base_t, ds_tid)                                         \
  |  |  ------------------
  |  |  |  |   75|      1|  OMPD_FOREACH_ACCESS(ompd_init_sizeof_member)
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|      1|  ompd_sizeof__##t##__##m = sizeof(((t *)0)->m);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   60|      1|                                                                               \
  |  |   61|      1|  OMPD_ACCESS(kmp_info_t, th)                                                  \
  |  |  ------------------
  |  |  |  |   75|      1|  OMPD_FOREACH_ACCESS(ompd_init_sizeof_member)
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|      1|  ompd_sizeof__##t##__##m = sizeof(((t *)0)->m);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   62|      1|                                                                               \
  |  |   63|      1|  OMPD_ACCESS(kmp_r_sched_t, r_sched_type)                                     \
  |  |  ------------------
  |  |  |  |   75|      1|  OMPD_FOREACH_ACCESS(ompd_init_sizeof_member)
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|      1|  ompd_sizeof__##t##__##m = sizeof(((t *)0)->m);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   64|      1|  OMPD_ACCESS(kmp_r_sched_t, chunk)                                            \
  |  |  ------------------
  |  |  |  |   75|      1|  OMPD_FOREACH_ACCESS(ompd_init_sizeof_member)
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|      1|  ompd_sizeof__##t##__##m = sizeof(((t *)0)->m);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   65|      1|                                                                               \
  |  |   66|      1|  OMPD_ACCESS(kmp_root_t, r)                                                   \
  |  |  ------------------
  |  |  |  |   75|      1|  OMPD_FOREACH_ACCESS(ompd_init_sizeof_member)
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|      1|  ompd_sizeof__##t##__##m = sizeof(((t *)0)->m);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   67|      1|                                                                               \
  |  |   68|      1|  OMPD_ACCESS(kmp_internal_control_t, dynamic)                                 \
  |  |  ------------------
  |  |  |  |   75|      1|  OMPD_FOREACH_ACCESS(ompd_init_sizeof_member)
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|      1|  ompd_sizeof__##t##__##m = sizeof(((t *)0)->m);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   69|      1|  OMPD_ACCESS(kmp_internal_control_t, max_active_levels)                       \
  |  |  ------------------
  |  |  |  |   75|      1|  OMPD_FOREACH_ACCESS(ompd_init_sizeof_member)
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|      1|  ompd_sizeof__##t##__##m = sizeof(((t *)0)->m);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   70|      1|  OMPD_ACCESS(kmp_internal_control_t, nproc)                                   \
  |  |  ------------------
  |  |  |  |   75|      1|  OMPD_FOREACH_ACCESS(ompd_init_sizeof_member)
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|      1|  ompd_sizeof__##t##__##m = sizeof(((t *)0)->m);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   71|      1|  OMPD_ACCESS(kmp_internal_control_t, proc_bind)                               \
  |  |  ------------------
  |  |  |  |   75|      1|  OMPD_FOREACH_ACCESS(ompd_init_sizeof_member)
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|      1|  ompd_sizeof__##t##__##m = sizeof(((t *)0)->m);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   72|      1|  OMPD_ACCESS(kmp_internal_control_t, sched)                                   \
  |  |  ------------------
  |  |  |  |   75|      1|  OMPD_FOREACH_ACCESS(ompd_init_sizeof_member)
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|      1|  ompd_sizeof__##t##__##m = sizeof(((t *)0)->m);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   73|      1|  OMPD_ACCESS(kmp_internal_control_t, default_device)                          \
  |  |  ------------------
  |  |  |  |   75|      1|  OMPD_FOREACH_ACCESS(ompd_init_sizeof_member)
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|      1|  ompd_sizeof__##t##__##m = sizeof(((t *)0)->m);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   74|      1|  OMPD_ACCESS(kmp_internal_control_t, thread_limit)                            \
  |  |  ------------------
  |  |  |  |   75|      1|  OMPD_FOREACH_ACCESS(ompd_init_sizeof_member)
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|      1|  ompd_sizeof__##t##__##m = sizeof(((t *)0)->m);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   75|      1|                                                                               \
  |  |   76|      1|  OMPD_ACCESS(kmp_taskdata_t, ompt_task_info)                                  \
  |  |  ------------------
  |  |  |  |   75|      1|  OMPD_FOREACH_ACCESS(ompd_init_sizeof_member)
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|      1|  ompd_sizeof__##t##__##m = sizeof(((t *)0)->m);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   77|      1|  OMPD_ACCESS(kmp_taskdata_t, td_flags)                                        \
  |  |  ------------------
  |  |  |  |   75|      1|  OMPD_FOREACH_ACCESS(ompd_init_sizeof_member)
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|      1|  ompd_sizeof__##t##__##m = sizeof(((t *)0)->m);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   78|      1|  OMPD_ACCESS(kmp_taskdata_t, td_icvs)                                         \
  |  |  ------------------
  |  |  |  |   75|      1|  OMPD_FOREACH_ACCESS(ompd_init_sizeof_member)
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|      1|  ompd_sizeof__##t##__##m = sizeof(((t *)0)->m);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   79|      1|  OMPD_ACCESS(kmp_taskdata_t, td_parent)                                       \
  |  |  ------------------
  |  |  |  |   75|      1|  OMPD_FOREACH_ACCESS(ompd_init_sizeof_member)
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|      1|  ompd_sizeof__##t##__##m = sizeof(((t *)0)->m);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   80|      1|  OMPD_ACCESS(kmp_taskdata_t, td_team)                                         \
  |  |  ------------------
  |  |  |  |   75|      1|  OMPD_FOREACH_ACCESS(ompd_init_sizeof_member)
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|      1|  ompd_sizeof__##t##__##m = sizeof(((t *)0)->m);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   81|      1|                                                                               \
  |  |   82|      1|  OMPD_ACCESS(kmp_task_t, routine)                                             \
  |  |  ------------------
  |  |  |  |   75|      1|  OMPD_FOREACH_ACCESS(ompd_init_sizeof_member)
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|      1|  ompd_sizeof__##t##__##m = sizeof(((t *)0)->m);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   83|      1|                                                                               \
  |  |   84|      1|  OMPD_ACCESS(kmp_team_p, t)                                                   \
  |  |  ------------------
  |  |  |  |   75|      1|  OMPD_FOREACH_ACCESS(ompd_init_sizeof_member)
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|      1|  ompd_sizeof__##t##__##m = sizeof(((t *)0)->m);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   85|      1|                                                                               \
  |  |   86|      1|  OMPD_ACCESS(kmp_nested_nthreads_t, used)                                     \
  |  |  ------------------
  |  |  |  |   75|      1|  OMPD_FOREACH_ACCESS(ompd_init_sizeof_member)
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|      1|  ompd_sizeof__##t##__##m = sizeof(((t *)0)->m);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   87|      1|  OMPD_ACCESS(kmp_nested_nthreads_t, nth)                                      \
  |  |  ------------------
  |  |  |  |   75|      1|  OMPD_FOREACH_ACCESS(ompd_init_sizeof_member)
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|      1|  ompd_sizeof__##t##__##m = sizeof(((t *)0)->m);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   88|      1|                                                                               \
  |  |   89|      1|  OMPD_ACCESS(kmp_nested_proc_bind_t, used)                                    \
  |  |  ------------------
  |  |  |  |   75|      1|  OMPD_FOREACH_ACCESS(ompd_init_sizeof_member)
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|      1|  ompd_sizeof__##t##__##m = sizeof(((t *)0)->m);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   90|      1|  OMPD_ACCESS(kmp_nested_proc_bind_t, bind_types)                              \
  |  |  ------------------
  |  |  |  |   75|      1|  OMPD_FOREACH_ACCESS(ompd_init_sizeof_member)
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|      1|  ompd_sizeof__##t##__##m = sizeof(((t *)0)->m);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   91|      1|                                                                               \
  |  |   92|      1|  OMPD_ACCESS(ompt_task_info_t, frame)                                         \
  |  |  ------------------
  |  |  |  |   75|      1|  OMPD_FOREACH_ACCESS(ompd_init_sizeof_member)
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|      1|  ompd_sizeof__##t##__##m = sizeof(((t *)0)->m);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   93|      1|  OMPD_ACCESS(ompt_task_info_t, scheduling_parent)                             \
  |  |  ------------------
  |  |  |  |   75|      1|  OMPD_FOREACH_ACCESS(ompd_init_sizeof_member)
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|      1|  ompd_sizeof__##t##__##m = sizeof(((t *)0)->m);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   94|      1|  OMPD_ACCESS(ompt_task_info_t, task_data)                                     \
  |  |  ------------------
  |  |  |  |   75|      1|  OMPD_FOREACH_ACCESS(ompd_init_sizeof_member)
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|      1|  ompd_sizeof__##t##__##m = sizeof(((t *)0)->m);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   95|      1|                                                                               \
  |  |   96|      1|  OMPD_ACCESS(ompt_team_info_t, parallel_data)                                 \
  |  |  ------------------
  |  |  |  |   75|      1|  OMPD_FOREACH_ACCESS(ompd_init_sizeof_member)
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|      1|  ompd_sizeof__##t##__##m = sizeof(((t *)0)->m);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   97|      1|                                                                               \
  |  |   98|      1|  OMPD_ACCESS(ompt_thread_info_t, state)                                       \
  |  |  ------------------
  |  |  |  |   75|      1|  OMPD_FOREACH_ACCESS(ompd_init_sizeof_member)
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|      1|  ompd_sizeof__##t##__##m = sizeof(((t *)0)->m);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   99|      1|  OMPD_ACCESS(ompt_thread_info_t, wait_id)                                     \
  |  |  ------------------
  |  |  |  |   75|      1|  OMPD_FOREACH_ACCESS(ompd_init_sizeof_member)
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|      1|  ompd_sizeof__##t##__##m = sizeof(((t *)0)->m);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  100|      1|  OMPD_ACCESS(ompt_thread_info_t, thread_data)                                 \
  |  |  ------------------
  |  |  |  |   75|      1|  OMPD_FOREACH_ACCESS(ompd_init_sizeof_member)
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|      1|  ompd_sizeof__##t##__##m = sizeof(((t *)0)->m);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  101|      1|                                                                               \
  |  |  102|      1|  OMPD_ACCESS(ompt_data_t, value)                                              \
  |  |  ------------------
  |  |  |  |   75|      1|  OMPD_FOREACH_ACCESS(ompd_init_sizeof_member)
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|      1|  ompd_sizeof__##t##__##m = sizeof(((t *)0)->m);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  103|      1|  OMPD_ACCESS(ompt_data_t, ptr)                                                \
  |  |  ------------------
  |  |  |  |   75|      1|  OMPD_FOREACH_ACCESS(ompd_init_sizeof_member)
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|      1|  ompd_sizeof__##t##__##m = sizeof(((t *)0)->m);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  104|      1|                                                                               \
  |  |  105|      1|  OMPD_ACCESS(ompt_frame_t, exit_frame)                                        \
  |  |  ------------------
  |  |  |  |   75|      1|  OMPD_FOREACH_ACCESS(ompd_init_sizeof_member)
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|      1|  ompd_sizeof__##t##__##m = sizeof(((t *)0)->m);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  106|      1|  OMPD_ACCESS(ompt_frame_t, enter_frame)                                       \
  |  |  ------------------
  |  |  |  |   75|      1|  OMPD_FOREACH_ACCESS(ompd_init_sizeof_member)
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|      1|  ompd_sizeof__##t##__##m = sizeof(((t *)0)->m);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  107|      1|                                                                               \
  |  |  108|      1|  OMPD_ACCESS(ompt_lw_taskteam_t, parent)                                      \
  |  |  ------------------
  |  |  |  |   75|      1|  OMPD_FOREACH_ACCESS(ompd_init_sizeof_member)
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|      1|  ompd_sizeof__##t##__##m = sizeof(((t *)0)->m);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  109|      1|  OMPD_ACCESS(ompt_lw_taskteam_t, ompt_team_info)                              \
  |  |  ------------------
  |  |  |  |   75|      1|  OMPD_FOREACH_ACCESS(ompd_init_sizeof_member)
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|      1|  ompd_sizeof__##t##__##m = sizeof(((t *)0)->m);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|      1|  OMPD_ACCESS(ompt_lw_taskteam_t, ompt_task_info)
  |  |  ------------------
  |  |  |  |   75|      1|  OMPD_FOREACH_ACCESS(ompd_init_sizeof_member)
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|      1|  ompd_sizeof__##t##__##m = sizeof(((t *)0)->m);
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   76|      1|#undef ompd_init_sizeof_member
   77|       |
   78|      1|#define ompd_init_sizeof(t) ompd_sizeof__##t = sizeof(t);
   79|      1|  OMPD_FOREACH_SIZEOF(ompd_init_sizeof)
  ------------------
  |  |  126|      1|  OMPD_SIZEOF(kmp_info_t)                                                      \
  |  |  ------------------
  |  |  |  |   79|      1|  OMPD_FOREACH_SIZEOF(ompd_init_sizeof)
  |  |  |  |  ------------------
  |  |  |  |  |  |   78|      1|#define ompd_init_sizeof(t) ompd_sizeof__##t = sizeof(t);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  127|      1|  OMPD_SIZEOF(kmp_taskdata_t)                                                  \
  |  |  ------------------
  |  |  |  |   79|      1|  OMPD_FOREACH_SIZEOF(ompd_init_sizeof)
  |  |  |  |  ------------------
  |  |  |  |  |  |   78|      1|#define ompd_init_sizeof(t) ompd_sizeof__##t = sizeof(t);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  128|      1|  OMPD_SIZEOF(kmp_task_t)                                                      \
  |  |  ------------------
  |  |  |  |   79|      1|  OMPD_FOREACH_SIZEOF(ompd_init_sizeof)
  |  |  |  |  ------------------
  |  |  |  |  |  |   78|      1|#define ompd_init_sizeof(t) ompd_sizeof__##t = sizeof(t);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  129|      1|  OMPD_SIZEOF(kmp_tasking_flags_t)                                             \
  |  |  ------------------
  |  |  |  |   79|      1|  OMPD_FOREACH_SIZEOF(ompd_init_sizeof)
  |  |  |  |  ------------------
  |  |  |  |  |  |   78|      1|#define ompd_init_sizeof(t) ompd_sizeof__##t = sizeof(t);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  130|      1|  OMPD_SIZEOF(kmp_thread_t)                                                    \
  |  |  ------------------
  |  |  |  |   79|      1|  OMPD_FOREACH_SIZEOF(ompd_init_sizeof)
  |  |  |  |  ------------------
  |  |  |  |  |  |   78|      1|#define ompd_init_sizeof(t) ompd_sizeof__##t = sizeof(t);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  131|      1|  OMPD_SIZEOF(ompt_data_t)                                                     \
  |  |  ------------------
  |  |  |  |   79|      1|  OMPD_FOREACH_SIZEOF(ompd_init_sizeof)
  |  |  |  |  ------------------
  |  |  |  |  |  |   78|      1|#define ompd_init_sizeof(t) ompd_sizeof__##t = sizeof(t);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  132|      1|  OMPD_SIZEOF(ompt_id_t)                                                       \
  |  |  ------------------
  |  |  |  |   79|      1|  OMPD_FOREACH_SIZEOF(ompd_init_sizeof)
  |  |  |  |  ------------------
  |  |  |  |  |  |   78|      1|#define ompd_init_sizeof(t) ompd_sizeof__##t = sizeof(t);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  133|      1|  OMPD_SIZEOF(__kmp_avail_proc)                                                \
  |  |  ------------------
  |  |  |  |   79|      1|  OMPD_FOREACH_SIZEOF(ompd_init_sizeof)
  |  |  |  |  ------------------
  |  |  |  |  |  |   78|      1|#define ompd_init_sizeof(t) ompd_sizeof__##t = sizeof(t);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  134|      1|  OMPD_SIZEOF(__kmp_max_nth)                                                   \
  |  |  ------------------
  |  |  |  |   79|      1|  OMPD_FOREACH_SIZEOF(ompd_init_sizeof)
  |  |  |  |  ------------------
  |  |  |  |  |  |   78|      1|#define ompd_init_sizeof(t) ompd_sizeof__##t = sizeof(t);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  135|      1|  OMPD_SIZEOF(__kmp_stksize)                                                   \
  |  |  ------------------
  |  |  |  |   79|      1|  OMPD_FOREACH_SIZEOF(ompd_init_sizeof)
  |  |  |  |  ------------------
  |  |  |  |  |  |   78|      1|#define ompd_init_sizeof(t) ompd_sizeof__##t = sizeof(t);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  136|      1|  OMPD_SIZEOF(__kmp_omp_cancellation)                                          \
  |  |  ------------------
  |  |  |  |   79|      1|  OMPD_FOREACH_SIZEOF(ompd_init_sizeof)
  |  |  |  |  ------------------
  |  |  |  |  |  |   78|      1|#define ompd_init_sizeof(t) ompd_sizeof__##t = sizeof(t);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  137|      1|  OMPD_SIZEOF(__kmp_max_task_priority)                                         \
  |  |  ------------------
  |  |  |  |   79|      1|  OMPD_FOREACH_SIZEOF(ompd_init_sizeof)
  |  |  |  |  ------------------
  |  |  |  |  |  |   78|      1|#define ompd_init_sizeof(t) ompd_sizeof__##t = sizeof(t);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  138|      1|  OMPD_SIZEOF(__kmp_display_affinity)                                          \
  |  |  ------------------
  |  |  |  |   79|      1|  OMPD_FOREACH_SIZEOF(ompd_init_sizeof)
  |  |  |  |  ------------------
  |  |  |  |  |  |   78|      1|#define ompd_init_sizeof(t) ompd_sizeof__##t = sizeof(t);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  139|      1|  OMPD_SIZEOF(__kmp_affinity_format)                                           \
  |  |  ------------------
  |  |  |  |   79|      1|  OMPD_FOREACH_SIZEOF(ompd_init_sizeof)
  |  |  |  |  ------------------
  |  |  |  |  |  |   78|      1|#define ompd_init_sizeof(t) ompd_sizeof__##t = sizeof(t);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  140|      1|  OMPD_SIZEOF(__kmp_tool_libraries)                                            \
  |  |  ------------------
  |  |  |  |   79|      1|  OMPD_FOREACH_SIZEOF(ompd_init_sizeof)
  |  |  |  |  ------------------
  |  |  |  |  |  |   78|      1|#define ompd_init_sizeof(t) ompd_sizeof__##t = sizeof(t);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  141|      1|  OMPD_SIZEOF(__kmp_tool_verbose_init)                                         \
  |  |  ------------------
  |  |  |  |   79|      1|  OMPD_FOREACH_SIZEOF(ompd_init_sizeof)
  |  |  |  |  ------------------
  |  |  |  |  |  |   78|      1|#define ompd_init_sizeof(t) ompd_sizeof__##t = sizeof(t);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  142|      1|  OMPD_SIZEOF(__kmp_tool)                                                      \
  |  |  ------------------
  |  |  |  |   79|      1|  OMPD_FOREACH_SIZEOF(ompd_init_sizeof)
  |  |  |  |  ------------------
  |  |  |  |  |  |   78|      1|#define ompd_init_sizeof(t) ompd_sizeof__##t = sizeof(t);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  143|      1|  OMPD_SIZEOF(ompd_state)                                                      \
  |  |  ------------------
  |  |  |  |   79|      1|  OMPD_FOREACH_SIZEOF(ompd_init_sizeof)
  |  |  |  |  ------------------
  |  |  |  |  |  |   78|      1|#define ompd_init_sizeof(t) ompd_sizeof__##t = sizeof(t);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  144|      1|  OMPD_SIZEOF(kmp_nested_nthreads_t)                                           \
  |  |  ------------------
  |  |  |  |   79|      1|  OMPD_FOREACH_SIZEOF(ompd_init_sizeof)
  |  |  |  |  ------------------
  |  |  |  |  |  |   78|      1|#define ompd_init_sizeof(t) ompd_sizeof__##t = sizeof(t);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      1|  OMPD_SIZEOF(__kmp_nested_nth)                                                \
  |  |  ------------------
  |  |  |  |   79|      1|  OMPD_FOREACH_SIZEOF(ompd_init_sizeof)
  |  |  |  |  ------------------
  |  |  |  |  |  |   78|      1|#define ompd_init_sizeof(t) ompd_sizeof__##t = sizeof(t);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  146|      1|  OMPD_SIZEOF(kmp_nested_proc_bind_t)                                          \
  |  |  ------------------
  |  |  |  |   79|      1|  OMPD_FOREACH_SIZEOF(ompd_init_sizeof)
  |  |  |  |  ------------------
  |  |  |  |  |  |   78|      1|#define ompd_init_sizeof(t) ompd_sizeof__##t = sizeof(t);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  147|      1|  OMPD_SIZEOF(__kmp_nested_proc_bind)                                          \
  |  |  ------------------
  |  |  |  |   79|      1|  OMPD_FOREACH_SIZEOF(ompd_init_sizeof)
  |  |  |  |  ------------------
  |  |  |  |  |  |   78|      1|#define ompd_init_sizeof(t) ompd_sizeof__##t = sizeof(t);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  148|      1|  OMPD_SIZEOF(int)                                                             \
  |  |  ------------------
  |  |  |  |   79|      1|  OMPD_FOREACH_SIZEOF(ompd_init_sizeof)
  |  |  |  |  ------------------
  |  |  |  |  |  |   78|      1|#define ompd_init_sizeof(t) ompd_sizeof__##t = sizeof(t);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  149|      1|  OMPD_SIZEOF(char)                                                            \
  |  |  ------------------
  |  |  |  |   79|      1|  OMPD_FOREACH_SIZEOF(ompd_init_sizeof)
  |  |  |  |  ------------------
  |  |  |  |  |  |   78|      1|#define ompd_init_sizeof(t) ompd_sizeof__##t = sizeof(t);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|      1|  OMPD_SIZEOF(__kmp_gtid)                                                      \
  |  |  ------------------
  |  |  |  |   79|      1|  OMPD_FOREACH_SIZEOF(ompd_init_sizeof)
  |  |  |  |  ------------------
  |  |  |  |  |  |   78|      1|#define ompd_init_sizeof(t) ompd_sizeof__##t = sizeof(t);
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  151|      1|  OMPD_SIZEOF(__kmp_nth)
  |  |  ------------------
  |  |  |  |   79|      1|  OMPD_FOREACH_SIZEOF(ompd_init_sizeof)
  |  |  |  |  ------------------
  |  |  |  |  |  |   78|      1|#define ompd_init_sizeof(t) ompd_sizeof__##t = sizeof(t);
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   80|      1|#undef ompd_init_sizeof
   81|       |
   82|      1|  char *libname = NULL;
   83|       |
   84|      1|#if KMP_OS_UNIX
   85|       |  // Find the location of libomp.so thru dladdr and replace the libomp with
   86|       |  // libompd to get the full path of libompd
   87|      1|  Dl_info dl_info;
   88|      1|  int ret = dladdr((void *)ompd_init, &dl_info);
   89|      1|  if (!ret) {
  ------------------
  |  Branch (89:7): [True: 0, False: 1]
  ------------------
   90|      0|    fprintf(stderr, "%s\n", dlerror());
   91|      0|  }
   92|      1|  int lib_path_length;
   93|      1|  if (strrchr(dl_info.dli_fname, '/')) {
  ------------------
  |  Branch (93:7): [True: 1, False: 0]
  ------------------
   94|      1|    lib_path_length = strrchr(dl_info.dli_fname, '/') - dl_info.dli_fname;
   95|      1|    libname =
   96|      1|        (char *)malloc(lib_path_length + 12 /*for '/libompd.so' and '\0'*/);
   97|      1|    strncpy(libname, dl_info.dli_fname, lib_path_length);
   98|      1|    memcpy(libname + lib_path_length, "/libompd.so\0", 12);
   99|      1|  }
  100|      1|#endif
  101|       |
  102|      1|  const char *ompd_env_var = getenv("OMP_DEBUG");
  103|      1|  if (ompd_env_var && !strcmp(ompd_env_var, "enabled")) {
  ------------------
  |  Branch (103:7): [True: 0, False: 1]
  |  Branch (103:23): [True: 0, False: 0]
  ------------------
  104|      0|    fprintf(stderr, "OMP_OMPD active\n");
  105|      0|    ompt_enabled.enabled = 1;
  106|      0|    ompd_state |= OMPD_ENABLE_BP;
  ------------------
  |  |   35|      0|#define OMPD_ENABLE_BP 0x1
  ------------------
  107|      0|  }
  108|       |
  109|      1|  ompd_initialized = 1;
  110|      1|  ompd_dll_locations = (volatile const char **)malloc(3 * sizeof(const char *));
  111|      1|  ompd_dll_locations[0] = "libompd.so";
  112|      1|  ompd_dll_locations[1] = libname;
  113|       |  ompd_dll_locations[2] = NULL;
  114|      1|  ompd_dll_locations_valid();
  115|      1|}
_Z24ompd_dll_locations_validv:
  117|      1|void __attribute__((noinline)) ompd_dll_locations_valid(void) {
  118|       |  /* naive way of implementing hard to opt-out empty function
  119|       |     we might want to use a separate object file? */
  120|      1|  asm("");
  121|      1|}

ompt_start_tool:
  161|      1|ompt_start_tool(unsigned int omp_version, const char *runtime_version) {
  162|      1|  ompt_start_tool_result_t *ret = NULL;
  163|       |  // Search next symbol in the current address space. This can happen if the
  164|       |  // runtime library is linked before the tool. Since glibc 2.2 strong symbols
  165|       |  // don't override weak symbols that have been found before unless the user
  166|       |  // sets the environment variable LD_DYNAMIC_WEAK.
  167|      1|  ompt_start_tool_t next_tool =
  168|      1|      (ompt_start_tool_t)dlsym(RTLD_NEXT, "ompt_start_tool");
  169|      1|  if (next_tool) {
  ------------------
  |  Branch (169:7): [True: 0, False: 1]
  ------------------
  170|      0|    ret = next_tool(omp_version, runtime_version);
  171|      0|  }
  172|      1|  return ret;
  173|      1|}
ompt_pre_init:
  392|      1|void ompt_pre_init() {
  393|       |  //--------------------------------------------------
  394|       |  // Execute the pre-initialization logic only once.
  395|       |  //--------------------------------------------------
  396|      1|  static int ompt_pre_initialized = 0;
  397|       |
  398|      1|  if (ompt_pre_initialized)
  ------------------
  |  Branch (398:7): [True: 0, False: 1]
  ------------------
  399|      0|    return;
  400|       |
  401|      1|  ompt_pre_initialized = 1;
  402|       |
  403|       |  //--------------------------------------------------
  404|       |  // Use a tool iff a tool is enabled and available.
  405|       |  //--------------------------------------------------
  406|      1|  const char *ompt_env_var = getenv("OMP_TOOL");
  407|      1|  tool_setting_e tool_setting = omp_tool_error;
  408|       |
  409|      1|  if (!ompt_env_var || !strcmp(ompt_env_var, ""))
  ------------------
  |  Branch (409:7): [True: 1, False: 0]
  |  Branch (409:24): [True: 0, False: 0]
  ------------------
  410|      1|    tool_setting = omp_tool_unset;
  411|      0|  else if (OMPT_STR_MATCH(ompt_env_var, "disabled"))
  ------------------
  |  |   77|      0|#define OMPT_STR_MATCH(haystack, needle) __kmp_str_match(haystack, 0, needle)
  |  |  ------------------
  |  |  |  Branch (77:42): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  412|      0|    tool_setting = omp_tool_disabled;
  413|      0|  else if (OMPT_STR_MATCH(ompt_env_var, "enabled"))
  ------------------
  |  |   77|      0|#define OMPT_STR_MATCH(haystack, needle) __kmp_str_match(haystack, 0, needle)
  |  |  ------------------
  |  |  |  Branch (77:42): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  414|      0|    tool_setting = omp_tool_enabled;
  415|       |
  416|      1|  const char *ompt_env_verbose_init = getenv("OMP_TOOL_VERBOSE_INIT");
  417|       |  // possible options: disabled | stdout | stderr | <filename>
  418|       |  // if set, not empty and not disabled -> prepare for logging
  419|      1|  if (ompt_env_verbose_init && strcmp(ompt_env_verbose_init, "") &&
  ------------------
  |  Branch (419:7): [True: 0, False: 1]
  |  Branch (419:32): [True: 0, False: 0]
  ------------------
  420|      0|      !OMPT_STR_MATCH(ompt_env_verbose_init, "disabled")) {
  ------------------
  |  |   77|      0|#define OMPT_STR_MATCH(haystack, needle) __kmp_str_match(haystack, 0, needle)
  ------------------
  |  Branch (420:7): [True: 0, False: 0]
  ------------------
  421|      0|    verbose_init = 1;
  422|      0|    if (OMPT_STR_MATCH(ompt_env_verbose_init, "STDERR"))
  ------------------
  |  |   77|      0|#define OMPT_STR_MATCH(haystack, needle) __kmp_str_match(haystack, 0, needle)
  |  |  ------------------
  |  |  |  Branch (77:42): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  423|      0|      verbose_file = stderr;
  424|      0|    else if (OMPT_STR_MATCH(ompt_env_verbose_init, "STDOUT"))
  ------------------
  |  |   77|      0|#define OMPT_STR_MATCH(haystack, needle) __kmp_str_match(haystack, 0, needle)
  |  |  ------------------
  |  |  |  Branch (77:42): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  425|      0|      verbose_file = stdout;
  426|      0|    else
  427|      0|      verbose_file = fopen(ompt_env_verbose_init, "w");
  428|      0|  } else
  429|      1|    verbose_init = 0;
  430|       |
  431|       |#if OMPT_DEBUG
  432|       |  printf("ompt_pre_init(): tool_setting = %d\n", tool_setting);
  433|       |#endif
  434|      1|  switch (tool_setting) {
  ------------------
  |  Branch (434:11): [True: 1, False: 0]
  ------------------
  435|      0|  case omp_tool_disabled:
  ------------------
  |  Branch (435:3): [True: 0, False: 1]
  ------------------
  436|      0|    OMPT_VERBOSE_INIT_PRINT("OMP tool disabled. \n");
  ------------------
  |  |   53|      0|  if (verbose_init)                                                            \
  |  |  ------------------
  |  |  |  Branch (53:7): [True: 0, False: 0]
  |  |  ------------------
  |  |   54|      0|  fprintf(verbose_file, __VA_ARGS__)
  ------------------
  437|      0|    break;
  438|       |
  439|      1|  case omp_tool_unset:
  ------------------
  |  Branch (439:3): [True: 1, False: 0]
  ------------------
  440|      1|  case omp_tool_enabled:
  ------------------
  |  Branch (440:3): [True: 0, False: 1]
  ------------------
  441|       |
  442|       |    //--------------------------------------------------
  443|       |    // Load tool iff specified in environment variable
  444|       |    //--------------------------------------------------
  445|      1|    ompt_start_tool_result =
  446|      1|        ompt_try_start_tool(__kmp_openmp_version, ompt_get_runtime_version());
  447|       |
  448|      1|    memset(&ompt_enabled, 0, sizeof(ompt_enabled));
  449|      1|    break;
  450|       |
  451|      0|  case omp_tool_error:
  ------------------
  |  Branch (451:3): [True: 0, False: 1]
  ------------------
  452|      0|    fprintf(stderr,
  453|      0|            "Warning: OMP_TOOL has invalid value \"%s\".\n"
  454|      0|            "  legal values are (NULL,\"\",\"disabled\","
  455|      0|            "\"enabled\").\n",
  456|      0|            ompt_env_var);
  457|      0|    break;
  458|      1|  }
  459|      1|  if (verbose_init && verbose_file != stderr && verbose_file != stdout)
  ------------------
  |  Branch (459:7): [True: 0, False: 1]
  |  Branch (459:23): [True: 0, False: 0]
  |  Branch (459:49): [True: 0, False: 0]
  ------------------
  460|      0|    fclose(verbose_file);
  461|       |#if OMPT_DEBUG
  462|       |  printf("ompt_pre_init(): ompt_enabled = %d\n", ompt_enabled.enabled);
  463|       |#endif
  464|      1|}
ompt_post_init:
  468|      1|void ompt_post_init() {
  469|       |  //--------------------------------------------------
  470|       |  // Execute the post-initialization logic only once.
  471|       |  //--------------------------------------------------
  472|      1|  static int ompt_post_initialized = 0;
  473|       |
  474|      1|  if (ompt_post_initialized)
  ------------------
  |  Branch (474:7): [True: 0, False: 1]
  ------------------
  475|      0|    return;
  476|       |
  477|      1|  ompt_post_initialized = 1;
  478|       |
  479|       |  //--------------------------------------------------
  480|       |  // Initialize the tool if so indicated.
  481|       |  //--------------------------------------------------
  482|      1|  if (ompt_start_tool_result) {
  ------------------
  |  Branch (482:7): [True: 0, False: 1]
  ------------------
  483|      0|    ompt_enabled.enabled = !!ompt_start_tool_result->initialize(
  484|      0|        ompt_fn_lookup, omp_get_initial_device(),
  485|      0|        &(ompt_start_tool_result->tool_data));
  486|       |
  487|      0|    if (!ompt_enabled.enabled) {
  ------------------
  |  Branch (487:9): [True: 0, False: 0]
  ------------------
  488|       |      // tool not enabled, zero out the bitmap, and done
  489|      0|      memset(&ompt_enabled, 0, sizeof(ompt_enabled));
  490|      0|      return;
  491|      0|    }
  492|       |
  493|      0|    kmp_info_t *root_thread = ompt_get_thread();
  494|       |
  495|      0|    ompt_set_thread_state(root_thread, ompt_state_overhead);
  496|       |
  497|      0|    if (ompt_enabled.ompt_callback_thread_begin) {
  ------------------
  |  Branch (497:9): [True: 0, False: 0]
  ------------------
  498|      0|      ompt_callbacks.ompt_callback(ompt_callback_thread_begin)(
  ------------------
  |  |   27|      0|#define ompt_callback(e) e##_callback
  ------------------
  499|      0|          ompt_thread_initial, __ompt_get_thread_data_internal());
  500|      0|    }
  501|      0|    ompt_data_t *task_data = nullptr;
  502|      0|    ompt_data_t *parallel_data = nullptr;
  503|      0|    __ompt_get_task_info_internal(0, NULL, &task_data, NULL, &parallel_data,
  504|      0|                                  NULL);
  505|      0|    if (ompt_enabled.ompt_callback_implicit_task) {
  ------------------
  |  Branch (505:9): [True: 0, False: 0]
  ------------------
  506|      0|      ompt_callbacks.ompt_callback(ompt_callback_implicit_task)(
  ------------------
  |  |   27|      0|#define ompt_callback(e) e##_callback
  ------------------
  507|      0|          ompt_scope_begin, parallel_data, task_data, 1, 1, ompt_task_initial);
  508|      0|    }
  509|       |
  510|      0|    ompt_set_thread_state(root_thread, ompt_state_work_serial);
  511|      0|  }
  512|      1|}
ompt_fini:
  514|      1|void ompt_fini() {
  515|      1|  if (ompt_enabled.enabled) {
  ------------------
  |  Branch (515:7): [True: 0, False: 1]
  ------------------
  516|      0|    if (ompt_start_tool_result && ompt_start_tool_result->finalize) {
  ------------------
  |  Branch (516:9): [True: 0, False: 0]
  |  Branch (516:35): [True: 0, False: 0]
  ------------------
  517|      0|      ompt_start_tool_result->finalize(&(ompt_start_tool_result->tool_data));
  518|      0|    }
  519|      0|    if (libomptarget_ompt_result && libomptarget_ompt_result->finalize) {
  ------------------
  |  Branch (519:9): [True: 0, False: 0]
  |  Branch (519:37): [True: 0, False: 0]
  ------------------
  520|      0|      libomptarget_ompt_result->finalize(NULL);
  521|      0|    }
  522|      0|  }
  523|       |
  524|      1|  if (ompt_tool_module)
  ------------------
  |  Branch (524:7): [True: 0, False: 1]
  ------------------
  525|      0|    OMPT_DLCLOSE(ompt_tool_module);
  ------------------
  |  |  110|      0|#define OMPT_DLCLOSE(Lib) dlclose(Lib)
  ------------------
  526|      1|  memset(&ompt_enabled, 0, sizeof(ompt_enabled));
  527|      1|}
ompt-general.cpp:_ZL19ompt_try_start_tooljPKc:
  248|      1|ompt_try_start_tool(unsigned int omp_version, const char *runtime_version) {
  249|      1|  ompt_start_tool_result_t *ret = NULL;
  250|      1|  ompt_start_tool_t start_tool = NULL;
  251|       |#if KMP_OS_WINDOWS
  252|       |  // Cannot use colon to describe a list of absolute paths on Windows
  253|       |  const char *sep = ";";
  254|       |#else
  255|      1|  const char *sep = ":";
  256|      1|#endif
  257|       |
  258|      1|  OMPT_VERBOSE_INIT_PRINT("----- START LOGGING OF TOOL REGISTRATION -----\n");
  ------------------
  |  |   53|      1|  if (verbose_init)                                                            \
  |  |  ------------------
  |  |  |  Branch (53:7): [True: 0, False: 1]
  |  |  ------------------
  |  |   54|      1|  fprintf(verbose_file, __VA_ARGS__)
  ------------------
  259|      1|  OMPT_VERBOSE_INIT_PRINT("Search for OMP tool in current address space... ");
  ------------------
  |  |   53|      1|  if (verbose_init)                                                            \
  |  |  ------------------
  |  |  |  Branch (53:7): [True: 0, False: 1]
  |  |  ------------------
  |  |   54|      1|  fprintf(verbose_file, __VA_ARGS__)
  ------------------
  260|       |
  261|       |#if KMP_OS_DARWIN
  262|       |  // Try in the current address space
  263|       |  ret = ompt_tool_darwin(omp_version, runtime_version);
  264|       |#elif OMPT_HAVE_WEAK_ATTRIBUTE
  265|       |  ret = ompt_start_tool(omp_version, runtime_version);
  266|       |#elif OMPT_HAVE_PSAPI
  267|       |  ret = ompt_tool_windows(omp_version, runtime_version);
  268|       |#else
  269|       |#error Activation of OMPT is not supported on this platform.
  270|       |#endif
  271|      1|  if (ret) {
  ------------------
  |  Branch (271:7): [True: 0, False: 1]
  ------------------
  272|      0|    OMPT_VERBOSE_INIT_CONTINUED_PRINT("Success.\n");
  ------------------
  |  |   56|      0|  if (verbose_init)                                                            \
  |  |  ------------------
  |  |  |  Branch (56:7): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|  fprintf(verbose_file, __VA_ARGS__)
  ------------------
  273|      0|    OMPT_VERBOSE_INIT_PRINT(
  ------------------
  |  |   53|      0|  if (verbose_init)                                                            \
  |  |  ------------------
  |  |  |  Branch (53:7): [True: 0, False: 0]
  |  |  ------------------
  |  |   54|      0|  fprintf(verbose_file, __VA_ARGS__)
  ------------------
  274|      0|        "Tool was started and is using the OMPT interface.\n");
  275|      0|    OMPT_VERBOSE_INIT_PRINT("----- END LOGGING OF TOOL REGISTRATION -----\n");
  ------------------
  |  |   53|      0|  if (verbose_init)                                                            \
  |  |  ------------------
  |  |  |  Branch (53:7): [True: 0, False: 0]
  |  |  ------------------
  |  |   54|      0|  fprintf(verbose_file, __VA_ARGS__)
  ------------------
  276|      0|    return ret;
  277|      0|  }
  278|       |
  279|       |  // Try tool-libraries-var ICV
  280|      1|  OMPT_VERBOSE_INIT_CONTINUED_PRINT("Failed.\n");
  ------------------
  |  |   56|      1|  if (verbose_init)                                                            \
  |  |  ------------------
  |  |  |  Branch (56:7): [True: 0, False: 1]
  |  |  ------------------
  |  |   57|      1|  fprintf(verbose_file, __VA_ARGS__)
  ------------------
  281|      1|  const char *tool_libs = getenv("OMP_TOOL_LIBRARIES");
  282|      1|  if (tool_libs) {
  ------------------
  |  Branch (282:7): [True: 0, False: 1]
  ------------------
  283|      0|    OMPT_VERBOSE_INIT_PRINT("Searching tool libraries...\n");
  ------------------
  |  |   53|      0|  if (verbose_init)                                                            \
  |  |  ------------------
  |  |  |  Branch (53:7): [True: 0, False: 0]
  |  |  ------------------
  |  |   54|      0|  fprintf(verbose_file, __VA_ARGS__)
  ------------------
  284|      0|    OMPT_VERBOSE_INIT_PRINT("OMP_TOOL_LIBRARIES = %s\n", tool_libs);
  ------------------
  |  |   53|      0|  if (verbose_init)                                                            \
  |  |  ------------------
  |  |  |  Branch (53:7): [True: 0, False: 0]
  |  |  ------------------
  |  |   54|      0|  fprintf(verbose_file, __VA_ARGS__)
  ------------------
  285|      0|    char *libs = __kmp_str_format("%s", tool_libs);
  286|      0|    char *buf;
  287|      0|    char *fname = __kmp_str_token(libs, sep, &buf);
  288|       |    // Reset dl-error
  289|      0|    dlerror();
  290|       |
  291|      0|    while (fname) {
  ------------------
  |  Branch (291:12): [True: 0, False: 0]
  ------------------
  292|      0|#if KMP_OS_UNIX
  293|      0|      OMPT_VERBOSE_INIT_PRINT("Opening %s... ", fname);
  ------------------
  |  |   53|      0|  if (verbose_init)                                                            \
  |  |  ------------------
  |  |  |  Branch (53:7): [True: 0, False: 0]
  |  |  ------------------
  |  |   54|      0|  fprintf(verbose_file, __VA_ARGS__)
  ------------------
  294|      0|      void *h = dlopen(fname, RTLD_LAZY);
  295|      0|      if (!h) {
  ------------------
  |  Branch (295:11): [True: 0, False: 0]
  ------------------
  296|      0|        OMPT_VERBOSE_INIT_CONTINUED_PRINT("Failed: %s\n", dlerror());
  ------------------
  |  |   56|      0|  if (verbose_init)                                                            \
  |  |  ------------------
  |  |  |  Branch (56:7): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|  fprintf(verbose_file, __VA_ARGS__)
  ------------------
  297|      0|      } else {
  298|      0|        OMPT_VERBOSE_INIT_CONTINUED_PRINT("Success. \n");
  ------------------
  |  |   56|      0|  if (verbose_init)                                                            \
  |  |  ------------------
  |  |  |  Branch (56:7): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|  fprintf(verbose_file, __VA_ARGS__)
  ------------------
  299|      0|        OMPT_VERBOSE_INIT_PRINT("Searching for ompt_start_tool in %s... ",
  ------------------
  |  |   53|      0|  if (verbose_init)                                                            \
  |  |  ------------------
  |  |  |  Branch (53:7): [True: 0, False: 0]
  |  |  ------------------
  |  |   54|      0|  fprintf(verbose_file, __VA_ARGS__)
  ------------------
  300|      0|                                fname);
  301|      0|        dlerror(); // Clear any existing error
  302|      0|        start_tool = (ompt_start_tool_t)dlsym(h, "ompt_start_tool");
  303|      0|        if (!start_tool) {
  ------------------
  |  Branch (303:13): [True: 0, False: 0]
  ------------------
  304|      0|          char *error = dlerror();
  305|      0|          if (error != NULL) {
  ------------------
  |  Branch (305:15): [True: 0, False: 0]
  ------------------
  306|      0|            OMPT_VERBOSE_INIT_CONTINUED_PRINT("Failed: %s\n", error);
  ------------------
  |  |   56|      0|  if (verbose_init)                                                            \
  |  |  ------------------
  |  |  |  Branch (56:7): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|  fprintf(verbose_file, __VA_ARGS__)
  ------------------
  307|      0|          } else {
  308|      0|            OMPT_VERBOSE_INIT_CONTINUED_PRINT("Failed: %s\n",
  ------------------
  |  |   56|      0|  if (verbose_init)                                                            \
  |  |  ------------------
  |  |  |  Branch (56:7): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|  fprintf(verbose_file, __VA_ARGS__)
  ------------------
  309|      0|                                              "ompt_start_tool = NULL");
  310|      0|          }
  311|      0|        } else
  312|       |#elif KMP_OS_WINDOWS
  313|       |      OMPT_VERBOSE_INIT_PRINT("Opening %s... ", fname);
  314|       |      HMODULE h = LoadLibrary(fname);
  315|       |      if (!h) {
  316|       |        OMPT_VERBOSE_INIT_CONTINUED_PRINT("Failed: Error %u\n",
  317|       |                                          (unsigned)GetLastError());
  318|       |      } else {
  319|       |        OMPT_VERBOSE_INIT_CONTINUED_PRINT("Success. \n");
  320|       |        OMPT_VERBOSE_INIT_PRINT("Searching for ompt_start_tool in %s... ",
  321|       |                                fname);
  322|       |        start_tool = (ompt_start_tool_t)GetProcAddress(h, "ompt_start_tool");
  323|       |        if (!start_tool) {
  324|       |          OMPT_VERBOSE_INIT_CONTINUED_PRINT("Failed: Error %u\n",
  325|       |                                            (unsigned)GetLastError());
  326|       |        } else
  327|       |#else
  328|       |#error Activation of OMPT is not supported on this platform.
  329|       |#endif
  330|      0|        { // if (start_tool)
  331|      0|          ret = (*start_tool)(omp_version, runtime_version);
  332|      0|          if (ret) {
  ------------------
  |  Branch (332:15): [True: 0, False: 0]
  ------------------
  333|      0|            OMPT_VERBOSE_INIT_CONTINUED_PRINT("Success.\n");
  ------------------
  |  |   56|      0|  if (verbose_init)                                                            \
  |  |  ------------------
  |  |  |  Branch (56:7): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|  fprintf(verbose_file, __VA_ARGS__)
  ------------------
  334|      0|            OMPT_VERBOSE_INIT_PRINT(
  ------------------
  |  |   53|      0|  if (verbose_init)                                                            \
  |  |  ------------------
  |  |  |  Branch (53:7): [True: 0, False: 0]
  |  |  ------------------
  |  |   54|      0|  fprintf(verbose_file, __VA_ARGS__)
  ------------------
  335|      0|                "Tool was started and is using the OMPT interface.\n");
  336|      0|            ompt_tool_module = h;
  337|      0|            break;
  338|      0|          }
  339|      0|          OMPT_VERBOSE_INIT_CONTINUED_PRINT(
  ------------------
  |  |   56|      0|  if (verbose_init)                                                            \
  |  |  ------------------
  |  |  |  Branch (56:7): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|  fprintf(verbose_file, __VA_ARGS__)
  ------------------
  340|      0|              "Found but not using the OMPT interface.\n");
  341|      0|          OMPT_VERBOSE_INIT_PRINT("Continuing search...\n");
  ------------------
  |  |   53|      0|  if (verbose_init)                                                            \
  |  |  ------------------
  |  |  |  Branch (53:7): [True: 0, False: 0]
  |  |  ------------------
  |  |   54|      0|  fprintf(verbose_file, __VA_ARGS__)
  ------------------
  342|      0|        }
  343|      0|        OMPT_DLCLOSE(h);
  ------------------
  |  |  110|      0|#define OMPT_DLCLOSE(Lib) dlclose(Lib)
  ------------------
  344|      0|      }
  345|      0|      fname = __kmp_str_token(NULL, sep, &buf);
  346|      0|    }
  347|      0|    __kmp_str_free(&libs);
  348|      1|  } else {
  349|      1|    OMPT_VERBOSE_INIT_PRINT("No OMP_TOOL_LIBRARIES defined.\n");
  ------------------
  |  |   53|      1|  if (verbose_init)                                                            \
  |  |  ------------------
  |  |  |  Branch (53:7): [True: 0, False: 1]
  |  |  ------------------
  |  |   54|      1|  fprintf(verbose_file, __VA_ARGS__)
  ------------------
  350|      1|  }
  351|       |
  352|       |  // usable tool found in tool-libraries
  353|      1|  if (ret) {
  ------------------
  |  Branch (353:7): [True: 0, False: 1]
  ------------------
  354|      0|    OMPT_VERBOSE_INIT_PRINT("----- END LOGGING OF TOOL REGISTRATION -----\n");
  ------------------
  |  |   53|      0|  if (verbose_init)                                                            \
  |  |  ------------------
  |  |  |  Branch (53:7): [True: 0, False: 0]
  |  |  ------------------
  |  |   54|      0|  fprintf(verbose_file, __VA_ARGS__)
  ------------------
  355|      0|    return ret;
  356|      0|  }
  357|       |
  358|      1|#if KMP_OS_UNIX
  359|      1|  { // Non-standard: load archer tool if application is built with TSan
  360|      1|    const char *fname = "libarcher.so";
  361|      1|    OMPT_VERBOSE_INIT_PRINT(
  ------------------
  |  |   53|      1|  if (verbose_init)                                                            \
  |  |  ------------------
  |  |  |  Branch (53:7): [True: 0, False: 1]
  |  |  ------------------
  |  |   54|      1|  fprintf(verbose_file, __VA_ARGS__)
  ------------------
  362|      1|        "...searching tool libraries failed. Using archer tool.\n");
  363|      1|    OMPT_VERBOSE_INIT_PRINT("Opening %s... ", fname);
  ------------------
  |  |   53|      1|  if (verbose_init)                                                            \
  |  |  ------------------
  |  |  |  Branch (53:7): [True: 0, False: 1]
  |  |  ------------------
  |  |   54|      1|  fprintf(verbose_file, __VA_ARGS__)
  ------------------
  364|      1|    void *h = dlopen(fname, RTLD_LAZY);
  365|      1|    if (h) {
  ------------------
  |  Branch (365:9): [True: 0, False: 1]
  ------------------
  366|      0|      OMPT_VERBOSE_INIT_CONTINUED_PRINT("Success.\n");
  ------------------
  |  |   56|      0|  if (verbose_init)                                                            \
  |  |  ------------------
  |  |  |  Branch (56:7): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|  fprintf(verbose_file, __VA_ARGS__)
  ------------------
  367|      0|      OMPT_VERBOSE_INIT_PRINT("Searching for ompt_start_tool in %s... ", fname);
  ------------------
  |  |   53|      0|  if (verbose_init)                                                            \
  |  |  ------------------
  |  |  |  Branch (53:7): [True: 0, False: 0]
  |  |  ------------------
  |  |   54|      0|  fprintf(verbose_file, __VA_ARGS__)
  ------------------
  368|      0|      start_tool = (ompt_start_tool_t)dlsym(h, "ompt_start_tool");
  369|      0|      if (start_tool) {
  ------------------
  |  Branch (369:11): [True: 0, False: 0]
  ------------------
  370|      0|        ret = (*start_tool)(omp_version, runtime_version);
  371|      0|        if (ret) {
  ------------------
  |  Branch (371:13): [True: 0, False: 0]
  ------------------
  372|      0|          OMPT_VERBOSE_INIT_CONTINUED_PRINT("Success.\n");
  ------------------
  |  |   56|      0|  if (verbose_init)                                                            \
  |  |  ------------------
  |  |  |  Branch (56:7): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|  fprintf(verbose_file, __VA_ARGS__)
  ------------------
  373|      0|          OMPT_VERBOSE_INIT_PRINT(
  ------------------
  |  |   53|      0|  if (verbose_init)                                                            \
  |  |  ------------------
  |  |  |  Branch (53:7): [True: 0, False: 0]
  |  |  ------------------
  |  |   54|      0|  fprintf(verbose_file, __VA_ARGS__)
  ------------------
  374|      0|              "Tool was started and is using the OMPT interface.\n");
  375|      0|          OMPT_VERBOSE_INIT_PRINT(
  ------------------
  |  |   53|      0|  if (verbose_init)                                                            \
  |  |  ------------------
  |  |  |  Branch (53:7): [True: 0, False: 0]
  |  |  ------------------
  |  |   54|      0|  fprintf(verbose_file, __VA_ARGS__)
  ------------------
  376|      0|              "----- END LOGGING OF TOOL REGISTRATION -----\n");
  377|      0|          return ret;
  378|      0|        }
  379|      0|        OMPT_VERBOSE_INIT_CONTINUED_PRINT(
  ------------------
  |  |   56|      0|  if (verbose_init)                                                            \
  |  |  ------------------
  |  |  |  Branch (56:7): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|  fprintf(verbose_file, __VA_ARGS__)
  ------------------
  380|      0|            "Found but not using the OMPT interface.\n");
  381|      0|      } else {
  382|      0|        OMPT_VERBOSE_INIT_CONTINUED_PRINT("Failed: %s\n", dlerror());
  ------------------
  |  |   56|      0|  if (verbose_init)                                                            \
  |  |  ------------------
  |  |  |  Branch (56:7): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|  fprintf(verbose_file, __VA_ARGS__)
  ------------------
  383|      0|      }
  384|      0|    }
  385|      1|  }
  386|      1|#endif
  387|      1|  OMPT_VERBOSE_INIT_PRINT("No OMP tool loaded.\n");
  ------------------
  |  |   53|      1|  if (verbose_init)                                                            \
  |  |  ------------------
  |  |  |  Branch (53:7): [True: 0, False: 1]
  |  |  ------------------
  |  |   54|      1|  fprintf(verbose_file, __VA_ARGS__)
  ------------------
  388|      1|  OMPT_VERBOSE_INIT_PRINT("----- END LOGGING OF TOOL REGISTRATION -----\n");
  ------------------
  |  |   53|      1|  if (verbose_init)                                                            \
  |  |  ------------------
  |  |  |  Branch (53:7): [True: 0, False: 1]
  |  |  ------------------
  |  |   54|      1|  fprintf(verbose_file, __VA_ARGS__)
  ------------------
  389|      1|  return ret;
  390|      1|}

_Z29__ompt_get_task_info_internaliPiPP11ompt_data_tPP12ompt_frame_tS2_S_:
  361|      1|                                  int *thread_num) {
  362|      1|  if (__kmp_get_gtid() < 0)
  ------------------
  |  | 3466|      1|#define __kmp_get_gtid() __kmp_get_global_thread_id()
  ------------------
  |  Branch (362:7): [True: 0, False: 1]
  ------------------
  363|      0|    return 0;
  364|       |
  365|      1|  if (ancestor_level < 0)
  ------------------
  |  Branch (365:7): [True: 0, False: 1]
  ------------------
  366|      0|    return 0;
  367|       |
  368|       |  // copied from __ompt_get_scheduling_taskinfo
  369|      1|  ompt_task_info_t *info = NULL;
  370|      1|  ompt_team_info_t *team_info = NULL;
  371|      1|  kmp_info_t *thr = ompt_get_thread();
  372|      1|  int level = ancestor_level;
  373|       |
  374|      1|  if (thr) {
  ------------------
  |  Branch (374:7): [True: 1, False: 0]
  ------------------
  375|      1|    kmp_taskdata_t *taskdata = thr->th.th_current_task;
  376|      1|    if (taskdata == NULL)
  ------------------
  |  Branch (376:9): [True: 0, False: 1]
  ------------------
  377|      0|      return 0;
  378|      1|    kmp_team *team = thr->th.th_team, *prev_team = NULL;
  379|      1|    if (team == NULL)
  ------------------
  |  Branch (379:9): [True: 0, False: 1]
  ------------------
  380|      0|      return 0;
  381|      1|    ompt_lw_taskteam_t *lwt = NULL,
  382|      1|                       *next_lwt = LWT_FROM_TEAM(taskdata->td_team);
  ------------------
  |  |   36|      1|#define LWT_FROM_TEAM(team) (team)->t.ompt_serialized_team_info
  ------------------
  383|       |
  384|      1|    while (ancestor_level > 0) {
  ------------------
  |  Branch (384:12): [True: 0, False: 1]
  ------------------
  385|       |      // next lightweight team (if any)
  386|      0|      if (lwt)
  ------------------
  |  Branch (386:11): [True: 0, False: 0]
  ------------------
  387|      0|        lwt = lwt->parent;
  388|       |
  389|       |      // next heavyweight team (if any) after
  390|       |      // lightweight teams are exhausted
  391|      0|      if (!lwt && taskdata) {
  ------------------
  |  Branch (391:11): [True: 0, False: 0]
  |  Branch (391:19): [True: 0, False: 0]
  ------------------
  392|       |        // first try scheduling parent (for explicit task scheduling)
  393|      0|        if (taskdata->ompt_task_info.scheduling_parent) {
  ------------------
  |  Branch (393:13): [True: 0, False: 0]
  ------------------
  394|      0|          taskdata = taskdata->ompt_task_info.scheduling_parent;
  395|      0|        } else if (next_lwt) {
  ------------------
  |  Branch (395:20): [True: 0, False: 0]
  ------------------
  396|      0|          lwt = next_lwt;
  397|      0|          next_lwt = NULL;
  398|      0|        } else {
  399|       |          // then go for implicit tasks
  400|      0|          taskdata = taskdata->td_parent;
  401|      0|          if (team == NULL)
  ------------------
  |  Branch (401:15): [True: 0, False: 0]
  ------------------
  402|      0|            return 0;
  403|      0|          prev_team = team;
  404|      0|          team = team->t.t_parent;
  405|      0|          if (taskdata) {
  ------------------
  |  Branch (405:15): [True: 0, False: 0]
  ------------------
  406|      0|            next_lwt = LWT_FROM_TEAM(taskdata->td_team);
  ------------------
  |  |   36|      0|#define LWT_FROM_TEAM(team) (team)->t.ompt_serialized_team_info
  ------------------
  407|      0|          }
  408|      0|        }
  409|      0|      }
  410|      0|      ancestor_level--;
  411|      0|    }
  412|       |
  413|      1|    if (lwt) {
  ------------------
  |  Branch (413:9): [True: 0, False: 1]
  ------------------
  414|      0|      info = &lwt->ompt_task_info;
  415|      0|      team_info = &lwt->ompt_team_info;
  416|      0|      if (type) {
  ------------------
  |  Branch (416:11): [True: 0, False: 0]
  ------------------
  417|      0|        *type = ompt_task_implicit;
  418|      0|      }
  419|      1|    } else if (taskdata) {
  ------------------
  |  Branch (419:16): [True: 1, False: 0]
  ------------------
  420|      1|      info = &taskdata->ompt_task_info;
  421|      1|      team_info = &team->t.ompt_team_info;
  422|      1|      if (type) {
  ------------------
  |  Branch (422:11): [True: 0, False: 1]
  ------------------
  423|      0|        if (taskdata->td_parent) {
  ------------------
  |  Branch (423:13): [True: 0, False: 0]
  ------------------
  424|      0|          *type = (taskdata->td_flags.tasktype ? ompt_task_explicit
  ------------------
  |  Branch (424:20): [True: 0, False: 0]
  ------------------
  425|      0|                                               : ompt_task_implicit) |
  426|      0|                  TASK_TYPE_DETAILS_FORMAT(taskdata);
  ------------------
  |  |   48|      0|  ((info->td_flags.task_serial || info->td_flags.tasking_ser)                  \
  |  |  ------------------
  |  |  |  Branch (48:5): [True: 0, False: 0]
  |  |  |  Branch (48:35): [True: 0, False: 0]
  |  |  ------------------
  |  |   49|      0|       ? ompt_task_undeferred                                                  \
  |  |   50|      0|       : 0x0) |                                                                \
  |  |   51|      0|      ((!(info->td_flags.tiedness)) ? ompt_task_untied : 0x0) |                \
  |  |  ------------------
  |  |  |  Branch (51:8): [True: 0, False: 0]
  |  |  ------------------
  |  |   52|      0|      (info->td_flags.final ? ompt_task_final : 0x0) |                         \
  |  |  ------------------
  |  |  |  Branch (52:8): [True: 0, False: 0]
  |  |  ------------------
  |  |   53|      0|      (info->td_flags.merged_if0 ? ompt_task_mergeable : 0x0)
  |  |  ------------------
  |  |  |  Branch (53:8): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  427|      0|        } else {
  428|      0|          *type = ompt_task_initial;
  429|      0|        }
  430|      0|      }
  431|      1|    }
  432|      1|    if (task_data) {
  ------------------
  |  Branch (432:9): [True: 1, False: 0]
  ------------------
  433|      1|      *task_data = info ? &info->task_data : NULL;
  ------------------
  |  Branch (433:20): [True: 1, False: 0]
  ------------------
  434|      1|    }
  435|      1|    if (task_frame) {
  ------------------
  |  Branch (435:9): [True: 0, False: 1]
  ------------------
  436|       |      // OpenMP spec asks for the scheduling task to be returned.
  437|      0|      *task_frame = info ? &info->frame : NULL;
  ------------------
  |  Branch (437:21): [True: 0, False: 0]
  ------------------
  438|      0|    }
  439|      1|    if (parallel_data) {
  ------------------
  |  Branch (439:9): [True: 1, False: 0]
  ------------------
  440|      1|      *parallel_data = team_info ? &(team_info->parallel_data) : NULL;
  ------------------
  |  Branch (440:24): [True: 1, False: 0]
  ------------------
  441|      1|    }
  442|      1|    if (thread_num) {
  ------------------
  |  Branch (442:9): [True: 0, False: 1]
  ------------------
  443|      0|      if (level == 0)
  ------------------
  |  Branch (443:11): [True: 0, False: 0]
  ------------------
  444|      0|        *thread_num = __kmp_get_tid();
  ------------------
  |  | 3468|      0|#define __kmp_get_tid() (__kmp_tid_from_gtid(__kmp_get_gtid()))
  |  |  ------------------
  |  |  |  | 3466|      0|#define __kmp_get_gtid() __kmp_get_global_thread_id()
  |  |  ------------------
  ------------------
  445|      0|      else if (lwt)
  ------------------
  |  Branch (445:16): [True: 0, False: 0]
  ------------------
  446|      0|        *thread_num = 0;
  447|      0|      else if (!prev_team) {
  ------------------
  |  Branch (447:16): [True: 0, False: 0]
  ------------------
  448|       |        // The innermost parallel region contains at least one explicit task.
  449|       |        // The task at level > 0 is either an implicit task that
  450|       |        // corresponds to the mentioned region or one of the explicit tasks
  451|       |        // nested inside the same region. Note that the task isn't the
  452|       |        // innermost explicit tasks (because of condition level > 0).
  453|       |        // Since the task at this level still belongs to the innermost parallel
  454|       |        // region, thread_num is determined the same way as for level==0.
  455|      0|        *thread_num = __kmp_get_tid();
  ------------------
  |  | 3468|      0|#define __kmp_get_tid() (__kmp_tid_from_gtid(__kmp_get_gtid()))
  |  |  ------------------
  |  |  |  | 3466|      0|#define __kmp_get_gtid() __kmp_get_global_thread_id()
  |  |  ------------------
  ------------------
  456|      0|      } else
  457|      0|        *thread_num = prev_team->t.t_master_tid;
  458|       |      //        *thread_num = team->t.t_master_tid;
  459|      0|    }
  460|      1|    return info ? 2 : 0;
  ------------------
  |  Branch (460:12): [True: 1, False: 0]
  ------------------
  461|      1|  }
  462|      0|  return 0;
  463|      1|}
_Z21__ompt_team_assign_idP8kmp_team11ompt_data_t:
  501|  1.38k|void __ompt_team_assign_id(kmp_team_t *team, ompt_data_t ompt_pid) {
  502|  1.38k|  team->t.ompt_team_info.parallel_data = ompt_pid;
  503|  1.38k|}

_ZN22OmptReturnAddressGuardC2EiPv:
  139|   153k|  OmptReturnAddressGuard(int Gtid, void *ReturnAddress) : Gtid(Gtid) {
  140|   153k|    if (ompt_enabled.enabled && Gtid >= 0 && __kmp_threads[Gtid] &&
  ------------------
  |  Branch (140:9): [True: 0, False: 153k]
  |  Branch (140:33): [True: 0, False: 0]
  |  Branch (140:46): [True: 0, False: 0]
  ------------------
  141|      0|        !__kmp_threads[Gtid]->th.ompt_thread_info.return_address) {
  ------------------
  |  Branch (141:9): [True: 0, False: 0]
  ------------------
  142|      0|      SetAddress = true;
  143|      0|      __kmp_threads[Gtid]->th.ompt_thread_info.return_address = ReturnAddress;
  144|      0|    }
  145|   153k|  }
_ZN22OmptReturnAddressGuardD2Ev:
  146|   152k|  ~OmptReturnAddressGuard() {
  147|   152k|    if (SetAddress)
  ------------------
  |  Branch (147:9): [True: 0, False: 152k]
  ------------------
  148|      0|      __kmp_threads[Gtid]->th.ompt_thread_info.return_address = NULL;
  149|   152k|  }
_Z26__ompt_load_return_addressi:
   79|   115k|inline void *__ompt_load_return_address(int gtid) {
   80|   115k|  kmp_info_t *thr = __kmp_threads[gtid];
   81|   115k|  void *return_address = thr->th.ompt_thread_info.return_address;
   82|       |  thr->th.ompt_thread_info.return_address = NULL;
   83|   115k|  return return_address;
   84|   115k|}
_Z20ompt_get_thread_gtidi:
  115|      1|inline kmp_info_t *ompt_get_thread_gtid(int gtid) {
  116|      1|  return (gtid >= 0) ? __kmp_thread_from_gtid(gtid) : NULL;
  ------------------
  |  Branch (116:10): [True: 1, False: 0]
  ------------------
  117|      1|}
_Z15ompt_get_threadv:
  119|      1|inline kmp_info_t *ompt_get_thread() {
  120|      1|  int gtid = __kmp_get_gtid();
  ------------------
  |  | 3466|      1|#define __kmp_get_gtid() __kmp_get_global_thread_id()
  ------------------
  121|      1|  return ompt_get_thread_gtid(gtid);
  122|      1|}
_Z24ompt_get_runtime_versionv:
  129|      1|inline const char *ompt_get_runtime_version() {
  130|      1|  return &__kmp_version_lib_ver[KMP_VERSION_MAGIC_LEN];
  ------------------
  |  |   32|      1|#define KMP_VERSION_MAGIC_LEN 6 // Length of KMP_VERSION_MAGIC_STR.
  ------------------
  131|      1|}

__kmp_affinity_bind_thread:
  109|     32|void __kmp_affinity_bind_thread(int which) {
  110|     32|  KMP_ASSERT2(KMP_AFFINITY_CAPABLE(),
  ------------------
  |  |   53|     32|#define KMP_ASSERT2(cond, msg) KMP_ASSERT(cond)
  |  |  ------------------
  |  |  |  |   50|     32|  if (!(cond)) {                                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (50:7): [True: 0, False: 32]
  |  |  |  |  ------------------
  |  |  |  |   51|      0|    __kmp_debug_assert("assertion failure", __FILE__, __LINE__);               \
  |  |  |  |   52|      0|  }
  |  |  ------------------
  ------------------
  111|     32|              "Illegal set affinity operation when not capable");
  112|       |
  113|     32|  kmp_affin_mask_t *mask;
  114|     32|  KMP_CPU_ALLOC_ON_STACK(mask);
  ------------------
  |  |  699|     32|#define KMP_CPU_ALLOC_ON_STACK(ptr) KMP_CPU_ALLOC(ptr)
  |  |  ------------------
  |  |  |  |  697|     32|#define KMP_CPU_ALLOC(ptr) (ptr = __kmp_affinity_dispatch->allocate_mask())
  |  |  ------------------
  ------------------
  115|     32|  KMP_CPU_ZERO(mask);
  ------------------
  |  |  692|     32|#define KMP_CPU_ZERO(mask) (mask)->zero()
  ------------------
  116|     32|  KMP_CPU_SET(which, mask);
  ------------------
  |  |  689|     32|#define KMP_CPU_SET(i, mask) (mask)->set(i)
  ------------------
  117|     32|  __kmp_set_system_affinity(mask, TRUE);
  ------------------
  |  |  713|     32|  (mask)->set_system_affinity(abort_bool)
  ------------------
  118|     32|  KMP_CPU_FREE_FROM_STACK(mask);
  ------------------
  |  |  700|     32|#define KMP_CPU_FREE_FROM_STACK(ptr) KMP_CPU_FREE(ptr)
  |  |  ------------------
  |  |  |  |  698|     32|#define KMP_CPU_FREE(ptr) __kmp_affinity_dispatch->deallocate_mask(ptr)
  |  |  ------------------
  ------------------
  119|     32|}
__kmp_affinity_determine_capable:
  124|      1|void __kmp_affinity_determine_capable(const char *env_var) {
  125|       |  // Check and see if the OS supports thread affinity.
  126|       |
  127|      1|#if KMP_OS_LINUX
  128|      1|#define KMP_CPU_SET_SIZE_LIMIT (1024 * 1024)
  129|      1|#define KMP_CPU_SET_TRY_SIZE CACHE_LINE
  130|       |#elif KMP_OS_FREEBSD
  131|       |#define KMP_CPU_SET_SIZE_LIMIT (sizeof(cpuset_t))
  132|       |#endif
  133|       |
  134|      1|  int verbose = __kmp_affinity.flags.verbose;
  135|      1|  int warnings = __kmp_affinity.flags.warnings;
  136|      1|  enum affinity_type type = __kmp_affinity.type;
  137|       |
  138|      1|#if KMP_OS_LINUX
  139|      1|  long gCode;
  140|      1|  unsigned char *buf;
  141|      1|  buf = (unsigned char *)KMP_INTERNAL_MALLOC(KMP_CPU_SET_SIZE_LIMIT);
  ------------------
  |  |  110|      1|#define KMP_INTERNAL_MALLOC(sz) malloc(sz)
  ------------------
  142|       |
  143|       |  // If the syscall returns a suggestion for the size,
  144|       |  // then we don't have to search for an appropriate size.
  145|      1|  gCode = syscall(__NR_sched_getaffinity, 0, KMP_CPU_SET_TRY_SIZE, buf);
  ------------------
  |  |  129|      1|#define KMP_CPU_SET_TRY_SIZE CACHE_LINE
  |  |  ------------------
  |  |  |  |  108|      1|# define CACHE_LINE 64
  |  |  ------------------
  ------------------
  146|      1|  KA_TRACE(30, ("__kmp_affinity_determine_capable: "
  147|      1|                "initial getaffinity call returned %ld errno = %d\n",
  148|      1|                gCode, errno));
  149|       |
  150|      1|  if (gCode < 0 && errno != EINVAL) {
  ------------------
  |  Branch (150:7): [True: 0, False: 1]
  |  Branch (150:20): [True: 0, False: 0]
  ------------------
  151|       |    // System call not supported
  152|      0|    if (verbose ||
  ------------------
  |  Branch (152:9): [True: 0, False: 0]
  ------------------
  153|      0|        (warnings && (type != affinity_none) && (type != affinity_default) &&
  ------------------
  |  Branch (153:10): [True: 0, False: 0]
  |  Branch (153:22): [True: 0, False: 0]
  |  Branch (153:49): [True: 0, False: 0]
  ------------------
  154|      0|         (type != affinity_disabled))) {
  ------------------
  |  Branch (154:10): [True: 0, False: 0]
  ------------------
  155|      0|      int error = errno;
  156|      0|      kmp_msg_t err_code = KMP_ERR(error);
  ------------------
  |  |  125|      0|#define KMP_ERR KMP_SYSERRCODE
  |  |  ------------------
  |  |  |  |  123|      0|#define KMP_SYSERRCODE(code) __kmp_msg_error_code(code)
  |  |  ------------------
  ------------------
  157|      0|      __kmp_msg(kmp_ms_warning, KMP_MSG(GetAffSysCallNotSupported, env_var),
  ------------------
  |  |  121|      0|#define KMP_MSG(...) __kmp_msg_format(kmp_i18n_msg_##__VA_ARGS__)
  ------------------
  158|      0|                err_code, __kmp_msg_null);
  159|      0|      if (__kmp_generate_warnings == kmp_warnings_off) {
  ------------------
  |  Branch (159:11): [True: 0, False: 0]
  ------------------
  160|      0|        __kmp_str_free(&err_code.str);
  161|      0|      }
  162|      0|    }
  163|      0|    KMP_AFFINITY_DISABLE();
  ------------------
  |  |  685|      0|#define KMP_AFFINITY_DISABLE() (__kmp_affin_mask_size = 0)
  ------------------
  164|      0|    KMP_INTERNAL_FREE(buf);
  ------------------
  |  |  111|      0|#define KMP_INTERNAL_FREE(p) free(p)
  ------------------
  165|      0|    return;
  166|      1|  } else if (gCode > 0) {
  ------------------
  |  Branch (166:14): [True: 1, False: 0]
  ------------------
  167|       |    // The optimal situation: the OS returns the size of the buffer it expects.
  168|      1|    KMP_AFFINITY_ENABLE(gCode);
  ------------------
  |  |  686|      1|#define KMP_AFFINITY_ENABLE(mask_size) (__kmp_affin_mask_size = mask_size)
  ------------------
  169|      1|    KA_TRACE(10, ("__kmp_affinity_determine_capable: "
  170|      1|                  "affinity supported (mask size %d)\n",
  171|      1|                  (int)__kmp_affin_mask_size));
  172|      1|    KMP_INTERNAL_FREE(buf);
  ------------------
  |  |  111|      1|#define KMP_INTERNAL_FREE(p) free(p)
  ------------------
  173|      1|    return;
  174|      1|  }
  175|       |
  176|       |  // Call the getaffinity system call repeatedly with increasing set sizes
  177|       |  // until we succeed, or reach an upper bound on the search.
  178|      0|  KA_TRACE(30, ("__kmp_affinity_determine_capable: "
  179|      0|                "searching for proper set size\n"));
  180|      0|  int size;
  181|      0|  for (size = 1; size <= KMP_CPU_SET_SIZE_LIMIT; size *= 2) {
  ------------------
  |  |  128|      0|#define KMP_CPU_SET_SIZE_LIMIT (1024 * 1024)
  ------------------
  |  Branch (181:18): [True: 0, False: 0]
  ------------------
  182|      0|    gCode = syscall(__NR_sched_getaffinity, 0, size, buf);
  183|      0|    KA_TRACE(30, ("__kmp_affinity_determine_capable: "
  184|      0|                  "getaffinity for mask size %ld returned %ld errno = %d\n",
  185|      0|                  size, gCode, errno));
  186|       |
  187|      0|    if (gCode < 0) {
  ------------------
  |  Branch (187:9): [True: 0, False: 0]
  ------------------
  188|      0|      if (errno == ENOSYS) {
  ------------------
  |  Branch (188:11): [True: 0, False: 0]
  ------------------
  189|       |        // We shouldn't get here
  190|      0|        KA_TRACE(30, ("__kmp_affinity_determine_capable: "
  191|      0|                      "inconsistent OS call behavior: errno == ENOSYS for mask "
  192|      0|                      "size %d\n",
  193|      0|                      size));
  194|      0|        if (verbose ||
  ------------------
  |  Branch (194:13): [True: 0, False: 0]
  ------------------
  195|      0|            (warnings && (type != affinity_none) &&
  ------------------
  |  Branch (195:14): [True: 0, False: 0]
  |  Branch (195:26): [True: 0, False: 0]
  ------------------
  196|      0|             (type != affinity_default) && (type != affinity_disabled))) {
  ------------------
  |  Branch (196:14): [True: 0, False: 0]
  |  Branch (196:44): [True: 0, False: 0]
  ------------------
  197|      0|          int error = errno;
  198|      0|          kmp_msg_t err_code = KMP_ERR(error);
  ------------------
  |  |  125|      0|#define KMP_ERR KMP_SYSERRCODE
  |  |  ------------------
  |  |  |  |  123|      0|#define KMP_SYSERRCODE(code) __kmp_msg_error_code(code)
  |  |  ------------------
  ------------------
  199|      0|          __kmp_msg(kmp_ms_warning, KMP_MSG(GetAffSysCallNotSupported, env_var),
  ------------------
  |  |  121|      0|#define KMP_MSG(...) __kmp_msg_format(kmp_i18n_msg_##__VA_ARGS__)
  ------------------
  200|      0|                    err_code, __kmp_msg_null);
  201|      0|          if (__kmp_generate_warnings == kmp_warnings_off) {
  ------------------
  |  Branch (201:15): [True: 0, False: 0]
  ------------------
  202|      0|            __kmp_str_free(&err_code.str);
  203|      0|          }
  204|      0|        }
  205|      0|        KMP_AFFINITY_DISABLE();
  ------------------
  |  |  685|      0|#define KMP_AFFINITY_DISABLE() (__kmp_affin_mask_size = 0)
  ------------------
  206|      0|        KMP_INTERNAL_FREE(buf);
  ------------------
  |  |  111|      0|#define KMP_INTERNAL_FREE(p) free(p)
  ------------------
  207|      0|        return;
  208|      0|      }
  209|      0|      continue;
  210|      0|    }
  211|       |
  212|      0|    KMP_AFFINITY_ENABLE(gCode);
  ------------------
  |  |  686|      0|#define KMP_AFFINITY_ENABLE(mask_size) (__kmp_affin_mask_size = mask_size)
  ------------------
  213|      0|    KA_TRACE(10, ("__kmp_affinity_determine_capable: "
  214|      0|                  "affinity supported (mask size %d)\n",
  215|      0|                  (int)__kmp_affin_mask_size));
  216|      0|    KMP_INTERNAL_FREE(buf);
  ------------------
  |  |  111|      0|#define KMP_INTERNAL_FREE(p) free(p)
  ------------------
  217|      0|    return;
  218|      0|  }
  219|       |#elif KMP_OS_FREEBSD
  220|       |  long gCode;
  221|       |  unsigned char *buf;
  222|       |  buf = (unsigned char *)KMP_INTERNAL_MALLOC(KMP_CPU_SET_SIZE_LIMIT);
  223|       |  gCode = pthread_getaffinity_np(pthread_self(), KMP_CPU_SET_SIZE_LIMIT,
  224|       |                                 reinterpret_cast<cpuset_t *>(buf));
  225|       |  KA_TRACE(30, ("__kmp_affinity_determine_capable: "
  226|       |                "initial getaffinity call returned %d errno = %d\n",
  227|       |                gCode, errno));
  228|       |  if (gCode == 0) {
  229|       |    KMP_AFFINITY_ENABLE(KMP_CPU_SET_SIZE_LIMIT);
  230|       |    KA_TRACE(10, ("__kmp_affinity_determine_capable: "
  231|       |                  "affinity supported (mask size %d)\n",
  232|       |                  (int)__kmp_affin_mask_size));
  233|       |    KMP_INTERNAL_FREE(buf);
  234|       |    return;
  235|       |  }
  236|       |#endif
  237|      0|  KMP_INTERNAL_FREE(buf);
  ------------------
  |  |  111|      0|#define KMP_INTERNAL_FREE(p) free(p)
  ------------------
  238|       |
  239|       |  // Affinity is not supported
  240|      0|  KMP_AFFINITY_DISABLE();
  ------------------
  |  |  685|      0|#define KMP_AFFINITY_DISABLE() (__kmp_affin_mask_size = 0)
  ------------------
  241|      0|  KA_TRACE(10, ("__kmp_affinity_determine_capable: "
  242|      0|                "cannot determine mask size - affinity not supported\n"));
  243|      0|  if (verbose || (warnings && (type != affinity_none) &&
  ------------------
  |  Branch (243:7): [True: 0, False: 0]
  |  Branch (243:19): [True: 0, False: 0]
  |  Branch (243:31): [True: 0, False: 0]
  ------------------
  244|      0|                  (type != affinity_default) && (type != affinity_disabled))) {
  ------------------
  |  Branch (244:19): [True: 0, False: 0]
  |  Branch (244:49): [True: 0, False: 0]
  ------------------
  245|      0|    KMP_WARNING(AffCantGetMaskSize, env_var);
  ------------------
  |  |  145|      0|  __kmp_msg(kmp_ms_warning, KMP_MSG(__VA_ARGS__), __kmp_msg_null)
  |  |  ------------------
  |  |  |  |  121|      0|#define KMP_MSG(...) __kmp_msg_format(kmp_i18n_msg_##__VA_ARGS__)
  |  |  ------------------
  ------------------
  246|      0|  }
  247|      0|}
__kmp_create_worker:
  710|     32|void __kmp_create_worker(int gtid, kmp_info_t *th, size_t stack_size) {
  711|     32|  pthread_t handle;
  712|     32|  pthread_attr_t thread_attr;
  713|     32|  int status;
  714|       |
  715|     32|  th->th.th_info.ds.ds_gtid = gtid;
  716|       |
  717|       |#if KMP_STATS_ENABLED
  718|       |  // sets up worker thread stats
  719|       |  __kmp_acquire_tas_lock(&__kmp_stats_lock, gtid);
  720|       |
  721|       |  // th->th.th_stats is used to transfer thread-specific stats-pointer to
  722|       |  // __kmp_launch_worker. So when thread is created (goes into
  723|       |  // __kmp_launch_worker) it will set its thread local pointer to
  724|       |  // th->th.th_stats
  725|       |  if (!KMP_UBER_GTID(gtid)) {
  726|       |    th->th.th_stats = __kmp_stats_list->push_back(gtid);
  727|       |  } else {
  728|       |    // For root threads, __kmp_stats_thread_ptr is set in __kmp_register_root(),
  729|       |    // so set the th->th.th_stats field to it.
  730|       |    th->th.th_stats = __kmp_stats_thread_ptr;
  731|       |  }
  732|       |  __kmp_release_tas_lock(&__kmp_stats_lock, gtid);
  733|       |
  734|       |#endif // KMP_STATS_ENABLED
  735|       |
  736|     32|  if (KMP_UBER_GTID(gtid)) {
  ------------------
  |  Branch (736:7): [True: 1, False: 31]
  ------------------
  737|      1|    KA_TRACE(10, ("__kmp_create_worker: uber thread (%d)\n", gtid));
  738|      1|    th->th.th_info.ds.ds_thread = pthread_self();
  739|      1|    __kmp_set_stack_info(gtid, th);
  740|      1|    __kmp_check_stack_overlap(th);
  741|      1|    return;
  742|      1|  }
  743|       |
  744|     31|  KA_TRACE(10, ("__kmp_create_worker: try to create thread (%d)\n", gtid));
  745|       |
  746|     31|  KMP_MB(); /* Flush all pending memory write invalidates.  */
  747|       |
  748|     31|#ifdef KMP_THREAD_ATTR
  749|     31|  status = pthread_attr_init(&thread_attr);
  750|     31|  if (status != 0) {
  ------------------
  |  Branch (750:7): [True: 0, False: 31]
  ------------------
  751|      0|    __kmp_fatal(KMP_MSG(CantInitThreadAttrs), KMP_ERR(status), __kmp_msg_null);
  ------------------
  |  |  121|      0|#define KMP_MSG(...) __kmp_msg_format(kmp_i18n_msg_##__VA_ARGS__)
  ------------------
                  __kmp_fatal(KMP_MSG(CantInitThreadAttrs), KMP_ERR(status), __kmp_msg_null);
  ------------------
  |  |  125|      0|#define KMP_ERR KMP_SYSERRCODE
  |  |  ------------------
  |  |  |  |  123|      0|#define KMP_SYSERRCODE(code) __kmp_msg_error_code(code)
  |  |  ------------------
  ------------------
  752|      0|  }
  753|     31|  status = pthread_attr_setdetachstate(&thread_attr, PTHREAD_CREATE_JOINABLE);
  754|     31|  if (status != 0) {
  ------------------
  |  Branch (754:7): [True: 0, False: 31]
  ------------------
  755|      0|    __kmp_fatal(KMP_MSG(CantSetWorkerState), KMP_ERR(status), __kmp_msg_null);
  ------------------
  |  |  121|      0|#define KMP_MSG(...) __kmp_msg_format(kmp_i18n_msg_##__VA_ARGS__)
  ------------------
                  __kmp_fatal(KMP_MSG(CantSetWorkerState), KMP_ERR(status), __kmp_msg_null);
  ------------------
  |  |  125|      0|#define KMP_ERR KMP_SYSERRCODE
  |  |  ------------------
  |  |  |  |  123|      0|#define KMP_SYSERRCODE(code) __kmp_msg_error_code(code)
  |  |  ------------------
  ------------------
  756|      0|  }
  757|       |
  758|       |  /* Set stack size for this thread now.
  759|       |     The multiple of 2 is there because on some machines, requesting an unusual
  760|       |     stacksize causes the thread to have an offset before the dummy alloca()
  761|       |     takes place to create the offset.  Since we want the user to have a
  762|       |     sufficient stacksize AND support a stack offset, we alloca() twice the
  763|       |     offset so that the upcoming alloca() does not eliminate any premade offset,
  764|       |     and also gives the user the stack space they requested for all threads */
  765|     31|  stack_size += gtid * __kmp_stkoffset * 2;
  766|       |
  767|     31|  KA_TRACE(10, ("__kmp_create_worker: T#%d, default stacksize = %lu bytes, "
  768|     31|                "__kmp_stksize = %lu bytes, final stacksize = %lu bytes\n",
  769|     31|                gtid, KMP_DEFAULT_STKSIZE, __kmp_stksize, stack_size));
  770|       |
  771|     31|#ifdef _POSIX_THREAD_ATTR_STACKSIZE
  772|     31|  status = pthread_attr_setstacksize(&thread_attr, stack_size);
  773|     31|#ifdef KMP_BACKUP_STKSIZE
  774|     31|  if (status != 0) {
  ------------------
  |  Branch (774:7): [True: 0, False: 31]
  ------------------
  775|      0|    if (!__kmp_env_stksize) {
  ------------------
  |  Branch (775:9): [True: 0, False: 0]
  ------------------
  776|      0|      stack_size = KMP_BACKUP_STKSIZE + gtid * __kmp_stkoffset;
  ------------------
  |  | 1159|      0|#define KMP_BACKUP_STKSIZE ((size_t)(2 * 1024 * 1024))
  ------------------
  777|      0|      __kmp_stksize = KMP_BACKUP_STKSIZE;
  ------------------
  |  | 1159|      0|#define KMP_BACKUP_STKSIZE ((size_t)(2 * 1024 * 1024))
  ------------------
  778|      0|      KA_TRACE(10, ("__kmp_create_worker: T#%d, default stacksize = %lu bytes, "
  779|      0|                    "__kmp_stksize = %lu bytes, (backup) final stacksize = %lu "
  780|      0|                    "bytes\n",
  781|      0|                    gtid, KMP_DEFAULT_STKSIZE, __kmp_stksize, stack_size));
  782|      0|      status = pthread_attr_setstacksize(&thread_attr, stack_size);
  783|      0|    }
  784|      0|  }
  785|     31|#endif /* KMP_BACKUP_STKSIZE */
  786|     31|  if (status != 0) {
  ------------------
  |  Branch (786:7): [True: 0, False: 31]
  ------------------
  787|      0|    __kmp_fatal(KMP_MSG(CantSetWorkerStackSize, stack_size), KMP_ERR(status),
  ------------------
  |  |  121|      0|#define KMP_MSG(...) __kmp_msg_format(kmp_i18n_msg_##__VA_ARGS__)
  ------------------
                  __kmp_fatal(KMP_MSG(CantSetWorkerStackSize, stack_size), KMP_ERR(status),
  ------------------
  |  |  125|      0|#define KMP_ERR KMP_SYSERRCODE
  |  |  ------------------
  |  |  |  |  123|      0|#define KMP_SYSERRCODE(code) __kmp_msg_error_code(code)
  |  |  ------------------
  ------------------
  788|      0|                KMP_HNT(ChangeWorkerStackSize), __kmp_msg_null);
  ------------------
  |  |  122|      0|#define KMP_HNT(...) __kmp_msg_format(kmp_i18n_hnt_##__VA_ARGS__)
  ------------------
  789|      0|  }
  790|     31|#endif /* _POSIX_THREAD_ATTR_STACKSIZE */
  791|       |
  792|     31|#endif /* KMP_THREAD_ATTR */
  793|       |
  794|     31|  status =
  795|     31|      pthread_create(&handle, &thread_attr, __kmp_launch_worker, (void *)th);
  796|     31|  if (status != 0 || !handle) { // ??? Why do we check handle??
  ------------------
  |  Branch (796:7): [True: 0, False: 31]
  |  Branch (796:22): [True: 0, False: 31]
  ------------------
  797|      0|#ifdef _POSIX_THREAD_ATTR_STACKSIZE
  798|      0|    if (status == EINVAL) {
  ------------------
  |  Branch (798:9): [True: 0, False: 0]
  ------------------
  799|      0|      __kmp_fatal(KMP_MSG(CantSetWorkerStackSize, stack_size), KMP_ERR(status),
  ------------------
  |  |  121|      0|#define KMP_MSG(...) __kmp_msg_format(kmp_i18n_msg_##__VA_ARGS__)
  ------------------
                    __kmp_fatal(KMP_MSG(CantSetWorkerStackSize, stack_size), KMP_ERR(status),
  ------------------
  |  |  125|      0|#define KMP_ERR KMP_SYSERRCODE
  |  |  ------------------
  |  |  |  |  123|      0|#define KMP_SYSERRCODE(code) __kmp_msg_error_code(code)
  |  |  ------------------
  ------------------
  800|      0|                  KMP_HNT(IncreaseWorkerStackSize), __kmp_msg_null);
  ------------------
  |  |  122|      0|#define KMP_HNT(...) __kmp_msg_format(kmp_i18n_hnt_##__VA_ARGS__)
  ------------------
  801|      0|    }
  802|      0|    if (status == ENOMEM) {
  ------------------
  |  Branch (802:9): [True: 0, False: 0]
  ------------------
  803|      0|      __kmp_fatal(KMP_MSG(CantSetWorkerStackSize, stack_size), KMP_ERR(status),
  ------------------
  |  |  121|      0|#define KMP_MSG(...) __kmp_msg_format(kmp_i18n_msg_##__VA_ARGS__)
  ------------------
                    __kmp_fatal(KMP_MSG(CantSetWorkerStackSize, stack_size), KMP_ERR(status),
  ------------------
  |  |  125|      0|#define KMP_ERR KMP_SYSERRCODE
  |  |  ------------------
  |  |  |  |  123|      0|#define KMP_SYSERRCODE(code) __kmp_msg_error_code(code)
  |  |  ------------------
  ------------------
  804|      0|                  KMP_HNT(DecreaseWorkerStackSize), __kmp_msg_null);
  ------------------
  |  |  122|      0|#define KMP_HNT(...) __kmp_msg_format(kmp_i18n_hnt_##__VA_ARGS__)
  ------------------
  805|      0|    }
  806|      0|#endif /* _POSIX_THREAD_ATTR_STACKSIZE */
  807|      0|    if (status == EAGAIN) {
  ------------------
  |  Branch (807:9): [True: 0, False: 0]
  ------------------
  808|      0|      __kmp_fatal(KMP_MSG(NoResourcesForWorkerThread), KMP_ERR(status),
  ------------------
  |  |  121|      0|#define KMP_MSG(...) __kmp_msg_format(kmp_i18n_msg_##__VA_ARGS__)
  ------------------
                    __kmp_fatal(KMP_MSG(NoResourcesForWorkerThread), KMP_ERR(status),
  ------------------
  |  |  125|      0|#define KMP_ERR KMP_SYSERRCODE
  |  |  ------------------
  |  |  |  |  123|      0|#define KMP_SYSERRCODE(code) __kmp_msg_error_code(code)
  |  |  ------------------
  ------------------
  809|      0|                  KMP_HNT(Decrease_NUM_THREADS), __kmp_msg_null);
  ------------------
  |  |  122|      0|#define KMP_HNT(...) __kmp_msg_format(kmp_i18n_hnt_##__VA_ARGS__)
  ------------------
  810|      0|    }
  811|      0|    KMP_SYSFAIL("pthread_create", status);
  ------------------
  |  |  148|      0|  __kmp_fatal(KMP_MSG(FunctionError, func), KMP_SYSERRCODE(error),             \
  |  |  ------------------
  |  |  |  |  121|      0|#define KMP_MSG(...) __kmp_msg_format(kmp_i18n_msg_##__VA_ARGS__)
  |  |  ------------------
  |  |                 __kmp_fatal(KMP_MSG(FunctionError, func), KMP_SYSERRCODE(error),             \
  |  |  ------------------
  |  |  |  |  123|      0|#define KMP_SYSERRCODE(code) __kmp_msg_error_code(code)
  |  |  ------------------
  |  |  149|      0|              __kmp_msg_null)
  ------------------
  812|      0|  }
  813|       |
  814|     31|  th->th.th_info.ds.ds_thread = handle;
  815|       |
  816|     31|#ifdef KMP_THREAD_ATTR
  817|     31|  status = pthread_attr_destroy(&thread_attr);
  818|     31|  if (status) {
  ------------------
  |  Branch (818:7): [True: 0, False: 31]
  ------------------
  819|      0|    kmp_msg_t err_code = KMP_ERR(status);
  ------------------
  |  |  125|      0|#define KMP_ERR KMP_SYSERRCODE
  |  |  ------------------
  |  |  |  |  123|      0|#define KMP_SYSERRCODE(code) __kmp_msg_error_code(code)
  |  |  ------------------
  ------------------
  820|      0|    __kmp_msg(kmp_ms_warning, KMP_MSG(CantDestroyThreadAttrs), err_code,
  ------------------
  |  |  121|      0|#define KMP_MSG(...) __kmp_msg_format(kmp_i18n_msg_##__VA_ARGS__)
  ------------------
  821|      0|              __kmp_msg_null);
  822|      0|    if (__kmp_generate_warnings == kmp_warnings_off) {
  ------------------
  |  Branch (822:9): [True: 0, False: 0]
  ------------------
  823|      0|      __kmp_str_free(&err_code.str);
  824|      0|    }
  825|      0|  }
  826|     31|#endif /* KMP_THREAD_ATTR */
  827|       |
  828|     31|  KMP_MB(); /* Flush all pending memory write invalidates.  */
  829|       |
  830|     31|  KA_TRACE(10, ("__kmp_create_worker: done creating thread (%d)\n", gtid));
  831|       |
  832|     31|} // __kmp_create_worker
__kmp_reap_worker:
 1032|     31|void __kmp_reap_worker(kmp_info_t *th) {
 1033|     31|  int status;
 1034|     31|  void *exit_val;
 1035|       |
 1036|     31|  KMP_MB(); /* Flush all pending memory write invalidates.  */
 1037|       |
 1038|     31|  KA_TRACE(
 1039|     31|      10, ("__kmp_reap_worker: try to reap T#%d\n", th->th.th_info.ds.ds_gtid));
 1040|       |
 1041|     31|  status = pthread_join(th->th.th_info.ds.ds_thread, &exit_val);
 1042|       |#ifdef KMP_DEBUG
 1043|       |  /* Don't expose these to the user until we understand when they trigger */
 1044|       |  if (status != 0) {
 1045|       |    __kmp_fatal(KMP_MSG(ReapWorkerError), KMP_ERR(status), __kmp_msg_null);
 1046|       |  }
 1047|       |  if (exit_val != th) {
 1048|       |    KA_TRACE(10, ("__kmp_reap_worker: worker T#%d did not reap properly, "
 1049|       |                  "exit_val = %p\n",
 1050|       |                  th->th.th_info.ds.ds_gtid, exit_val));
 1051|       |  }
 1052|       |#else
 1053|     31|  (void)status; // unused variable
 1054|     31|#endif /* KMP_DEBUG */
 1055|       |
 1056|     31|  KA_TRACE(10, ("__kmp_reap_worker: done reaping T#%d\n",
 1057|     31|                th->th.th_info.ds.ds_gtid));
 1058|       |
 1059|     31|  KMP_MB(); /* Flush all pending memory write invalidates.  */
 1060|     31|}
__kmp_install_signals:
 1156|      2|void __kmp_install_signals(int parallel_init) {
 1157|      2|  KB_TRACE(10, ("__kmp_install_signals( %d )\n", parallel_init));
 1158|      2|  if (__kmp_handle_signals || !parallel_init) {
  ------------------
  |  Branch (1158:7): [True: 0, False: 2]
  |  Branch (1158:31): [True: 1, False: 1]
  ------------------
 1159|       |    // If ! parallel_init, we do not install handlers, just save original
 1160|       |    // handlers. Let us do it even __handle_signals is 0.
 1161|      1|    sigemptyset(&__kmp_sigset);
 1162|      1|    __kmp_install_one_handler(SIGHUP, __kmp_team_handler, parallel_init);
 1163|      1|    __kmp_install_one_handler(SIGINT, __kmp_team_handler, parallel_init);
 1164|      1|    __kmp_install_one_handler(SIGQUIT, __kmp_team_handler, parallel_init);
 1165|      1|    __kmp_install_one_handler(SIGILL, __kmp_team_handler, parallel_init);
 1166|      1|    __kmp_install_one_handler(SIGABRT, __kmp_team_handler, parallel_init);
 1167|      1|    __kmp_install_one_handler(SIGFPE, __kmp_team_handler, parallel_init);
 1168|      1|    __kmp_install_one_handler(SIGBUS, __kmp_team_handler, parallel_init);
 1169|      1|    __kmp_install_one_handler(SIGSEGV, __kmp_team_handler, parallel_init);
 1170|      1|#ifdef SIGSYS
 1171|      1|    __kmp_install_one_handler(SIGSYS, __kmp_team_handler, parallel_init);
 1172|      1|#endif // SIGSYS
 1173|      1|    __kmp_install_one_handler(SIGTERM, __kmp_team_handler, parallel_init);
 1174|      1|#ifdef SIGPIPE
 1175|       |    __kmp_install_one_handler(SIGPIPE, __kmp_team_handler, parallel_init);
 1176|      1|#endif // SIGPIPE
 1177|      1|  }
 1178|      2|} // __kmp_install_signals
__kmp_remove_signals:
 1180|      1|void __kmp_remove_signals(void) {
 1181|      1|  int sig;
 1182|      1|  KB_TRACE(10, ("__kmp_remove_signals()\n"));
 1183|     65|  for (sig = 1; sig < NSIG; ++sig) {
  ------------------
  |  Branch (1183:17): [True: 64, False: 1]
  ------------------
 1184|     64|    __kmp_remove_one_handler(sig);
 1185|     64|  }
 1186|      1|} // __kmp_remove_signals
__kmp_register_atfork:
 1318|      1|void __kmp_register_atfork(void) {
 1319|      1|  if (__kmp_need_register_atfork) {
  ------------------
  |  Branch (1319:7): [True: 1, False: 0]
  ------------------
 1320|      1|    int status = pthread_atfork(__kmp_atfork_prepare, __kmp_atfork_parent,
 1321|      1|                                __kmp_atfork_child);
 1322|      1|    KMP_CHECK_SYSFAIL("pthread_atfork", status);
  ------------------
  |  |  153|      1|  {                                                                            \
  |  |  154|      1|    if (error) {                                                               \
  |  |  ------------------
  |  |  |  Branch (154:9): [True: 0, False: 1]
  |  |  ------------------
  |  |  155|      0|      KMP_SYSFAIL(func, error);                                                \
  |  |  ------------------
  |  |  |  |  148|      0|  __kmp_fatal(KMP_MSG(FunctionError, func), KMP_SYSERRCODE(error),             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  121|      0|#define KMP_MSG(...) __kmp_msg_format(kmp_i18n_msg_##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |                 __kmp_fatal(KMP_MSG(FunctionError, func), KMP_SYSERRCODE(error),             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  123|      0|#define KMP_SYSERRCODE(code) __kmp_msg_error_code(code)
  |  |  |  |  ------------------
  |  |  |  |  149|      0|              __kmp_msg_null)
  |  |  ------------------
  |  |  156|      0|    }                                                                          \
  |  |  157|      1|  }
  ------------------
 1323|      1|    __kmp_need_register_atfork = FALSE;
  ------------------
  |  | 1279|      1|#define FALSE 0
  ------------------
 1324|      1|  }
 1325|      1|}
__kmp_suspend_initialize:
 1327|      1|void __kmp_suspend_initialize(void) {
 1328|      1|  int status;
 1329|      1|  status = pthread_mutexattr_init(&__kmp_suspend_mutex_attr);
 1330|      1|  KMP_CHECK_SYSFAIL("pthread_mutexattr_init", status);
  ------------------
  |  |  153|      1|  {                                                                            \
  |  |  154|      1|    if (error) {                                                               \
  |  |  ------------------
  |  |  |  Branch (154:9): [True: 0, False: 1]
  |  |  ------------------
  |  |  155|      0|      KMP_SYSFAIL(func, error);                                                \
  |  |  ------------------
  |  |  |  |  148|      0|  __kmp_fatal(KMP_MSG(FunctionError, func), KMP_SYSERRCODE(error),             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  121|      0|#define KMP_MSG(...) __kmp_msg_format(kmp_i18n_msg_##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |                 __kmp_fatal(KMP_MSG(FunctionError, func), KMP_SYSERRCODE(error),             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  123|      0|#define KMP_SYSERRCODE(code) __kmp_msg_error_code(code)
  |  |  |  |  ------------------
  |  |  |  |  149|      0|              __kmp_msg_null)
  |  |  ------------------
  |  |  156|      0|    }                                                                          \
  |  |  157|      1|  }
  ------------------
 1331|      1|  status = pthread_condattr_init(&__kmp_suspend_cond_attr);
 1332|      1|  KMP_CHECK_SYSFAIL("pthread_condattr_init", status);
  ------------------
  |  |  153|      1|  {                                                                            \
  |  |  154|      1|    if (error) {                                                               \
  |  |  ------------------
  |  |  |  Branch (154:9): [True: 0, False: 1]
  |  |  ------------------
  |  |  155|      0|      KMP_SYSFAIL(func, error);                                                \
  |  |  ------------------
  |  |  |  |  148|      0|  __kmp_fatal(KMP_MSG(FunctionError, func), KMP_SYSERRCODE(error),             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  121|      0|#define KMP_MSG(...) __kmp_msg_format(kmp_i18n_msg_##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |                 __kmp_fatal(KMP_MSG(FunctionError, func), KMP_SYSERRCODE(error),             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  123|      0|#define KMP_SYSERRCODE(code) __kmp_msg_error_code(code)
  |  |  |  |  ------------------
  |  |  |  |  149|      0|              __kmp_msg_null)
  |  |  ------------------
  |  |  156|      0|    }                                                                          \
  |  |  157|      1|  }
  ------------------
 1333|      1|}
__kmp_suspend_initialize_thread:
 1335|  3.20k|void __kmp_suspend_initialize_thread(kmp_info_t *th) {
 1336|  3.20k|  int old_value = KMP_ATOMIC_LD_RLX(&th->th.th_suspend_init_count);
  ------------------
  |  | 1250|  3.20k|#define KMP_ATOMIC_LD_RLX(p) KMP_ATOMIC_LD(p, relaxed)
  |  |  ------------------
  |  |  |  | 1245|  3.20k|#define KMP_ATOMIC_LD(p, order) (p)->load(std::memory_order_##order)
  |  |  ------------------
  ------------------
 1337|  3.20k|  int new_value = __kmp_fork_count + 1;
 1338|       |  // Return if already initialized
 1339|  3.20k|  if (old_value == new_value)
  ------------------
  |  Branch (1339:7): [True: 3.17k, False: 27]
  ------------------
 1340|  3.17k|    return;
 1341|       |  // Wait, then return if being initialized
 1342|     32|  if (old_value == -1 || !__kmp_atomic_compare_store(
  ------------------
  |  Branch (1342:7): [True: 18.4E, False: 32]
  |  Branch (1342:26): [True: 0, False: 32]
  ------------------
 1343|     32|                             &th->th.th_suspend_init_count, old_value, -1)) {
 1344|      0|    while (KMP_ATOMIC_LD_ACQ(&th->th.th_suspend_init_count) != new_value) {
  ------------------
  |  | 1249|      0|#define KMP_ATOMIC_LD_ACQ(p) KMP_ATOMIC_LD(p, acquire)
  |  |  ------------------
  |  |  |  | 1245|      0|#define KMP_ATOMIC_LD(p, order) (p)->load(std::memory_order_##order)
  |  |  ------------------
  ------------------
  |  Branch (1344:12): [True: 0, False: 0]
  ------------------
 1345|      0|      KMP_CPU_PAUSE();
  ------------------
  |  | 1498|      0|#define KMP_CPU_PAUSE() __kmp_x86_pause()
  ------------------
 1346|      0|    }
 1347|     27|  } else {
 1348|       |    // Claim to be the initializer and do initializations
 1349|     27|    int status;
 1350|     27|    status = pthread_cond_init(&th->th.th_suspend_cv.c_cond,
 1351|     27|                               &__kmp_suspend_cond_attr);
 1352|     27|    KMP_CHECK_SYSFAIL("pthread_cond_init", status);
  ------------------
  |  |  153|     27|  {                                                                            \
  |  |  154|     27|    if (error) {                                                               \
  |  |  ------------------
  |  |  |  Branch (154:9): [True: 0, False: 27]
  |  |  ------------------
  |  |  155|      0|      KMP_SYSFAIL(func, error);                                                \
  |  |  ------------------
  |  |  |  |  148|      0|  __kmp_fatal(KMP_MSG(FunctionError, func), KMP_SYSERRCODE(error),             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  121|      0|#define KMP_MSG(...) __kmp_msg_format(kmp_i18n_msg_##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |                 __kmp_fatal(KMP_MSG(FunctionError, func), KMP_SYSERRCODE(error),             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  123|      0|#define KMP_SYSERRCODE(code) __kmp_msg_error_code(code)
  |  |  |  |  ------------------
  |  |  |  |  149|      0|              __kmp_msg_null)
  |  |  ------------------
  |  |  156|      0|    }                                                                          \
  |  |  157|     27|  }
  ------------------
 1353|     27|    status = pthread_mutex_init(&th->th.th_suspend_mx.m_mutex,
 1354|     27|                                &__kmp_suspend_mutex_attr);
 1355|     27|    KMP_CHECK_SYSFAIL("pthread_mutex_init", status);
  ------------------
  |  |  153|     27|  {                                                                            \
  |  |  154|     27|    if (error) {                                                               \
  |  |  ------------------
  |  |  |  Branch (154:9): [True: 0, False: 27]
  |  |  ------------------
  |  |  155|      0|      KMP_SYSFAIL(func, error);                                                \
  |  |  ------------------
  |  |  |  |  148|      0|  __kmp_fatal(KMP_MSG(FunctionError, func), KMP_SYSERRCODE(error),             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  121|      0|#define KMP_MSG(...) __kmp_msg_format(kmp_i18n_msg_##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |                 __kmp_fatal(KMP_MSG(FunctionError, func), KMP_SYSERRCODE(error),             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  123|      0|#define KMP_SYSERRCODE(code) __kmp_msg_error_code(code)
  |  |  |  |  ------------------
  |  |  |  |  149|      0|              __kmp_msg_null)
  |  |  ------------------
  |  |  156|      0|    }                                                                          \
  |  |  157|     27|  }
  ------------------
 1356|     27|    KMP_ATOMIC_ST_REL(&th->th.th_suspend_init_count, new_value);
  ------------------
  |  | 1251|     27|#define KMP_ATOMIC_ST_REL(p, v) KMP_ATOMIC_OP(store, p, v, release)
  |  |  ------------------
  |  |  |  | 1246|     27|#define KMP_ATOMIC_OP(op, p, v, order) (p)->op(v, std::memory_order_##order)
  |  |  ------------------
  ------------------
 1357|     27|  }
 1358|     27|}
__kmp_suspend_uninitialize_thread:
 1360|     32|void __kmp_suspend_uninitialize_thread(kmp_info_t *th) {
 1361|     32|  if (KMP_ATOMIC_LD_ACQ(&th->th.th_suspend_init_count) > __kmp_fork_count) {
  ------------------
  |  | 1249|     32|#define KMP_ATOMIC_LD_ACQ(p) KMP_ATOMIC_LD(p, acquire)
  |  |  ------------------
  |  |  |  | 1245|     32|#define KMP_ATOMIC_LD(p, order) (p)->load(std::memory_order_##order)
  |  |  ------------------
  ------------------
  |  Branch (1361:7): [True: 32, False: 0]
  ------------------
 1362|       |    /* this means we have initialize the suspension pthread objects for this
 1363|       |       thread in this instance of the process */
 1364|     32|    int status;
 1365|       |
 1366|     32|    status = pthread_cond_destroy(&th->th.th_suspend_cv.c_cond);
 1367|     32|    if (status != 0 && status != EBUSY) {
  ------------------
  |  Branch (1367:9): [True: 0, False: 32]
  |  Branch (1367:24): [True: 0, False: 0]
  ------------------
 1368|      0|      KMP_SYSFAIL("pthread_cond_destroy", status);
  ------------------
  |  |  148|      0|  __kmp_fatal(KMP_MSG(FunctionError, func), KMP_SYSERRCODE(error),             \
  |  |  ------------------
  |  |  |  |  121|      0|#define KMP_MSG(...) __kmp_msg_format(kmp_i18n_msg_##__VA_ARGS__)
  |  |  ------------------
  |  |                 __kmp_fatal(KMP_MSG(FunctionError, func), KMP_SYSERRCODE(error),             \
  |  |  ------------------
  |  |  |  |  123|      0|#define KMP_SYSERRCODE(code) __kmp_msg_error_code(code)
  |  |  ------------------
  |  |  149|      0|              __kmp_msg_null)
  ------------------
 1369|      0|    }
 1370|     32|    status = pthread_mutex_destroy(&th->th.th_suspend_mx.m_mutex);
 1371|     32|    if (status != 0 && status != EBUSY) {
  ------------------
  |  Branch (1371:9): [True: 0, False: 32]
  |  Branch (1371:24): [True: 0, False: 0]
  ------------------
 1372|      0|      KMP_SYSFAIL("pthread_mutex_destroy", status);
  ------------------
  |  |  148|      0|  __kmp_fatal(KMP_MSG(FunctionError, func), KMP_SYSERRCODE(error),             \
  |  |  ------------------
  |  |  |  |  121|      0|#define KMP_MSG(...) __kmp_msg_format(kmp_i18n_msg_##__VA_ARGS__)
  |  |  ------------------
  |  |                 __kmp_fatal(KMP_MSG(FunctionError, func), KMP_SYSERRCODE(error),             \
  |  |  ------------------
  |  |  |  |  123|      0|#define KMP_SYSERRCODE(code) __kmp_msg_error_code(code)
  |  |  ------------------
  |  |  149|      0|              __kmp_msg_null)
  ------------------
 1373|      0|    }
 1374|     32|    --th->th.th_suspend_init_count;
 1375|     32|    KMP_DEBUG_ASSERT(KMP_ATOMIC_LD_RLX(&th->th.th_suspend_init_count) ==
 1376|     32|                     __kmp_fork_count);
 1377|     32|  }
 1378|     32|}
__kmp_lock_suspend_mx:
 1385|  3.21k|void __kmp_lock_suspend_mx(kmp_info_t *th) {
 1386|  3.21k|  int status = pthread_mutex_lock(&th->th.th_suspend_mx.m_mutex);
 1387|  3.21k|  KMP_CHECK_SYSFAIL("pthread_mutex_lock", status);
  ------------------
  |  |  153|  3.21k|  {                                                                            \
  |  |  154|  3.21k|    if (error) {                                                               \
  |  |  ------------------
  |  |  |  Branch (154:9): [True: 0, False: 3.21k]
  |  |  ------------------
  |  |  155|      0|      KMP_SYSFAIL(func, error);                                                \
  |  |  ------------------
  |  |  |  |  148|      0|  __kmp_fatal(KMP_MSG(FunctionError, func), KMP_SYSERRCODE(error),             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  121|      0|#define KMP_MSG(...) __kmp_msg_format(kmp_i18n_msg_##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |                 __kmp_fatal(KMP_MSG(FunctionError, func), KMP_SYSERRCODE(error),             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  123|      0|#define KMP_SYSERRCODE(code) __kmp_msg_error_code(code)
  |  |  |  |  ------------------
  |  |  |  |  149|      0|              __kmp_msg_null)
  |  |  ------------------
  |  |  156|      0|    }                                                                          \
  |  |  157|  3.21k|  }
  ------------------
 1388|  3.21k|}
__kmp_unlock_suspend_mx:
 1390|  3.23k|void __kmp_unlock_suspend_mx(kmp_info_t *th) {
 1391|  3.23k|  int status = pthread_mutex_unlock(&th->th.th_suspend_mx.m_mutex);
 1392|  3.23k|  KMP_CHECK_SYSFAIL("pthread_mutex_unlock", status);
  ------------------
  |  |  153|  3.23k|  {                                                                            \
  |  |  154|  3.23k|    if (error) {                                                               \
  |  |  ------------------
  |  |  |  Branch (154:9): [True: 0, False: 3.23k]
  |  |  ------------------
  |  |  155|      0|      KMP_SYSFAIL(func, error);                                                \
  |  |  ------------------
  |  |  |  |  148|      0|  __kmp_fatal(KMP_MSG(FunctionError, func), KMP_SYSERRCODE(error),             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  121|      0|#define KMP_MSG(...) __kmp_msg_format(kmp_i18n_msg_##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |                 __kmp_fatal(KMP_MSG(FunctionError, func), KMP_SYSERRCODE(error),             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  123|      0|#define KMP_SYSERRCODE(code) __kmp_msg_error_code(code)
  |  |  |  |  ------------------
  |  |  |  |  149|      0|              __kmp_msg_null)
  |  |  ------------------
  |  |  156|      0|    }                                                                          \
  |  |  157|  3.23k|  }
  ------------------
 1393|  3.23k|}
_Z16__kmp_suspend_64ILb0ELb1EEviP11kmp_flag_64IXT_EXT0_EE:
 1561|  1.62k|void __kmp_suspend_64(int th_gtid, kmp_flag_64<C, S> *flag) {
 1562|  1.62k|  __kmp_suspend_template(th_gtid, flag);
 1563|  1.62k|}
_Z15__kmp_resume_64ILb0ELb1EEviP11kmp_flag_64IXT_EXT0_EE:
 1667|  1.55k|void __kmp_resume_64(int target_gtid, kmp_flag_64<C, S> *flag) {
 1668|  1.55k|  __kmp_resume_template(target_gtid, flag);
 1669|  1.55k|}
__kmp_yield:
 1714|  2.07M|void __kmp_yield() { sched_yield(); }
__kmp_gtid_set_specific:
 1716|     32|void __kmp_gtid_set_specific(int gtid) {
 1717|     32|  if (__kmp_init_gtid) {
  ------------------
  |  Branch (1717:7): [True: 32, False: 0]
  ------------------
 1718|     32|    int status;
 1719|     32|    status = pthread_setspecific(__kmp_gtid_threadprivate_key,
 1720|     32|                                 (void *)(intptr_t)(gtid + 1));
 1721|     32|    KMP_CHECK_SYSFAIL("pthread_setspecific", status);
  ------------------
  |  |  153|     32|  {                                                                            \
  |  |  154|     32|    if (error) {                                                               \
  |  |  ------------------
  |  |  |  Branch (154:9): [True: 0, False: 32]
  |  |  ------------------
  |  |  155|      0|      KMP_SYSFAIL(func, error);                                                \
  |  |  ------------------
  |  |  |  |  148|      0|  __kmp_fatal(KMP_MSG(FunctionError, func), KMP_SYSERRCODE(error),             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  121|      0|#define KMP_MSG(...) __kmp_msg_format(kmp_i18n_msg_##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |                 __kmp_fatal(KMP_MSG(FunctionError, func), KMP_SYSERRCODE(error),             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  123|      0|#define KMP_SYSERRCODE(code) __kmp_msg_error_code(code)
  |  |  |  |  ------------------
  |  |  |  |  149|      0|              __kmp_msg_null)
  |  |  ------------------
  |  |  156|      0|    }                                                                          \
  |  |  157|     32|  }
  ------------------
 1722|     32|  } else {
 1723|      0|    KA_TRACE(50, ("__kmp_gtid_set_specific: runtime shutdown, returning\n"));
 1724|      0|  }
 1725|     32|}
__kmp_gtid_get_specific:
 1727|      2|int __kmp_gtid_get_specific() {
 1728|      2|  int gtid;
 1729|      2|  if (!__kmp_init_gtid) {
  ------------------
  |  Branch (1729:7): [True: 0, False: 2]
  ------------------
 1730|      0|    KA_TRACE(50, ("__kmp_gtid_get_specific: runtime shutdown, returning "
 1731|      0|                  "KMP_GTID_SHUTDOWN\n"));
 1732|      0|    return KMP_GTID_SHUTDOWN;
  ------------------
  |  | 1001|      0|#define KMP_GTID_SHUTDOWN (-3) /* Library is shutting down */
  ------------------
 1733|      0|  }
 1734|      2|  gtid = (int)(size_t)pthread_getspecific(__kmp_gtid_threadprivate_key);
 1735|      2|  if (gtid == 0) {
  ------------------
  |  Branch (1735:7): [True: 0, False: 2]
  ------------------
 1736|      0|    gtid = KMP_GTID_DNE;
  ------------------
  |  | 1000|      0|#define KMP_GTID_DNE (-2) /* Does not exist */
  ------------------
 1737|      2|  } else {
 1738|      2|    gtid--;
 1739|      2|  }
 1740|      2|  KA_TRACE(50, ("__kmp_gtid_get_specific: key:%d gtid:%d\n",
 1741|      2|                __kmp_gtid_threadprivate_key, gtid));
 1742|      2|  return gtid;
 1743|      2|}
__kmp_read_system_time:
 1784|      1|void __kmp_read_system_time(double *delta) {
 1785|      1|  double t_ns;
 1786|      1|  struct timeval tval;
 1787|      1|  struct timespec stop;
 1788|      1|  int status;
 1789|       |
 1790|      1|  status = gettimeofday(&tval, NULL);
 1791|      1|  KMP_CHECK_SYSFAIL_ERRNO("gettimeofday", status);
  ------------------
  |  |  161|      1|  {                                                                            \
  |  |  162|      1|    if (status != 0) {                                                         \
  |  |  ------------------
  |  |  |  Branch (162:9): [True: 0, False: 1]
  |  |  ------------------
  |  |  163|      0|      int error = errno;                                                       \
  |  |  164|      0|      KMP_SYSFAIL(func, error);                                                \
  |  |  ------------------
  |  |  |  |  148|      0|  __kmp_fatal(KMP_MSG(FunctionError, func), KMP_SYSERRCODE(error),             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  121|      0|#define KMP_MSG(...) __kmp_msg_format(kmp_i18n_msg_##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |                 __kmp_fatal(KMP_MSG(FunctionError, func), KMP_SYSERRCODE(error),             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  123|      0|#define KMP_SYSERRCODE(code) __kmp_msg_error_code(code)
  |  |  |  |  ------------------
  |  |  |  |  149|      0|              __kmp_msg_null)
  |  |  ------------------
  |  |  165|      0|    }                                                                          \
  |  |  166|      1|  }
  ------------------
 1792|      1|  TIMEVAL_TO_TIMESPEC(&tval, &stop);
 1793|      1|  t_ns = (double)(TS2NS(stop) - TS2NS(__kmp_sys_timer_data.start));
  ------------------
  |  |   75|      1|  (((timespec).tv_sec * (long int)1e9) + (timespec).tv_nsec)
  ------------------
                t_ns = (double)(TS2NS(stop) - TS2NS(__kmp_sys_timer_data.start));
  ------------------
  |  |   75|      1|  (((timespec).tv_sec * (long int)1e9) + (timespec).tv_nsec)
  ------------------
 1794|      1|  *delta = (t_ns * 1e-9);
 1795|      1|}
__kmp_runtime_initialize:
 1863|      1|void __kmp_runtime_initialize(void) {
 1864|      1|  int status;
 1865|      1|  pthread_mutexattr_t mutex_attr;
 1866|      1|  pthread_condattr_t cond_attr;
 1867|       |
 1868|      1|  if (__kmp_init_runtime) {
  ------------------
  |  Branch (1868:7): [True: 0, False: 1]
  ------------------
 1869|      0|    return;
 1870|      0|  }
 1871|       |
 1872|      1|#if (KMP_ARCH_X86 || KMP_ARCH_X86_64)
 1873|      1|  if (!__kmp_cpuinfo.initialized) {
  ------------------
  |  Branch (1873:7): [True: 1, False: 0]
  ------------------
 1874|      1|    __kmp_query_cpuid(&__kmp_cpuinfo);
 1875|      1|  }
 1876|      1|#endif /* KMP_ARCH_X86 || KMP_ARCH_X86_64 */
 1877|       |
 1878|      1|  __kmp_xproc = __kmp_get_xproc();
 1879|       |
 1880|      1|#if !KMP_32_BIT_ARCH
 1881|      1|  struct rlimit rlim;
 1882|       |  // read stack size of calling thread, save it as default for worker threads;
 1883|       |  // this should be done before reading environment variables
 1884|      1|  status = getrlimit(RLIMIT_STACK, &rlim);
 1885|      1|  if (status == 0) { // success?
  ------------------
  |  Branch (1885:7): [True: 1, False: 0]
  ------------------
 1886|      1|    __kmp_stksize = rlim.rlim_cur;
 1887|      1|    __kmp_check_stksize(&__kmp_stksize); // check value and adjust if needed
 1888|      1|  }
 1889|      1|#endif /* KMP_32_BIT_ARCH */
 1890|       |
 1891|      1|  if (sysconf(_SC_THREADS)) {
  ------------------
  |  Branch (1891:7): [True: 1, False: 0]
  ------------------
 1892|       |
 1893|       |    /* Query the maximum number of threads */
 1894|      1|    __kmp_type_convert(sysconf(_SC_THREAD_THREADS_MAX), &(__kmp_sys_max_nth));
 1895|      1|    if (__kmp_sys_max_nth == -1) {
  ------------------
  |  Branch (1895:9): [True: 1, False: 0]
  ------------------
 1896|       |      /* Unlimited threads for NPTL */
 1897|      1|      __kmp_sys_max_nth = INT_MAX;
 1898|      1|    } else if (__kmp_sys_max_nth <= 1) {
  ------------------
  |  Branch (1898:16): [True: 0, False: 0]
  ------------------
 1899|       |      /* Can't tell, just use PTHREAD_THREADS_MAX */
 1900|      0|      __kmp_sys_max_nth = KMP_MAX_NTH;
  ------------------
  |  | 1143|      0|#define KMP_MAX_NTH INT_MAX
  ------------------
 1901|      0|    }
 1902|       |
 1903|       |    /* Query the minimum stack size */
 1904|      1|    __kmp_sys_min_stksize = sysconf(_SC_THREAD_STACK_MIN);
 1905|      1|    if (__kmp_sys_min_stksize <= 1) {
  ------------------
  |  Branch (1905:9): [True: 0, False: 1]
  ------------------
 1906|      0|      __kmp_sys_min_stksize = KMP_MIN_STKSIZE;
  ------------------
  |  | 1148|      0|#define KMP_MIN_STKSIZE ((size_t)PTHREAD_STACK_MIN)
  ------------------
 1907|      0|    }
 1908|      1|  }
 1909|       |
 1910|       |  /* Set up minimum number of threads to switch to TLS gtid */
 1911|      1|  __kmp_tls_gtid_min = KMP_TLS_GTID_MIN;
  ------------------
  |  | 1266|      1|#define KMP_TLS_GTID_MIN 5
  ------------------
 1912|       |
 1913|      1|  status = pthread_key_create(&__kmp_gtid_threadprivate_key,
 1914|      1|                              __kmp_internal_end_dest);
 1915|      1|  KMP_CHECK_SYSFAIL("pthread_key_create", status);
  ------------------
  |  |  153|      1|  {                                                                            \
  |  |  154|      1|    if (error) {                                                               \
  |  |  ------------------
  |  |  |  Branch (154:9): [True: 0, False: 1]
  |  |  ------------------
  |  |  155|      0|      KMP_SYSFAIL(func, error);                                                \
  |  |  ------------------
  |  |  |  |  148|      0|  __kmp_fatal(KMP_MSG(FunctionError, func), KMP_SYSERRCODE(error),             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  121|      0|#define KMP_MSG(...) __kmp_msg_format(kmp_i18n_msg_##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |                 __kmp_fatal(KMP_MSG(FunctionError, func), KMP_SYSERRCODE(error),             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  123|      0|#define KMP_SYSERRCODE(code) __kmp_msg_error_code(code)
  |  |  |  |  ------------------
  |  |  |  |  149|      0|              __kmp_msg_null)
  |  |  ------------------
  |  |  156|      0|    }                                                                          \
  |  |  157|      1|  }
  ------------------
 1916|      1|  status = pthread_mutexattr_init(&mutex_attr);
 1917|      1|  KMP_CHECK_SYSFAIL("pthread_mutexattr_init", status);
  ------------------
  |  |  153|      1|  {                                                                            \
  |  |  154|      1|    if (error) {                                                               \
  |  |  ------------------
  |  |  |  Branch (154:9): [True: 0, False: 1]
  |  |  ------------------
  |  |  155|      0|      KMP_SYSFAIL(func, error);                                                \
  |  |  ------------------
  |  |  |  |  148|      0|  __kmp_fatal(KMP_MSG(FunctionError, func), KMP_SYSERRCODE(error),             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  121|      0|#define KMP_MSG(...) __kmp_msg_format(kmp_i18n_msg_##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |                 __kmp_fatal(KMP_MSG(FunctionError, func), KMP_SYSERRCODE(error),             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  123|      0|#define KMP_SYSERRCODE(code) __kmp_msg_error_code(code)
  |  |  |  |  ------------------
  |  |  |  |  149|      0|              __kmp_msg_null)
  |  |  ------------------
  |  |  156|      0|    }                                                                          \
  |  |  157|      1|  }
  ------------------
 1918|      1|  status = pthread_mutex_init(&__kmp_wait_mx.m_mutex, &mutex_attr);
 1919|      1|  KMP_CHECK_SYSFAIL("pthread_mutex_init", status);
  ------------------
  |  |  153|      1|  {                                                                            \
  |  |  154|      1|    if (error) {                                                               \
  |  |  ------------------
  |  |  |  Branch (154:9): [True: 0, False: 1]
  |  |  ------------------
  |  |  155|      0|      KMP_SYSFAIL(func, error);                                                \
  |  |  ------------------
  |  |  |  |  148|      0|  __kmp_fatal(KMP_MSG(FunctionError, func), KMP_SYSERRCODE(error),             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  121|      0|#define KMP_MSG(...) __kmp_msg_format(kmp_i18n_msg_##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |                 __kmp_fatal(KMP_MSG(FunctionError, func), KMP_SYSERRCODE(error),             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  123|      0|#define KMP_SYSERRCODE(code) __kmp_msg_error_code(code)
  |  |  |  |  ------------------
  |  |  |  |  149|      0|              __kmp_msg_null)
  |  |  ------------------
  |  |  156|      0|    }                                                                          \
  |  |  157|      1|  }
  ------------------
 1920|      1|  status = pthread_mutexattr_destroy(&mutex_attr);
 1921|      1|  KMP_CHECK_SYSFAIL("pthread_mutexattr_destroy", status);
  ------------------
  |  |  153|      1|  {                                                                            \
  |  |  154|      1|    if (error) {                                                               \
  |  |  ------------------
  |  |  |  Branch (154:9): [True: 0, False: 1]
  |  |  ------------------
  |  |  155|      0|      KMP_SYSFAIL(func, error);                                                \
  |  |  ------------------
  |  |  |  |  148|      0|  __kmp_fatal(KMP_MSG(FunctionError, func), KMP_SYSERRCODE(error),             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  121|      0|#define KMP_MSG(...) __kmp_msg_format(kmp_i18n_msg_##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |                 __kmp_fatal(KMP_MSG(FunctionError, func), KMP_SYSERRCODE(error),             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  123|      0|#define KMP_SYSERRCODE(code) __kmp_msg_error_code(code)
  |  |  |  |  ------------------
  |  |  |  |  149|      0|              __kmp_msg_null)
  |  |  ------------------
  |  |  156|      0|    }                                                                          \
  |  |  157|      1|  }
  ------------------
 1922|      1|  status = pthread_condattr_init(&cond_attr);
 1923|      1|  KMP_CHECK_SYSFAIL("pthread_condattr_init", status);
  ------------------
  |  |  153|      1|  {                                                                            \
  |  |  154|      1|    if (error) {                                                               \
  |  |  ------------------
  |  |  |  Branch (154:9): [True: 0, False: 1]
  |  |  ------------------
  |  |  155|      0|      KMP_SYSFAIL(func, error);                                                \
  |  |  ------------------
  |  |  |  |  148|      0|  __kmp_fatal(KMP_MSG(FunctionError, func), KMP_SYSERRCODE(error),             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  121|      0|#define KMP_MSG(...) __kmp_msg_format(kmp_i18n_msg_##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |                 __kmp_fatal(KMP_MSG(FunctionError, func), KMP_SYSERRCODE(error),             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  123|      0|#define KMP_SYSERRCODE(code) __kmp_msg_error_code(code)
  |  |  |  |  ------------------
  |  |  |  |  149|      0|              __kmp_msg_null)
  |  |  ------------------
  |  |  156|      0|    }                                                                          \
  |  |  157|      1|  }
  ------------------
 1924|      1|  status = pthread_cond_init(&__kmp_wait_cv.c_cond, &cond_attr);
 1925|      1|  KMP_CHECK_SYSFAIL("pthread_cond_init", status);
  ------------------
  |  |  153|      1|  {                                                                            \
  |  |  154|      1|    if (error) {                                                               \
  |  |  ------------------
  |  |  |  Branch (154:9): [True: 0, False: 1]
  |  |  ------------------
  |  |  155|      0|      KMP_SYSFAIL(func, error);                                                \
  |  |  ------------------
  |  |  |  |  148|      0|  __kmp_fatal(KMP_MSG(FunctionError, func), KMP_SYSERRCODE(error),             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  121|      0|#define KMP_MSG(...) __kmp_msg_format(kmp_i18n_msg_##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |                 __kmp_fatal(KMP_MSG(FunctionError, func), KMP_SYSERRCODE(error),             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  123|      0|#define KMP_SYSERRCODE(code) __kmp_msg_error_code(code)
  |  |  |  |  ------------------
  |  |  |  |  149|      0|              __kmp_msg_null)
  |  |  ------------------
  |  |  156|      0|    }                                                                          \
  |  |  157|      1|  }
  ------------------
 1926|      1|  status = pthread_condattr_destroy(&cond_attr);
 1927|      1|  KMP_CHECK_SYSFAIL("pthread_condattr_destroy", status);
  ------------------
  |  |  153|      1|  {                                                                            \
  |  |  154|      1|    if (error) {                                                               \
  |  |  ------------------
  |  |  |  Branch (154:9): [True: 0, False: 1]
  |  |  ------------------
  |  |  155|      0|      KMP_SYSFAIL(func, error);                                                \
  |  |  ------------------
  |  |  |  |  148|      0|  __kmp_fatal(KMP_MSG(FunctionError, func), KMP_SYSERRCODE(error),             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  121|      0|#define KMP_MSG(...) __kmp_msg_format(kmp_i18n_msg_##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |                 __kmp_fatal(KMP_MSG(FunctionError, func), KMP_SYSERRCODE(error),             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  123|      0|#define KMP_SYSERRCODE(code) __kmp_msg_error_code(code)
  |  |  |  |  ------------------
  |  |  |  |  149|      0|              __kmp_msg_null)
  |  |  ------------------
  |  |  156|      0|    }                                                                          \
  |  |  157|      1|  }
  ------------------
 1928|       |#if USE_ITT_BUILD
 1929|       |  __kmp_itt_initialize();
 1930|       |#endif /* USE_ITT_BUILD */
 1931|       |
 1932|      1|  __kmp_init_runtime = TRUE;
  ------------------
  |  | 1280|      1|#define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  | 1279|      1|#define FALSE 0
  |  |  ------------------
  ------------------
 1933|      1|}
__kmp_runtime_destroy:
 1935|      1|void __kmp_runtime_destroy(void) {
 1936|      1|  int status;
 1937|       |
 1938|      1|  if (!__kmp_init_runtime) {
  ------------------
  |  Branch (1938:7): [True: 0, False: 1]
  ------------------
 1939|      0|    return; // Nothing to do.
 1940|      0|  }
 1941|       |
 1942|       |#if USE_ITT_BUILD
 1943|       |  __kmp_itt_destroy();
 1944|       |#endif /* USE_ITT_BUILD */
 1945|       |
 1946|      1|  status = pthread_key_delete(__kmp_gtid_threadprivate_key);
 1947|      1|  KMP_CHECK_SYSFAIL("pthread_key_delete", status);
  ------------------
  |  |  153|      1|  {                                                                            \
  |  |  154|      1|    if (error) {                                                               \
  |  |  ------------------
  |  |  |  Branch (154:9): [True: 0, False: 1]
  |  |  ------------------
  |  |  155|      0|      KMP_SYSFAIL(func, error);                                                \
  |  |  ------------------
  |  |  |  |  148|      0|  __kmp_fatal(KMP_MSG(FunctionError, func), KMP_SYSERRCODE(error),             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  121|      0|#define KMP_MSG(...) __kmp_msg_format(kmp_i18n_msg_##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |                 __kmp_fatal(KMP_MSG(FunctionError, func), KMP_SYSERRCODE(error),             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  123|      0|#define KMP_SYSERRCODE(code) __kmp_msg_error_code(code)
  |  |  |  |  ------------------
  |  |  |  |  149|      0|              __kmp_msg_null)
  |  |  ------------------
  |  |  156|      0|    }                                                                          \
  |  |  157|      1|  }
  ------------------
 1948|       |
 1949|      1|  status = pthread_mutex_destroy(&__kmp_wait_mx.m_mutex);
 1950|      1|  if (status != 0 && status != EBUSY) {
  ------------------
  |  Branch (1950:7): [True: 0, False: 1]
  |  Branch (1950:22): [True: 0, False: 0]
  ------------------
 1951|      0|    KMP_SYSFAIL("pthread_mutex_destroy", status);
  ------------------
  |  |  148|      0|  __kmp_fatal(KMP_MSG(FunctionError, func), KMP_SYSERRCODE(error),             \
  |  |  ------------------
  |  |  |  |  121|      0|#define KMP_MSG(...) __kmp_msg_format(kmp_i18n_msg_##__VA_ARGS__)
  |  |  ------------------
  |  |                 __kmp_fatal(KMP_MSG(FunctionError, func), KMP_SYSERRCODE(error),             \
  |  |  ------------------
  |  |  |  |  123|      0|#define KMP_SYSERRCODE(code) __kmp_msg_error_code(code)
  |  |  ------------------
  |  |  149|      0|              __kmp_msg_null)
  ------------------
 1952|      0|  }
 1953|      1|  status = pthread_cond_destroy(&__kmp_wait_cv.c_cond);
 1954|      1|  if (status != 0 && status != EBUSY) {
  ------------------
  |  Branch (1954:7): [True: 0, False: 1]
  |  Branch (1954:22): [True: 0, False: 0]
  ------------------
 1955|      0|    KMP_SYSFAIL("pthread_cond_destroy", status);
  ------------------
  |  |  148|      0|  __kmp_fatal(KMP_MSG(FunctionError, func), KMP_SYSERRCODE(error),             \
  |  |  ------------------
  |  |  |  |  121|      0|#define KMP_MSG(...) __kmp_msg_format(kmp_i18n_msg_##__VA_ARGS__)
  |  |  ------------------
  |  |                 __kmp_fatal(KMP_MSG(FunctionError, func), KMP_SYSERRCODE(error),             \
  |  |  ------------------
  |  |  |  |  123|      0|#define KMP_SYSERRCODE(code) __kmp_msg_error_code(code)
  |  |  ------------------
  |  |  149|      0|              __kmp_msg_null)
  ------------------
 1956|      0|  }
 1957|      1|#if KMP_AFFINITY_SUPPORTED
 1958|      1|  __kmp_affinity_uninitialize();
 1959|      1|#endif
 1960|       |
 1961|      1|  __kmp_init_runtime = FALSE;
  ------------------
  |  | 1279|      1|#define FALSE 0
  ------------------
 1962|      1|}
_Z14__kmp_now_nsecv:
 1992|      2|kmp_uint64 __kmp_now_nsec() {
 1993|      2|  struct timeval t;
 1994|      2|  gettimeofday(&t, NULL);
 1995|      2|  kmp_uint64 nsec = (kmp_uint64)KMP_NSEC_PER_SEC * (kmp_uint64)t.tv_sec +
  ------------------
  |  |  181|      2|#define KMP_NSEC_PER_SEC 1000000000L
  ------------------
 1996|      2|                    (kmp_uint64)1000 * (kmp_uint64)t.tv_usec;
 1997|      2|  return nsec;
 1998|      2|}
__kmp_initialize_system_tick:
 2002|      1|void __kmp_initialize_system_tick() {
 2003|      1|  kmp_uint64 now, nsec2, diff;
 2004|      1|  kmp_uint64 delay = 100000; // 50~100 usec on most machines.
 2005|      1|  kmp_uint64 nsec = __kmp_now_nsec();
 2006|      1|  kmp_uint64 goal = __kmp_hardware_timestamp() + delay;
 2007|  3.83k|  while ((now = __kmp_hardware_timestamp()) < goal)
  ------------------
  |  Branch (2007:10): [True: 3.83k, False: 1]
  ------------------
 2008|  3.83k|    ;
 2009|      1|  nsec2 = __kmp_now_nsec();
 2010|      1|  diff = nsec2 - nsec;
 2011|      1|  if (diff > 0) {
  ------------------
  |  Branch (2011:7): [True: 1, False: 0]
  ------------------
 2012|      1|    kmp_uint64 tpms = ((kmp_uint64)1e6 * (delay + (now - goal)) / diff);
 2013|      1|    if (tpms > 0)
  ------------------
  |  Branch (2013:9): [True: 1, False: 0]
  ------------------
 2014|      1|      __kmp_ticks_per_msec = tpms;
 2015|      1|  }
 2016|      1|}
z_Linux_util.cpp:_ZL20__kmp_set_stack_infoiP8kmp_info:
  408|     32|static kmp_int32 __kmp_set_stack_info(int gtid, kmp_info_t *th) {
  409|     32|  int stack_data;
  410|     32|#if KMP_OS_LINUX || KMP_OS_DRAGONFLY || KMP_OS_FREEBSD || KMP_OS_NETBSD ||     \
  411|     32|    KMP_OS_HURD
  412|     32|  pthread_attr_t attr;
  413|     32|  int status;
  414|     32|  size_t size = 0;
  415|     32|  void *addr = 0;
  416|       |
  417|       |  /* Always do incremental stack refinement for ubermaster threads since the
  418|       |     initial thread stack range can be reduced by sibling thread creation so
  419|       |     pthread_attr_getstack may cause thread gtid aliasing */
  420|     32|  if (!KMP_UBER_GTID(gtid)) {
  ------------------
  |  Branch (420:7): [True: 31, False: 1]
  ------------------
  421|       |
  422|       |    /* Fetch the real thread attributes */
  423|     31|    status = pthread_attr_init(&attr);
  424|     31|    KMP_CHECK_SYSFAIL("pthread_attr_init", status);
  ------------------
  |  |  153|     31|  {                                                                            \
  |  |  154|     31|    if (error) {                                                               \
  |  |  ------------------
  |  |  |  Branch (154:9): [True: 0, False: 31]
  |  |  ------------------
  |  |  155|      0|      KMP_SYSFAIL(func, error);                                                \
  |  |  ------------------
  |  |  |  |  148|      0|  __kmp_fatal(KMP_MSG(FunctionError, func), KMP_SYSERRCODE(error),             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  121|      0|#define KMP_MSG(...) __kmp_msg_format(kmp_i18n_msg_##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |                 __kmp_fatal(KMP_MSG(FunctionError, func), KMP_SYSERRCODE(error),             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  123|      0|#define KMP_SYSERRCODE(code) __kmp_msg_error_code(code)
  |  |  |  |  ------------------
  |  |  |  |  149|      0|              __kmp_msg_null)
  |  |  ------------------
  |  |  156|      0|    }                                                                          \
  |  |  157|     31|  }
  ------------------
  425|       |#if KMP_OS_DRAGONFLY || KMP_OS_FREEBSD || KMP_OS_NETBSD
  426|       |    status = pthread_attr_get_np(pthread_self(), &attr);
  427|       |    KMP_CHECK_SYSFAIL("pthread_attr_get_np", status);
  428|       |#else
  429|     31|    status = pthread_getattr_np(pthread_self(), &attr);
  430|     31|    KMP_CHECK_SYSFAIL("pthread_getattr_np", status);
  ------------------
  |  |  153|     31|  {                                                                            \
  |  |  154|     31|    if (error) {                                                               \
  |  |  ------------------
  |  |  |  Branch (154:9): [True: 0, False: 31]
  |  |  ------------------
  |  |  155|      0|      KMP_SYSFAIL(func, error);                                                \
  |  |  ------------------
  |  |  |  |  148|      0|  __kmp_fatal(KMP_MSG(FunctionError, func), KMP_SYSERRCODE(error),             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  121|      0|#define KMP_MSG(...) __kmp_msg_format(kmp_i18n_msg_##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |                 __kmp_fatal(KMP_MSG(FunctionError, func), KMP_SYSERRCODE(error),             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  123|      0|#define KMP_SYSERRCODE(code) __kmp_msg_error_code(code)
  |  |  |  |  ------------------
  |  |  |  |  149|      0|              __kmp_msg_null)
  |  |  ------------------
  |  |  156|      0|    }                                                                          \
  |  |  157|     31|  }
  ------------------
  431|     31|#endif
  432|     31|    status = pthread_attr_getstack(&attr, &addr, &size);
  433|     31|    KMP_CHECK_SYSFAIL("pthread_attr_getstack", status);
  ------------------
  |  |  153|     31|  {                                                                            \
  |  |  154|     31|    if (error) {                                                               \
  |  |  ------------------
  |  |  |  Branch (154:9): [True: 0, False: 31]
  |  |  ------------------
  |  |  155|      0|      KMP_SYSFAIL(func, error);                                                \
  |  |  ------------------
  |  |  |  |  148|      0|  __kmp_fatal(KMP_MSG(FunctionError, func), KMP_SYSERRCODE(error),             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  121|      0|#define KMP_MSG(...) __kmp_msg_format(kmp_i18n_msg_##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |                 __kmp_fatal(KMP_MSG(FunctionError, func), KMP_SYSERRCODE(error),             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  123|      0|#define KMP_SYSERRCODE(code) __kmp_msg_error_code(code)
  |  |  |  |  ------------------
  |  |  |  |  149|      0|              __kmp_msg_null)
  |  |  ------------------
  |  |  156|      0|    }                                                                          \
  |  |  157|     31|  }
  ------------------
  434|     31|    KA_TRACE(60,
  435|     31|             ("__kmp_set_stack_info: T#%d pthread_attr_getstack returned size:"
  436|     31|              " %lu, low addr: %p\n",
  437|     31|              gtid, size, addr));
  438|     31|    status = pthread_attr_destroy(&attr);
  439|     31|    KMP_CHECK_SYSFAIL("pthread_attr_destroy", status);
  ------------------
  |  |  153|     31|  {                                                                            \
  |  |  154|     31|    if (error) {                                                               \
  |  |  ------------------
  |  |  |  Branch (154:9): [True: 0, False: 31]
  |  |  ------------------
  |  |  155|      0|      KMP_SYSFAIL(func, error);                                                \
  |  |  ------------------
  |  |  |  |  148|      0|  __kmp_fatal(KMP_MSG(FunctionError, func), KMP_SYSERRCODE(error),             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  121|      0|#define KMP_MSG(...) __kmp_msg_format(kmp_i18n_msg_##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |                 __kmp_fatal(KMP_MSG(FunctionError, func), KMP_SYSERRCODE(error),             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  123|      0|#define KMP_SYSERRCODE(code) __kmp_msg_error_code(code)
  |  |  |  |  ------------------
  |  |  |  |  149|      0|              __kmp_msg_null)
  |  |  ------------------
  |  |  156|      0|    }                                                                          \
  |  |  157|     31|  }
  ------------------
  440|     31|  }
  441|       |
  442|     32|  if (size != 0 && addr != 0) { // was stack parameter determination successful?
  ------------------
  |  Branch (442:7): [True: 31, False: 1]
  |  Branch (442:20): [True: 31, False: 0]
  ------------------
  443|       |    /* Store the correct base and size */
  444|     31|    TCW_PTR(th->th.th_info.ds.ds_stackbase, (((char *)addr) + size));
  ------------------
  |  | 1157|     31|#define TCW_PTR(a, b) TCW_8((a), (b))
  |  |  ------------------
  |  |  |  | 1132|     31|#define TCW_8(a, b) (a) = (b)
  |  |  ------------------
  ------------------
  445|     31|    TCW_PTR(th->th.th_info.ds.ds_stacksize, size);
  ------------------
  |  | 1157|     31|#define TCW_PTR(a, b) TCW_8((a), (b))
  |  |  ------------------
  |  |  |  | 1132|     31|#define TCW_8(a, b) (a) = (b)
  |  |  ------------------
  ------------------
  446|     31|    TCW_4(th->th.th_info.ds.ds_stackgrow, FALSE);
  ------------------
  |  | 1128|     31|#define TCW_4(a, b) (a) = (b)
  ------------------
  447|     31|    return TRUE;
  ------------------
  |  | 1280|     31|#define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  | 1279|     31|#define FALSE 0
  |  |  ------------------
  ------------------
  448|     31|  }
  449|      1|#endif /* KMP_OS_LINUX || KMP_OS_DRAGONFLY || KMP_OS_FREEBSD || KMP_OS_NETBSD  \
  450|       |          || KMP_OS_HURD */
  451|       |  /* Use incremental refinement starting from initial conservative estimate */
  452|      1|  TCW_PTR(th->th.th_info.ds.ds_stacksize, 0);
  ------------------
  |  | 1157|      1|#define TCW_PTR(a, b) TCW_8((a), (b))
  |  |  ------------------
  |  |  |  | 1132|      1|#define TCW_8(a, b) (a) = (b)
  |  |  ------------------
  ------------------
  453|      1|  TCW_PTR(th->th.th_info.ds.ds_stackbase, &stack_data);
  ------------------
  |  | 1157|      1|#define TCW_PTR(a, b) TCW_8((a), (b))
  |  |  ------------------
  |  |  |  | 1132|      1|#define TCW_8(a, b) (a) = (b)
  |  |  ------------------
  ------------------
  454|      1|  TCW_4(th->th.th_info.ds.ds_stackgrow, TRUE);
  ------------------
  |  | 1128|      1|#define TCW_4(a, b) (a) = (b)
  ------------------
  455|      1|  return FALSE;
  ------------------
  |  | 1279|      1|#define FALSE 0
  ------------------
  456|     32|}
z_Linux_util.cpp:_ZL19__kmp_launch_workerPv:
  458|     31|static void *__kmp_launch_worker(void *thr) {
  459|     31|  int status, old_type, old_state;
  460|       |#ifdef KMP_BLOCK_SIGNALS
  461|       |  sigset_t new_set, old_set;
  462|       |#endif /* KMP_BLOCK_SIGNALS */
  463|     31|  void *exit_val;
  464|     31|#if KMP_OS_LINUX || KMP_OS_DRAGONFLY || KMP_OS_FREEBSD || KMP_OS_NETBSD ||     \
  465|     31|    KMP_OS_OPENBSD || KMP_OS_HURD
  466|     31|  void *volatile padding = 0;
  467|     31|#endif
  468|     31|  int gtid;
  469|       |
  470|     31|  gtid = ((kmp_info_t *)thr)->th.th_info.ds.ds_gtid;
  471|     31|  __kmp_gtid_set_specific(gtid);
  472|     31|#ifdef KMP_TDATA_GTID
  473|     31|  __kmp_gtid = gtid;
  474|     31|#endif
  475|       |#if KMP_STATS_ENABLED
  476|       |  // set thread local index to point to thread-specific stats
  477|       |  __kmp_stats_thread_ptr = ((kmp_info_t *)thr)->th.th_stats;
  478|       |  __kmp_stats_thread_ptr->startLife();
  479|       |  KMP_SET_THREAD_STATE(IDLE);
  480|       |  KMP_INIT_PARTITIONED_TIMERS(OMP_idle);
  481|       |#endif
  482|       |
  483|       |#if USE_ITT_BUILD
  484|       |  __kmp_itt_thread_name(gtid);
  485|       |#endif /* USE_ITT_BUILD */
  486|       |
  487|     31|#if KMP_AFFINITY_SUPPORTED
  488|     31|  __kmp_affinity_set_init_mask(gtid, FALSE);
  ------------------
  |  | 1279|     31|#define FALSE 0
  ------------------
  489|     31|#endif
  490|       |
  491|     31|#ifdef KMP_CANCEL_THREADS
  492|     31|  status = pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, &old_type);
  493|     31|  KMP_CHECK_SYSFAIL("pthread_setcanceltype", status);
  ------------------
  |  |  153|     31|  {                                                                            \
  |  |  154|     31|    if (error) {                                                               \
  |  |  ------------------
  |  |  |  Branch (154:9): [True: 0, False: 31]
  |  |  ------------------
  |  |  155|      0|      KMP_SYSFAIL(func, error);                                                \
  |  |  ------------------
  |  |  |  |  148|      0|  __kmp_fatal(KMP_MSG(FunctionError, func), KMP_SYSERRCODE(error),             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  121|      0|#define KMP_MSG(...) __kmp_msg_format(kmp_i18n_msg_##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |                 __kmp_fatal(KMP_MSG(FunctionError, func), KMP_SYSERRCODE(error),             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  123|      0|#define KMP_SYSERRCODE(code) __kmp_msg_error_code(code)
  |  |  |  |  ------------------
  |  |  |  |  149|      0|              __kmp_msg_null)
  |  |  ------------------
  |  |  156|      0|    }                                                                          \
  |  |  157|     31|  }
  ------------------
  494|       |  // josh todo: isn't PTHREAD_CANCEL_ENABLE default for newly-created threads?
  495|     31|  status = pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, &old_state);
  496|     31|  KMP_CHECK_SYSFAIL("pthread_setcancelstate", status);
  ------------------
  |  |  153|     31|  {                                                                            \
  |  |  154|     31|    if (error) {                                                               \
  |  |  ------------------
  |  |  |  Branch (154:9): [True: 0, False: 31]
  |  |  ------------------
  |  |  155|      0|      KMP_SYSFAIL(func, error);                                                \
  |  |  ------------------
  |  |  |  |  148|      0|  __kmp_fatal(KMP_MSG(FunctionError, func), KMP_SYSERRCODE(error),             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  121|      0|#define KMP_MSG(...) __kmp_msg_format(kmp_i18n_msg_##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |                 __kmp_fatal(KMP_MSG(FunctionError, func), KMP_SYSERRCODE(error),             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  123|      0|#define KMP_SYSERRCODE(code) __kmp_msg_error_code(code)
  |  |  |  |  ------------------
  |  |  |  |  149|      0|              __kmp_msg_null)
  |  |  ------------------
  |  |  156|      0|    }                                                                          \
  |  |  157|     31|  }
  ------------------
  497|     31|#endif
  498|       |
  499|     31|#if KMP_ARCH_X86 || KMP_ARCH_X86_64
  500|       |  // Set FP control regs to be a copy of the parallel initialization thread's.
  501|     31|  __kmp_clear_x87_fpu_status_word();
  502|     31|  __kmp_load_x87_fpu_control_word(&__kmp_init_x87_fpu_control_word);
  503|     31|  __kmp_load_mxcsr(&__kmp_init_mxcsr);
  504|     31|#endif /* KMP_ARCH_X86 || KMP_ARCH_X86_64 */
  505|       |
  506|       |#ifdef KMP_BLOCK_SIGNALS
  507|       |  status = sigfillset(&new_set);
  508|       |  KMP_CHECK_SYSFAIL_ERRNO("sigfillset", status);
  509|       |  status = pthread_sigmask(SIG_BLOCK, &new_set, &old_set);
  510|       |  KMP_CHECK_SYSFAIL("pthread_sigmask", status);
  511|       |#endif /* KMP_BLOCK_SIGNALS */
  512|       |
  513|     31|#if KMP_OS_LINUX || KMP_OS_DRAGONFLY || KMP_OS_FREEBSD || KMP_OS_NETBSD ||     \
  514|     31|    KMP_OS_OPENBSD
  515|     31|  if (__kmp_stkoffset > 0 && gtid > 0) {
  ------------------
  |  Branch (515:7): [True: 31, False: 0]
  |  Branch (515:30): [True: 31, False: 0]
  ------------------
  516|     31|    padding = KMP_ALLOCA(gtid * __kmp_stkoffset);
  ------------------
  |  |   59|     31|#define KMP_ALLOCA alloca
  ------------------
  517|     31|    (void)padding;
  518|     31|  }
  519|     31|#endif
  520|       |
  521|     31|  KMP_MB();
  522|     31|  __kmp_set_stack_info(gtid, (kmp_info_t *)thr);
  523|       |
  524|     31|  __kmp_check_stack_overlap((kmp_info_t *)thr);
  525|       |
  526|     31|  exit_val = __kmp_launch_thread((kmp_info_t *)thr);
  527|       |
  528|       |#ifdef KMP_BLOCK_SIGNALS
  529|       |  status = pthread_sigmask(SIG_SETMASK, &old_set, NULL);
  530|       |  KMP_CHECK_SYSFAIL("pthread_sigmask", status);
  531|       |#endif /* KMP_BLOCK_SIGNALS */
  532|       |
  533|     31|  return exit_val;
  534|     31|}
z_Linux_util.cpp:_ZL25__kmp_install_one_handleriPFviEi:
 1113|     11|                                      int parallel_init) {
 1114|     11|  KMP_MB(); // Flush all pending memory write invalidates.
 1115|     11|  KB_TRACE(60,
 1116|     11|           ("__kmp_install_one_handler( %d, ..., %d )\n", sig, parallel_init));
 1117|     11|  if (parallel_init) {
  ------------------
  |  Branch (1117:7): [True: 0, False: 11]
  ------------------
 1118|      0|    struct sigaction new_action;
 1119|      0|    struct sigaction old_action;
 1120|      0|    new_action.sa_handler = handler_func;
 1121|      0|    new_action.sa_flags = 0;
 1122|      0|    sigfillset(&new_action.sa_mask);
 1123|      0|    __kmp_sigaction(sig, &new_action, &old_action);
 1124|      0|    if (old_action.sa_handler == __kmp_sighldrs[sig].sa_handler) {
  ------------------
  |  Branch (1124:9): [True: 0, False: 0]
  ------------------
 1125|      0|      sigaddset(&__kmp_sigset, sig);
 1126|      0|    } else {
 1127|       |      // Restore/keep user's handler if one previously installed.
 1128|      0|      __kmp_sigaction(sig, &old_action, NULL);
 1129|      0|    }
 1130|     11|  } else {
 1131|       |    // Save initial/system signal handlers to see if user handlers installed.
 1132|       |    __kmp_sigaction(sig, NULL, &__kmp_sighldrs[sig]);
 1133|     11|  }
 1134|     11|  KMP_MB(); // Flush all pending memory write invalidates.
 1135|     11|} // __kmp_install_one_handler
z_Linux_util.cpp:_ZL15__kmp_sigactioniPK9sigactionPS_:
 1107|     11|                            struct sigaction *oldact) {
 1108|     11|  int rc = sigaction(signum, act, oldact);
 1109|       |  KMP_CHECK_SYSFAIL_ERRNO("sigaction", rc);
  ------------------
  |  |  161|     11|  {                                                                            \
  |  |  162|     11|    if (status != 0) {                                                         \
  |  |  ------------------
  |  |  |  Branch (162:9): [True: 0, False: 11]
  |  |  ------------------
  |  |  163|      0|      int error = errno;                                                       \
  |  |  164|      0|      KMP_SYSFAIL(func, error);                                                \
  |  |  ------------------
  |  |  |  |  148|      0|  __kmp_fatal(KMP_MSG(FunctionError, func), KMP_SYSERRCODE(error),             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  121|      0|#define KMP_MSG(...) __kmp_msg_format(kmp_i18n_msg_##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |                 __kmp_fatal(KMP_MSG(FunctionError, func), KMP_SYSERRCODE(error),             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  123|      0|#define KMP_SYSERRCODE(code) __kmp_msg_error_code(code)
  |  |  |  |  ------------------
  |  |  |  |  149|      0|              __kmp_msg_null)
  |  |  ------------------
  |  |  165|      0|    }                                                                          \
  |  |  166|     11|  }
  ------------------
 1110|     11|}
z_Linux_util.cpp:_ZL24__kmp_remove_one_handleri:
 1137|     64|static void __kmp_remove_one_handler(int sig) {
 1138|     64|  KB_TRACE(60, ("__kmp_remove_one_handler( %d )\n", sig));
 1139|     64|  if (sigismember(&__kmp_sigset, sig)) {
  ------------------
  |  Branch (1139:7): [True: 0, False: 64]
  ------------------
 1140|      0|    struct sigaction old;
 1141|      0|    KMP_MB(); // Flush all pending memory write invalidates.
 1142|      0|    __kmp_sigaction(sig, &__kmp_sighldrs[sig], &old);
 1143|      0|    if ((old.sa_handler != __kmp_team_handler) &&
  ------------------
  |  Branch (1143:9): [True: 0, False: 0]
  ------------------
 1144|      0|        (old.sa_handler != __kmp_null_handler)) {
  ------------------
  |  Branch (1144:9): [True: 0, False: 0]
  ------------------
 1145|       |      // Restore the users signal handler.
 1146|      0|      KB_TRACE(10, ("__kmp_remove_one_handler: oops, not our handler, "
 1147|      0|                    "restoring: sig=%d\n",
 1148|      0|                    sig));
 1149|       |      __kmp_sigaction(sig, &old, NULL);
 1150|      0|    }
 1151|      0|    sigdelset(&__kmp_sigset, sig);
 1152|      0|    KMP_MB(); // Flush all pending memory write invalidates.
 1153|      0|  }
 1154|     64|} // __kmp_remove_one_handler
z_Linux_util.cpp:_ZL15__kmp_get_xprocv:
 1805|      1|static int __kmp_get_xproc(void) {
 1806|       |
 1807|      1|  int r = 0;
 1808|       |
 1809|      1|#if KMP_OS_LINUX
 1810|       |
 1811|      1|  __kmp_type_convert(sysconf(_SC_NPROCESSORS_CONF), &(r));
 1812|       |
 1813|       |#elif KMP_OS_DRAGONFLY || KMP_OS_FREEBSD || KMP_OS_NETBSD || KMP_OS_OPENBSD || \
 1814|       |    KMP_OS_HURD
 1815|       |
 1816|       |  __kmp_type_convert(sysconf(_SC_NPROCESSORS_ONLN), &(r));
 1817|       |
 1818|       |#elif KMP_OS_DARWIN
 1819|       |
 1820|       |  // Bug C77011 High "OpenMP Threads and number of active cores".
 1821|       |
 1822|       |  // Find the number of available CPUs.
 1823|       |  kern_return_t rc;
 1824|       |  host_basic_info_data_t info;
 1825|       |  mach_msg_type_number_t num = HOST_BASIC_INFO_COUNT;
 1826|       |  rc = host_info(mach_host_self(), HOST_BASIC_INFO, (host_info_t)&info, &num);
 1827|       |  if (rc == 0 && num == HOST_BASIC_INFO_COUNT) {
 1828|       |    // Cannot use KA_TRACE() here because this code works before trace support
 1829|       |    // is initialized.
 1830|       |    r = info.avail_cpus;
 1831|       |  } else {
 1832|       |    KMP_WARNING(CantGetNumAvailCPU);
 1833|       |    KMP_INFORM(AssumedNumCPU);
 1834|       |  }
 1835|       |
 1836|       |#else
 1837|       |
 1838|       |#error "Unknown or unsupported OS."
 1839|       |
 1840|       |#endif
 1841|       |
 1842|      1|  return r > 0 ? r : 2; /* guess value of 2 if OS told us 0 */
  ------------------
  |  Branch (1842:10): [True: 1, False: 0]
  ------------------
 1843|       |
 1844|      1|} // __kmp_get_xproc
z_Linux_util.cpp:_ZL22__kmp_suspend_templateI11kmp_flag_64ILb0ELb1EEEviPT_:
 1398|  1.62k|static inline void __kmp_suspend_template(int th_gtid, C *flag) {
 1399|  1.62k|  KMP_TIME_DEVELOPER_PARTITIONED_BLOCK(USER_suspend);
  ------------------
  |  | 1008|  1.62k|#define KMP_TIME_DEVELOPER_PARTITIONED_BLOCK(n) ((void)0)
  ------------------
 1400|  1.62k|  kmp_info_t *th = __kmp_threads[th_gtid];
 1401|  1.62k|  int status;
 1402|  1.62k|  typename C::flag_t old_spin;
 1403|       |
 1404|  1.62k|  KF_TRACE(30, ("__kmp_suspend_template: T#%d enter for flag = %p\n", th_gtid,
 1405|  1.62k|                flag->get()));
 1406|       |
 1407|  1.62k|  __kmp_suspend_initialize_thread(th);
 1408|       |
 1409|  1.62k|  __kmp_lock_suspend_mx(th);
 1410|       |
 1411|  1.62k|  KF_TRACE(10, ("__kmp_suspend_template: T#%d setting sleep bit for spin(%p)\n",
 1412|  1.62k|                th_gtid, flag->get()));
 1413|       |
 1414|       |  /* TODO: shouldn't this use release semantics to ensure that
 1415|       |     __kmp_suspend_initialize_thread gets called first? */
 1416|  1.62k|  old_spin = flag->set_sleeping();
 1417|  1.62k|  TCW_PTR(th->th.th_sleep_loc, (void *)flag);
  ------------------
  |  | 1157|  1.62k|#define TCW_PTR(a, b) TCW_8((a), (b))
  |  |  ------------------
  |  |  |  | 1132|  1.62k|#define TCW_8(a, b) (a) = (b)
  |  |  ------------------
  ------------------
 1418|  1.62k|  th->th.th_sleep_loc_type = flag->get_type();
 1419|  1.62k|  if (__kmp_dflt_blocktime == KMP_MAX_BLOCKTIME &&
  ------------------
  |  | 1184|  3.24k|  (INT_MAX) /* Must be this for "infinite" setting the work */
  ------------------
  |  Branch (1419:7): [True: 0, False: 1.62k]
  ------------------
 1420|      0|      __kmp_pause_status != kmp_soft_paused) {
  ------------------
  |  Branch (1420:7): [True: 0, False: 0]
  ------------------
 1421|      0|    flag->unset_sleeping();
 1422|      0|    TCW_PTR(th->th.th_sleep_loc, NULL);
  ------------------
  |  | 1157|      0|#define TCW_PTR(a, b) TCW_8((a), (b))
  |  |  ------------------
  |  |  |  | 1132|      0|#define TCW_8(a, b) (a) = (b)
  |  |  ------------------
  ------------------
 1423|      0|    th->th.th_sleep_loc_type = flag_unset;
 1424|      0|    __kmp_unlock_suspend_mx(th);
 1425|      0|    return;
 1426|      0|  }
 1427|  1.62k|  KF_TRACE(5, ("__kmp_suspend_template: T#%d set sleep bit for spin(%p)==%x,"
 1428|  1.62k|               " was %x\n",
 1429|  1.62k|               th_gtid, flag->get(), flag->load(), old_spin));
 1430|       |
 1431|  1.62k|  if (flag->done_check_val(old_spin) || flag->done_check()) {
  ------------------
  |  Branch (1431:7): [True: 41, False: 1.58k]
  |  Branch (1431:41): [True: 2, False: 1.57k]
  ------------------
 1432|     47|    flag->unset_sleeping();
 1433|     47|    TCW_PTR(th->th.th_sleep_loc, NULL);
  ------------------
  |  | 1157|     47|#define TCW_PTR(a, b) TCW_8((a), (b))
  |  |  ------------------
  |  |  |  | 1132|     47|#define TCW_8(a, b) (a) = (b)
  |  |  ------------------
  ------------------
 1434|     47|    th->th.th_sleep_loc_type = flag_unset;
 1435|     47|    KF_TRACE(5, ("__kmp_suspend_template: T#%d false alarm, reset sleep bit "
 1436|     47|                 "for spin(%p)\n",
 1437|     47|                 th_gtid, flag->get()));
 1438|  1.57k|  } else {
 1439|       |    /* Encapsulate in a loop as the documentation states that this may
 1440|       |       "with low probability" return when the condition variable has
 1441|       |       not been signaled or broadcast */
 1442|  1.57k|    int deactivated = FALSE;
  ------------------
  |  | 1279|  1.57k|#define FALSE 0
  ------------------
 1443|       |
 1444|  3.14k|    while (flag->is_sleeping()) {
  ------------------
  |  Branch (1444:12): [True: 1.57k, False: 1.57k]
  ------------------
 1445|       |#ifdef DEBUG_SUSPEND
 1446|       |      char buffer[128];
 1447|       |      __kmp_suspend_count++;
 1448|       |      __kmp_print_cond(buffer, &th->th.th_suspend_cv);
 1449|       |      __kmp_printf("__kmp_suspend_template: suspending T#%d: %s\n", th_gtid,
 1450|       |                   buffer);
 1451|       |#endif
 1452|       |      // Mark the thread as no longer active (only in the first iteration of the
 1453|       |      // loop).
 1454|  1.57k|      if (!deactivated) {
  ------------------
  |  Branch (1454:11): [True: 1.57k, False: 0]
  ------------------
 1455|  1.57k|        th->th.th_active = FALSE;
  ------------------
  |  | 1279|  1.57k|#define FALSE 0
  ------------------
 1456|  1.57k|        if (th->th.th_active_in_pool) {
  ------------------
  |  Branch (1456:13): [True: 0, False: 1.57k]
  ------------------
 1457|      0|          th->th.th_active_in_pool = FALSE;
  ------------------
  |  | 1279|      0|#define FALSE 0
  ------------------
 1458|      0|          KMP_ATOMIC_DEC(&__kmp_thread_pool_active_nth);
  ------------------
  |  | 1260|      0|#define KMP_ATOMIC_DEC(p) KMP_ATOMIC_OP(fetch_sub, p, 1, acq_rel)
  |  |  ------------------
  |  |  |  | 1246|      0|#define KMP_ATOMIC_OP(op, p, v, order) (p)->op(v, std::memory_order_##order)
  |  |  ------------------
  ------------------
 1459|      0|          KMP_DEBUG_ASSERT(TCR_4(__kmp_thread_pool_active_nth) >= 0);
 1460|      0|        }
 1461|  1.57k|        deactivated = TRUE;
  ------------------
  |  | 1280|  1.57k|#define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  | 1279|  1.57k|#define FALSE 0
  |  |  ------------------
  ------------------
 1462|  1.57k|      }
 1463|       |
 1464|  1.57k|      KMP_DEBUG_ASSERT(th->th.th_sleep_loc);
 1465|  1.57k|      KMP_DEBUG_ASSERT(flag->get_type() == th->th.th_sleep_loc_type);
 1466|       |
 1467|       |#if USE_SUSPEND_TIMEOUT
 1468|       |      struct timespec now;
 1469|       |      struct timeval tval;
 1470|       |      int msecs;
 1471|       |
 1472|       |      status = gettimeofday(&tval, NULL);
 1473|       |      KMP_CHECK_SYSFAIL_ERRNO("gettimeofday", status);
 1474|       |      TIMEVAL_TO_TIMESPEC(&tval, &now);
 1475|       |
 1476|       |      msecs = (4 * __kmp_dflt_blocktime) + 200;
 1477|       |      now.tv_sec += msecs / 1000;
 1478|       |      now.tv_nsec += (msecs % 1000) * 1000;
 1479|       |
 1480|       |      KF_TRACE(15, ("__kmp_suspend_template: T#%d about to perform "
 1481|       |                    "pthread_cond_timedwait\n",
 1482|       |                    th_gtid));
 1483|       |      status = pthread_cond_timedwait(&th->th.th_suspend_cv.c_cond,
 1484|       |                                      &th->th.th_suspend_mx.m_mutex, &now);
 1485|       |#else
 1486|  1.57k|      KF_TRACE(15, ("__kmp_suspend_template: T#%d about to perform"
 1487|  1.57k|                    " pthread_cond_wait\n",
 1488|  1.57k|                    th_gtid));
 1489|  1.57k|      status = pthread_cond_wait(&th->th.th_suspend_cv.c_cond,
 1490|  1.57k|                                 &th->th.th_suspend_mx.m_mutex);
 1491|  1.57k|#endif // USE_SUSPEND_TIMEOUT
 1492|       |
 1493|  1.57k|      if ((status != 0) && (status != EINTR) && (status != ETIMEDOUT)) {
  ------------------
  |  Branch (1493:11): [True: 0, False: 1.57k]
  |  Branch (1493:28): [True: 0, False: 0]
  |  Branch (1493:49): [True: 0, False: 0]
  ------------------
 1494|      0|        KMP_SYSFAIL("pthread_cond_wait", status);
  ------------------
  |  |  148|      0|  __kmp_fatal(KMP_MSG(FunctionError, func), KMP_SYSERRCODE(error),             \
  |  |  ------------------
  |  |  |  |  121|      0|#define KMP_MSG(...) __kmp_msg_format(kmp_i18n_msg_##__VA_ARGS__)
  |  |  ------------------
  |  |                 __kmp_fatal(KMP_MSG(FunctionError, func), KMP_SYSERRCODE(error),             \
  |  |  ------------------
  |  |  |  |  123|      0|#define KMP_SYSERRCODE(code) __kmp_msg_error_code(code)
  |  |  ------------------
  |  |  149|      0|              __kmp_msg_null)
  ------------------
 1495|      0|      }
 1496|       |
 1497|  1.57k|      KMP_DEBUG_ASSERT(flag->get_type() == flag->get_ptr_type());
 1498|       |
 1499|  1.57k|      if (!flag->is_sleeping() &&
  ------------------
  |  Branch (1499:11): [True: 1.57k, False: 18.4E]
  ------------------
 1500|  1.57k|          ((status == EINTR) || (status == ETIMEDOUT))) {
  ------------------
  |  Branch (1500:12): [True: 1, False: 1.57k]
  |  Branch (1500:33): [True: 18.4E, False: 1.57k]
  ------------------
 1501|       |        // if interrupt or timeout, and thread is no longer sleeping, we need to
 1502|       |        // make sure sleep_loc gets reset; however, this shouldn't be needed if
 1503|       |        // we woke up with resume
 1504|      0|        flag->unset_sleeping();
 1505|      0|        TCW_PTR(th->th.th_sleep_loc, NULL);
  ------------------
  |  | 1157|      0|#define TCW_PTR(a, b) TCW_8((a), (b))
  |  |  ------------------
  |  |  |  | 1132|      0|#define TCW_8(a, b) (a) = (b)
  |  |  ------------------
  ------------------
 1506|      0|        th->th.th_sleep_loc_type = flag_unset;
 1507|      0|      }
 1508|       |#ifdef KMP_DEBUG
 1509|       |      if (status == ETIMEDOUT) {
 1510|       |        if (flag->is_sleeping()) {
 1511|       |          KF_TRACE(100,
 1512|       |                   ("__kmp_suspend_template: T#%d timeout wakeup\n", th_gtid));
 1513|       |        } else {
 1514|       |          KF_TRACE(2, ("__kmp_suspend_template: T#%d timeout wakeup, sleep bit "
 1515|       |                       "not set!\n",
 1516|       |                       th_gtid));
 1517|       |          TCW_PTR(th->th.th_sleep_loc, NULL);
 1518|       |          th->th.th_sleep_loc_type = flag_unset;
 1519|       |        }
 1520|       |      } else if (flag->is_sleeping()) {
 1521|       |        KF_TRACE(100,
 1522|       |                 ("__kmp_suspend_template: T#%d spurious wakeup\n", th_gtid));
 1523|       |      }
 1524|       |#endif
 1525|  1.57k|    } // while
 1526|       |
 1527|       |    // Mark the thread as active again (if it was previous marked as inactive)
 1528|  1.57k|    if (deactivated) {
  ------------------
  |  Branch (1528:9): [True: 1.57k, False: 0]
  ------------------
 1529|  1.57k|      th->th.th_active = TRUE;
  ------------------
  |  | 1280|  1.57k|#define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  | 1279|  1.57k|#define FALSE 0
  |  |  ------------------
  ------------------
 1530|  1.57k|      if (TCR_4(th->th.th_in_pool)) {
  ------------------
  |  | 1127|  1.57k|#define TCR_4(a) (a)
  |  |  ------------------
  |  |  |  Branch (1127:18): [True: 0, False: 1.57k]
  |  |  ------------------
  ------------------
 1531|      0|        KMP_ATOMIC_INC(&__kmp_thread_pool_active_nth);
  ------------------
  |  | 1259|      0|#define KMP_ATOMIC_INC(p) KMP_ATOMIC_OP(fetch_add, p, 1, acq_rel)
  |  |  ------------------
  |  |  |  | 1246|      0|#define KMP_ATOMIC_OP(op, p, v, order) (p)->op(v, std::memory_order_##order)
  |  |  ------------------
  ------------------
 1532|      0|        th->th.th_active_in_pool = TRUE;
  ------------------
  |  | 1280|      0|#define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  | 1279|      0|#define FALSE 0
  |  |  ------------------
  ------------------
 1533|      0|      }
 1534|  1.57k|    }
 1535|  1.57k|  }
 1536|       |  // We may have had the loop variable set before entering the loop body;
 1537|       |  // so we need to reset sleep_loc.
 1538|  1.62k|  TCW_PTR(th->th.th_sleep_loc, NULL);
  ------------------
  |  | 1157|  1.62k|#define TCW_PTR(a, b) TCW_8((a), (b))
  |  |  ------------------
  |  |  |  | 1132|  1.62k|#define TCW_8(a, b) (a) = (b)
  |  |  ------------------
  ------------------
 1539|  1.62k|  th->th.th_sleep_loc_type = flag_unset;
 1540|       |
 1541|  1.62k|  KMP_DEBUG_ASSERT(!flag->is_sleeping());
 1542|  1.62k|  KMP_DEBUG_ASSERT(!th->th.th_sleep_loc);
 1543|       |#ifdef DEBUG_SUSPEND
 1544|       |  {
 1545|       |    char buffer[128];
 1546|       |    __kmp_print_cond(buffer, &th->th.th_suspend_cv);
 1547|       |    __kmp_printf("__kmp_suspend_template: T#%d has awakened: %s\n", th_gtid,
 1548|       |                 buffer);
 1549|       |  }
 1550|       |#endif
 1551|       |
 1552|  1.62k|  __kmp_unlock_suspend_mx(th);
 1553|  1.62k|  KF_TRACE(30, ("__kmp_suspend_template: T#%d exit\n", th_gtid));
 1554|  1.62k|}
z_Linux_util.cpp:_ZL21__kmp_resume_templateI11kmp_flag_64ILb0ELb1EEEviPT_:
 1584|  1.55k|static inline void __kmp_resume_template(int target_gtid, C *flag) {
 1585|  1.55k|  KMP_TIME_DEVELOPER_PARTITIONED_BLOCK(USER_resume);
  ------------------
  |  | 1008|  1.55k|#define KMP_TIME_DEVELOPER_PARTITIONED_BLOCK(n) ((void)0)
  ------------------
 1586|  1.55k|  kmp_info_t *th = __kmp_threads[target_gtid];
 1587|  1.55k|  int status;
 1588|       |
 1589|       |#ifdef KMP_DEBUG
 1590|       |  int gtid = TCR_4(__kmp_init_gtid) ? __kmp_get_gtid() : -1;
 1591|       |#endif
 1592|       |
 1593|  1.55k|  KF_TRACE(30, ("__kmp_resume_template: T#%d wants to wakeup T#%d enter\n",
 1594|  1.55k|                gtid, target_gtid));
 1595|  1.55k|  KMP_DEBUG_ASSERT(gtid != target_gtid);
 1596|       |
 1597|  1.55k|  __kmp_suspend_initialize_thread(th);
 1598|       |
 1599|  1.55k|  __kmp_lock_suspend_mx(th);
 1600|       |
 1601|  1.58k|  if (!flag || flag != th->th.th_sleep_loc) {
  ------------------
  |  Branch (1601:7): [True: 18.4E, False: 1.58k]
  |  Branch (1601:16): [True: 1.58k, False: 0]
  ------------------
 1602|       |    // coming from __kmp_null_resume_wrapper, or thread is now sleeping on a
 1603|       |    // different location; wake up at new location
 1604|  1.58k|    flag = (C *)CCAST(void *, th->th.th_sleep_loc);
  ------------------
  |  |  229|  1.58k|#define CCAST(type, var) const_cast<type>(var)
  ------------------
 1605|  1.58k|  }
 1606|       |
 1607|       |  // First, check if the flag is null or its type has changed. If so, someone
 1608|       |  // else woke it up.
 1609|  1.55k|  if (!flag) { // Thread doesn't appear to be sleeping on anything
  ------------------
  |  Branch (1609:7): [True: 0, False: 1.55k]
  ------------------
 1610|      0|    KF_TRACE(5, ("__kmp_resume_template: T#%d exiting, thread T#%d already "
 1611|      0|                 "awake: flag(%p)\n",
 1612|      0|                 gtid, target_gtid, (void *)NULL));
 1613|      0|    __kmp_unlock_suspend_mx(th);
 1614|      0|    return;
 1615|  1.55k|  } else if (flag->get_type() != th->th.th_sleep_loc_type) {
  ------------------
  |  Branch (1615:14): [True: 0, False: 1.55k]
  ------------------
 1616|       |    // Flag type does not appear to match this function template; possibly the
 1617|       |    // thread is sleeping on something else. Try null resume again.
 1618|      0|    KF_TRACE(
 1619|      0|        5,
 1620|      0|        ("__kmp_resume_template: T#%d retrying, thread T#%d Mismatch flag(%p), "
 1621|      0|         "spin(%p) type=%d ptr_type=%d\n",
 1622|      0|         gtid, target_gtid, flag, flag->get(), flag->get_type(),
 1623|      0|         th->th.th_sleep_loc_type));
 1624|      0|    __kmp_unlock_suspend_mx(th);
 1625|      0|    __kmp_null_resume_wrapper(th);
 1626|      0|    return;
 1627|  1.55k|  } else { // if multiple threads are sleeping, flag should be internally
 1628|       |    // referring to a specific thread here
 1629|  1.55k|    if (!flag->is_sleeping()) {
  ------------------
  |  Branch (1629:9): [True: 0, False: 1.55k]
  ------------------
 1630|      0|      KF_TRACE(5, ("__kmp_resume_template: T#%d exiting, thread T#%d already "
 1631|      0|                   "awake: flag(%p): %u\n",
 1632|      0|                   gtid, target_gtid, flag->get(), (unsigned int)flag->load()));
 1633|      0|      __kmp_unlock_suspend_mx(th);
 1634|      0|      return;
 1635|      0|    }
 1636|  1.55k|  }
 1637|  1.55k|  KMP_DEBUG_ASSERT(flag);
 1638|  1.55k|  flag->unset_sleeping();
 1639|  1.55k|  TCW_PTR(th->th.th_sleep_loc, NULL);
  ------------------
  |  | 1157|  1.55k|#define TCW_PTR(a, b) TCW_8((a), (b))
  |  |  ------------------
  |  |  |  | 1132|  1.55k|#define TCW_8(a, b) (a) = (b)
  |  |  ------------------
  ------------------
 1640|  1.55k|  th->th.th_sleep_loc_type = flag_unset;
 1641|       |
 1642|  1.55k|  KF_TRACE(5, ("__kmp_resume_template: T#%d about to wakeup T#%d, reset "
 1643|  1.55k|               "sleep bit for flag's loc(%p): %u\n",
 1644|  1.55k|               gtid, target_gtid, flag->get(), (unsigned int)flag->load()));
 1645|       |
 1646|       |#ifdef DEBUG_SUSPEND
 1647|       |  {
 1648|       |    char buffer[128];
 1649|       |    __kmp_print_cond(buffer, &th->th.th_suspend_cv);
 1650|       |    __kmp_printf("__kmp_resume_template: T#%d resuming T#%d: %s\n", gtid,
 1651|       |                 target_gtid, buffer);
 1652|       |  }
 1653|       |#endif
 1654|  1.55k|  status = pthread_cond_signal(&th->th.th_suspend_cv.c_cond);
 1655|  1.55k|  KMP_CHECK_SYSFAIL("pthread_cond_signal", status);
  ------------------
  |  |  153|  1.55k|  {                                                                            \
  |  |  154|  1.55k|    if (error) {                                                               \
  |  |  ------------------
  |  |  |  Branch (154:9): [True: 0, False: 1.55k]
  |  |  ------------------
  |  |  155|      0|      KMP_SYSFAIL(func, error);                                                \
  |  |  ------------------
  |  |  |  |  148|      0|  __kmp_fatal(KMP_MSG(FunctionError, func), KMP_SYSERRCODE(error),             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  121|      0|#define KMP_MSG(...) __kmp_msg_format(kmp_i18n_msg_##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |                 __kmp_fatal(KMP_MSG(FunctionError, func), KMP_SYSERRCODE(error),             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  123|      0|#define KMP_SYSERRCODE(code) __kmp_msg_error_code(code)
  |  |  |  |  ------------------
  |  |  |  |  149|      0|              __kmp_msg_null)
  |  |  ------------------
  |  |  156|      0|    }                                                                          \
  |  |  157|  1.55k|  }
  ------------------
 1656|  1.55k|  __kmp_unlock_suspend_mx(th);
 1657|  1.55k|  KF_TRACE(30, ("__kmp_resume_template: T#%d exiting after signaling wake up"
 1658|  1.55k|                " for T#%d\n",
 1659|  1.55k|                gtid, target_gtid));
 1660|  1.55k|}

