LLVMFuzzerTestOneInput:
   36|    733|extern "C" int LLVMFuzzerTestOneInput(const uint8_t* Data, size_t Size) {
   37|    733|  assert(Data);
  ------------------
  |  Branch (37:3): [True: 733, False: 0]
  ------------------
   38|       |
   39|    733|  try {
   40|    733|    const rawspeed::Buffer b(
   41|    733|        Data, rawspeed::implicit_cast<rawspeed::Buffer::size_type>(Size));
   42|    733|    const rawspeed::DataBuffer db(b, rawspeed::Endianness::little);
   43|    733|    rawspeed::ByteStream bs(db);
   44|       |
   45|    733|    rawspeed::RawImage mRaw(CreateRawImage(bs));
   46|       |
   47|    733|    rawspeed::ByteStream rawData = bs.getStream(bs.getRemainSize());
   48|       |
   49|    733|    rawspeed::PanasonicV7Decompressor p(mRaw, rawData);
   50|    733|    mRaw->createData();
   51|    733|    p.decompress();
   52|       |
   53|    733|    rawspeed::MSan::CheckMemIsInitialized(
   54|    733|        mRaw->getByteDataAsUncroppedArray2DRef());
   55|    733|  } catch (const rawspeed::RawspeedException&) { // NOLINT(bugprone-empty-catch)
   56|       |    // Exceptions are good, crashes are bad.
   57|    341|  }
   58|       |
   59|    733|  return 0;
   60|    733|}

_Z14CreateRawImageRN8rawspeed10ByteStreamE:
   31|    733|rawspeed::RawImage CreateRawImage(rawspeed::ByteStream& bs) {
   32|    733|  const uint32_t width = bs.getU32();
   33|    733|  const uint32_t height = bs.getU32();
   34|    733|  const uint32_t type = bs.getU32();
   35|    733|  const uint32_t cpp = bs.getU32();
   36|    733|  const uint32_t isCFA = bs.getU32();
   37|       |
   38|    733|  if (type != static_cast<uint32_t>(rawspeed::RawImageType::UINT16) &&
  ------------------
  |  Branch (38:7): [True: 66, False: 667]
  ------------------
   39|     66|      type != static_cast<uint32_t>(rawspeed::RawImageType::F32))
  ------------------
  |  Branch (39:7): [True: 57, False: 9]
  ------------------
   40|    733|    ThrowRSE("Unknown image type: %u", type);
  ------------------
  |  |   95|     57|  ThrowExceptionHelper(rawspeed::RawspeedException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     57|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     57|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     57|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   41|       |
   42|    676|  rawspeed::RawImage mRaw(
   43|    676|      rawspeed::RawImage::create(static_cast<rawspeed::RawImageType>(type)));
   44|       |
   45|    676|  mRaw->dim =
   46|    676|      rawspeed::iPoint2D(static_cast<rawspeed::iPoint2D::value_type>(width),
   47|    676|                         static_cast<rawspeed::iPoint2D::value_type>(height));
   48|    676|  mRaw->setCpp(cpp);
   49|    676|  mRaw->isCFA = isCFA;
   50|       |
   51|    676|  return mRaw;
   52|    733|}

_ZNK8rawspeed16AlignedAllocatorIhLi16EE10deallocateEPhm:
   74|    392|  void deallocate(T* p, std::size_t n) const noexcept {
   75|    392|    invariant(p);
  ------------------
  |  |   27|    392|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (75:5): [True: 392, False: 0]
  ------------------
   76|    392|    invariant(n > 0);
  ------------------
  |  |   27|    392|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (76:5): [True: 392, False: 0]
  ------------------
   77|    392|    invariant(isAligned(p, alignment));
  ------------------
  |  |   27|    392|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (77:5): [True: 392, False: 0]
  ------------------
   78|    392|    operator delete(p, static_cast<std::align_val_t>(alignment));
   79|    392|  }
_ZNK8rawspeed16AlignedAllocatorIhLi16EE8allocateEm:
   47|    392|  [[nodiscard]] T* allocate(std::size_t numElts) const {
   48|    392|    static_assert(size_t(alignment) >= alignof(T), "insufficient alignment");
   49|    392|    invariant(numElts > 0 && "Should not be trying to allocate no elements");
  ------------------
  |  |   27|    392|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (49:5): [True: 392, False: 0]
  |  Branch (49:5): [True: 392, Folded]
  |  Branch (49:5): [True: 392, False: 0]
  ------------------
   50|    392|    assert(numElts <= allocator_traits::max_size(*this) &&
  ------------------
  |  Branch (50:5): [True: 392, False: 0]
  |  Branch (50:5): [True: 392, Folded]
  |  Branch (50:5): [True: 392, False: 0]
  ------------------
   51|    392|           "Can allocate this many elements.");
   52|    392|    invariant(numElts <= SIZE_MAX / sizeof(T) &&
  ------------------
  |  |   27|    392|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (52:5): [True: 392, False: 0]
  |  Branch (52:5): [True: 392, Folded]
  |  Branch (52:5): [True: 392, False: 0]
  ------------------
   53|    392|              "Byte count calculation will not overflow");
   54|       |
   55|    392|    std::size_t numBytes = sizeof(T) * numElts;
   56|       |
   57|    392|#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|    392|    if (numBytes > 2UL << 30UL)
  ------------------
  |  Branch (62:9): [True: 0, False: 392]
  ------------------
   63|    392|      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|    392|#endif
   65|       |
   66|    392|    auto* r = static_cast<T*>(operator new(
   67|    392|        numBytes, static_cast<std::align_val_t>(alignment)));
   68|    392|    invariant(isAligned(r, alignment));
  ------------------
  |  |   27|    392|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (68:5): [True: 392, False: 0]
  ------------------
   69|    392|    if (!r)
  ------------------
  |  Branch (69:9): [True: 0, False: 392]
  ------------------
   70|    392|      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|    392|    return r;
   72|    392|  }

_ZN8rawspeed10Array1DRefIKhEC2EPS1_i:
  104|  32.0M|    : data(data_), numElts(numElts_) {
  105|  32.0M|  establishClassInvariants();
  106|  32.0M|}
_ZNK8rawspeed10Array1DRefIKhE24establishClassInvariantsEv:
   97|   277M|Array1DRef<T>::establishClassInvariants() const noexcept {
   98|   277M|  invariant(data);
  ------------------
  |  |   27|   277M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (98:3): [True: 281M, False: 18.4E]
  ------------------
   99|   281M|  invariant(numElts >= 0);
  ------------------
  |  |   27|   281M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (99:3): [True: 281M, False: 18.4E]
  ------------------
  100|   281M|}
_ZNK8rawspeed10Array1DRefIKhE5beginEv:
  159|  16.5M|template <class T> inline T* Array1DRef<T>::begin() const {
  160|  16.5M|  establishClassInvariants();
  161|  16.5M|  return addressOf(/*eltIdx=*/0);
  162|  16.5M|}
_ZNK8rawspeed10Array1DRefIKhE9addressOfEi:
  133|  29.3M|Array1DRef<T>::addressOf(const int eltIdx) const {
  134|  29.3M|  establishClassInvariants();
  135|  29.3M|  invariant(eltIdx >= 0);
  ------------------
  |  |   27|  29.3M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (135:3): [True: 28.8M, False: 488k]
  ------------------
  136|  28.8M|  invariant(eltIdx <= numElts);
  ------------------
  |  |   27|  28.8M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (136:3): [True: 28.7M, False: 75.9k]
  ------------------
  137|  28.7M|#pragma GCC diagnostic push
  138|  28.7M|#pragma GCC diagnostic ignored "-Wpragmas"
  139|  28.7M|#pragma GCC diagnostic ignored "-Wunknown-warning-option"
  140|  28.7M|#pragma GCC diagnostic ignored "-Wunsafe-buffer-usage"
  141|  28.7M|  return data + eltIdx;
  142|  28.8M|#pragma GCC diagnostic pop
  143|  28.8M|}
_ZNK8rawspeed10Array1DRefIKhE4sizeEv:
  154|   159M|template <class T> inline int Array1DRef<T>::size() const {
  155|   159M|  establishClassInvariants();
  156|   159M|  return numElts;
  157|   159M|}
_ZNK8rawspeed10Array1DRefIKhE7getCropEii:
  110|  13.1M|Array1DRef<T>::getCrop(int offset, int size) const {
  111|  13.1M|  establishClassInvariants();
  112|  13.1M|  invariant(offset >= 0);
  ------------------
  |  |   27|  13.1M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (112:3): [True: 13.2M, False: 18.4E]
  ------------------
  113|  13.2M|  invariant(size >= 0);
  ------------------
  |  |   27|  13.2M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (113:3): [True: 13.2M, False: 18.4E]
  ------------------
  114|  13.2M|  invariant(offset <= numElts);
  ------------------
  |  |   27|  13.2M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (114:3): [True: 13.2M, False: 18.4E]
  ------------------
  115|  13.2M|  invariant(size <= numElts);
  ------------------
  |  |   27|  13.2M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (115:3): [True: 13.2M, False: 18.4E]
  ------------------
  116|  13.2M|  invariant(offset + size <= numElts);
  ------------------
  |  |   27|  13.2M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (116:3): [True: 13.2M, False: 5.93k]
  ------------------
  117|  13.2M|  return {*this, offset, size};
  118|  13.2M|}
_ZNK8rawspeed10Array1DRefISt4byteE24establishClassInvariantsEv:
   97|   373M|Array1DRef<T>::establishClassInvariants() const noexcept {
   98|   373M|  invariant(data);
  ------------------
  |  |   27|   373M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (98:3): [True: 378M, False: 18.4E]
  ------------------
   99|   378M|  invariant(numElts >= 0);
  ------------------
  |  |   27|   378M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (99:3): [True: 403M, False: 18.4E]
  ------------------
  100|   378M|}
_ZNK8rawspeed10Array1DRefISt4byteE4sizeEv:
  154|   239M|template <class T> inline int Array1DRef<T>::size() const {
  155|   239M|  establishClassInvariants();
  156|   239M|  return numElts;
  157|   239M|}
_ZNK8rawspeed10Array1DRefISt4byteE9addressOfEi:
  133|  34.6M|Array1DRef<T>::addressOf(const int eltIdx) const {
  134|  34.6M|  establishClassInvariants();
  135|  34.6M|  invariant(eltIdx >= 0);
  ------------------
  |  |   27|  34.6M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (135:3): [True: 33.9M, False: 705k]
  ------------------
  136|  33.9M|  invariant(eltIdx <= numElts);
  ------------------
  |  |   27|  33.9M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (136:3): [True: 33.9M, False: 18.4E]
  ------------------
  137|  33.9M|#pragma GCC diagnostic push
  138|  33.9M|#pragma GCC diagnostic ignored "-Wpragmas"
  139|  33.9M|#pragma GCC diagnostic ignored "-Wunknown-warning-option"
  140|  33.9M|#pragma GCC diagnostic ignored "-Wunsafe-buffer-usage"
  141|  33.9M|  return data + eltIdx;
  142|  33.9M|#pragma GCC diagnostic pop
  143|  33.9M|}
_ZN8rawspeed10Array1DRefISt4byteEC2EPS1_i:
  104|  27.7M|    : data(data_), numElts(numElts_) {
  105|  27.7M|  establishClassInvariants();
  106|  27.7M|}
_ZNK8rawspeed10Array1DRefISt4byteE7getCropEii:
  110|  22.3M|Array1DRef<T>::getCrop(int offset, int size) const {
  111|  22.3M|  establishClassInvariants();
  112|  22.3M|  invariant(offset >= 0);
  ------------------
  |  |   27|  22.3M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (112:3): [True: 22.4M, False: 18.4E]
  ------------------
  113|  22.4M|  invariant(size >= 0);
  ------------------
  |  |   27|  22.4M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (113:3): [True: 22.4M, False: 18.4E]
  ------------------
  114|  22.4M|  invariant(offset <= numElts);
  ------------------
  |  |   27|  22.4M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (114:3): [True: 22.4M, False: 824]
  ------------------
  115|  22.4M|  invariant(size <= numElts);
  ------------------
  |  |   27|  22.4M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (115:3): [True: 22.4M, False: 18.4E]
  ------------------
  116|  22.4M|  invariant(offset + size <= numElts);
  ------------------
  |  |   27|  22.4M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (116:3): [True: 22.4M, False: 18.4E]
  ------------------
  117|  22.4M|  return {*this, offset, size};
  118|  22.4M|}
_ZN8rawspeed10Array1DRefItEC2EPti:
  104|  6.09M|    : data(data_), numElts(numElts_) {
  105|  6.09M|  establishClassInvariants();
  106|  6.09M|}
_ZNK8rawspeed10Array1DRefItE24establishClassInvariantsEv:
   97|   199M|Array1DRef<T>::establishClassInvariants() const noexcept {
   98|   199M|  invariant(data);
  ------------------
  |  |   27|   199M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (98:3): [True: 208M, False: 18.4E]
  ------------------
   99|   208M|  invariant(numElts >= 0);
  ------------------
  |  |   27|   208M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (99:3): [True: 209M, False: 18.4E]
  ------------------
  100|   208M|}
_ZNK8rawspeed10Array1DRefItE4sizeEv:
  154|   158M|template <class T> inline int Array1DRef<T>::size() const {
  155|   158M|  establishClassInvariants();
  156|   158M|  return numElts;
  157|   158M|}
_ZN8rawspeed10Array1DRefISt4byteEC2ItQaaaantaasr3stdE10is_const_vITL0__Entsr3stdE10is_const_vIT_Entsr3stdE9is_same_vIu14__remove_constIS5_Eu14__remove_constIS4_EEsr3stdE9is_same_vIS6_S1_EEENS0_IS5_EE:
   78|    784|      : Array1DRef(reinterpret_cast<T*>(RHS.data), sizeof(T2) * RHS.numElts) {}
_ZNK8rawspeed10Array1DRefIKSt4byteE4sizeEv:
  154|   109M|template <class T> inline int Array1DRef<T>::size() const {
  155|   109M|  establishClassInvariants();
  156|   109M|  return numElts;
  157|   109M|}
_ZNK8rawspeed10Array1DRefIKSt4byteE24establishClassInvariantsEv:
   97|   103M|Array1DRef<T>::establishClassInvariants() const noexcept {
   98|   103M|  invariant(data);
  ------------------
  |  |   27|   103M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (98:3): [True: 120M, False: 18.4E]
  ------------------
   99|   120M|  invariant(numElts >= 0);
  ------------------
  |  |   27|   120M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (99:3): [True: 149M, False: 18.4E]
  ------------------
  100|   120M|}
_ZNK8rawspeed10Array1DRefIKSt4byteE5beginEv:
  159|  11.8M|template <class T> inline T* Array1DRef<T>::begin() const {
  160|  11.8M|  establishClassInvariants();
  161|  11.8M|  return addressOf(/*eltIdx=*/0);
  162|  11.8M|}
_ZNK8rawspeed10Array1DRefIKSt4byteE9addressOfEi:
  133|  18.3M|Array1DRef<T>::addressOf(const int eltIdx) const {
  134|  18.3M|  establishClassInvariants();
  135|  18.3M|  invariant(eltIdx >= 0);
  ------------------
  |  |   27|  18.3M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (135:3): [True: 17.2M, False: 1.06M]
  ------------------
  136|  17.2M|  invariant(eltIdx <= numElts);
  ------------------
  |  |   27|  17.2M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (136:3): [True: 17.0M, False: 214k]
  ------------------
  137|  17.0M|#pragma GCC diagnostic push
  138|  17.0M|#pragma GCC diagnostic ignored "-Wpragmas"
  139|  17.0M|#pragma GCC diagnostic ignored "-Wunknown-warning-option"
  140|  17.0M|#pragma GCC diagnostic ignored "-Wunsafe-buffer-usage"
  141|  17.0M|  return data + eltIdx;
  142|  17.2M|#pragma GCC diagnostic pop
  143|  17.2M|}
_ZNK8rawspeed10Array1DRefISt4byteE5beginEv:
  159|  12.0M|template <class T> inline T* Array1DRef<T>::begin() const {
  160|  12.0M|  establishClassInvariants();
  161|  12.0M|  return addressOf(/*eltIdx=*/0);
  162|  12.0M|}
_ZNK8rawspeed10Array1DRefIKSt4byteE7getCropEii:
  110|  11.5M|Array1DRef<T>::getCrop(int offset, int size) const {
  111|  11.5M|  establishClassInvariants();
  112|  11.5M|  invariant(offset >= 0);
  ------------------
  |  |   27|  11.5M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (112:3): [True: 12.2M, False: 18.4E]
  ------------------
  113|  12.2M|  invariant(size >= 0);
  ------------------
  |  |   27|  12.2M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (113:3): [True: 12.2M, False: 18.4E]
  ------------------
  114|  12.2M|  invariant(offset <= numElts);
  ------------------
  |  |   27|  12.2M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (114:3): [True: 12.2M, False: 18.4E]
  ------------------
  115|  12.2M|  invariant(size <= numElts);
  ------------------
  |  |   27|  12.2M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (115:3): [True: 12.2M, False: 18.4E]
  ------------------
  116|  12.2M|  invariant(offset + size <= numElts);
  ------------------
  |  |   27|  12.2M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (116:3): [True: 12.2M, False: 18.4E]
  ------------------
  117|  12.2M|  return {*this, offset, size};
  118|  12.2M|}
_ZNK8rawspeed10Array1DRefISt4byteEclEi:
  147|  3.17M|Array1DRef<T>::operator()(const int eltIdx) const {
  148|  3.17M|  establishClassInvariants();
  149|  3.17M|  invariant(eltIdx >= 0);
  ------------------
  |  |   27|  3.17M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (149:3): [True: 3.17M, False: 0]
  ------------------
  150|  3.17M|  invariant(eltIdx < numElts);
  ------------------
  |  |   27|  3.17M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (150:3): [True: 3.17M, False: 0]
  ------------------
  151|  3.17M|  return *addressOf(eltIdx);
  152|  3.17M|}
_ZNK8rawspeed10Array1DRefItE9addressOfEi:
  133|  27.5M|Array1DRef<T>::addressOf(const int eltIdx) const {
  134|  27.5M|  establishClassInvariants();
  135|  27.5M|  invariant(eltIdx >= 0);
  ------------------
  |  |   27|  27.5M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (135:3): [True: 26.0M, False: 1.49M]
  ------------------
  136|  26.0M|  invariant(eltIdx <= numElts);
  ------------------
  |  |   27|  26.0M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (136:3): [True: 26.1M, False: 18.4E]
  ------------------
  137|  26.1M|#pragma GCC diagnostic push
  138|  26.1M|#pragma GCC diagnostic ignored "-Wpragmas"
  139|  26.1M|#pragma GCC diagnostic ignored "-Wunknown-warning-option"
  140|  26.1M|#pragma GCC diagnostic ignored "-Wunsafe-buffer-usage"
  141|  26.1M|  return data + eltIdx;
  142|  26.0M|#pragma GCC diagnostic pop
  143|  26.0M|}
_ZNK8rawspeed10Array1DRefItE7getCropEii:
  110|  6.40M|Array1DRef<T>::getCrop(int offset, int size) const {
  111|  6.40M|  establishClassInvariants();
  112|  6.40M|  invariant(offset >= 0);
  ------------------
  |  |   27|  6.40M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (112:3): [True: 6.50M, False: 18.4E]
  ------------------
  113|  6.50M|  invariant(size >= 0);
  ------------------
  |  |   27|  6.50M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (113:3): [True: 6.50M, False: 18.4E]
  ------------------
  114|  6.50M|  invariant(offset <= numElts);
  ------------------
  |  |   27|  6.50M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (114:3): [True: 6.50M, False: 18.4E]
  ------------------
  115|  6.50M|  invariant(size <= numElts);
  ------------------
  |  |   27|  6.50M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (115:3): [True: 6.50M, False: 18.4E]
  ------------------
  116|  6.50M|  invariant(offset + size <= numElts);
  ------------------
  |  |   27|  6.50M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (116:3): [True: 6.50M, False: 18.4E]
  ------------------
  117|  6.50M|  return {*this, offset, size};
  118|  6.50M|}
_ZN8rawspeed10Array1DRefIKSt4byteEC2IKhQaaaantaasr3stdE10is_const_vITL0__Entsr3stdE10is_const_vIT_Entsr3stdE9is_same_vIu14__remove_constIS7_Eu14__remove_constIS6_EEsr3stdE9is_same_vIS8_S1_EEENS0_IS7_EE:
   78|  3.40M|      : Array1DRef(reinterpret_cast<T*>(RHS.data), sizeof(T2) * RHS.numElts) {}
_ZN8rawspeed10Array1DRefIKSt4byteEC2EPS2_i:
  104|  12.5M|    : data(data_), numElts(numElts_) {
  105|  12.5M|  establishClassInvariants();
  106|  12.5M|}
_ZNK8rawspeed10Array1DRefISt4byteE8getBlockEii:
  122|  12.3M|Array1DRef<T>::getBlock(int size, int index) const {
  123|  12.3M|  establishClassInvariants();
  124|  12.3M|  invariant(index >= 0);
  ------------------
  |  |   27|  12.3M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (124:3): [True: 12.7M, False: 18.4E]
  ------------------
  125|  12.7M|  invariant(size >= 0);
  ------------------
  |  |   27|  12.7M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (125:3): [True: 12.7M, False: 18.4E]
  ------------------
  126|  12.7M|  invariant(index <= numElts);
  ------------------
  |  |   27|  12.7M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (126:3): [True: 12.7M, False: 18.4E]
  ------------------
  127|  12.7M|  invariant(size <= numElts);
  ------------------
  |  |   27|  12.7M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (127:3): [True: 12.7M, False: 18.4E]
  ------------------
  128|  12.7M|  return getCrop(size * index, size);
  129|  12.7M|}
_ZNK8rawspeed10Array1DRefItE8getBlockEii:
  122|  3.39M|Array1DRef<T>::getBlock(int size, int index) const {
  123|  3.39M|  establishClassInvariants();
  124|  3.39M|  invariant(index >= 0);
  ------------------
  |  |   27|  3.39M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (124:3): [True: 3.38M, False: 6.12k]
  ------------------
  125|  3.38M|  invariant(size >= 0);
  ------------------
  |  |   27|  3.38M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (125:3): [True: 3.38M, False: 2.84k]
  ------------------
  126|  3.38M|  invariant(index <= numElts);
  ------------------
  |  |   27|  3.38M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (126:3): [True: 3.38M, False: 18.4E]
  ------------------
  127|  3.38M|  invariant(size <= numElts);
  ------------------
  |  |   27|  3.38M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (127:3): [True: 3.38M, False: 18.4E]
  ------------------
  128|  3.38M|  return getCrop(size * index, size);
  129|  3.38M|}

_ZNK8rawspeed10Array2DRefISt4byteE24establishClassInvariantsEv:
  127|  47.7M|Array2DRef<T>::establishClassInvariants() const noexcept {
  128|  47.7M|  data.establishClassInvariants();
  129|  47.7M|  invariant(_width >= 0);
  ------------------
  |  |   27|  47.7M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (129:3): [True: 47.7M, False: 0]
  ------------------
  130|  47.7M|  invariant(_height >= 0);
  ------------------
  |  |   27|  47.7M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (130:3): [True: 47.7M, False: 0]
  ------------------
  131|  47.7M|  invariant(_pitch != 0);
  ------------------
  |  |   27|  47.7M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (131:3): [True: 47.7M, False: 0]
  ------------------
  132|  47.7M|  invariant(_pitch >= 0);
  ------------------
  |  |   27|  47.7M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (132:3): [True: 47.7M, False: 0]
  ------------------
  133|  47.7M|  invariant(_pitch >= _width);
  ------------------
  |  |   27|  47.7M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (133:3): [True: 47.7M, False: 0]
  ------------------
  134|  47.7M|  invariant((_width == 0) == (_height == 0));
  ------------------
  |  |   27|  47.7M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (134:3): [True: 47.7M, False: 0]
  ------------------
  135|  47.7M|  invariant(data.size() == _pitch * _height);
  ------------------
  |  |   27|  47.7M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (135:3): [True: 47.7M, False: 0]
  ------------------
  136|  47.7M|}
_ZNK8rawspeed10Array2DRefISt4byteE5widthEv:
  165|  19.0M|__attribute__((always_inline)) inline int Array2DRef<T>::width() const {
  166|  19.0M|  establishClassInvariants();
  167|  19.0M|  return _width;
  168|  19.0M|}
_ZNK8rawspeed10Array2DRefISt4byteE6heightEv:
  171|  15.9M|__attribute__((always_inline)) inline int Array2DRef<T>::height() const {
  172|  15.9M|  establishClassInvariants();
  173|  15.9M|  return _height;
  174|  15.9M|}
_ZNK8rawspeed10Array2DRefISt4byteEixEi:
  186|  6.35M|inline Array1DRef<T> Array2DRef<T>::operator[](const int row) const {
  187|  6.35M|  establishClassInvariants();
  188|  6.35M|  invariant(row >= 0);
  ------------------
  |  |   27|  6.35M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (188:3): [True: 6.35M, False: 0]
  ------------------
  189|  6.35M|  invariant(row < height());
  ------------------
  |  |   27|  6.35M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (189:3): [True: 6.35M, False: 0]
  ------------------
  190|  6.35M|  return data.getCrop(row * _pitch, width()).getAsArray1DRef();
  191|  6.35M|}
_ZN8rawspeed10Array2DRefItEC2EPtiii:
  148|  3.10M|    : Array2DRef({data_, pitch_ * height_}, width_, height_, pitch_) {
  149|  3.10M|  establishClassInvariants();
  150|  3.10M|}
_ZN8rawspeed10Array2DRefItEC2ENS_10Array1DRefItEEiii:
  141|  3.11M|    : data(data_), _pitch(pitch_), _width(width_), _height(height_) {
  142|  3.11M|  establishClassInvariants();
  143|  3.11M|}
_ZNK8rawspeed10Array2DRefItE24establishClassInvariantsEv:
  127|  15.0M|Array2DRef<T>::establishClassInvariants() const noexcept {
  128|  15.0M|  data.establishClassInvariants();
  129|  15.0M|  invariant(_width >= 0);
  ------------------
  |  |   27|  15.0M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (129:3): [True: 15.1M, False: 18.4E]
  ------------------
  130|  15.1M|  invariant(_height >= 0);
  ------------------
  |  |   27|  15.1M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (130:3): [True: 15.1M, False: 331]
  ------------------
  131|  15.1M|  invariant(_pitch != 0);
  ------------------
  |  |   27|  15.1M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (131:3): [True: 15.1M, False: 18.4E]
  ------------------
  132|  15.1M|  invariant(_pitch >= 0);
  ------------------
  |  |   27|  15.1M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (132:3): [True: 15.1M, False: 18.4E]
  ------------------
  133|  15.1M|  invariant(_pitch >= _width);
  ------------------
  |  |   27|  15.1M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (133:3): [True: 15.1M, False: 18.4E]
  ------------------
  134|  15.1M|  invariant((_width == 0) == (_height == 0));
  ------------------
  |  |   27|  15.1M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (134:3): [True: 15.1M, False: 18.4E]
  ------------------
  135|  15.1M|  invariant(data.size() == _pitch * _height);
  ------------------
  |  |   27|  15.1M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (135:3): [True: 15.1M, False: 15.0k]
  ------------------
  136|  15.1M|}
_ZN8rawspeed10Array2DRefISt4byteEC2ItQaaaantaasr3stdE10is_const_vITL0__Entsr3stdE10is_const_vIT_Entsr3stdE9is_same_vIu14__remove_constIS5_Eu14__remove_constIS4_EEsr3stdE9is_same_vIS6_S1_EEENS0_IS5_EE:
   92|    784|      : Array2DRef(RHS.data, sizeof(T2) * RHS._width, RHS._height,
   93|    784|                   sizeof(T2) * RHS._pitch) {}
_ZN8rawspeed10Array2DRefISt4byteEC2ENS_10Array1DRefIS1_EEiii:
  141|    784|    : data(data_), _pitch(pitch_), _width(width_), _height(height_) {
  142|    784|  establishClassInvariants();
  143|    784|}
_ZNK8rawspeed10Array2DRefItE5widthEv:
  165|  3.09M|__attribute__((always_inline)) inline int Array2DRef<T>::width() const {
  166|  3.09M|  establishClassInvariants();
  167|  3.09M|  return _width;
  168|  3.09M|}
_ZNK8rawspeed10Array2DRefItE6heightEv:
  171|  3.14M|__attribute__((always_inline)) inline int Array2DRef<T>::height() const {
  172|  3.14M|  establishClassInvariants();
  173|  3.14M|  return _height;
  174|  3.14M|}
_ZNK8rawspeed10Array2DRefISt4byteEclEii:
  195|  3.17M|Array2DRef<T>::operator()(const int row, const int col) const {
  196|  3.17M|  establishClassInvariants();
  197|  3.17M|  invariant(col >= 0);
  ------------------
  |  |   27|  3.17M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (197:3): [True: 3.17M, False: 0]
  ------------------
  198|  3.17M|  invariant(col < width());
  ------------------
  |  |   27|  3.17M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (198:3): [True: 3.17M, False: 0]
  ------------------
  199|  3.17M|  return (operator[](row))(col);
  200|  3.17M|}
_ZNK8rawspeed10Array2DRefItEixEi:
  186|  3.15M|inline Array1DRef<T> Array2DRef<T>::operator[](const int row) const {
  187|  3.15M|  establishClassInvariants();
  188|  3.15M|  invariant(row >= 0);
  ------------------
  |  |   27|  3.15M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (188:3): [True: 3.14M, False: 10.9k]
  ------------------
  189|  3.14M|  invariant(row < height());
  ------------------
  |  |   27|  3.14M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (189:3): [True: 3.09M, False: 53.9k]
  ------------------
  190|  3.09M|  return data.getCrop(row * _pitch, width()).getAsArray1DRef();
  191|  3.14M|}

_ZN8rawspeed8bitwidthIjEEjT_:
   43|  25.5M|constexpr unsigned RAWSPEED_READNONE bitwidth([[maybe_unused]] T unused = {}) {
   44|       |  return CHAR_BIT * sizeof(T);
   45|  25.5M|}
_ZN8rawspeed14extractLowBitsIjQsr3stdE17unsigned_integralIT_EEES1_S1_j:
   96|  25.8M|constexpr RAWSPEED_READNONE T extractLowBits(T value, unsigned nBits) {
   97|       |  // invariant(nBits >= 0);
   98|  25.8M|  invariant(nBits != 0);             // Would result in out-of-bound shift.
  ------------------
  |  |   27|  25.8M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (98:3): [True: 25.8M, False: 0]
  ------------------
   99|  25.8M|  invariant(nBits <= bitwidth<T>()); // No-op is fine.
  ------------------
  |  |   27|  25.8M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (99:3): [True: 24.1M, False: 1.65M]
  ------------------
  100|  24.1M|  unsigned numHighPaddingBits = bitwidth<T>() - nBits;
  101|       |  // invariant(numHighPaddingBits >= 0);
  102|  24.1M|  invariant(numHighPaddingBits < bitwidth<T>()); // Shift is in-bounds.
  ------------------
  |  |   27|  24.1M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (102:3): [True: 23.6M, False: 506k]
  ------------------
  103|  23.6M|  value <<= numHighPaddingBits;
  104|  23.6M|  value >>= numHighPaddingBits;
  105|  23.6M|  return value;
  106|  24.1M|}

_ZN8rawspeed13implicit_castIjmQaaaaoosr3stdE13is_integral_vIT0_Esr3stdE19is_floating_point_vIS1_Eoosr3stdE13is_integral_vIT_Esr3stdE19is_floating_point_vIS2_Entsr3stdE9is_same_vIS1_S2_EEES2_S1_:
   32|  1.12k|constexpr RAWSPEED_READNONE Ttgt implicit_cast(Tsrc value) {
   33|  1.12k|#pragma GCC diagnostic push
   34|  1.12k|#pragma GCC diagnostic ignored "-Wconversion"
   35|  1.12k|#pragma GCC diagnostic ignored "-Wdouble-promotion"
   36|  1.12k|  return value;
   37|  1.12k|#pragma GCC diagnostic pop
   38|  1.12k|}
_ZN8rawspeed13implicit_castIijQaaaaoosr3stdE13is_integral_vIT0_Esr3stdE19is_floating_point_vIS1_Eoosr3stdE13is_integral_vIT_Esr3stdE19is_floating_point_vIS2_Entsr3stdE9is_same_vIS1_S2_EEES2_S1_:
   32|  19.6M|constexpr RAWSPEED_READNONE Ttgt implicit_cast(Tsrc value) {
   33|  19.6M|#pragma GCC diagnostic push
   34|  19.6M|#pragma GCC diagnostic ignored "-Wconversion"
   35|  19.6M|#pragma GCC diagnostic ignored "-Wdouble-promotion"
   36|  19.6M|  return value;
   37|  19.6M|#pragma GCC diagnostic pop
   38|  19.6M|}
_ZN8rawspeed13implicit_castItjQaaaaoosr3stdE13is_integral_vIT0_Esr3stdE19is_floating_point_vIS1_Eoosr3stdE13is_integral_vIT_Esr3stdE19is_floating_point_vIS2_Entsr3stdE9is_same_vIS1_S2_EEES2_S1_:
   32|  23.8M|constexpr RAWSPEED_READNONE Ttgt implicit_cast(Tsrc value) {
   33|  23.8M|#pragma GCC diagnostic push
   34|  23.8M|#pragma GCC diagnostic ignored "-Wconversion"
   35|  23.8M|#pragma GCC diagnostic ignored "-Wdouble-promotion"
   36|  23.8M|  return value;
   37|  23.8M|#pragma GCC diagnostic pop
   38|  23.8M|}
_ZN8rawspeed13implicit_castIimQaaaaoosr3stdE13is_integral_vIT0_Esr3stdE19is_floating_point_vIS1_Eoosr3stdE13is_integral_vIT_Esr3stdE19is_floating_point_vIS2_Entsr3stdE9is_same_vIS1_S2_EEES2_S1_:
   32|  21.2M|constexpr RAWSPEED_READNONE Ttgt implicit_cast(Tsrc value) {
   33|  21.2M|#pragma GCC diagnostic push
   34|  21.2M|#pragma GCC diagnostic ignored "-Wconversion"
   35|  21.2M|#pragma GCC diagnostic ignored "-Wdouble-promotion"
   36|  21.2M|  return value;
   37|  21.2M|#pragma GCC diagnostic pop
   38|  21.2M|}

_ZN8rawspeed17CroppedArray1DRefIKhEC2ENS_10Array1DRefIS1_EEii:
  107|  13.2M|    : base(base_), offset(offset_), numElts(numElts_) {
  108|  13.2M|  establishClassInvariants();
  109|  13.2M|}
_ZNK8rawspeed17CroppedArray1DRefIKhE24establishClassInvariantsEv:
   94|  50.6M|CroppedArray1DRef<T>::establishClassInvariants() const noexcept {
   95|  50.6M|  base.establishClassInvariants();
   96|  50.6M|  invariant(offset >= 0);
  ------------------
  |  |   27|  50.6M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (96:3): [True: 51.1M, False: 18.4E]
  ------------------
   97|  51.1M|  invariant(numElts >= 0);
  ------------------
  |  |   27|  51.1M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (97:3): [True: 51.2M, False: 18.4E]
  ------------------
   98|  51.2M|  invariant(offset <= base.size());
  ------------------
  |  |   27|  51.2M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (98:3): [True: 51.1M, False: 67.1k]
  ------------------
   99|  51.1M|  invariant(numElts <= base.size());
  ------------------
  |  |   27|  51.1M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (99:3): [True: 50.5M, False: 574k]
  ------------------
  100|  50.5M|  invariant(offset + numElts <= base.size());
  ------------------
  |  |   27|  50.5M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (100:3): [True: 50.3M, False: 273k]
  ------------------
  101|  50.5M|}
_ZNK8rawspeed17CroppedArray1DRefIKhE15getAsArray1DRefEv:
   71|  13.0M|  [[nodiscard]] Array1DRef<T> getAsArray1DRef() const {
   72|  13.0M|    return {begin(), size()};
   73|  13.0M|  }
_ZNK8rawspeed17CroppedArray1DRefIKhE5beginEv:
  137|  13.0M|template <class T> inline T* CroppedArray1DRef<T>::begin() const {
  138|  13.0M|  establishClassInvariants();
  139|  13.0M|  return addressOf(/*eltIdx=*/0);
  140|  13.0M|}
_ZNK8rawspeed17CroppedArray1DRefIKhE9addressOfEi:
  152|  13.0M|inline T* CroppedArray1DRef<T>::addressOf(const int eltIdx) const {
  153|  13.0M|  establishClassInvariants();
  154|  13.0M|  invariant(eltIdx >= 0);
  ------------------
  |  |   27|  13.0M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (154:3): [True: 13.0M, False: 18.4E]
  ------------------
  155|  13.0M|  invariant(eltIdx <= numElts);
  ------------------
  |  |   27|  13.0M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (155:3): [True: 13.1M, False: 18.4E]
  ------------------
  156|  13.1M|  return base.addressOf(offset + eltIdx);
  157|  13.0M|}
_ZNK8rawspeed17CroppedArray1DRefIKhE4sizeEv:
  146|  12.9M|template <class T> inline int CroppedArray1DRef<T>::size() const {
  147|  12.9M|  establishClassInvariants();
  148|  12.9M|  return numElts;
  149|  12.9M|}
_ZNK8rawspeed17CroppedArray1DRefISt4byteE5beginEv:
  137|  20.8M|template <class T> inline T* CroppedArray1DRef<T>::begin() const {
  138|  20.8M|  establishClassInvariants();
  139|  20.8M|  return addressOf(/*eltIdx=*/0);
  140|  20.8M|}
_ZNK8rawspeed17CroppedArray1DRefISt4byteE24establishClassInvariantsEv:
   94|  65.7M|CroppedArray1DRef<T>::establishClassInvariants() const noexcept {
   95|  65.7M|  base.establishClassInvariants();
   96|  65.7M|  invariant(offset >= 0);
  ------------------
  |  |   27|  65.7M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (96:3): [True: 68.5M, False: 18.4E]
  ------------------
   97|  68.5M|  invariant(numElts >= 0);
  ------------------
  |  |   27|  68.5M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (97:3): [True: 68.6M, False: 18.4E]
  ------------------
   98|  68.6M|  invariant(offset <= base.size());
  ------------------
  |  |   27|  68.6M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (98:3): [True: 66.8M, False: 1.83M]
  ------------------
   99|  66.8M|  invariant(numElts <= base.size());
  ------------------
  |  |   27|  66.8M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (99:3): [True: 65.1M, False: 1.61M]
  ------------------
  100|  65.1M|  invariant(offset + numElts <= base.size());
  ------------------
  |  |   27|  65.1M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (100:3): [True: 64.3M, False: 804k]
  ------------------
  101|  65.1M|}
_ZNK8rawspeed17CroppedArray1DRefISt4byteE9addressOfEi:
  152|  20.8M|inline T* CroppedArray1DRef<T>::addressOf(const int eltIdx) const {
  153|  20.8M|  establishClassInvariants();
  154|  20.8M|  invariant(eltIdx >= 0);
  ------------------
  |  |   27|  20.8M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (154:3): [True: 21.0M, False: 18.4E]
  ------------------
  155|  21.0M|  invariant(eltIdx <= numElts);
  ------------------
  |  |   27|  21.0M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (155:3): [True: 21.1M, False: 18.4E]
  ------------------
  156|  21.1M|  return base.addressOf(offset + eltIdx);
  157|  21.0M|}
_ZNK8rawspeed17CroppedArray1DRefISt4byteE4sizeEv:
  146|  6.35M|template <class T> inline int CroppedArray1DRef<T>::size() const {
  147|  6.35M|  establishClassInvariants();
  148|  6.35M|  return numElts;
  149|  6.35M|}
_ZNK8rawspeed17CroppedArray1DRefISt4byteE15getAsArray1DRefEv:
   71|  6.35M|  [[nodiscard]] Array1DRef<T> getAsArray1DRef() const {
   72|  6.35M|    return {begin(), size()};
   73|  6.35M|  }
_ZN8rawspeed17CroppedArray1DRefISt4byteEC2ENS_10Array1DRefIS1_EEii:
  107|  22.4M|    : base(base_), offset(offset_), numElts(numElts_) {
  108|  22.4M|  establishClassInvariants();
  109|  22.4M|}
_ZNK8rawspeed17CroppedArray1DRefIKSt4byteE24establishClassInvariantsEv:
   94|  29.0M|CroppedArray1DRef<T>::establishClassInvariants() const noexcept {
   95|  29.0M|  base.establishClassInvariants();
   96|  29.0M|  invariant(offset >= 0);
  ------------------
  |  |   27|  29.0M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (96:3): [True: 36.5M, False: 18.4E]
  ------------------
   97|  36.5M|  invariant(numElts >= 0);
  ------------------
  |  |   27|  36.5M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (97:3): [True: 37.0M, False: 18.4E]
  ------------------
   98|  37.0M|  invariant(offset <= base.size());
  ------------------
  |  |   27|  37.0M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (98:3): [True: 32.8M, False: 4.13M]
  ------------------
   99|  32.8M|  invariant(numElts <= base.size());
  ------------------
  |  |   27|  32.8M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (99:3): [True: 28.4M, False: 4.47M]
  ------------------
  100|  28.4M|  invariant(offset + numElts <= base.size());
  ------------------
  |  |   27|  28.4M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (100:3): [True: 26.2M, False: 2.20M]
  ------------------
  101|  28.4M|}
_ZNK8rawspeed17CroppedArray1DRefIKSt4byteE15getAsArray1DRefEv:
   71|  10.1M|  [[nodiscard]] Array1DRef<T> getAsArray1DRef() const {
   72|  10.1M|    return {begin(), size()};
   73|  10.1M|  }
_ZNK8rawspeed17CroppedArray1DRefIKSt4byteE5beginEv:
  137|  10.2M|template <class T> inline T* CroppedArray1DRef<T>::begin() const {
  138|  10.2M|  establishClassInvariants();
  139|  10.2M|  return addressOf(/*eltIdx=*/0);
  140|  10.2M|}
_ZNK8rawspeed17CroppedArray1DRefIKSt4byteE9addressOfEi:
  152|  9.79M|inline T* CroppedArray1DRef<T>::addressOf(const int eltIdx) const {
  153|  9.79M|  establishClassInvariants();
  154|  9.79M|  invariant(eltIdx >= 0);
  ------------------
  |  |   27|  9.79M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (154:3): [True: 9.80M, False: 18.4E]
  ------------------
  155|  9.80M|  invariant(eltIdx <= numElts);
  ------------------
  |  |   27|  9.80M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (155:3): [True: 9.82M, False: 18.4E]
  ------------------
  156|  9.82M|  return base.addressOf(offset + eltIdx);
  157|  9.80M|}
_ZNK8rawspeed17CroppedArray1DRefIKSt4byteE4sizeEv:
  146|  9.77M|template <class T> inline int CroppedArray1DRef<T>::size() const {
  147|  9.77M|  establishClassInvariants();
  148|  9.77M|  return numElts;
  149|  9.77M|}
_ZNK8rawspeed17CroppedArray1DRefItE15getAsArray1DRefEv:
   71|  3.08M|  [[nodiscard]] Array1DRef<T> getAsArray1DRef() const {
   72|  3.08M|    return {begin(), size()};
   73|  3.08M|  }
_ZNK8rawspeed17CroppedArray1DRefItE5beginEv:
  137|  3.08M|template <class T> inline T* CroppedArray1DRef<T>::begin() const {
  138|  3.08M|  establishClassInvariants();
  139|  3.08M|  return addressOf(/*eltIdx=*/0);
  140|  3.08M|}
_ZNK8rawspeed17CroppedArray1DRefItE24establishClassInvariantsEv:
   94|  59.5M|CroppedArray1DRef<T>::establishClassInvariants() const noexcept {
   95|  59.5M|  base.establishClassInvariants();
   96|  59.5M|  invariant(offset >= 0);
  ------------------
  |  |   27|  59.5M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (96:3): [True: 61.2M, False: 18.4E]
  ------------------
   97|  61.2M|  invariant(numElts >= 0);
  ------------------
  |  |   27|  61.2M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (97:3): [True: 61.9M, False: 18.4E]
  ------------------
   98|  61.9M|  invariant(offset <= base.size());
  ------------------
  |  |   27|  61.9M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (98:3): [True: 61.3M, False: 529k]
  ------------------
   99|  61.3M|  invariant(numElts <= base.size());
  ------------------
  |  |   27|  61.3M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (99:3): [True: 58.5M, False: 2.82M]
  ------------------
  100|  58.5M|  invariant(offset + numElts <= base.size());
  ------------------
  |  |   27|  58.5M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (100:3): [True: 57.2M, False: 1.26M]
  ------------------
  101|  58.5M|}
_ZNK8rawspeed17CroppedArray1DRefItE9addressOfEi:
  152|  27.0M|inline T* CroppedArray1DRef<T>::addressOf(const int eltIdx) const {
  153|  27.0M|  establishClassInvariants();
  154|  27.0M|  invariant(eltIdx >= 0);
  ------------------
  |  |   27|  27.0M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (154:3): [True: 27.4M, False: 18.4E]
  ------------------
  155|  27.4M|  invariant(eltIdx <= numElts);
  ------------------
  |  |   27|  27.4M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (155:3): [True: 27.5M, False: 18.4E]
  ------------------
  156|  27.5M|  return base.addressOf(offset + eltIdx);
  157|  27.4M|}
_ZNK8rawspeed17CroppedArray1DRefItE4sizeEv:
  146|  6.33M|template <class T> inline int CroppedArray1DRef<T>::size() const {
  147|  6.33M|  establishClassInvariants();
  148|  6.33M|  return numElts;
  149|  6.33M|}
_ZN8rawspeed17CroppedArray1DRefItEC2ENS_10Array1DRefItEEii:
  107|  6.50M|    : base(base_), offset(offset_), numElts(numElts_) {
  108|  6.50M|  establishClassInvariants();
  109|  6.50M|}
_ZNK8rawspeed17CroppedArray1DRefItEclEi:
  160|  26.2M|inline T& CroppedArray1DRef<T>::operator()(const int eltIdx) const {
  161|  26.2M|  establishClassInvariants();
  162|  26.2M|  invariant(eltIdx >= 0);
  ------------------
  |  |   27|  26.2M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (162:3): [True: 24.1M, False: 2.17M]
  ------------------
  163|  24.1M|  invariant(eltIdx < numElts);
  ------------------
  |  |   27|  24.1M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (163:3): [True: 24.4M, False: 18.4E]
  ------------------
  164|  24.4M|  return *addressOf(eltIdx);
  165|  24.1M|}
_ZN8rawspeed17CroppedArray1DRefIKSt4byteEC2ENS_10Array1DRefIS2_EEii:
  107|  12.2M|    : base(base_), offset(offset_), numElts(numElts_) {
  108|  12.2M|  establishClassInvariants();
  109|  12.2M|}

_ZNK8rawspeed17CroppedArray2DRefISt4byteEixEi:
  125|  3.17M|CroppedArray2DRef<T>::operator[](const int row) const {
  126|  3.17M|  establishClassInvariants();
  127|  3.17M|  invariant(row >= 0);
  ------------------
  |  |   27|  3.17M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (127:3): [True: 3.17M, False: 0]
  ------------------
  128|  3.17M|  invariant(row < croppedHeight);
  ------------------
  |  |   27|  3.17M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (128:3): [True: 3.17M, False: 0]
  ------------------
  129|  3.17M|  const Array1DRef<T> fullLine = base.operator[](offsetRows + row);
  130|  3.17M|  return fullLine.getCrop(offsetCols, croppedWidth);
  131|  3.17M|}
_ZNK8rawspeed17CroppedArray2DRefISt4byteE24establishClassInvariantsEv:
   98|  3.18M|CroppedArray2DRef<T>::establishClassInvariants() const noexcept {
   99|  3.18M|  base.establishClassInvariants();
  100|  3.18M|  invariant(offsetCols >= 0);
  ------------------
  |  |   27|  3.18M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (100:3): [True: 3.18M, False: 0]
  ------------------
  101|  3.18M|  invariant(offsetRows >= 0);
  ------------------
  |  |   27|  3.18M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (101:3): [True: 3.18M, False: 0]
  ------------------
  102|  3.18M|  invariant(croppedWidth >= 0);
  ------------------
  |  |   27|  3.18M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (102:3): [True: 3.18M, False: 0]
  ------------------
  103|  3.18M|  invariant(croppedHeight >= 0);
  ------------------
  |  |   27|  3.18M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (103:3): [True: 3.18M, False: 0]
  ------------------
  104|  3.18M|  invariant(offsetCols <= base.width());
  ------------------
  |  |   27|  3.18M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (104:3): [True: 3.18M, False: 0]
  ------------------
  105|  3.18M|  invariant(offsetRows <= base.height());
  ------------------
  |  |   27|  3.18M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (105:3): [True: 3.18M, False: 0]
  ------------------
  106|  3.18M|  invariant(croppedWidth <= base.width());
  ------------------
  |  |   27|  3.18M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (106:3): [True: 3.18M, False: 0]
  ------------------
  107|  3.18M|  invariant(croppedHeight <= base.height());
  ------------------
  |  |   27|  3.18M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (107:3): [True: 3.18M, False: 0]
  ------------------
  108|  3.18M|  invariant(offsetCols + croppedWidth <= base.width());
  ------------------
  |  |   27|  3.18M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (108:3): [True: 3.18M, False: 0]
  ------------------
  109|  3.18M|  invariant(offsetRows + croppedHeight <= base.height());
  ------------------
  |  |   27|  3.18M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (109:3): [True: 3.18M, False: 0]
  ------------------
  110|  3.18M|  invariant((croppedWidth == 0) == (croppedHeight == 0));
  ------------------
  |  |   27|  3.18M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (110:3): [True: 3.18M, False: 0]
  ------------------
  111|  3.18M|}
_ZN8rawspeed17CroppedArray2DRefISt4byteEC2ENS_10Array2DRefIS1_EE:
   64|    392|      : CroppedArray2DRef(RHS, /*offsetCols=*/0, /*offsetRows=*/0, RHS.width(),
   65|    392|                          RHS.height()) {}
_ZN8rawspeed17CroppedArray2DRefISt4byteEC2ENS_10Array2DRefIS1_EEiiii:
  118|    392|    : base(base_), offsetCols(offsetCols_), offsetRows(offsetRows_),
  119|    392|      croppedWidth(croppedWidth_), croppedHeight(croppedHeight_) {
  120|    392|  establishClassInvariants();
  121|    392|}

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

_ZN8rawspeed5MutexC2Ev:
   40|  1.32k|  explicit Mutex() { omp_init_lock(&mutex); }
_ZN8rawspeed5MutexD2Ev:
   47|  1.32k|  ~Mutex() { omp_destroy_lock(&mutex); }

_ZN8rawspeed8OptionalINS_10Array2DRefIiEEEC2Ev:
   35|    663|  Optional() = default;
_ZN8rawspeed8OptionalIiEC2Ev:
   35|    663|  Optional() = default;
_ZN8rawspeed8OptionalINSt3__15arrayIfLm4EEEEC2Ev:
   35|    663|  Optional() = default;

_ZN8rawspeed8iPoint2DC2Eii:
   41|  1.92k|  constexpr iPoint2D(value_type a, value_type b) : x(a), y(b) {}
_ZNK8rawspeed8iPoint2DgtERKS0_:
   63|    602|  constexpr bool RAWSPEED_READONLY operator>(const iPoint2D& rhs) const {
   64|    602|    return x > rhs.x && y > rhs.y;
  ------------------
  |  Branch (64:12): [True: 563, False: 39]
  |  Branch (64:25): [True: 521, False: 42]
  ------------------
   65|    602|  }
_ZNK8rawspeed8iPoint2D15hasPositiveAreaEv:
   77|    602|  [[nodiscard]] bool RAWSPEED_READONLY hasPositiveArea() const {
   78|    602|    return *this > iPoint2D(0, 0);
   79|    602|  }
_ZNK8rawspeed8iPoint2D4areaEv:
   81|    514|  [[nodiscard]] area_type RAWSPEED_READONLY area() const {
   82|    514|    using signed_area = std::make_signed_t<area_type>;
   83|       |
   84|    514|    area_type x_abs = std::abs(static_cast<signed_area>(x));
   85|    514|    area_type y_abs = std::abs(static_cast<signed_area>(y));
   86|       |
   87|    514|    return x_abs * y_abs;
   88|    514|  }
_ZN8rawspeed8iPoint2DC2Ev:
   40|  2.65k|  constexpr iPoint2D() = default;

_ZNK8rawspeed18BitStreamCacheBase24establishClassInvariantsEv:
   54|  93.2M|BitStreamCacheBase::establishClassInvariants() const noexcept {
   55|  93.2M|  invariant(fillLevel >= 0);
  ------------------
  |  |   27|  93.2M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (55:3): [True: 100M, False: 18.4E]
  ------------------
   56|   100M|  invariant(fillLevel <= Size);
  ------------------
  |  |   27|   100M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (56:3): [True: 103M, False: 18.4E]
  ------------------
   57|   100M|}
_ZN8rawspeed28BitStreamCacheLeftInRightOut4pushEmi:
   60|  11.6M|  void push(uint64_t bits, int count) noexcept {
   61|  11.6M|    establishClassInvariants();
   62|  11.6M|    invariant(count >= 0);
  ------------------
  |  |   27|  11.6M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (62:5): [True: 12.0M, False: 18.4E]
  ------------------
   63|       |    // NOTE: count may be zero!
   64|  12.0M|    invariant(count <= Size);
  ------------------
  |  |   27|  12.0M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (64:5): [True: 12.1M, False: 18.4E]
  ------------------
   65|  12.1M|    invariant(count + fillLevel <= Size);
  ------------------
  |  |   27|  12.1M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (65:5): [True: 12.1M, False: 18.4E]
  ------------------
   66|  12.1M|    cache |= bits << fillLevel;
   67|  12.1M|    fillLevel += count;
   68|  12.1M|  }
_ZNK8rawspeed28BitStreamCacheLeftInRightOut4peekEi:
   70|  24.6M|  [[nodiscard]] uint32_t peek(int count) const noexcept {
   71|  24.6M|    establishClassInvariants();
   72|  24.6M|    invariant(count >= 0);
  ------------------
  |  |   27|  24.6M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (72:5): [True: 25.6M, False: 18.4E]
  ------------------
   73|  25.6M|    invariant(count <= MaxGetBits);
  ------------------
  |  |   27|  25.6M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (73:5): [True: 25.7M, False: 18.4E]
  ------------------
   74|  25.7M|    invariant(count != 0);
  ------------------
  |  |   27|  25.7M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (74:5): [True: 25.7M, False: 41.6k]
  ------------------
   75|  25.7M|    invariant(count <= Size);
  ------------------
  |  |   27|  25.7M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (75:5): [True: 25.7M, False: 0]
  ------------------
   76|  25.7M|    invariant(count <= fillLevel);
  ------------------
  |  |   27|  25.7M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (76:5): [True: 25.8M, False: 18.4E]
  ------------------
   77|  25.8M|    return extractLowBits(static_cast<uint32_t>(cache), count);
   78|  25.7M|  }
_ZN8rawspeed28BitStreamCacheLeftInRightOut4skipEi:
   80|  24.7M|  void skip(int count) noexcept {
   81|  24.7M|    establishClassInvariants();
   82|  24.7M|    invariant(count >= 0);
  ------------------
  |  |   27|  24.7M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (82:5): [True: 26.0M, False: 18.4E]
  ------------------
   83|       |    // `count` *could* be larger than `MaxGetBits`.
   84|       |    // `count` could be zero.
   85|  26.0M|    invariant(count <= Size);
  ------------------
  |  |   27|  26.0M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (85:5): [True: 26.0M, False: 18.4E]
  ------------------
   86|  26.0M|    invariant(count <= fillLevel);
  ------------------
  |  |   27|  26.0M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (86:5): [True: 26.1M, False: 18.4E]
  ------------------
   87|  26.1M|    cache >>= count;
   88|  26.1M|    fillLevel -= count;
   89|  26.1M|  }

_ZN8rawspeed11BitStreamerINS_14BitStreamerLSBENS_39BitStreamerForwardSequentialReplenisherIS1_EEEC2ENS_10Array1DRefIKSt4byteEE:
  192|  3.36M|  explicit BitStreamer(Array1DRef<const std::byte> input) : replenisher(input) {
  193|  3.36M|    establishClassInvariants();
  194|  3.36M|  }
_ZN8rawspeed26BitStreamerReplenisherBaseINS_14BitStreamerLSBEEC2ENS_10Array1DRefIKSt4byteEE:
   57|  3.35M|      : input(input_) {
   58|  3.35M|    if (input.size() < BitStreamerTraits<Tag>::MaxProcessBytes)
  ------------------
  |  Branch (58:9): [True: 0, False: 3.35M]
  ------------------
   59|  3.35M|      ThrowIOE("Bit stream size is smaller than MaxProcessBytes");
  ------------------
  |  |   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__)
  |  |  ------------------
  ------------------
   60|  3.35M|  }
_ZNK8rawspeed11BitStreamerINS_14BitStreamerLSBENS_39BitStreamerForwardSequentialReplenisherIS1_EEE24establishClassInvariantsEv:
  185|  76.5M|  void establishClassInvariants() const noexcept {
  186|  76.5M|    cache.establishClassInvariants();
  187|  76.5M|    replenisher.establishClassInvariants();
  188|  76.5M|  }
_ZNK8rawspeed26BitStreamerReplenisherBaseINS_14BitStreamerLSBEE24establishClassInvariantsEv:
   65|  98.1M|BitStreamerReplenisherBase<Tag>::establishClassInvariants() const noexcept {
   66|  98.1M|  input.establishClassInvariants();
   67|  98.1M|  invariant(input.size() >= BitStreamerTraits<Tag>::MaxProcessBytes);
  ------------------
  |  |   27|  98.1M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (67:3): [True: 86.7M, False: 11.4M]
  ------------------
   68|  86.7M|  invariant(pos >= 0);
  ------------------
  |  |   27|  86.7M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (68:3): [True: 67.8M, False: 18.8M]
  ------------------
   69|  67.8M|  invariant(pos % StreamTraits::MinLoadStepByteMultiple == 0);
  ------------------
  |  |   27|  67.8M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (69:3): [True: 67.8M, False: 0]
  ------------------
   70|       |  // `pos` *could* be out-of-bounds of `input`.
   71|  67.8M|}
_ZN8rawspeed11BitStreamerINS_14BitStreamerLSBENS_39BitStreamerForwardSequentialReplenisherIS1_EEE7getBitsEi:
  294|  24.5M|  uint32_t getBits(int nbits) {
  295|  24.5M|    establishClassInvariants();
  296|  24.5M|    invariant(nbits >= 0);
  ------------------
  |  |   27|  24.5M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (296:5): [True: 21.7M, False: 2.81M]
  ------------------
  297|  21.7M|    invariant(nbits != 0);
  ------------------
  |  |   27|  21.7M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (297:5): [True: 21.7M, False: 0]
  ------------------
  298|  21.7M|    invariant(nbits <= Cache::MaxGetBits);
  ------------------
  |  |   27|  21.7M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (298:5): [True: 24.5M, False: 18.4E]
  ------------------
  299|  24.5M|    fill(nbits);
  300|  24.5M|    return getBitsNoFill(nbits);
  301|  21.7M|  }
_ZN8rawspeed11BitStreamerINS_14BitStreamerLSBENS_39BitStreamerForwardSequentialReplenisherIS1_EEE4fillEi:
  216|  24.4M|  void fill(int nbits = Cache::MaxGetBits) {
  217|  24.4M|    establishClassInvariants();
  218|  24.4M|    invariant(nbits >= 0);
  ------------------
  |  |   27|  24.4M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (218:5): [True: 24.6M, False: 18.4E]
  ------------------
  219|  24.6M|    invariant(nbits != 0);
  ------------------
  |  |   27|  24.6M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (219:5): [True: 24.6M, False: 18.4E]
  ------------------
  220|  24.6M|    invariant(nbits <= Cache::MaxGetBits);
  ------------------
  |  |   27|  24.6M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (220:5): [True: 24.6M, False: 18.4E]
  ------------------
  221|       |
  222|  24.6M|    if (cache.fillLevel >= nbits)
  ------------------
  |  Branch (222:9): [True: 14.9M, False: 9.74M]
  ------------------
  223|  14.9M|      return;
  224|       |
  225|  9.74M|    const auto input = replenisher.getInput();
  226|  9.74M|    const auto numBytes = static_cast<Derived*>(this)->fillCache(input);
  227|  9.74M|    replenisher.markNumBytesAsConsumed(numBytes);
  228|       |    invariant(cache.fillLevel >= nbits);
  ------------------
  |  |   27|  9.74M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (228:5): [True: 11.4M, False: 18.4E]
  ------------------
  229|  9.74M|  }
_ZN8rawspeed39BitStreamerForwardSequentialReplenisherINS_14BitStreamerLSBEE8getInputEv:
  100|  12.3M|  std::array<std::byte, BitStreamerTraits<Tag>::MaxProcessBytes> getInput() {
  101|  12.3M|    Base::establishClassInvariants();
  102|       |
  103|  12.3M|    std::array<std::byte, BitStreamerTraits<Tag>::MaxProcessBytes> tmpStorage;
  104|  12.3M|    auto tmp = Array1DRef<std::byte>(tmpStorage.data(),
  105|  12.3M|                                     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|  12.3M|    if (getPos() + BitStreamerTraits<Tag>::MaxProcessBytes <=
  ------------------
  |  Branch (109:9): [True: 12.1M, False: 224k]
  ------------------
  110|  12.3M|        Base::input.size()) [[likely]] {
  111|  12.1M|      auto currInput =
  112|  12.1M|          Base::input.getCrop(getPos(), BitStreamerTraits<Tag>::MaxProcessBytes)
  113|  12.1M|              .getAsArray1DRef();
  114|  12.1M|      invariant(currInput.size() == tmp.size());
  ------------------
  |  |   27|  12.1M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (114:7): [True: 11.9M, False: 198k]
  ------------------
  115|  11.9M|      memcpy(tmp.begin(), currInput.begin(),
  116|  11.9M|             BitStreamerTraits<Tag>::MaxProcessBytes);
  117|  11.9M|      return tmpStorage;
  118|  12.1M|    }
  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|   224k|    if (getPos() > Base::input.size() +
  ------------------
  |  Branch (125:9): [True: 0, False: 224k]
  ------------------
  126|   224k|                       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|   224k|    variableLengthLoadNaiveViaMemcpy(tmp, Base::input, getPos());
  130|       |
  131|   224k|    return tmpStorage;
  132|   224k|  }
_ZNK8rawspeed39BitStreamerForwardSequentialReplenisherINS_14BitStreamerLSBEE6getPosEv:
   84|  22.3M|  [[nodiscard]] typename Base::size_type getPos() const {
   85|  22.3M|    Base::establishClassInvariants();
   86|  22.3M|    return Base::pos;
   87|  22.3M|  }
_ZN8rawspeed11BitStreamerINS_14BitStreamerLSBENS_39BitStreamerForwardSequentialReplenisherIS1_EEE9fillCacheENSt3__15arrayISt4byteLm4EEE:
  157|  11.1M|                inputStorage) {
  158|  11.1M|    static_assert(BitStreamCacheBase::MaxGetBits >= 32, "check implementation");
  159|  11.1M|    establishClassInvariants();
  160|  11.1M|    auto input = Array1DRef<std::byte>(inputStorage.data(),
  161|  11.1M|                                       implicit_cast<int>(inputStorage.size()));
  162|  11.1M|    invariant(input.size() == Traits::MaxProcessBytes);
  ------------------
  |  |   27|  11.1M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (162:5): [True: 12.0M, False: 18.4E]
  ------------------
  163|       |
  164|  12.0M|    constexpr int StreamChunkBitwidth =
  165|  12.0M|        bitwidth<typename StreamTraits::ChunkType>();
  166|  12.0M|    static_assert(CHAR_BIT * Traits::MaxProcessBytes >= StreamChunkBitwidth);
  167|  12.0M|    static_assert(CHAR_BIT * Traits::MaxProcessBytes % StreamChunkBitwidth ==
  168|  12.0M|                  0);
  169|  12.0M|    constexpr int NumChunksNeeded =
  170|  12.0M|        (CHAR_BIT * Traits::MaxProcessBytes) / StreamChunkBitwidth;
  171|  12.0M|    static_assert(NumChunksNeeded >= 1);
  172|       |
  173|  24.1M|    for (int i = 0; i != NumChunksNeeded; ++i) {
  ------------------
  |  Branch (173:21): [True: 12.0M, False: 12.0M]
  ------------------
  174|  12.0M|      auto chunkInput =
  175|  12.0M|          input.getBlock(sizeof(typename StreamTraits::ChunkType), i);
  176|  12.0M|      auto chunk = getByteSwapped<typename StreamTraits::ChunkType>(
  177|  12.0M|          chunkInput.begin(),
  178|  12.0M|          StreamTraits::ChunkEndianness != getHostEndianness());
  179|  12.0M|      cache.push(chunk, StreamChunkBitwidth);
  180|  12.0M|    }
  181|  12.0M|    return Traits::MaxProcessBytes;
  182|  11.1M|  }
_ZN8rawspeed39BitStreamerForwardSequentialReplenisherINS_14BitStreamerLSBEE22markNumBytesAsConsumedEi:
   92|  12.3M|  void markNumBytesAsConsumed(typename Base::size_type numBytes) {
   93|  12.3M|    Base::establishClassInvariants();
   94|  12.3M|    invariant(numBytes >= 0);
  ------------------
  |  |   27|  12.3M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (94:5): [True: 11.4M, False: 922k]
  ------------------
   95|  11.4M|    invariant(numBytes != 0);
  ------------------
  |  |   27|  11.4M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (95:5): [True: 11.5M, False: 18.4E]
  ------------------
   96|  11.5M|    invariant(numBytes % StreamTraits::MinLoadStepByteMultiple == 0);
  ------------------
  |  |   27|  11.5M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (96:5): [True: 11.5M, False: 0]
  ------------------
   97|  11.5M|    Base::pos += numBytes;
   98|  11.5M|  }
_ZN8rawspeed11BitStreamerINS_14BitStreamerLSBENS_39BitStreamerForwardSequentialReplenisherIS1_EEE13getBitsNoFillEi:
  269|  24.1M|  uint32_t getBitsNoFill(int nbits) {
  270|  24.1M|    establishClassInvariants();
  271|  24.1M|    invariant(nbits >= 0);
  ------------------
  |  |   27|  24.1M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (271:5): [True: 24.1M, False: 12.3k]
  ------------------
  272|  24.1M|    invariant(nbits != 0);
  ------------------
  |  |   27|  24.1M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (272:5): [True: 24.3M, False: 18.4E]
  ------------------
  273|  24.3M|    invariant(nbits <= Cache::MaxGetBits);
  ------------------
  |  |   27|  24.3M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (273:5): [True: 24.4M, False: 18.4E]
  ------------------
  274|  24.4M|    uint32_t ret = peekBitsNoFill(nbits);
  275|  24.4M|    skipBitsNoFill(nbits);
  276|  24.4M|    return ret;
  277|  24.3M|  }
_ZN8rawspeed11BitStreamerINS_14BitStreamerLSBENS_39BitStreamerForwardSequentialReplenisherIS1_EEE14peekBitsNoFillEi:
  253|  24.4M|  uint32_t RAWSPEED_READONLY peekBitsNoFill(int nbits) {
  254|  24.4M|    establishClassInvariants();
  255|  24.4M|    invariant(nbits >= 0);
  ------------------
  |  |   27|  24.4M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (255:5): [True: 24.2M, False: 226k]
  ------------------
  256|  24.2M|    invariant(nbits != 0);
  ------------------
  |  |   27|  24.2M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (256:5): [True: 24.4M, False: 18.4E]
  ------------------
  257|  24.4M|    invariant(nbits <= Cache::MaxGetBits);
  ------------------
  |  |   27|  24.4M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (257:5): [True: 24.5M, False: 18.4E]
  ------------------
  258|  24.5M|    return cache.peek(nbits);
  259|  24.4M|  }
_ZN8rawspeed11BitStreamerINS_14BitStreamerLSBENS_39BitStreamerForwardSequentialReplenisherIS1_EEE14skipBitsNoFillEi:
  261|  25.6M|  void skipBitsNoFill(int nbits) {
  262|  25.6M|    establishClassInvariants();
  263|  25.6M|    invariant(nbits >= 0);
  ------------------
  |  |   27|  25.6M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (263:5): [True: 23.8M, False: 1.78M]
  ------------------
  264|       |    // `nbits` could be zero.
  265|  23.8M|    invariant(nbits <= Cache::MaxGetBits);
  ------------------
  |  |   27|  23.8M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (265:5): [True: 23.8M, False: 0]
  ------------------
  266|  23.8M|    cache.skip(nbits);
  267|  23.8M|  }

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

_ZN8rawspeed21getMisalignmentOffsetImQsr3stdE13is_integral_vIT_EEEmS1_m:
  109|    392|                                                           uint64_t multiple) {
  110|    392|  if (multiple == 0)
  ------------------
  |  Branch (110:7): [True: 0, False: 392]
  ------------------
  111|      0|    return 0;
  112|    392|  return value % multiple;
  113|    392|}
_ZN8rawspeed15roundToMultipleImEET_S1_mb:
  117|    392|                                              bool roundDown) {
  118|    392|  uint64_t offset = getMisalignmentOffset(value, multiple);
  119|    392|  if (offset == 0)
  ------------------
  |  Branch (119:7): [True: 7, False: 385]
  ------------------
  120|      7|    return value;
  121|       |  // Drop remainder.
  122|    385|  T roundedDown = value - offset;
  123|    385|  if (roundDown) // If we were rounding down, then that's it.
  ------------------
  |  Branch (123:7): [True: 0, False: 385]
  ------------------
  124|      0|    return roundedDown;
  125|       |  // Else, just add one multiple.
  126|    385|  return roundedDown + multiple;
  127|    385|}
_ZN8rawspeed7roundUpEmm:
  135|    392|                                             uint64_t multiple) {
  136|    392|  return roundToMultiple(value, multiple, /*roundDown=*/false);
  137|    392|}
_ZN8rawspeed21getMisalignmentOffsetIPhQsr3stdE12is_pointer_vIT_EEEmS2_m:
   98|    784|                                                           uint64_t multiple) {
   99|    784|  if (multiple == 0)
  ------------------
  |  Branch (99:7): [True: 0, False: 784]
  ------------------
  100|      0|    return 0;
  101|    784|  static_assert(bitwidth<uintptr_t>() >= bitwidth<T>(),
  102|    784|                "uintptr_t can not represent all pointer values?");
  103|    784|  return reinterpret_cast<uintptr_t>(value) % multiple;
  104|    784|}
_ZN8rawspeed9isAlignedIPhEEbT_m:
  151|    784|constexpr RAWSPEED_READNONE bool isAligned(T value, size_t multiple) {
  152|    784|  return (multiple == 0) || (getMisalignmentOffset(value, multiple) == 0);
  ------------------
  |  Branch (152:10): [True: 0, False: 784]
  |  Branch (152:29): [True: 784, False: 0]
  ------------------
  153|    784|}
_ZN8rawspeed9isAlignedIiEEbT_m:
  151|    392|constexpr RAWSPEED_READNONE bool isAligned(T value, size_t multiple) {
  152|    392|  return (multiple == 0) || (getMisalignmentOffset(value, multiple) == 0);
  ------------------
  |  Branch (152:10): [True: 0, False: 392]
  |  Branch (152:29): [True: 392, False: 0]
  ------------------
  153|    392|}
_ZN8rawspeed21getMisalignmentOffsetIiQsr3stdE13is_integral_vIT_EEEmS1_m:
  109|    392|                                                           uint64_t multiple) {
  110|    392|  if (multiple == 0)
  ------------------
  |  Branch (110:7): [True: 0, False: 392]
  ------------------
  111|      0|    return 0;
  112|    392|  return value % multiple;
  113|    392|}
_ZN8rawspeed9isAlignedIPSt4byteEEbT_m:
  151|  3.17M|constexpr RAWSPEED_READNONE bool isAligned(T value, size_t multiple) {
  152|  3.17M|  return (multiple == 0) || (getMisalignmentOffset(value, multiple) == 0);
  ------------------
  |  Branch (152:10): [True: 0, False: 3.17M]
  |  Branch (152:29): [True: 3.17M, False: 0]
  ------------------
  153|  3.17M|}
_ZN8rawspeed21getMisalignmentOffsetIPSt4byteQsr3stdE12is_pointer_vIT_EEEmS3_m:
   98|  3.17M|                                                           uint64_t multiple) {
   99|  3.17M|  if (multiple == 0)
  ------------------
  |  Branch (99:7): [True: 0, False: 3.17M]
  ------------------
  100|      0|    return 0;
  101|  3.17M|  static_assert(bitwidth<uintptr_t>() >= bitwidth<T>(),
  102|  3.17M|                "uintptr_t can not represent all pointer values?");
  103|  3.17M|  return reinterpret_cast<uintptr_t>(value) % multiple;
  104|  3.17M|}

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

_ZN8rawspeed12RawImageData10createDataEv:
   68|    394|void RawImageData::createData() {
   69|    394|  static constexpr const auto alignment = 16;
   70|       |
   71|    394|  if (dim.x > 65535 || dim.y > 65535)
  ------------------
  |  Branch (71:7): [True: 2, False: 392]
  |  Branch (71:24): [True: 0, False: 392]
  ------------------
   72|    394|    ThrowRDE("Dimensions too large for allocation.");
  ------------------
  |  |   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__)
  |  |  ------------------
  ------------------
   73|    392|  if (dim.x <= 0 || dim.y <= 0)
  ------------------
  |  Branch (73:7): [True: 0, False: 392]
  |  Branch (73:21): [True: 0, False: 392]
  ------------------
   74|    392|    ThrowRDE("Dimension of one sides is less than 1 - 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__)
  |  |  ------------------
  ------------------
   75|    392|  if (cpp <= 0 || bpp <= 0)
  ------------------
  |  Branch (75:7): [True: 0, False: 392]
  |  Branch (75:19): [True: 0, False: 392]
  ------------------
   76|    392|    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|    392|  if (isAllocated())
  ------------------
  |  Branch (77:7): [True: 0, False: 392]
  ------------------
   78|    392|    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|    392|  pitch =
   82|    392|      implicit_cast<int>(roundUp(static_cast<size_t>(dim.x) * bpp, alignment));
   83|    392|  assert(isAligned(pitch, alignment));
  ------------------
  |  Branch (83:3): [True: 392, 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|    392|  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|    392|  data.resize(static_cast<size_t>(pitch) * dim.y);
  100|       |
  101|    392|  uncropped_dim = dim;
  102|       |
  103|    392|#ifndef NDEBUG
  104|    392|  const Array2DRef<std::byte> img = getByteDataAsUncroppedArray2DRef();
  105|       |
  106|  3.18M|  for (int j = 0; j < dim.y; j++) {
  ------------------
  |  Branch (106:19): [True: 3.17M, False: 392]
  ------------------
  107|       |    // each line is indeed 16-byte aligned
  108|  3.17M|    assert(isAligned(&img(j, 0), alignment));
  ------------------
  |  Branch (108:5): [True: 3.17M, False: 0]
  ------------------
  109|  3.17M|  }
  110|    392|#endif
  111|       |
  112|    392|  poisonPadding();
  113|    392|}
_ZN8rawspeed12RawImageData13poisonPaddingEv:
  127|    392|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|    392|}
_ZN8rawspeed12RawImageData6setCppEj:
  153|    663|void RawImageData::setCpp(uint32_t val) {
  154|    663|  if (isAllocated())
  ------------------
  |  Branch (154:7): [True: 0, False: 663]
  ------------------
  155|    663|    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|    663|  if (val > 4) {
  ------------------
  |  Branch (156:7): [True: 47, False: 616]
  ------------------
  157|     47|    ThrowRDE(
  ------------------
  |  |   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__)
  |  |  ------------------
  ------------------
  158|     47|        "Only up to 4 components per pixel is support - attempted to set: %u",
  159|     47|        val);
  160|     47|  }
  161|       |
  162|    616|  bpp /= cpp;
  163|    616|  cpp = val;
  164|    616|  bpp *= val;
  165|    616|}

_ZNK8rawspeed8RawImageptEv:
  253|  3.08M|  RawImageData* RAWSPEED_READONLY operator->() const { return &*p_; }
_ZN8rawspeed12RawImageData32getByteDataAsUncroppedArray2DRefEv:
  330|    784|RawImageData::getByteDataAsUncroppedArray2DRef() noexcept {
  331|    784|  switch (dataType) {
  ------------------
  |  Branch (331:11): [True: 784, False: 0]
  ------------------
  332|    784|  case RawImageType::UINT16:
  ------------------
  |  Branch (332:3): [True: 784, False: 0]
  ------------------
  333|    784|    return getU16DataAsUncroppedArray2DRef();
  334|      0|  case RawImageType::F32:
  ------------------
  |  Branch (334:3): [True: 0, False: 784]
  ------------------
  335|      0|    return getF32DataAsUncroppedArray2DRef();
  336|    784|  }
  337|      0|  __builtin_unreachable();
  338|    784|}
_ZN8rawspeed12RawImageData31getU16DataAsUncroppedArray2DRefEv:
  290|  3.08M|RawImageData::getU16DataAsUncroppedArray2DRef() noexcept {
  291|  3.08M|  assert(dataType == RawImageType::UINT16 &&
  ------------------
  |  Branch (291:3): [True: 3.08M, False: 18.4E]
  |  Branch (291:3): [True: 3.08M, Folded]
  |  Branch (291:3): [True: 3.08M, False: 18.4E]
  ------------------
  292|  3.08M|         "Attempting to access floating-point buffer as uint16_t.");
  293|  3.08M|  assert(!data.empty() && "Data not yet allocated.");
  ------------------
  |  Branch (293:3): [True: 3.08M, False: 18.4E]
  |  Branch (293:3): [True: 3.08M, Folded]
  |  Branch (293:3): [True: 3.08M, False: 18.4E]
  ------------------
  294|  3.08M|#pragma GCC diagnostic push
  295|  3.08M|#pragma GCC diagnostic ignored "-Wpragmas"
  296|  3.08M|#pragma GCC diagnostic ignored "-Wunknown-warning-option"
  297|  3.08M|#pragma GCC diagnostic ignored "-Wunsafe-buffer-usage"
  298|  3.08M|  return {reinterpret_cast<uint16_t*>(data.data()), cpp * uncropped_dim.x,
  299|  3.08M|          uncropped_dim.y, static_cast<int>(pitch / sizeof(uint16_t))};
  300|  3.08M|#pragma GCC diagnostic pop
  301|  3.08M|}
_ZNK8rawspeed12RawImageData6getCppEv:
  118|    616|  [[nodiscard]] uint32_t RAWSPEED_READONLY getCpp() const { return cpp; }
_ZNK8rawspeed12RawImageData6getBppEv:
  119|    602|  [[nodiscard]] uint32_t RAWSPEED_READONLY getBpp() const { return bpp; }
_ZNK8rawspeed12RawImageData11getDataTypeEv:
  125|    605|  [[nodiscard]] rawspeed::RawImageType getDataType() const { return dataType; }
_ZNK8rawspeed12RawImageData11isAllocatedEv:
  152|  1.05k|  [[nodiscard]] bool isAllocated() const { return !data.empty(); }
_ZN8rawspeed8RawImageC2ENSt3__110shared_ptrINS_12RawImageDataEEE:
  257|    663|  explicit RawImage(std::shared_ptr<RawImageData> p) : p_(std::move(p)) {}
_ZN8rawspeed8RawImage6createENS_12RawImageTypeE:
  265|    663|inline RawImage RawImage::create(RawImageType type) {
  266|    663|  switch (type) {
  ------------------
  |  Branch (266:11): [True: 663, False: 0]
  ------------------
  267|    654|  case RawImageType::UINT16:
  ------------------
  |  Branch (267:3): [True: 654, False: 9]
  ------------------
  268|    654|    return RawImage(std::make_shared<RawImageDataU16>());
  269|      9|  case RawImageType::F32:
  ------------------
  |  Branch (269:3): [True: 9, False: 654]
  ------------------
  270|      9|    return RawImage(std::make_shared<RawImageDataFloat>());
  271|    663|  }
  272|      0|  writeLog(DEBUG_PRIO::ERROR, "RawImage::create: Unknown Image type!");
  273|      0|  __builtin_unreachable();
  274|    663|}
_ZN8rawspeed12RawImageDataD2Ev:
  117|    663|  virtual ~RawImageData() = default;
_ZN8rawspeed12RawImageDataC2Ev:
  191|    663|  RawImageData() = default;

_ZN8rawspeed17RawImageDataFloatC2Ev:
   43|      9|RawImageDataFloat::RawImageDataFloat() {
   44|      9|  bpp = sizeof(float);
   45|      9|  dataType = RawImageType::F32;
   46|      9|}

_ZN8rawspeed15RawImageDataU16C2Ev:
   52|    654|RawImageDataU16::RawImageDataU16() {
   53|    654|  dataType = RawImageType::UINT16;
   54|    654|  bpp = sizeof(uint16_t);
   55|    654|}

_ZN8rawspeed14ThrowExceptionINS_11IOExceptionEEEvPKcz:
   36|     13|    ThrowException(const char* fmt, ...) {
   37|     13|  static constexpr size_t bufSize = 8192;
   38|     13|#if defined(HAVE_CXX_THREAD_LOCAL)
   39|     13|  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|     13|  va_list val;
   49|     13|  va_start(val, fmt);
   50|     13|  vsnprintf(buf.data(), sizeof(buf), fmt, val);
   51|       |  va_end(val);
   52|     13|  writeLog(DEBUG_PRIO::EXTRA, "EXCEPTION: %s", buf.data());
   53|     13|  throw T(buf.data());
   54|     13|}
_ZN8rawspeed17RawspeedExceptionC2EPKc:
   67|    341|      : std::runtime_error(msg) {
   68|    341|    log(msg);
   69|    341|  }
_ZN8rawspeed17RawspeedException3logEPKc:
   58|    341|  log(const char* msg) {
   59|    341|    writeLog(DEBUG_PRIO::EXTRA, "EXCEPTION: %s", msg);
   60|    341|  }
_ZN8rawspeed14ThrowExceptionINS_19RawDecoderExceptionEEEvPKcz:
   36|    271|    ThrowException(const char* fmt, ...) {
   37|    271|  static constexpr size_t bufSize = 8192;
   38|    271|#if defined(HAVE_CXX_THREAD_LOCAL)
   39|    271|  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|    271|  va_list val;
   49|    271|  va_start(val, fmt);
   50|    271|  vsnprintf(buf.data(), sizeof(buf), fmt, val);
   51|       |  va_end(val);
   52|    271|  writeLog(DEBUG_PRIO::EXTRA, "EXCEPTION: %s", buf.data());
   53|    271|  throw T(buf.data());
   54|    271|}
_ZN8rawspeed14ThrowExceptionINS_17RawspeedExceptionEEEvPKcz:
   36|     57|    ThrowException(const char* fmt, ...) {
   37|     57|  static constexpr size_t bufSize = 8192;
   38|     57|#if defined(HAVE_CXX_THREAD_LOCAL)
   39|     57|  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|     57|  va_list val;
   49|     57|  va_start(val, fmt);
   50|     57|  vsnprintf(buf.data(), sizeof(buf), fmt, val);
   51|       |  va_end(val);
   52|     57|  writeLog(DEBUG_PRIO::EXTRA, "EXCEPTION: %s", buf.data());
   53|     57|  throw T(buf.data());
   54|     57|}

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

_ZN8rawspeed6BufferC2EPKhj:
   68|    733|      : Buffer(Array1DRef(data_, implicit_cast<int>(size_))) {}
_ZN8rawspeed6BufferC2ENS_10Array1DRefIKhEE:
   62|  13.1M|      : data(data_.begin()), size(data_.size()) {
   63|  13.1M|    assert(data);
  ------------------
  |  Branch (63:5): [True: 13.0M, False: 157k]
  ------------------
   64|  13.1M|    assert(!ASan::RegionIsPoisoned(data, size));
  ------------------
  |  Branch (64:5): [True: 13.0M, False: 113]
  ------------------
   65|  13.0M|  }
_ZN8rawspeed10DataBufferC2ENS_6BufferENS_10EndiannessE:
  142|  6.46M|      : Buffer(data_), endianness(endianness_) {}
_ZNK8rawspeed6Buffer10getSubViewEjj:
   78|  13.0M|  [[nodiscard]] Buffer getSubView(size_type offset, size_type size_) const {
   79|  13.0M|    if (!isValid(offset, size_))
  ------------------
  |  Branch (79:9): [True: 13, False: 13.0M]
  ------------------
   80|  13.0M|      ThrowIOE("Buffer overflow: image file may be truncated");
  ------------------
  |  |   37|     13|#define ThrowIOE(...) ThrowExceptionHelper(rawspeed::IOException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     13|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     13|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     13|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   81|       |
   82|  13.0M|    return getAsArray1DRef().getCrop(offset, size_).getAsArray1DRef();
   83|  13.0M|  }
_ZNK8rawspeed6Buffer7isValidEjj:
  117|  16.2M|  [[nodiscard]] bool isValid(size_type offset, size_type count = 1) const {
  118|  16.2M|    return static_cast<uint64_t>(offset) + count <=
  119|  16.2M|           static_cast<uint64_t>(getSize());
  120|  16.2M|  }
_ZNK8rawspeed6Buffer7getSizeEv:
  115|  29.2M|  [[nodiscard]] size_type RAWSPEED_READONLY getSize() const { return size; }
_ZNK8rawspeed6Buffer15getAsArray1DRefEv:
   70|  19.6M|  [[nodiscard]] Array1DRef<const uint8_t> getAsArray1DRef() const {
   71|  19.6M|    return {data, implicit_cast<int>(size)};
   72|  19.6M|  }
_ZNK8rawspeed10DataBuffer12getByteOrderEv:
  154|  6.45M|  [[nodiscard]] Endianness getByteOrder() const { return endianness; }
_ZNK8rawspeed6Buffer5beginEv:
   99|  3.41M|  [[nodiscard]] const uint8_t* begin() const {
  100|  3.41M|    return getAsArray1DRef().begin();
  101|  3.41M|  }
_ZNK8rawspeed10DataBuffer3getIjEET_jj:
  147|  3.63k|  [[nodiscard]] T get(size_type offset, size_type index = 0) const {
  148|  3.63k|    assert(Endianness::unknown != endianness);
  ------------------
  |  Branch (148:5): [True: 3.63k, False: 0]
  ------------------
  149|  3.63k|    assert(Endianness::little == endianness || Endianness::big == endianness);
  ------------------
  |  Branch (149:5): [True: 3.63k, False: 0]
  |  Branch (149:5): [True: 0, False: 0]
  |  Branch (149:5): [True: 3.63k, False: 0]
  ------------------
  150|       |
  151|  3.63k|    return Buffer::get<T>(getHostEndianness() == endianness, offset, index);
  152|  3.63k|  }
_ZNK8rawspeed6Buffer3getIjEET_bjj:
  108|  3.63k|                      size_type index = 0) const {
  109|  3.63k|    const Buffer buf =
  110|  3.63k|        getSubView(offset + (index * static_cast<size_type>(sizeof(T))),
  111|  3.63k|                   static_cast<size_type>(sizeof(T)));
  112|  3.63k|    return getByteSwapped<T>(buf.begin(), !inNativeByteOrder);
  113|  3.63k|  }
_ZN8rawspeed10DataBufferC2Ev:
  139|    616|  DataBuffer() = default;
_ZN8rawspeed6BufferC2Ev:
   58|    616|  Buffer() = default;

_ZN8rawspeed10ByteStreamC2ENS_10DataBufferE:
   50|  6.46M|  explicit ByteStream(DataBuffer buffer) : DataBuffer(buffer) {}
_ZN8rawspeed10ByteStream9getStreamEj:
  119|  3.38M|  ByteStream getStream(size_type size_) {
  120|  3.38M|    ByteStream ret = peekStream(size_);
  121|  3.38M|    pos += size_;
  122|  3.38M|    return ret;
  123|  3.38M|  }
_ZNK8rawspeed10ByteStream10peekStreamEj:
  111|  3.38M|  [[nodiscard]] ByteStream peekStream(size_type size_) const {
  112|  3.38M|    return getSubStream(pos, size_);
  113|  3.38M|  }
_ZNK8rawspeed10ByteStream12getSubStreamEjj:
   55|  6.45M|                                        size_type size_) const {
   56|  6.45M|    return ByteStream(DataBuffer(getSubView(offset, size_), getByteOrder()));
   57|  6.45M|  }
_ZNK8rawspeed10ByteStream13getRemainSizeEv:
   87|  3.33M|  [[nodiscard]] size_type RAWSPEED_READONLY getRemainSize() const {
   88|  3.33M|    invariant(getSize() >= pos);
  ------------------
  |  |   27|  3.33M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (88:5): [True: 3.33M, False: 0]
  ------------------
   89|  3.33M|    (void)check(0);
   90|  3.33M|    return getSize() - pos;
   91|  3.33M|  }
_ZNK8rawspeed10ByteStream5checkEj:
   63|  3.33M|  [[nodiscard]] size_type check(size_type bytes) const {
   64|  3.33M|    if (!isValid(pos, bytes))
  ------------------
  |  Branch (64:9): [True: 0, False: 3.33M]
  ------------------
   65|  3.33M|      ThrowIOE("Out of bounds access in ByteStream");
  ------------------
  |  |   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__)
  |  |  ------------------
  ------------------
   66|  3.33M|    [[maybe_unused]] Buffer tmp = getSubView(pos, bytes);
   67|  3.33M|    assert(tmp.getSize() == bytes);
  ------------------
  |  Branch (67:5): [True: 3.40M, False: 18.4E]
  ------------------
   68|  3.40M|    assert(!ASan::RegionIsPoisoned(tmp.begin(), tmp.getSize()));
  ------------------
  |  Branch (68:5): [True: 3.40M, False: 5.91k]
  ------------------
   69|  3.40M|    return bytes;
   70|  3.40M|  }
_ZNK8rawspeed10ByteStream19peekRemainingBufferEv:
  108|  3.33M|  [[nodiscard]] Buffer peekRemainingBuffer() const {
  109|  3.33M|    return getSubView(pos, getRemainSize());
  110|  3.33M|  }
_ZNK8rawspeed10ByteStream10peekStreamEjj:
  114|    394|  [[nodiscard]] ByteStream peekStream(size_type nmemb, size_type size_) const {
  115|    394|    if (size_ && nmemb > std::numeric_limits<size_type>::max() / size_)
  ------------------
  |  Branch (115:9): [True: 394, False: 0]
  |  Branch (115:18): [True: 0, False: 394]
  ------------------
  116|    394|      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|    394|    return peekStream(nmemb * size_);
  118|    394|  }
_ZN8rawspeed10ByteStream6getU32Ev:
  196|  3.63k|  uint32_t getU32() { return get<uint32_t>(); }
_ZNK8rawspeed10ByteStream4peekIjEET_j:
  156|  3.63k|  template <typename T> [[nodiscard]] T peek(size_type i = 0) const {
  157|  3.63k|    return DataBuffer::get<T>(pos, i);
  158|  3.63k|  }
_ZN8rawspeed10ByteStream3getIjEET_v:
  159|  3.63k|  template <typename T> T get() {
  160|  3.63k|    auto ret = peek<T>();
  161|  3.63k|    pos += sizeof(T);
  162|  3.63k|    return ret;
  163|  3.63k|  }
_ZN8rawspeed10ByteStreamC2Ev:
   48|    616|  ByteStream() = default;

_ZN8rawspeed17getHostEndiannessEv:
   63|  11.5M|inline Endianness getHostEndianness() {
   64|  11.5M|#if defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
   65|  11.5M|  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|  11.5M|}
_ZN8rawspeed14getByteSwappedIjEET_PKvb:
  100|  11.5M|template <typename T> inline T getByteSwapped(const void* data, bool bswap) {
  101|  11.5M|  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|  11.5M|  memcpy(&ret, data, sizeof(T));
  106|  11.5M|  return bswap ? getByteSwapped(ret) : ret;
  ------------------
  |  Branch (106:10): [True: 0, False: 11.5M]
  ------------------
  107|  11.5M|}

_ZN8rawspeed16ColorFilterArrayC2Ev:
   51|    663|  ColorFilterArray() = default;

_ZNSt9exceptionC2B8ne180100Ev:
   74|    341|  _LIBCPP_HIDE_FROM_ABI exception() _NOEXCEPT {}

_ZNSt3__122__libcpp_aligned_allocB8ne180100Emm:
   30|    733|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|    733|  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|    733|  return ::aligned_alloc(__alignment, __size > __rounded_size ? __size : __rounded_size);
  ------------------
  |  Branch (43:39): [True: 0, False: 733]
  ------------------
   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|    733|}
_ZNSt3__121__libcpp_aligned_freeB8ne180100EPv:
   52|    733|inline _LIBCPP_HIDE_FROM_ABI void __libcpp_aligned_free(void* __ptr) {
   53|       |#  if defined(_LIBCPP_MSVCRT_LIKE)
   54|       |  ::_aligned_free(__ptr);
   55|       |#  else
   56|    733|  ::free(__ptr);
   57|    733|#  endif
   58|    733|}

_ZNSt3__121__libcpp_execute_onceB8ne180100EPiPFvvE:
  302|  1.02k|int __libcpp_execute_once(__libcpp_exec_once_flag* __flag, void (*__init_routine)()) {
  303|  1.02k|  return pthread_once(__flag, __init_routine);
  304|  1.02k|}
_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|  1.02k|void* __libcpp_tls_get(__libcpp_tls_key __key) { return pthread_getspecific(__key); }
_ZNSt3__116__libcpp_tls_setB8ne180100EjPv:
  352|      1|int __libcpp_tls_set(__libcpp_tls_key __key, void* __p) { return pthread_setspecific(__key, __p); }

_ZNSt27__type_info_implementations13__unique_impl4__eqB8ne180100EPKcS2_:
  203|  1.76k|    _LIBCPP_HIDE_FROM_ABI _LIBCPP_ALWAYS_INLINE static bool __eq(__type_name_t __lhs, __type_name_t __rhs) _NOEXCEPT {
  204|  1.76k|      return __lhs == __rhs;
  205|  1.76k|    }
_ZNKSt9type_infoeqB8ne180100ERKS_:
  302|  1.76k|  _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|  1.76k|    if (__libcpp_is_constant_evaluated()) {
  ------------------
  |  Branch (305:9): [Folded, False: 1.76k]
  ------------------
  306|      0|      return this == &__arg;
  307|      0|    }
  308|  1.76k|    return __impl::__eq(__type_name, __arg.__type_name);
  309|  1.76k|  }

memory.cpp:_ZNSt3__112_GLOBAL__N_120__libcpp_atomic_loadB8ne180100IlEET_PKS2_i:
   58|    663|inline _LIBCPP_HIDE_FROM_ABI _ValueType __libcpp_atomic_load(_ValueType const* __val, int __order = _AO_Seq) {
   59|    663|  return __atomic_load_n(__val, __order);
   60|    663|}
cxa_handlers.cpp:_ZNSt3__112_GLOBAL__N_120__libcpp_atomic_loadB8ne180100IPFvvEEET_PKS4_i:
   58|    682|inline _LIBCPP_HIDE_FROM_ABI _ValueType __libcpp_atomic_load(_ValueType const* __val, int __order = _AO_Seq) {
   59|    682|  return __atomic_load_n(__val, __order);
   60|    682|}
cxa_exception.cpp:_ZNSt3__112_GLOBAL__N_119__libcpp_atomic_addB8ne180100ImmEET_PS2_T0_i:
   63|    341|inline _LIBCPP_HIDE_FROM_ABI _ValueType __libcpp_atomic_add(_ValueType* __val, _AddType __a, int __order = _AO_Seq) {
   64|    341|  return __atomic_add_fetch(__val, __a, __order);
   65|    341|}
stdlib_stdexcept.cpp:_ZNSt3__112_GLOBAL__N_119__libcpp_atomic_addB8ne180100IiiEET_PS2_T0_i:
   63|    341|inline _LIBCPP_HIDE_FROM_ABI _ValueType __libcpp_atomic_add(_ValueType* __val, _AddType __a, int __order = _AO_Seq) {
   64|    341|  return __atomic_add_fetch(__val, __a, __order);
   65|    341|}

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

_ZNSt3__119__shared_weak_count14__release_weakEv:
   57|    663|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|    663|  if (__libcpp_atomic_load(&__shared_weak_owners_, _AO_Acquire) == 0) {
  ------------------
  |  Branch (79:7): [True: 663, 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|    663|    __on_zero_shared_weak();
   84|    663|  } else if (__libcpp_atomic_refcount_decrement(__shared_weak_owners_) == -1)
  ------------------
  |  Branch (84:14): [True: 0, False: 0]
  ------------------
   85|      0|    __on_zero_shared_weak();
   86|    663|}

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

_ZN10__cxxabiv119__setExceptionClassEP17_Unwind_Exceptionm:
   81|    341|void __setExceptionClass(_Unwind_Exception* unwind_exception, uint64_t newValue) {
   82|    341|    ::memcpy(&unwind_exception->exception_class, &newValue, sizeof(newValue));
   83|    341|}
_ZN10__cxxabiv119__getExceptionClassEPK17_Unwind_Exception:
   95|  1.36k|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|  1.36k|    uint64_t exClass;
  101|  1.36k|    ::memcpy(&exClass, &unwind_exception->exception_class, sizeof(exClass));
  102|  1.36k|    return exClass;
  103|  1.36k|}
_ZN10__cxxabiv121__isOurExceptionClassEPK17_Unwind_Exception:
  105|    682|bool __isOurExceptionClass(const _Unwind_Exception* unwind_exception) {
  106|    682|    return (__getExceptionClass(unwind_exception) & get_vendor_and_language) ==
  107|    682|           (kOurExceptionClass                    & get_vendor_and_language);
  108|    682|}
__cxa_allocate_exception:
  183|    341|void *__cxa_allocate_exception(size_t thrown_size) throw() {
  184|    341|    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|    341|    size_t header_offset = get_cxa_exception_offset();
  189|    341|    char *raw_buffer =
  190|    341|        (char *)__aligned_malloc_with_fallback(header_offset + actual_size);
  191|    341|    if (NULL == raw_buffer)
  ------------------
  |  Branch (191:9): [True: 0, False: 341]
  ------------------
  192|      0|        std::terminate();
  193|    341|    __cxa_exception *exception_header =
  194|    341|        static_cast<__cxa_exception *>((void *)(raw_buffer + header_offset));
  195|    341|    ::memset(exception_header, 0, actual_size);
  196|    341|    return thrown_object_from_cxa_exception(exception_header);
  197|    341|}
__cxa_free_exception:
  201|    341|void __cxa_free_exception(void *thrown_object) throw() {
  202|       |    // Compute the size of the padding before the header.
  203|    341|    size_t header_offset = get_cxa_exception_offset();
  204|    341|    char *raw_buffer =
  205|    341|        ((char *)cxa_exception_from_thrown_object(thrown_object)) - header_offset;
  206|    341|    __aligned_free_with_fallback((void *)raw_buffer);
  207|    341|}
__cxa_init_primary_exception:
  210|    341|                                              void(_LIBCXXABI_DTOR_FUNC* dest)(void*)) throw() {
  211|    341|  __cxa_exception* exception_header = cxa_exception_from_thrown_object(object);
  212|    341|  exception_header->referenceCount = 0;
  213|    341|  exception_header->unexpectedHandler = std::get_unexpected();
  214|    341|  exception_header->terminateHandler = std::get_terminate();
  215|    341|  exception_header->exceptionType = tinfo;
  216|    341|  exception_header->exceptionDestructor = dest;
  217|    341|  setOurExceptionClass(&exception_header->unwindHeader);
  218|    341|  exception_header->unwindHeader.exception_cleanup = exception_cleanup_func;
  219|       |
  220|    341|  return exception_header;
  221|    341|}
__cxa_throw:
  274|    341|__cxa_throw(void *thrown_object, std::type_info *tinfo, void (_LIBCXXABI_DTOR_FUNC *dest)(void *)) {
  275|    341|#endif
  276|    341|  __cxa_eh_globals* globals = __cxa_get_globals();
  277|    341|  globals->uncaughtExceptions += 1; // Not atomically, since globals are thread-local
  278|       |
  279|    341|  __cxa_exception* exception_header = __cxa_init_primary_exception(thrown_object, tinfo, dest);
  280|    341|  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|    341|    _Unwind_RaiseException(&exception_header->unwindHeader);
  291|    341|#endif
  292|       |    //  This only happens when there is no handler, or some unexpected unwinding
  293|       |    //     error happens.
  294|    341|    failed_throw(exception_header);
  295|    341|}
__cxa_begin_catch:
  446|    341|{
  447|    341|    _Unwind_Exception* unwind_exception = static_cast<_Unwind_Exception*>(unwind_arg);
  448|    341|    bool native_exception = __isOurExceptionClass(unwind_exception);
  449|    341|    __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|    341|    __cxa_exception* exception_header =
  454|    341|            cxa_exception_from_exception_unwind_exception
  455|    341|            (
  456|    341|                static_cast<_Unwind_Exception*>(unwind_exception)
  457|    341|            );
  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|    341|    if (native_exception)
  ------------------
  |  Branch (466:9): [True: 341, False: 0]
  ------------------
  467|    341|    {
  468|       |        // Increment the handler count, removing the flag about being rethrown
  469|    341|        exception_header->handlerCount = exception_header->handlerCount < 0 ?
  ------------------
  |  Branch (469:42): [True: 0, False: 341]
  ------------------
  470|    341|            -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|    341|        if (exception_header != globals->caughtExceptions)
  ------------------
  |  Branch (473:13): [True: 341, False: 0]
  ------------------
  474|    341|        {
  475|    341|            exception_header->nextException = globals->caughtExceptions;
  476|    341|            globals->caughtExceptions = exception_header;
  477|    341|        }
  478|    341|        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|    341|        return exception_header->adjustedPtr;
  483|    341|#endif
  484|    341|    }
  485|       |    // Else this is a foreign exception
  486|       |    // If the caughtExceptions stack is not empty, terminate
  487|      0|    if (globals->caughtExceptions != 0)
  ------------------
  |  Branch (487:9): [True: 0, False: 0]
  ------------------
  488|      0|        std::terminate();
  489|       |    // Push the foreign exception on to the stack
  490|      0|    globals->caughtExceptions = exception_header;
  491|      0|    return unwind_exception + 1;
  492|    341|}
__cxa_end_catch:
  513|    341|void __cxa_end_catch() {
  514|    341|  static_assert(sizeof(__cxa_exception) == sizeof(__cxa_dependent_exception),
  515|    341|                "sizeof(__cxa_exception) must be equal to "
  516|    341|                "sizeof(__cxa_dependent_exception)");
  517|    341|  static_assert(__builtin_offsetof(__cxa_exception, referenceCount) ==
  518|    341|                    __builtin_offsetof(__cxa_dependent_exception,
  519|    341|                                       primaryException),
  520|    341|                "the layout of __cxa_exception must match the layout of "
  521|    341|                "__cxa_dependent_exception");
  522|    341|  static_assert(__builtin_offsetof(__cxa_exception, handlerCount) ==
  523|    341|                    __builtin_offsetof(__cxa_dependent_exception, handlerCount),
  524|    341|                "the layout of __cxa_exception must match the layout of "
  525|    341|                "__cxa_dependent_exception");
  526|    341|    __cxa_eh_globals* globals = __cxa_get_globals_fast(); // __cxa_get_globals called in __cxa_begin_catch
  527|    341|    __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|    341|    if (NULL != exception_header)
  ------------------
  |  Branch (531:9): [True: 341, False: 0]
  ------------------
  532|    341|    {
  533|    341|        bool native_exception = __isOurExceptionClass(&exception_header->unwindHeader);
  534|    341|        if (native_exception)
  ------------------
  |  Branch (534:13): [True: 341, False: 0]
  ------------------
  535|    341|        {
  536|       |            // This is a native exception
  537|    341|            if (exception_header->handlerCount < 0)
  ------------------
  |  Branch (537:17): [True: 0, False: 341]
  ------------------
  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|    341|            else
  551|    341|            {
  552|       |                // The native exception has not been rethrown
  553|    341|                if (0 == decrementHandlerCount(exception_header))
  ------------------
  |  Branch (553:21): [True: 341, False: 0]
  ------------------
  554|    341|                {
  555|       |                    //  Remove from the chain of uncaught exceptions
  556|    341|                    globals->caughtExceptions = exception_header->nextException;
  557|       |                    // Destroy this exception, being careful to distinguish
  558|       |                    //    between dependent and primary exceptions
  559|    341|                    if (isDependentException(&exception_header->unwindHeader))
  ------------------
  |  Branch (559:25): [True: 0, False: 341]
  ------------------
  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|    341|                    __cxa_decrement_exception_refcount(thrown_object_from_cxa_exception(exception_header));
  571|    341|                }
  572|    341|            }
  573|    341|        }
  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|    341|    }
  585|    341|}
__cxa_decrement_exception_refcount:
  678|    341|void __cxa_decrement_exception_refcount(void *thrown_object) throw() {
  679|    341|    if (thrown_object != NULL )
  ------------------
  |  Branch (679:9): [True: 341, False: 0]
  ------------------
  680|    341|    {
  681|    341|        __cxa_exception* exception_header = cxa_exception_from_thrown_object(thrown_object);
  682|    341|        if (std::__libcpp_atomic_add(&exception_header->referenceCount, size_t(-1)) == 0)
  ------------------
  |  Branch (682:13): [True: 341, False: 0]
  ------------------
  683|    341|        {
  684|    341|            if (NULL != exception_header->exceptionDestructor)
  ------------------
  |  Branch (684:17): [True: 341, False: 0]
  ------------------
  685|    341|                exception_header->exceptionDestructor(thrown_object);
  686|    341|            __cxa_free_exception(thrown_object);
  687|    341|        }
  688|    341|    }
  689|    341|}
cxa_exception.cpp:_ZN10__cxxabiv1L45cxa_exception_size_from_exception_thrown_sizeEm:
   76|    341|size_t cxa_exception_size_from_exception_thrown_size(size_t size) {
   77|    341|    return aligned_allocation_size(size + sizeof (__cxa_exception),
   78|    341|                                   alignof(__cxa_exception));
   79|    341|}
cxa_exception.cpp:_ZN10__cxxabiv1L23aligned_allocation_sizeEmm:
   71|    341|size_t aligned_allocation_size(size_t s, size_t a) {
   72|    341|    return (s + a - 1) & ~(a - 1);
   73|    341|}
cxa_exception.cpp:_ZN10__cxxabiv1L24get_cxa_exception_offsetEv:
  161|    682|static size_t get_cxa_exception_offset() {
  162|    682|  struct S {
  163|    682|  } __attribute__((aligned));
  164|       |
  165|       |  // Compute the maximum alignment for the target machine.
  166|    682|  constexpr size_t alignment = alignof(S);
  167|    682|  constexpr size_t excp_size = sizeof(__cxa_exception);
  168|    682|  constexpr size_t aligned_size =
  169|    682|      (excp_size + alignment - 1) / alignment * alignment;
  170|    682|  constexpr size_t offset = aligned_size - excp_size;
  171|    682|  static_assert((offset == 0 || alignof(_Unwind_Exception) < alignment),
  172|    682|                "offset is non-zero only if _Unwind_Exception isn't aligned");
  173|    682|  return offset;
  174|    682|}
cxa_exception.cpp:_ZN10__cxxabiv1L32thrown_object_from_cxa_exceptionEPNS_15__cxa_exceptionE:
   54|    682|{
   55|    682|    return static_cast<void*>(exception_header + 1);
   56|    682|}
cxa_exception.cpp:_ZN10__cxxabiv1L32cxa_exception_from_thrown_objectEPv:
   44|  1.36k|{
   45|  1.36k|    return static_cast<__cxa_exception*>(thrown_object) - 1;
   46|  1.36k|}
cxa_exception.cpp:_ZN10__cxxabiv1L20setOurExceptionClassEP17_Unwind_Exception:
   86|    341|static void setOurExceptionClass(_Unwind_Exception* unwind_exception) {
   87|    341|    __setExceptionClass(unwind_exception, kOurExceptionClass);
   88|    341|}
cxa_exception.cpp:_ZN10__cxxabiv1L45cxa_exception_from_exception_unwind_exceptionEP17_Unwind_Exception:
   65|    341|{
   66|    341|    return cxa_exception_from_thrown_object(unwind_exception + 1 );
   67|    341|}
cxa_exception.cpp:_ZN10__cxxabiv1L21decrementHandlerCountEPNS_15__cxa_exceptionE:
  120|    341|static inline  int decrementHandlerCount(__cxa_exception *exception) {
  121|    341|    return --exception->handlerCount;
  122|    341|}
cxa_exception.cpp:_ZN10__cxxabiv1L20isDependentExceptionEP17_Unwind_Exception:
  110|    341|static bool isDependentException(_Unwind_Exception* unwind_exception) {
  111|    341|    return (__getExceptionClass(unwind_exception) & 0xFF) == 0x01;
  112|    341|}

__cxa_get_globals:
   74|    682|    __cxa_eh_globals *__cxa_get_globals() {
   75|       |        // Try to get the globals for this thread
   76|    682|        __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|    682|        if (NULL == retVal) {
  ------------------
  |  Branch (79:13): [True: 1, False: 681]
  ------------------
   80|      1|            retVal = static_cast<__cxa_eh_globals*>(
   81|      1|                __calloc_with_fallback(1, sizeof(__cxa_eh_globals)));
   82|      1|            if (NULL == retVal)
  ------------------
  |  Branch (82:17): [True: 0, False: 1]
  ------------------
   83|      0|                abort_message("cannot allocate __cxa_eh_globals");
   84|      1|            if (0 != std::__libcpp_tls_set(key_, retVal))
  ------------------
  |  Branch (84:17): [True: 0, False: 1]
  ------------------
   85|      0|               abort_message("std::__libcpp_tls_set failure in __cxa_get_globals()");
   86|      1|        }
   87|    682|        return retVal;
   88|    682|    }
__cxa_get_globals_fast:
   94|  1.02k|    __cxa_eh_globals *__cxa_get_globals_fast() {
   95|       |        // First time through, create the key.
   96|  1.02k|        if (0 != std::__libcpp_execute_once(&flag_, construct_))
  ------------------
  |  Branch (96:13): [True: 0, False: 1.02k]
  ------------------
   97|      0|            abort_message("execute once failure in __cxa_get_globals_fast()");
   98|  1.02k|        return static_cast<__cxa_eh_globals*>(std::__libcpp_tls_get(key_));
   99|  1.02k|    }
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|    }

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

__gxx_personality_v0:
  924|  2.31k|{
  925|  2.31k|    if (version != 1 || unwind_exception == 0 || context == 0)
  ------------------
  |  Branch (925:9): [True: 0, False: 2.31k]
  |  Branch (925:25): [True: 0, False: 2.31k]
  |  Branch (925:50): [True: 0, False: 2.31k]
  ------------------
  926|      0|        return _URC_FATAL_PHASE1_ERROR;
  927|       |
  928|  2.31k|    bool native_exception = (exceptionClass     & get_vendor_and_language) ==
  929|  2.31k|                            (kOurExceptionClass & get_vendor_and_language);
  930|  2.31k|    scan_results results;
  931|       |    // Process a catch handler for a native exception first.
  932|  2.31k|    if (actions == (_UA_CLEANUP_PHASE | _UA_HANDLER_FRAME) &&
  ------------------
  |  Branch (932:9): [True: 341, False: 1.97k]
  ------------------
  933|    341|        native_exception) {
  ------------------
  |  Branch (933:9): [True: 341, False: 0]
  ------------------
  934|       |        // Reload the results from the phase 1 cache.
  935|    341|        __cxa_exception* exception_header =
  936|    341|            (__cxa_exception*)(unwind_exception + 1) - 1;
  937|    341|        results.ttypeIndex = exception_header->handlerSwitchValue;
  938|    341|        results.actionRecord = exception_header->actionRecord;
  939|    341|        results.languageSpecificData = exception_header->languageSpecificData;
  940|    341|        results.landingPad =
  941|    341|            reinterpret_cast<uintptr_t>(exception_header->catchTemp);
  942|    341|        results.adjustedPtr = exception_header->adjustedPtr;
  943|       |
  944|       |        // Jump to the handler.
  945|    341|        set_registers(unwind_exception, context, results);
  946|       |        // Cache base for calculating the address of ttype in
  947|       |        // __cxa_call_unexpected.
  948|    341|        if (results.ttypeIndex < 0) {
  ------------------
  |  Branch (948:13): [True: 0, False: 341]
  ------------------
  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|    341|        return _URC_INSTALL_CONTEXT;
  956|    341|    }
  957|       |
  958|       |    // In other cases we need to scan LSDA.
  959|  1.97k|    scan_eh_tab(results, actions, native_exception, unwind_exception, context);
  960|  1.97k|    if (results.reason == _URC_CONTINUE_UNWIND ||
  ------------------
  |  Branch (960:9): [True: 1.36k, False: 610]
  ------------------
  961|    610|        results.reason == _URC_FATAL_PHASE1_ERROR)
  ------------------
  |  Branch (961:9): [True: 0, False: 610]
  ------------------
  962|  1.36k|        return results.reason;
  963|       |
  964|    610|    if (actions & _UA_SEARCH_PHASE)
  ------------------
  |  Branch (964:9): [True: 341, False: 269]
  ------------------
  965|    341|    {
  966|       |        // Phase 1 search:  All we're looking for in phase 1 is a handler that
  967|       |        //   halts unwinding
  968|    341|        assert(results.reason == _URC_HANDLER_FOUND);
  ------------------
  |  Branch (968:9): [True: 341, False: 0]
  ------------------
  969|    341|        if (native_exception) {
  ------------------
  |  Branch (969:13): [True: 341, False: 0]
  ------------------
  970|       |            // For a native exception, cache the LSDA result.
  971|    341|            __cxa_exception* exc = (__cxa_exception*)(unwind_exception + 1) - 1;
  972|    341|            exc->handlerSwitchValue = static_cast<int>(results.ttypeIndex);
  973|    341|            exc->actionRecord = results.actionRecord;
  974|    341|            exc->languageSpecificData = results.languageSpecificData;
  975|    341|            exc->catchTemp = reinterpret_cast<void*>(results.landingPad);
  976|    341|            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|    341|        }
  983|    341|        return _URC_HANDLER_FOUND;
  984|    341|    }
  985|       |
  986|    610|    assert(actions & _UA_CLEANUP_PHASE);
  ------------------
  |  Branch (986:5): [True: 269, False: 0]
  ------------------
  987|    269|    assert(results.reason == _URC_HANDLER_FOUND);
  ------------------
  |  Branch (987:5): [True: 269, False: 0]
  ------------------
  988|    269|    set_registers(unwind_exception, context, results);
  989|       |    // Cache base for calculating the address of ttype in __cxa_call_unexpected.
  990|    269|    if (results.ttypeIndex < 0) {
  ------------------
  |  Branch (990:9): [True: 0, False: 269]
  ------------------
  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|    269|    return _URC_INSTALL_CONTEXT;
 1000|    269|}
cxa_personality.cpp:_ZN10__cxxabiv1L13set_registersEP17_Unwind_ExceptionP15_Unwind_ContextRKNS_12_GLOBAL__N_112scan_resultsE:
  549|    610|{
  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|    610|  _Unwind_SetGR(context, __builtin_eh_return_data_regno(0),
  557|    610|                reinterpret_cast<uintptr_t>(unwind_exception));
  558|    610|  _Unwind_SetGR(context, __builtin_eh_return_data_regno(1),
  559|    610|                static_cast<uintptr_t>(results.ttypeIndex));
  560|    610|  _Unwind_SetIP(context, results.landingPad);
  561|    610|}
cxa_personality.cpp:_ZN10__cxxabiv1L11scan_eh_tabERNS_12_GLOBAL__N_112scan_resultsE14_Unwind_ActionbP17_Unwind_ExceptionP15_Unwind_Context:
  587|  1.97k|                        _Unwind_Context *context) {
  588|       |    // Initialize results to found nothing but an error
  589|  1.97k|    results.ttypeIndex = 0;
  590|  1.97k|    results.actionRecord = 0;
  591|  1.97k|    results.languageSpecificData = 0;
  592|  1.97k|    results.landingPad = 0;
  593|  1.97k|    results.adjustedPtr = 0;
  594|  1.97k|    results.reason = _URC_FATAL_PHASE1_ERROR;
  595|       |    // Check for consistent actions
  596|  1.97k|    if (actions & _UA_SEARCH_PHASE)
  ------------------
  |  Branch (596:9): [True: 1.02k, False: 949]
  ------------------
  597|  1.02k|    {
  598|       |        // Do Phase 1
  599|  1.02k|        if (actions & (_UA_CLEANUP_PHASE | _UA_HANDLER_FRAME | _UA_FORCE_UNWIND))
  ------------------
  |  Branch (599:13): [True: 0, False: 1.02k]
  ------------------
  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|  1.02k|    }
  607|    949|    else if (actions & _UA_CLEANUP_PHASE)
  ------------------
  |  Branch (607:14): [True: 949, False: 0]
  ------------------
  608|    949|    {
  609|    949|        if ((actions & _UA_HANDLER_FRAME) && (actions & _UA_FORCE_UNWIND))
  ------------------
  |  Branch (609:13): [True: 0, False: 949]
  |  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|    949|    }
  618|      0|    else // Neither _UA_SEARCH_PHASE nor _UA_CLEANUP_PHASE is set
  619|      0|    {
  620|       |        // One of these should be set.
  621|       |        //   Client error
  622|      0|        results.reason = _URC_FATAL_PHASE1_ERROR;
  623|      0|        return;
  624|      0|    }
  625|       |    // Start scan by getting exception table address.
  626|  1.97k|    const uint8_t *lsda = (const uint8_t *)_Unwind_GetLanguageSpecificData(context);
  627|  1.97k|    if (lsda == 0)
  ------------------
  |  Branch (627:9): [True: 0, False: 1.97k]
  ------------------
  628|      0|    {
  629|       |        // There is no exception table
  630|      0|        results.reason = _URC_CONTINUE_UNWIND;
  631|      0|        return;
  632|      0|    }
  633|  1.97k|    results.languageSpecificData = lsda;
  634|       |#if defined(_AIX)
  635|       |    uintptr_t base = _Unwind_GetDataRelBase(context);
  636|       |#else
  637|  1.97k|    uintptr_t base = 0;
  638|  1.97k|#endif
  639|       |    // Get the current instruction pointer and offset it before next
  640|       |    // instruction in the current frame which threw the exception.
  641|  1.97k|    uintptr_t ip = _Unwind_GetIP(context) - 1;
  642|       |    // Get beginning current frame's code (as defined by the
  643|       |    // emitted dwarf code)
  644|  1.97k|    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|  1.97k|    uintptr_t ipOffset = ip - funcStart;
  657|  1.97k|#endif // !__USING_SJLJ_EXCEPTIONS__ && !__USING_WASM_EXCEPTIONS__
  658|  1.97k|    const uint8_t* classInfo = NULL;
  659|       |    // Note: See JITDwarfEmitter::EmitExceptionTable(...) for corresponding
  660|       |    //       dwarf emission
  661|       |    // Parse LSDA header.
  662|  1.97k|    uint8_t lpStartEncoding = *lsda++;
  663|  1.97k|    const uint8_t* lpStart = lpStartEncoding == DW_EH_PE_omit
  ------------------
  |  Branch (663:30): [True: 1.97k, False: 0]
  ------------------
  664|  1.97k|                                 ? (const uint8_t*)funcStart
  665|  1.97k|                                 : (const uint8_t*)readEncodedPointer(&lsda, lpStartEncoding, base);
  666|  1.97k|    uint8_t ttypeEncoding = *lsda++;
  667|  1.97k|    if (ttypeEncoding != DW_EH_PE_omit)
  ------------------
  |  Branch (667:9): [True: 341, False: 1.62k]
  ------------------
  668|    341|    {
  669|       |        // Calculate type info locations in emitted dwarf code which
  670|       |        // were flagged by type info arguments to llvm.eh.selector
  671|       |        // intrinsic
  672|    341|        uintptr_t classInfoOffset = readULEB128(&lsda);
  673|    341|        classInfo = lsda + classInfoOffset;
  674|    341|    }
  675|       |    // Walk call-site table looking for range that
  676|       |    // includes current PC.
  677|  1.97k|    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|  1.97k|    uint32_t callSiteTableLength = static_cast<uint32_t>(readULEB128(&lsda));
  682|  1.97k|    const uint8_t* callSiteTableStart = lsda;
  683|  1.97k|    const uint8_t* callSiteTableEnd = callSiteTableStart + callSiteTableLength;
  684|  1.97k|    const uint8_t* actionTableStart = callSiteTableEnd;
  685|  1.97k|    const uint8_t* callSitePtr = callSiteTableStart;
  686|  6.78k|    while (callSitePtr < callSiteTableEnd)
  ------------------
  |  Branch (686:12): [True: 6.78k, False: 0]
  ------------------
  687|  6.78k|    {
  688|       |        // There is one entry per call site.
  689|  6.78k|#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|  6.78k|        uintptr_t start = readEncodedPointer(&callSitePtr, callSiteEncoding);
  693|  6.78k|        uintptr_t length = readEncodedPointer(&callSitePtr, callSiteEncoding);
  694|  6.78k|        uintptr_t landingPad = readEncodedPointer(&callSitePtr, callSiteEncoding);
  695|  6.78k|        uintptr_t actionEntry = readULEB128(&callSitePtr);
  696|  6.78k|        if ((start <= ipOffset) && (ipOffset < (start + length)))
  ------------------
  |  Branch (696:13): [True: 6.78k, False: 0]
  |  Branch (696:36): [True: 1.97k, False: 4.81k]
  ------------------
  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|  1.97k|        {
  704|       |            // Found the call site containing ip.
  705|  1.97k|#if !defined(__USING_SJLJ_EXCEPTIONS__) && !defined(__USING_WASM_EXCEPTIONS__)
  706|  1.97k|            if (landingPad == 0)
  ------------------
  |  Branch (706:17): [True: 1.09k, False: 879]
  ------------------
  707|  1.09k|            {
  708|       |                // No handler here
  709|  1.09k|                results.reason = _URC_CONTINUE_UNWIND;
  710|  1.09k|                return;
  711|  1.09k|            }
  712|    879|            landingPad = (uintptr_t)lpStart + landingPad;
  713|       |#else  // __USING_SJLJ_EXCEPTIONS__ || __USING_WASM_EXCEPTIONS__
  714|       |            ++landingPad;
  715|       |#endif // __USING_SJLJ_EXCEPTIONS__ || __USING_WASM_EXCEPTIONS__
  716|    879|            results.landingPad = landingPad;
  717|    879|            if (actionEntry == 0)
  ------------------
  |  Branch (717:17): [True: 538, False: 341]
  ------------------
  718|    538|            {
  719|       |                // Found a cleanup
  720|    538|                results.reason = actions & _UA_SEARCH_PHASE
  ------------------
  |  Branch (720:34): [True: 269, False: 269]
  ------------------
  721|    538|                                     ? _URC_CONTINUE_UNWIND
  722|    538|                                     : _URC_HANDLER_FOUND;
  723|    538|                return;
  724|    538|            }
  725|       |            // Convert 1-based byte offset into
  726|    341|            const uint8_t* action = actionTableStart + (actionEntry - 1);
  727|    341|            bool hasCleanup = false;
  728|       |            // Scan action entries until you find a matching handler, cleanup, or the end of action list
  729|    341|            while (true)
  ------------------
  |  Branch (729:20): [True: 341, Folded]
  ------------------
  730|    341|            {
  731|    341|                const uint8_t* actionRecord = action;
  732|    341|                int64_t ttypeIndex = readSLEB128(&action);
  733|    341|                if (ttypeIndex > 0)
  ------------------
  |  Branch (733:21): [True: 341, False: 0]
  ------------------
  734|    341|                {
  735|       |                    // Found a catch, does it actually catch?
  736|       |                    // First check for catch (...)
  737|    341|                    const __shim_type_info* catchType =
  738|    341|                        get_shim_type_info(static_cast<uint64_t>(ttypeIndex),
  739|    341|                                           classInfo, ttypeEncoding,
  740|    341|                                           native_exception, unwind_exception,
  741|    341|                                           base);
  742|    341|                    if (catchType == 0)
  ------------------
  |  Branch (742:25): [True: 0, False: 341]
  ------------------
  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|    341|                    else if (native_exception)
  ------------------
  |  Branch (758:30): [True: 341, False: 0]
  ------------------
  759|    341|                    {
  760|    341|                        __cxa_exception* exception_header = (__cxa_exception*)(unwind_exception+1) - 1;
  761|    341|                        void* adjustedPtr = get_thrown_object_ptr(unwind_exception);
  762|    341|                        const __shim_type_info* excpType =
  763|    341|                            static_cast<const __shim_type_info*>(exception_header->exceptionType);
  764|    341|                        if (adjustedPtr == 0 || excpType == 0)
  ------------------
  |  Branch (764:29): [True: 0, False: 341]
  |  Branch (764:49): [True: 0, False: 341]
  ------------------
  765|      0|                        {
  766|       |                            // Something very bad happened
  767|      0|                            call_terminate(native_exception, unwind_exception);
  768|      0|                        }
  769|    341|                        if (catchType->can_catch(excpType, adjustedPtr))
  ------------------
  |  Branch (769:29): [True: 341, False: 0]
  ------------------
  770|    341|                        {
  771|       |                            // Found a matching handler. This is either search
  772|       |                            // phase or forced unwinding.
  773|    341|                            assert(actions &
  ------------------
  |  Branch (773:29): [True: 341, False: 0]
  ------------------
  774|    341|                                   (_UA_SEARCH_PHASE | _UA_FORCE_UNWIND));
  775|    341|                            results.ttypeIndex = ttypeIndex;
  776|    341|                            results.actionRecord = actionRecord;
  777|    341|                            results.adjustedPtr = adjustedPtr;
  778|    341|                            results.reason = _URC_HANDLER_FOUND;
  779|    341|                            return;
  780|    341|                        }
  781|    341|                    }
  782|       |                    // Scan next action ...
  783|    341|                }
  784|      0|                else if (ttypeIndex < 0)
  ------------------
  |  Branch (784:26): [True: 0, False: 0]
  ------------------
  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|      0|                } else {
  825|      0|                    hasCleanup = true;
  826|      0|                }
  827|      0|                const uint8_t* temp = action;
  828|      0|                int64_t actionOffset = readSLEB128(&temp);
  829|      0|                if (actionOffset == 0)
  ------------------
  |  Branch (829:21): [True: 0, False: 0]
  ------------------
  830|      0|                {
  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|      0|                    results.reason = hasCleanup && actions & _UA_CLEANUP_PHASE
  ------------------
  |  Branch (834:38): [True: 0, False: 0]
  |  Branch (834:52): [True: 0, False: 0]
  ------------------
  835|      0|                                         ? _URC_HANDLER_FOUND
  836|      0|                                         : _URC_CONTINUE_UNWIND;
  837|      0|                    return;
  838|      0|                }
  839|       |                // Go to next action
  840|      0|                action += actionOffset;
  841|      0|            }  // there is no break out of this loop, only return
  842|    341|        }
  843|  4.81k|#if !defined(__USING_SJLJ_EXCEPTIONS__) && !defined(__USING_WASM_EXCEPTIONS__)
  844|  4.81k|        else if (ipOffset < start)
  ------------------
  |  Branch (844:18): [True: 0, False: 4.81k]
  ------------------
  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|  6.78k|#endif // !__USING_SJLJ_EXCEPTIONS__ && !__USING_WASM_EXCEPTIONS__
  852|  6.78k|    }  // 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|      0|    call_terminate(native_exception, unwind_exception);
  857|      0|}
cxa_personality.cpp:_ZN10__cxxabiv1L11readSLEB128EPPKh:
  231|    341|{
  232|    341|    uintptr_t result = 0;
  233|    341|    uintptr_t shift = 0;
  234|    341|    unsigned char byte;
  235|    341|    const uint8_t *p = *data;
  236|    341|    do
  237|    341|    {
  238|    341|        byte = *p++;
  239|    341|        result |= static_cast<uintptr_t>(byte & 0x7F) << shift;
  240|    341|        shift += 7;
  241|    341|    } while (byte & 0x80);
  ------------------
  |  Branch (241:14): [True: 0, False: 341]
  ------------------
  242|    341|    *data = p;
  243|    341|    if ((byte & 0x40) && (shift < (sizeof(result) << 3)))
  ------------------
  |  Branch (243:9): [True: 0, False: 341]
  |  Branch (243:26): [True: 0, False: 0]
  ------------------
  244|      0|        result |= static_cast<uintptr_t>(~0) << shift;
  245|    341|    return static_cast<intptr_t>(result);
  246|    341|}
cxa_personality.cpp:_ZN10__cxxabiv1L18get_shim_type_infoEmPKhhbP17_Unwind_Exceptionm:
  389|    341|{
  390|    341|    if (classInfo == 0)
  ------------------
  |  Branch (390:9): [True: 0, False: 341]
  ------------------
  391|      0|    {
  392|       |        // this should not happen.  Indicates corrupted eh_table.
  393|      0|        call_terminate(native_exception, unwind_exception);
  394|      0|    }
  395|    341|    switch (ttypeEncoding & 0x0F)
  396|    341|    {
  397|      0|    case DW_EH_PE_absptr:
  ------------------
  |  Branch (397:5): [True: 0, False: 341]
  ------------------
  398|      0|        ttypeIndex *= sizeof(void*);
  399|      0|        break;
  400|      0|    case DW_EH_PE_udata2:
  ------------------
  |  Branch (400:5): [True: 0, False: 341]
  ------------------
  401|      0|    case DW_EH_PE_sdata2:
  ------------------
  |  Branch (401:5): [True: 0, False: 341]
  ------------------
  402|      0|        ttypeIndex *= 2;
  403|      0|        break;
  404|      0|    case DW_EH_PE_udata4:
  ------------------
  |  Branch (404:5): [True: 0, False: 341]
  ------------------
  405|    341|    case DW_EH_PE_sdata4:
  ------------------
  |  Branch (405:5): [True: 341, False: 0]
  ------------------
  406|    341|        ttypeIndex *= 4;
  407|    341|        break;
  408|      0|    case DW_EH_PE_udata8:
  ------------------
  |  Branch (408:5): [True: 0, False: 341]
  ------------------
  409|      0|    case DW_EH_PE_sdata8:
  ------------------
  |  Branch (409:5): [True: 0, False: 341]
  ------------------
  410|      0|        ttypeIndex *= 8;
  411|      0|        break;
  412|      0|    default:
  ------------------
  |  Branch (412:5): [True: 0, False: 341]
  ------------------
  413|       |        // this should not happen.   Indicates corrupted eh_table.
  414|      0|        call_terminate(native_exception, unwind_exception);
  415|    341|    }
  416|    341|    classInfo -= ttypeIndex;
  417|    341|    return (const __shim_type_info*)readEncodedPointer(&classInfo,
  418|    341|                                                       ttypeEncoding, base);
  419|    341|}
cxa_personality.cpp:_ZN10__cxxabiv1L21get_thrown_object_ptrEP17_Unwind_Exception:
  518|    341|{
  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|    341|    void* adjustedPtr = unwind_exception + 1;
  522|    341|    if (__getExceptionClass(unwind_exception) == kOurDependentExceptionClass)
  ------------------
  |  Branch (522:9): [True: 0, False: 341]
  ------------------
  523|      0|        adjustedPtr = ((__cxa_dependent_exception*)adjustedPtr - 1)->primaryException;
  524|    341|    return adjustedPtr;
  525|    341|}
cxa_personality.cpp:_ZN10__cxxabiv1L18readEncodedPointerEPPKhhm:
  258|  20.6k|{
  259|  20.6k|    uintptr_t result = 0;
  260|  20.6k|    if (encoding == DW_EH_PE_omit)
  ------------------
  |  Branch (260:9): [True: 0, False: 20.6k]
  ------------------
  261|      0|        return result;
  262|  20.6k|    const uint8_t* p = *data;
  263|       |    // first get value
  264|  20.6k|    switch (encoding & 0x0F)
  265|  20.6k|    {
  266|      0|    case DW_EH_PE_absptr:
  ------------------
  |  Branch (266:5): [True: 0, False: 20.6k]
  ------------------
  267|      0|        result = readPointerHelper<uintptr_t>(p);
  268|      0|        break;
  269|  20.3k|    case DW_EH_PE_uleb128:
  ------------------
  |  Branch (269:5): [True: 20.3k, False: 341]
  ------------------
  270|  20.3k|        result = readULEB128(&p);
  271|  20.3k|        break;
  272|      0|    case DW_EH_PE_sleb128:
  ------------------
  |  Branch (272:5): [True: 0, False: 20.6k]
  ------------------
  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: 20.6k]
  ------------------
  276|      0|        result = readPointerHelper<uint16_t>(p);
  277|      0|        break;
  278|      0|    case DW_EH_PE_udata4:
  ------------------
  |  Branch (278:5): [True: 0, False: 20.6k]
  ------------------
  279|      0|        result = readPointerHelper<uint32_t>(p);
  280|      0|        break;
  281|      0|    case DW_EH_PE_udata8:
  ------------------
  |  Branch (281:5): [True: 0, False: 20.6k]
  ------------------
  282|      0|        result = readPointerHelper<uint64_t>(p);
  283|      0|        break;
  284|      0|    case DW_EH_PE_sdata2:
  ------------------
  |  Branch (284:5): [True: 0, False: 20.6k]
  ------------------
  285|      0|        result = readPointerHelper<int16_t>(p);
  286|      0|        break;
  287|    341|    case DW_EH_PE_sdata4:
  ------------------
  |  Branch (287:5): [True: 341, False: 20.3k]
  ------------------
  288|    341|        result = readPointerHelper<int32_t>(p);
  289|    341|        break;
  290|      0|    case DW_EH_PE_sdata8:
  ------------------
  |  Branch (290:5): [True: 0, False: 20.6k]
  ------------------
  291|      0|        result = readPointerHelper<int64_t>(p);
  292|      0|        break;
  293|      0|    default:
  ------------------
  |  Branch (293:5): [True: 0, False: 20.6k]
  ------------------
  294|       |        // not supported
  295|      0|        abort();
  296|      0|        break;
  297|  20.6k|    }
  298|       |    // then add relative offset
  299|  20.6k|    switch (encoding & 0x70)
  300|  20.6k|    {
  301|  20.3k|    case DW_EH_PE_absptr:
  ------------------
  |  Branch (301:5): [True: 20.3k, False: 341]
  ------------------
  302|       |        // do nothing
  303|  20.3k|        break;
  304|    341|    case DW_EH_PE_pcrel:
  ------------------
  |  Branch (304:5): [True: 341, False: 20.3k]
  ------------------
  305|    341|        if (result)
  ------------------
  |  Branch (305:13): [True: 341, False: 0]
  ------------------
  306|    341|            result += (uintptr_t)(*data);
  307|    341|        break;
  308|      0|    case DW_EH_PE_datarel:
  ------------------
  |  Branch (308:5): [True: 0, False: 20.6k]
  ------------------
  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: 20.6k]
  ------------------
  314|      0|    case DW_EH_PE_funcrel:
  ------------------
  |  Branch (314:5): [True: 0, False: 20.6k]
  ------------------
  315|      0|    case DW_EH_PE_aligned:
  ------------------
  |  Branch (315:5): [True: 0, False: 20.6k]
  ------------------
  316|      0|    default:
  ------------------
  |  Branch (316:5): [True: 0, False: 20.6k]
  ------------------
  317|       |        // not supported
  318|      0|        abort();
  319|      0|        break;
  320|  20.6k|    }
  321|       |    // then apply indirection
  322|  20.6k|    if (result && (encoding & DW_EH_PE_indirect))
  ------------------
  |  Branch (322:9): [True: 16.1k, False: 4.54k]
  |  Branch (322:19): [True: 341, False: 15.8k]
  ------------------
  323|    341|        result = *((uintptr_t*)result);
  324|  20.6k|    *data = p;
  325|  20.6k|    return result;
  326|  20.6k|}
cxa_personality.cpp:_ZN10__cxxabiv112_GLOBAL__N_117readPointerHelperIiEEmRPKh:
  163|    341|uintptr_t readPointerHelper(const uint8_t*& p) {
  164|    341|    AsType value;
  165|    341|    memcpy(&value, p, sizeof(AsType));
  166|    341|    p += sizeof(AsType);
  167|    341|    return static_cast<uintptr_t>(value);
  168|    341|}
cxa_personality.cpp:_ZN10__cxxabiv1L11readULEB128EPPKh:
  208|  29.4k|{
  209|  29.4k|    uintptr_t result = 0;
  210|  29.4k|    uintptr_t shift = 0;
  211|  29.4k|    unsigned char byte;
  212|  29.4k|    const uint8_t *p = *data;
  213|  29.4k|    do
  214|  39.7k|    {
  215|  39.7k|        byte = *p++;
  216|  39.7k|        result |= static_cast<uintptr_t>(byte & 0x7F) << shift;
  217|  39.7k|        shift += 7;
  218|  39.7k|    } while (byte & 0x80);
  ------------------
  |  Branch (218:14): [True: 10.3k, False: 29.4k]
  ------------------
  219|  29.4k|    *data = p;
  220|  29.4k|    return result;
  221|  29.4k|}

_ZN10__cxxabiv130__aligned_malloc_with_fallbackEm:
  258|    341|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|    341|  if (size == 0)
  ------------------
  |  Branch (266:7): [True: 0, False: 341]
  ------------------
  267|      0|    size = 1;
  268|    341|  if (void* dest = std::__libcpp_aligned_alloc(__alignof(__aligned_type), size))
  ------------------
  |  Branch (268:13): [True: 341, False: 0]
  ------------------
  269|    341|    return dest;
  270|      0|#endif
  271|      0|  return fallback_malloc(size);
  272|    341|}
_ZN10__cxxabiv122__calloc_with_fallbackEmm:
  274|      1|void* __calloc_with_fallback(size_t count, size_t size) {
  275|      1|  void* ptr = ::calloc(count, size);
  276|      1|  if (NULL != ptr)
  ------------------
  |  Branch (276:7): [True: 1, False: 0]
  ------------------
  277|      1|    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|      1|}
_ZN10__cxxabiv128__aligned_free_with_fallbackEPv:
  285|    341|void __aligned_free_with_fallback(void* ptr) {
  286|    341|  if (is_fallback_ptr(ptr))
  ------------------
  |  Branch (286:7): [True: 0, False: 341]
  ------------------
  287|      0|    fallback_free(ptr);
  288|    341|  else {
  289|       |#if defined(_LIBCPP_HAS_NO_LIBRARY_ALIGNED_ALLOCATION)
  290|       |    ::free(ptr);
  291|       |#else
  292|    341|    std::__libcpp_aligned_free(ptr);
  293|    341|#endif
  294|    341|  }
  295|    341|}
fallback_malloc.cpp:_ZN12_GLOBAL__N_115is_fallback_ptrEPv:
  128|    341|bool is_fallback_ptr(void* ptr) {
  129|    341|  return ptr >= heap && ptr < (heap + HEAP_SIZE);
  ------------------
  |  Branch (129:10): [True: 341, False: 0]
  |  Branch (129:25): [True: 0, False: 341]
  ------------------
  130|    341|}

_ZNK10__cxxabiv117__class_type_info9can_catchEPKNS_16__shim_type_infoERPv:
  464|    341|{
  465|       |    // bullet 1
  466|    341|    if (is_equal(this, thrown_type, false))
  ------------------
  |  Branch (466:9): [True: 57, False: 284]
  ------------------
  467|     57|        return true;
  468|    284|    const __class_type_info* thrown_class_type =
  469|    284|        dynamic_cast<const __class_type_info*>(thrown_type);
  470|    284|    if (thrown_class_type == 0)
  ------------------
  |  Branch (470:9): [True: 0, False: 284]
  ------------------
  471|      0|        return false;
  472|       |    // bullet 2
  473|    284|    assert(adjustedPtr && "catching a class without an object?");
  ------------------
  |  Branch (473:5): [True: 284, False: 0]
  |  Branch (473:5): [True: 284, Folded]
  |  Branch (473:5): [True: 284, False: 0]
  ------------------
  474|    284|    __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|    284|    info.number_of_dst_type = 1;
  476|    284|    thrown_class_type->has_unambiguous_public_base(&info, adjustedPtr, public_path);
  477|    284|    if (info.path_dst_ptr_to_static_ptr == public_path)
  ------------------
  |  Branch (477:9): [True: 284, False: 0]
  ------------------
  478|    284|    {
  479|    284|        adjustedPtr = const_cast<void*>(info.dst_ptr_leading_to_static_ptr);
  480|    284|        return true;
  481|    284|    }
  482|      0|    return false;
  483|    284|}
_ZNK10__cxxabiv117__class_type_info24process_found_base_classEPNS_19__dynamic_cast_infoEPvi:
  509|    284|{
  510|    284|  if (info->number_to_static_ptr == 0) {
  ------------------
  |  Branch (510:7): [True: 284, False: 0]
  ------------------
  511|       |    // First time we found this base
  512|    284|    info->dst_ptr_leading_to_static_ptr = adjustedPtr;
  513|    284|    info->path_dst_ptr_to_static_ptr = path_below;
  514|       |    // stash the virtual base cookie.
  515|    284|    info->dst_ptr_not_leading_to_static_ptr = info->vbase_cookie;
  516|    284|    info->number_to_static_ptr = 1;
  517|    284|  } 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|    284|}
_ZNK10__cxxabiv120__si_class_type_info27has_unambiguous_public_baseEPNS_19__dynamic_cast_infoEPvi:
  544|    568|{
  545|    568|    if (is_equal(this, info->static_type, false))
  ------------------
  |  Branch (545:9): [True: 284, False: 284]
  ------------------
  546|    284|        process_found_base_class(info, adjustedPtr, path_below);
  547|    284|    else
  548|    284|        __base_type->has_unambiguous_public_base(info, adjustedPtr, path_below);
  549|    568|}
__dynamic_cast:
  899|    284|               std::ptrdiff_t src2dst_offset) {
  900|       |    // Get (dynamic_ptr, dynamic_type) from static_ptr
  901|    284|    derived_object_info derived_info;
  902|    284|    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|    284|    const void* dst_ptr = 0;
  908|       |
  909|       |    // Find out if we can use a giant short cut in the search
  910|    284|    if (is_equal(derived_info.dynamic_type, dst_type, false))
  ------------------
  |  Branch (910:9): [True: 0, False: 284]
  ------------------
  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|    284|    else
  920|    284|    {
  921|       |        // Optimize toward downcasting: let's first try to do a downcast before
  922|       |        //   falling back to the slow path.
  923|    284|        dst_ptr = dyn_cast_try_downcast(static_ptr,
  924|    284|                                        derived_info.dynamic_ptr,
  925|    284|                                        dst_type,
  926|    284|                                        derived_info.dynamic_type,
  927|    284|                                        src2dst_offset);
  928|       |
  929|    284|        if (!dst_ptr)
  ------------------
  |  Branch (929:13): [True: 0, False: 284]
  ------------------
  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|    284|    }
  939|       |
  940|    284|    return const_cast<void*>(dst_ptr);
  941|    284|}
_ZNK10__cxxabiv117__class_type_info29process_static_type_above_dstEPNS_19__dynamic_cast_infoEPKvS4_i:
  961|    284|{
  962|       |    // Record that we found a static_type
  963|    284|    info->found_any_static_type = true;
  964|    284|    if (current_ptr == info->static_ptr)
  ------------------
  |  Branch (964:9): [True: 284, False: 0]
  ------------------
  965|    284|    {
  966|       |        // Record that we found (static_ptr, static_type)
  967|    284|        info->found_our_static_ptr = true;
  968|    284|        if (info->dst_ptr_leading_to_static_ptr == 0)
  ------------------
  |  Branch (968:13): [True: 284, False: 0]
  ------------------
  969|    284|        {
  970|       |            // First time here
  971|    284|            info->dst_ptr_leading_to_static_ptr = dst_ptr;
  972|    284|            info->path_dst_ptr_to_static_ptr = path_below;
  973|    284|            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|    284|            if (info->number_of_dst_type == 1 && info->path_dst_ptr_to_static_ptr == public_path)
  ------------------
  |  Branch (976:17): [True: 284, False: 0]
  |  Branch (976:50): [True: 284, False: 0]
  ------------------
  977|    284|                info->search_done = true;
  978|    284|        }
  979|      0|        else if (info->dst_ptr_leading_to_static_ptr == dst_ptr)
  ------------------
  |  Branch (979:18): [True: 0, False: 0]
  ------------------
  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|      0|        else
  990|      0|        {
  991|       |            // We've detected an ambiguous cast from (static_ptr, static_type)
  992|       |            //   to a dst_type
  993|      0|            info->number_to_static_ptr += 1;
  994|      0|            info->search_done = true;
  995|      0|        }
  996|    284|    }
  997|    284|}
_ZNK10__cxxabiv120__si_class_type_info16search_above_dstEPNS_19__dynamic_cast_infoEPKvS4_ib:
 1469|    568|{
 1470|    568|    if (is_equal(this, info->static_type, use_strcmp))
  ------------------
  |  Branch (1470:9): [True: 284, False: 284]
  ------------------
 1471|    284|        process_static_type_above_dst(info, dst_ptr, current_ptr, path_below);
 1472|    284|    else
 1473|    284|        __base_type->search_above_dst(info, dst_ptr, current_ptr, path_below, use_strcmp);
 1474|    568|}
private_typeinfo.cpp:_ZL8is_equalPKSt9type_infoS1_b:
   57|  1.76k|{
   58|       |    // Use std::type_info's default comparison unless we've explicitly asked
   59|       |    // for strcmp.
   60|  1.76k|    if (!use_strcmp)
  ------------------
  |  Branch (60:9): [True: 1.76k, False: 0]
  ------------------
   61|  1.76k|        return *x == *y;
   62|       |    // Still allow pointer equality to short circut.
   63|      0|    return x == y || strcmp(x->name(), y->name()) == 0;
  ------------------
  |  Branch (63:12): [True: 0, False: 0]
  |  Branch (63:22): [True: 0, False: 0]
  ------------------
   64|  1.76k|}
private_typeinfo.cpp:_ZN10__cxxabiv112_GLOBAL__N_125dyn_cast_get_derived_infoEPNS0_19derived_object_infoEPKv:
   89|    284|{
   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|    284|    void **vtable = *static_cast<void ** const *>(static_ptr);
  106|    284|    info->offset_to_derived = reinterpret_cast<ptrdiff_t>(vtable[-2]);
  107|    284|    info->dynamic_ptr = static_cast<const char*>(static_ptr) + info->offset_to_derived;
  108|    284|    info->dynamic_type = static_cast<const __class_type_info*>(vtable[-1]);
  109|    284|#endif
  110|    284|}
private_typeinfo.cpp:_ZN10__cxxabiv112_GLOBAL__N_121dyn_cast_try_downcastEPKvS2_PKNS_17__class_type_infoES5_l:
  205|    284|{
  206|    284|    if (src2dst_offset < 0)
  ------------------
  |  Branch (206:9): [True: 0, False: 284]
  ------------------
  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|    284|    const void* dst_ptr_to_static = reinterpret_cast<const char*>(static_ptr) - src2dst_offset;
  217|       |
  218|    284|    if (reinterpret_cast<std::intptr_t>(dst_ptr_to_static) < reinterpret_cast<std::intptr_t>(dynamic_ptr))
  ------------------
  |  Branch (218:9): [True: 0, False: 284]
  ------------------
  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|    284|    __dynamic_cast_info dynamic_to_dst_info = {dynamic_type,
  226|    284|                                               dst_ptr_to_static,
  227|    284|                                               dst_type,
  228|    284|                                               src2dst_offset,
  229|    284|                                               0,
  230|    284|                                               0,
  231|    284|                                               0,
  232|    284|                                               0,
  233|    284|                                               0,
  234|    284|                                               0,
  235|    284|                                               0,
  236|    284|                                               0,
  237|    284|                                               1, // number_of_dst_type
  238|    284|                                               false,
  239|    284|                                               false,
  240|    284|                                               false,
  241|    284|                                               true,
  242|    284|                                               nullptr};
  243|    284|    dynamic_type->search_above_dst(&dynamic_to_dst_info, dynamic_ptr, dynamic_ptr, public_path, false);
  244|    284|    if (dynamic_to_dst_info.path_dst_ptr_to_static_ptr != unknown) {
  ------------------
  |  Branch (244:9): [True: 284, False: 0]
  ------------------
  245|       |        // We have found at least one path from dynamic_ptr to dst_ptr. The
  246|       |        //   downcast can succeed.
  247|    284|        return dst_ptr_to_static;
  248|    284|    }
  249|       |
  250|      0|    return nullptr;
  251|    284|}

_ZNSt9exceptionD2Ev:
   18|    341|{
   19|    341|}

_Znwm:
   66|  1.00k|_LIBCPP_MAKE_OVERRIDABLE_FUNCTION_DETECTABLE _LIBCPP_WEAK void* operator new(std::size_t size) _THROW_BAD_ALLOC {
   67|  1.00k|  void* p = operator_new_impl(size);
   68|  1.00k|  if (p == nullptr)
  ------------------
  |  Branch (68:7): [True: 0, False: 1.00k]
  ------------------
   69|      0|    __throw_bad_alloc_shim();
   70|  1.00k|  return p;
   71|  1.00k|}
_ZdlPv:
  125|  1.00k|_LIBCPP_WEAK void operator delete(void* ptr) noexcept { std::free(ptr); }
_ZdlPvm:
  129|    663|_LIBCPP_WEAK void operator delete(void* ptr, size_t) noexcept { ::operator delete(ptr); }
_ZnwmSt11align_val_t:
  160|    392|operator new(std::size_t size, std::align_val_t alignment) _THROW_BAD_ALLOC {
  161|    392|  void* p = operator_new_aligned_impl(size, alignment);
  162|    392|  if (p == nullptr)
  ------------------
  |  Branch (162:7): [True: 0, False: 392]
  ------------------
  163|      0|    __throw_bad_alloc_shim();
  164|    392|  return p;
  165|    392|}
_ZdlPvSt11align_val_t:
  221|    392|_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|  1.00k|static void* operator_new_impl(std::size_t size) {
   51|  1.00k|  if (size == 0)
  ------------------
  |  Branch (51:7): [True: 0, False: 1.00k]
  ------------------
   52|      0|    size = 1;
   53|  1.00k|  void* p;
   54|  1.00k|  while ((p = std::malloc(size)) == nullptr) {
  ------------------
  |  Branch (54:10): [True: 0, False: 1.00k]
  ------------------
   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|  1.00k|  return p;
   64|  1.00k|}
stdlib_new_delete.cpp:_ZL25operator_new_aligned_implmSt11align_val_t:
  139|    392|static void* operator_new_aligned_impl(std::size_t size, std::align_val_t alignment) {
  140|    392|  if (size == 0)
  ------------------
  |  Branch (140:7): [True: 0, False: 392]
  ------------------
  141|      0|    size = 1;
  142|    392|  if (static_cast<size_t>(alignment) < sizeof(void*))
  ------------------
  |  Branch (142:7): [True: 0, False: 392]
  ------------------
  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|    392|  void* p;
  149|    392|  while ((p = std::__libcpp_aligned_alloc(static_cast<std::size_t>(alignment), size)) == nullptr) {
  ------------------
  |  Branch (149:10): [True: 0, False: 392]
  ------------------
  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|    392|  return p;
  157|    392|}

_ZNSt13runtime_errorD2Ev:
   30|    341|runtime_error::~runtime_error() noexcept {}

kmp_csupport.cpp:_ZL23__kmp_assert_valid_gtidi:
 3510|    392|static inline void __kmp_assert_valid_gtid(kmp_int32 gtid) {
 3511|    392|  if (UNLIKELY(gtid < 0 || gtid >= __kmp_threads_capacity))
  ------------------
  |  |  119|    784|#define UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (119:21): [True: 0, False: 392]
  |  |  |  Branch (119:41): [True: 0, False: 392]
  |  |  |  Branch (119:41): [True: 0, False: 392]
  |  |  ------------------
  ------------------
 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|    392|}
_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|  12.9k|static inline int __kmp_tid_from_gtid(int gtid) {
 3486|  12.9k|  KMP_DEBUG_ASSERT(gtid >= 0);
 3487|  12.9k|  return __kmp_threads[gtid]->th.th_info.ds.ds_tid;
 3488|  12.9k|}
kmp_runtime.cpp:_ZL9copy_icvsP20kmp_internal_controlS0_:
 2111|    457|                             kmp_internal_control_t *src) {
 2112|    457|  *dst = *src;
 2113|    457|}
kmp_runtime.cpp:_ZL27__kmp_assign_root_init_maskv:
 3785|    393|static inline void __kmp_assign_root_init_mask() {
 3786|    393|  int gtid = __kmp_entry_gtid();
  ------------------
  |  | 3467|    393|#define __kmp_entry_gtid() __kmp_get_global_thread_id_reg()
  ------------------
 3787|    393|  kmp_root_t *r = __kmp_threads[gtid]->th.th_root;
 3788|    393|  if (r->r.r_uber_thread == __kmp_threads[gtid] && !r->r.r_affinity_assigned) {
  ------------------
  |  Branch (3788:7): [True: 393, False: 0]
  |  Branch (3788:52): [True: 0, False: 393]
  ------------------
 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|    393|}
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|  12.4k|static inline void __kmp_store_x87_fpu_control_word(kmp_int16 *p) {
 1363|  12.4k|  __asm__ __volatile__("fstcw %0" : "=m"(*p));
 1364|  12.4k|}
kmp_runtime.cpp:_ZL17__kmp_store_mxcsrPj:
 1388|  12.4k|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|     30|static inline void __kmp_type_convert(T1 src, T2 *dest) {
 4697|     30|  *dest = kmp_convert<T1, T2>::to(src);
 4698|     30|}
_ZN11kmp_convertIliLb0ELb0ELb1ELb1EE2toEl:
 4612|     31|  static TargetType to(SourceType src) {
 4613|     31|    KMP_ASSERT(src <= static_cast<SourceType>(
  ------------------
  |  |   50|     31|  if (!(cond)) {                                                               \
  |  |  ------------------
  |  |  |  Branch (50:7): [True: 0, False: 31]
  |  |  ------------------
  |  |   51|      0|    __kmp_debug_assert("assertion failure", __FILE__, __LINE__);               \
  |  |   52|      0|  }
  ------------------
 4614|     31|                          (std::numeric_limits<TargetType>::max)()));
 4615|     31|    KMP_ASSERT(src >= static_cast<SourceType>(
  ------------------
  |  |   50|     31|  if (!(cond)) {                                                               \
  |  |  ------------------
  |  |  |  Branch (50:7): [True: 0, False: 31]
  |  |  ------------------
  |  |   51|      0|    __kmp_debug_assert("assertion failure", __FILE__, __LINE__);               \
  |  |   52|      0|  }
  ------------------
 4616|     31|                          (std::numeric_limits<TargetType>::min)()));
 4617|     31|    return (TargetType)src;
 4618|     31|  }
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|  35.6k|static inline int __kmp_tid_from_gtid(int gtid) {
 3486|  35.6k|  KMP_DEBUG_ASSERT(gtid >= 0);
 3487|  35.6k|  return __kmp_threads[gtid]->th.th_info.ds.ds_tid;
 3488|  35.6k|}
kmp_barrier.cpp:_ZL15__kmp_x86_pausev:
 1496|   228M|static inline void __kmp_x86_pause(void) { _mm_pause(); }
kmp_barrier.cpp:_ZL9copy_icvsP20kmp_internal_controlS0_:
 2111|  22.9k|                             kmp_internal_control_t *src) {
 2112|  22.9k|  *dst = *src;
 2113|  22.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_lock.cpp:_ZL15__kmp_x86_pausev:
 1496|  3.44k|static inline void __kmp_x86_pause(void) { _mm_pause(); }
kmp_sched.cpp:_ZL23__kmp_assert_valid_gtidi:
 3510|  12.1k|static inline void __kmp_assert_valid_gtid(kmp_int32 gtid) {
 3511|  12.1k|  if (UNLIKELY(gtid < 0 || gtid >= __kmp_threads_capacity))
  ------------------
  |  |  119|  24.2k|#define UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (119:21): [True: 0, False: 12.1k]
  |  |  |  Branch (119:41): [True: 41, False: 12.1k]
  |  |  |  Branch (119:41): [True: 18.4E, False: 12.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|  12.1k|}
kmp_sched.cpp:_ZL19__kmp_tid_from_gtidi:
 3485|  12.1k|static inline int __kmp_tid_from_gtid(int gtid) {
 3486|  12.1k|  KMP_DEBUG_ASSERT(gtid >= 0);
 3487|  12.1k|  return __kmp_threads[gtid]->th.th_info.ds.ds_tid;
 3488|  12.1k|}
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|    392|static inline void __kmp_assign_root_init_mask() {
 3786|    392|  int gtid = __kmp_entry_gtid();
  ------------------
  |  | 3467|    392|#define __kmp_entry_gtid() __kmp_get_global_thread_id_reg()
  ------------------
 3787|    392|  kmp_root_t *r = __kmp_threads[gtid]->th.th_root;
 3788|    392|  if (r->r.r_uber_thread == __kmp_threads[gtid] && !r->r.r_affinity_assigned) {
  ------------------
  |  Branch (3788:7): [True: 392, False: 0]
  |  Branch (3788:52): [True: 1, False: 391]
  ------------------
 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|    392|}
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|    486|void *___kmp_allocate(size_t size KMP_SRC_LOC_DECL) {
 1998|    486|  void *ptr;
 1999|    486|  KE_TRACE(25, ("-> __kmp_allocate( %d ) called from %s:%d\n",
 2000|    486|                (int)size KMP_SRC_LOC_PARM));
 2001|    486|  ptr = ___kmp_allocate_align(size, __kmp_align_alloc KMP_SRC_LOC_PARM);
 2002|    486|  KE_TRACE(25, ("<- __kmp_allocate() returns %p\n", ptr));
 2003|    486|  return ptr;
 2004|    486|} // func ___kmp_allocate
___kmp_free:
 2023|    482|void ___kmp_free(void *ptr KMP_SRC_LOC_DECL) {
 2024|    482|  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|    482|  KE_TRACE(25,
 2030|    482|           ("-> __kmp_free( %p ) called from %s:%d\n", ptr KMP_SRC_LOC_PARM));
 2031|    482|  KMP_ASSERT(ptr != NULL);
  ------------------
  |  |   50|    482|  if (!(cond)) {                                                               \
  |  |  ------------------
  |  |  |  Branch (50:7): [True: 0, False: 482]
  |  |  ------------------
  |  |   51|      0|    __kmp_debug_assert("assertion failure", __FILE__, __LINE__);               \
  |  |   52|      0|  }
  ------------------
 2032|       |
 2033|    482|  descr = *(kmp_mem_descr_t *)((kmp_uintptr_t)ptr - sizeof(kmp_mem_descr_t));
 2034|       |
 2035|    482|  KE_TRACE(26, ("   __kmp_free:     "
 2036|    482|                "ptr_allocated=%p, size_allocated=%d, "
 2037|    482|                "ptr_aligned=%p, size_aligned=%d\n",
 2038|    482|                descr.ptr_allocated, (int)descr.size_allocated,
 2039|    482|                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|    482|#ifndef LEAK_MEMORY
 2054|    482|  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|    482|  free_src_loc(descr.ptr_allocated KMP_SRC_LOC_PARM);
  ------------------
  |  |  145|    482|#define free_src_loc(args) _free_src_loc(args)
  |  |  ------------------
  |  |  |  |  190|    482|#define _free_src_loc(ptr) free((ptr))
  |  |  ------------------
  ------------------
 2059|    482|#endif
 2060|    482|#endif
 2061|    482|  KMP_MB();
 2062|    482|  KE_TRACE(25, ("<- __kmp_free() returns\n"));
 2063|    482|} // 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|    486|                                   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|    486|  kmp_mem_descr_t descr;
 1931|    486|  kmp_uintptr_t addr_allocated; // Address returned by malloc().
 1932|    486|  kmp_uintptr_t addr_aligned; // Aligned address to return to caller.
 1933|    486|  kmp_uintptr_t addr_descr; // Address of memory block descriptor.
 1934|       |
 1935|    486|  KE_TRACE(25, ("-> ___kmp_allocate_align( %d, %d ) called from %s:%d\n",
 1936|    486|                (int)size, (int)alignment KMP_SRC_LOC_PARM));
 1937|       |
 1938|    486|  KMP_DEBUG_ASSERT(alignment < 32 * 1024); // Alignment should not be too
 1939|    486|  KMP_DEBUG_ASSERT(sizeof(void *) <= sizeof(kmp_uintptr_t));
 1940|       |  // Make sure kmp_uintptr_t is enough to store addresses.
 1941|       |
 1942|    486|  descr.size_aligned = size;
 1943|    486|  descr.size_allocated =
 1944|    486|      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|    486|  descr.ptr_allocated = malloc_src_loc(descr.size_allocated KMP_SRC_LOC_PARM);
  ------------------
  |  |  144|    486|#define malloc_src_loc(args) _malloc_src_loc(args)
  |  |  ------------------
  |  |  |  |  189|    486|#define _malloc_src_loc(size) malloc((size))
  |  |  ------------------
  ------------------
 1950|    486|#endif
 1951|    486|  KE_TRACE(10, ("   malloc( %d ) returned %p\n", (int)descr.size_allocated,
 1952|    486|                descr.ptr_allocated));
 1953|    486|  if (descr.ptr_allocated == NULL) {
  ------------------
  |  Branch (1953:7): [True: 0, False: 486]
  ------------------
 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|    486|  addr_allocated = (kmp_uintptr_t)descr.ptr_allocated;
 1958|    486|  addr_aligned =
 1959|    486|      (addr_allocated + sizeof(kmp_mem_descr_t) + alignment) & ~(alignment - 1);
 1960|    486|  addr_descr = addr_aligned - sizeof(kmp_mem_descr_t);
 1961|       |
 1962|    486|  descr.ptr_aligned = (void *)addr_aligned;
 1963|       |
 1964|    486|  KE_TRACE(26, ("   ___kmp_allocate_align: "
 1965|    486|                "ptr_allocated=%p, size_allocated=%d, "
 1966|    486|                "ptr_aligned=%p, size_aligned=%d\n",
 1967|    486|                descr.ptr_allocated, (int)descr.size_allocated,
 1968|    486|                descr.ptr_aligned, (int)descr.size_aligned));
 1969|       |
 1970|    486|  KMP_DEBUG_ASSERT(addr_allocated <= addr_descr);
 1971|    486|  KMP_DEBUG_ASSERT(addr_descr + sizeof(kmp_mem_descr_t) == addr_aligned);
 1972|    486|  KMP_DEBUG_ASSERT(addr_aligned + descr.size_aligned <=
 1973|    486|                   addr_allocated + descr.size_allocated);
 1974|    486|  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|    486|  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|    486|  *((kmp_mem_descr_t *)addr_descr) = descr;
 1986|       |
 1987|    486|  KMP_MB();
 1988|       |
 1989|    486|  KE_TRACE(25, ("<- ___kmp_allocate_align() returns %p\n", descr.ptr_aligned));
 1990|    486|  return descr.ptr_aligned;
 1991|    486|} // 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|}

_Z18__kmp_join_barrieri:
 2158|  12.4k|void __kmp_join_barrier(int gtid) {
 2159|  12.4k|  KMP_TIME_PARTITIONED_BLOCK(OMP_join_barrier);
  ------------------
  |  | 1013|  12.4k|#define KMP_TIME_PARTITIONED_BLOCK(name) ((void)0)
  ------------------
 2160|  12.4k|  KMP_SET_THREAD_STATE_BLOCK(FORK_JOIN_BARRIER);
  ------------------
  |  | 1018|  12.4k|#define KMP_SET_THREAD_STATE_BLOCK(state_name) ((void)0)
  ------------------
 2161|       |
 2162|  12.4k|  KMP_DEBUG_ASSERT(__kmp_threads && __kmp_threads[gtid]);
 2163|       |
 2164|  12.4k|  kmp_info_t *this_thr = __kmp_threads[gtid];
 2165|  12.4k|  kmp_team_t *team;
 2166|  12.4k|  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|  12.4k|  KMP_MB();
 2182|       |
 2183|       |  // Get current info
 2184|  12.4k|  team = this_thr->th.th_team;
 2185|  12.4k|  KMP_DEBUG_ASSERT(nproc == team->t.t_nproc);
 2186|  12.4k|  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|  12.4k|  KMP_DEBUG_ASSERT(master_thread == team->t.t_threads[0]);
 2195|  12.4k|  KMP_MB();
 2196|       |
 2197|       |  // Verify state
 2198|  12.4k|  KMP_DEBUG_ASSERT(TCR_PTR(this_thr->th.th_team));
 2199|  12.4k|  KMP_DEBUG_ASSERT(TCR_PTR(this_thr->th.th_root));
 2200|  12.4k|  KMP_DEBUG_ASSERT(this_thr == team->t.t_threads[tid]);
 2201|  12.4k|  KA_TRACE(10, ("__kmp_join_barrier: T#%d(%d:%d) arrived at join barrier\n",
 2202|  12.4k|                gtid, team_id, tid));
 2203|       |
 2204|  12.4k|#if OMPT_SUPPORT
 2205|  12.4k|  if (ompt_enabled.enabled) {
  ------------------
  |  Branch (2205:7): [True: 0, False: 12.4k]
  ------------------
 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|  12.4k|#endif
 2233|       |
 2234|  12.4k|  if (__kmp_tasking_mode == tskm_extra_barrier) {
  ------------------
  |  Branch (2234:7): [True: 0, False: 12.4k]
  ------------------
 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|  12.4k|  if (__kmp_dflt_blocktime != KMP_MAX_BLOCKTIME) {
  ------------------
  |  | 1184|  12.4k|  (INT_MAX) /* Must be this for "infinite" setting the work */
  ------------------
  |  Branch (2257:7): [True: 12.4k, 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|  12.4k|    this_thr->th.th_team_bt_intervals = KMP_BLOCKTIME_INTERVAL(team, tid);
  ------------------
  |  | 1221|  12.4k|  (KMP_BLOCKTIME(team, tid) * __kmp_ticks_per_msec)
  |  |  ------------------
  |  |  |  | 1210|  12.4k|  (get__bt_set(team, tid) ? get__blocktime(team, tid) : __kmp_dflt_blocktime)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2289|  12.4k|  ((xteam)->t.t_threads[(xtid)]->th.th_current_task->td_icvs.bt_set)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2289:3): [True: 0, False: 12.4k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                 (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|  12.4k|#endif
 2266|  12.4k|  }
 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|  12.4k|  switch (__kmp_barrier_gather_pattern[bs_forkjoin_barrier]) {
 2274|      0|  case bp_dist_bar: {
  ------------------
  |  Branch (2274:3): [True: 0, False: 12.4k]
  ------------------
 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|  12.4k|  case bp_hyper_bar: {
  ------------------
  |  Branch (2279:3): [True: 12.4k, False: 18.4E]
  ------------------
 2280|  12.4k|    KMP_ASSERT(__kmp_barrier_gather_branch_bits[bs_forkjoin_barrier]);
  ------------------
  |  |   50|  12.4k|  if (!(cond)) {                                                               \
  |  |  ------------------
  |  |  |  Branch (50:7): [True: 0, False: 12.4k]
  |  |  ------------------
  |  |   51|      0|    __kmp_debug_assert("assertion failure", __FILE__, __LINE__);               \
  |  |   52|      0|  }
  ------------------
 2281|  12.4k|    __kmp_hyper_barrier_gather(bs_forkjoin_barrier, this_thr, gtid, tid,
 2282|  12.4k|                               NULL USE_ITT_BUILD_ARG(itt_sync_obj));
 2283|  12.4k|    break;
 2284|      0|  }
 2285|      0|  case bp_hierarchical_bar: {
  ------------------
  |  Branch (2285:3): [True: 0, False: 12.4k]
  ------------------
 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: 12.4k]
  ------------------
 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: 12.4k]
  ------------------
 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|  12.4k|  }
 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|  12.5k|  if (KMP_MASTER_TID(tid)) {
  ------------------
  |  | 1271|  12.5k|#define KMP_MASTER_TID(tid) (0 == (tid))
  |  |  ------------------
  |  |  |  Branch (1271:29): [True: 392, False: 12.1k]
  |  |  ------------------
  ------------------
 2307|    392|    if (__kmp_tasking_mode != tskm_immediate_exec) {
  ------------------
  |  Branch (2307:9): [True: 392, False: 0]
  ------------------
 2308|    392|      __kmp_task_team_wait(this_thr, team USE_ITT_BUILD_ARG(itt_sync_obj));
 2309|    392|    }
 2310|    392|    if (__kmp_display_affinity) {
  ------------------
  |  Branch (2310:9): [True: 0, False: 392]
  ------------------
 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|    392|  }
 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|  12.5k|  KMP_MB(); // Flush all pending memory write invalidates.
 2391|  12.5k|  KA_TRACE(10,
 2392|  12.5k|           ("__kmp_join_barrier: T#%d(%d:%d) leaving\n", gtid, team_id, tid));
 2393|       |
 2394|  12.5k|}
_Z18__kmp_fork_barrierii:
 2398|  12.5k|void __kmp_fork_barrier(int gtid, int tid) {
 2399|  12.5k|  KMP_TIME_PARTITIONED_BLOCK(OMP_fork_barrier);
  ------------------
  |  | 1013|  12.5k|#define KMP_TIME_PARTITIONED_BLOCK(name) ((void)0)
  ------------------
 2400|  12.5k|  KMP_SET_THREAD_STATE_BLOCK(FORK_JOIN_BARRIER);
  ------------------
  |  | 1018|  12.5k|#define KMP_SET_THREAD_STATE_BLOCK(state_name) ((void)0)
  ------------------
 2401|  12.5k|  kmp_info_t *this_thr = __kmp_threads[gtid];
 2402|  12.5k|  kmp_team_t *team = (tid == 0) ? this_thr->th.th_team : NULL;
  ------------------
  |  Branch (2402:22): [True: 392, False: 12.1k]
  ------------------
 2403|       |#if USE_ITT_BUILD
 2404|       |  void *itt_sync_obj = NULL;
 2405|       |#endif /* USE_ITT_BUILD */
 2406|  12.5k|  if (team)
  ------------------
  |  Branch (2406:7): [True: 392, False: 12.1k]
  ------------------
 2407|       |
 2408|    392|  KA_TRACE(10, ("__kmp_fork_barrier: T#%d(%d:%d) has arrived\n", gtid,
 2409|    392|                (team != NULL) ? team->t.t_id : -1, tid));
 2410|       |
 2411|       |  // th_team pointer only valid for primary thread here
 2412|  12.5k|  if (KMP_MASTER_TID(tid)) {
  ------------------
  |  | 1271|  12.5k|#define KMP_MASTER_TID(tid) (0 == (tid))
  |  |  ------------------
  |  |  |  Branch (1271:29): [True: 392, False: 12.1k]
  |  |  ------------------
  ------------------
 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|    392|    if (__kmp_tasking_mode != tskm_immediate_exec) {
  ------------------
  |  Branch (2443:9): [True: 392, False: 0]
  ------------------
 2444|       |      // 0 indicates setup current task team if nthreads > 1
 2445|    392|      __kmp_task_team_setup(this_thr, team, 0);
 2446|    392|    }
 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|    392|    if (__kmp_dflt_blocktime != KMP_MAX_BLOCKTIME) {
  ------------------
  |  | 1184|    392|  (INT_MAX) /* Must be this for "infinite" setting the work */
  ------------------
  |  Branch (2454:9): [True: 392, 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|    392|      this_thr->th.th_team_bt_intervals = KMP_BLOCKTIME_INTERVAL(team, tid);
  ------------------
  |  | 1221|    392|  (KMP_BLOCKTIME(team, tid) * __kmp_ticks_per_msec)
  |  |  ------------------
  |  |  |  | 1210|    392|  (get__bt_set(team, tid) ? get__blocktime(team, tid) : __kmp_dflt_blocktime)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2289|    392|  ((xteam)->t.t_threads[(xtid)]->th.th_current_task->td_icvs.bt_set)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2289:3): [True: 0, False: 392]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                 (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|    392|#endif
 2463|    392|    }
 2464|    392|  } // primary thread
 2465|       |
 2466|  12.5k|  switch (__kmp_barrier_release_pattern[bs_forkjoin_barrier]) {
 2467|      0|  case bp_dist_bar: {
  ------------------
  |  Branch (2467:3): [True: 0, False: 12.5k]
  ------------------
 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|  12.5k|  case bp_hyper_bar: {
  ------------------
  |  Branch (2472:3): [True: 12.5k, False: 4]
  ------------------
 2473|  12.5k|    KMP_ASSERT(__kmp_barrier_release_branch_bits[bs_forkjoin_barrier]);
  ------------------
  |  |   50|  12.5k|  if (!(cond)) {                                                               \
  |  |  ------------------
  |  |  |  Branch (50:7): [True: 0, False: 12.5k]
  |  |  ------------------
  |  |   51|      0|    __kmp_debug_assert("assertion failure", __FILE__, __LINE__);               \
  |  |   52|      0|  }
  ------------------
 2474|  12.5k|    __kmp_hyper_barrier_release(bs_forkjoin_barrier, this_thr, gtid, tid,
 2475|  12.5k|                                TRUE USE_ITT_BUILD_ARG(itt_sync_obj));
  ------------------
  |  | 1280|  12.5k|#define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  | 1279|  12.5k|#define FALSE 0
  |  |  ------------------
  ------------------
 2476|  12.5k|    break;
 2477|      0|  }
 2478|      0|  case bp_hierarchical_bar: {
  ------------------
  |  Branch (2478:3): [True: 0, False: 12.5k]
  ------------------
 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: 12.5k]
  ------------------
 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: 12.5k]
  ------------------
 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|  12.5k|  }
 2494|       |
 2495|  11.9k|#if OMPT_SUPPORT
 2496|  11.9k|  if (ompt_enabled.enabled &&
  ------------------
  |  Branch (2496:7): [True: 0, False: 11.9k]
  ------------------
 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|  11.9k|#endif
 2527|       |
 2528|       |  // Early exit for reaping threads releasing forkjoin barrier
 2529|  11.9k|  if (TCR_4(__kmp_global.g.g_done)) {
  ------------------
  |  | 1127|  11.9k|#define TCR_4(a) (a)
  |  |  ------------------
  |  |  |  Branch (1127:18): [True: 21, False: 11.9k]
  |  |  ------------------
  ------------------
 2530|     21|    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|     21|    KA_TRACE(10, ("__kmp_fork_barrier: T#%d is leaving early\n", gtid));
 2542|     21|    return;
 2543|     21|  }
 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|  11.9k|  team = (kmp_team_t *)TCR_PTR(this_thr->th.th_team);
  ------------------
  |  | 1156|  11.9k|#define TCR_PTR(a) ((void *)TCR_8(a))
  |  |  ------------------
  |  |  |  | 1131|  11.9k|#define TCR_8(a) (a)
  |  |  ------------------
  ------------------
 2550|  11.9k|  KMP_DEBUG_ASSERT(team != NULL);
 2551|  11.9k|  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|  11.9k|  if (__kmp_tasking_mode != tskm_immediate_exec) {
  ------------------
  |  Branch (2577:7): [True: 11.9k, False: 18.4E]
  ------------------
 2578|  11.9k|    __kmp_task_team_sync(this_thr, team);
 2579|  11.9k|  }
 2580|       |
 2581|  11.9k|#if KMP_AFFINITY_SUPPORTED
 2582|  11.9k|  kmp_proc_bind_t proc_bind = team->t.t_proc_bind;
 2583|  11.9k|  if (proc_bind == proc_bind_intel) {
  ------------------
  |  Branch (2583:7): [True: 0, False: 11.9k]
  ------------------
 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|  11.9k|  } else if (proc_bind != proc_bind_false) {
  ------------------
  |  Branch (2588:14): [True: 0, False: 11.9k]
  ------------------
 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|  11.9k|#endif // KMP_AFFINITY_SUPPORTED
 2598|       |  // Perform the display affinity functionality
 2599|  11.9k|  if (__kmp_display_affinity) {
  ------------------
  |  Branch (2599:7): [True: 0, False: 11.9k]
  ------------------
 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|  11.9k|  if (!KMP_MASTER_TID(tid))
  ------------------
  |  | 1271|  11.9k|#define KMP_MASTER_TID(tid) (0 == (tid))
  ------------------
  |  Branch (2611:7): [True: 11.6k, False: 272]
  ------------------
 2612|  11.6k|    KMP_CHECK_UPDATE(this_thr->th.th_def_allocator, team->t.t_def_allocator);
  ------------------
  |  | 2280|  11.6k|  if ((a) != (b))                                                              \
  |  |  ------------------
  |  |  |  Branch (2280:7): [True: 0, False: 11.6k]
  |  |  ------------------
  |  | 2281|  11.6k|  (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|  11.9k|  KA_TRACE(10, ("__kmp_fork_barrier: T#%d(%d:%d) is leaving\n", gtid,
 2624|  11.9k|                team->t.t_id, tid));
 2625|  11.9k|}
_Z20__kmp_setup_icv_copyP8kmp_teamiP20kmp_internal_controlP5ident:
 2628|    392|                          kmp_internal_control_t *new_icvs, ident_t *loc) {
 2629|    392|  KMP_TIME_DEVELOPER_PARTITIONED_BLOCK(KMP_setup_icv_copy);
  ------------------
  |  | 1008|    392|#define KMP_TIME_DEVELOPER_PARTITIONED_BLOCK(n) ((void)0)
  ------------------
 2630|       |
 2631|    392|  KMP_DEBUG_ASSERT(team && new_nproc && new_icvs);
 2632|    392|  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|    392|  KF_TRACE(10, ("__kmp_setup_icv_copy: PUSH: T#%d this_thread=%p team=%p\n", 0,
 2652|    392|                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|    392|}
kmp_barrier.cpp:_ZL27__kmp_hyper_barrier_release12barrier_typeP8kmp_infoiii:
 1127|  12.5k|    int propagate_icvs USE_ITT_BUILD_ARG(void *itt_sync_obj)) {
 1128|  12.5k|  KMP_TIME_DEVELOPER_PARTITIONED_BLOCK(KMP_hyper_release);
  ------------------
  |  | 1008|  12.5k|#define KMP_TIME_DEVELOPER_PARTITIONED_BLOCK(n) ((void)0)
  ------------------
 1129|  12.5k|  kmp_team_t *team;
 1130|  12.5k|  kmp_bstate_t *thr_bar = &this_thr->th.th_bar[bt].bb;
 1131|  12.5k|  kmp_info_t **other_threads;
 1132|  12.5k|  kmp_uint32 num_threads;
 1133|  12.5k|  kmp_uint32 branch_bits = __kmp_barrier_release_branch_bits[bt];
 1134|  12.5k|  kmp_uint32 branch_factor = 1 << branch_bits;
 1135|  12.5k|  kmp_uint32 child;
 1136|  12.5k|  kmp_uint32 child_tid;
 1137|  12.5k|  kmp_uint32 offset;
 1138|  12.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|  12.5k|  if (KMP_MASTER_TID(tid)) { // primary thread
  ------------------
  |  | 1271|  12.5k|#define KMP_MASTER_TID(tid) (0 == (tid))
  |  |  ------------------
  |  |  |  Branch (1271:29): [True: 392, False: 12.1k]
  |  |  ------------------
  ------------------
 1145|    392|    team = __kmp_threads[gtid]->th.th_team;
 1146|    392|    KMP_DEBUG_ASSERT(team != NULL);
 1147|    392|    KA_TRACE(20, ("__kmp_hyper_barrier_release: T#%d(%d:%d) primary enter for "
 1148|    392|                  "barrier type %d\n",
 1149|    392|                  gtid, team->t.t_id, tid, bt));
 1150|    392|#if KMP_BARRIER_ICV_PUSH
 1151|    392|    if (propagate_icvs) { // primary already has ICVs in final destination; copy
  ------------------
  |  Branch (1151:9): [True: 392, False: 0]
  ------------------
 1152|    392|      copy_icvs(&thr_bar->th_fixed_icvs,
 1153|    392|                &team->t.t_implicit_task_taskdata[tid].td_icvs);
 1154|    392|    }
 1155|    392|#endif
 1156|  12.1k|  } else { // Handle fork barrier workers who aren't part of a team yet
 1157|  12.1k|    KA_TRACE(20, ("__kmp_hyper_barrier_release: T#%d wait go(%p) == %u\n", gtid,
 1158|  12.1k|                  &thr_bar->b_go, KMP_BARRIER_STATE_BUMP));
 1159|       |    // Wait for parent thread to release us
 1160|  12.1k|    kmp_flag_64<> flag(&thr_bar->b_go, KMP_BARRIER_STATE_BUMP);
  ------------------
  |  | 2025|  12.1k|#define KMP_BARRIER_STATE_BUMP (1 << KMP_BARRIER_BUMP_BIT)
  |  |  ------------------
  |  |  |  | 2021|  12.1k|#define KMP_BARRIER_BUMP_BIT 2 /* lsb used for bump of go/arrived state */
  |  |  ------------------
  ------------------
 1161|  12.1k|    flag.wait(this_thr, TRUE USE_ITT_BUILD_ARG(itt_sync_obj));
  ------------------
  |  | 1280|  12.1k|#define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  | 1279|  12.1k|#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|  12.1k|        if (bt == bs_forkjoin_barrier && TCR_4(__kmp_global.g.g_done))
  ------------------
  |  | 1127|  11.9k|#define TCR_4(a) (a)
  |  |  ------------------
  |  |  |  Branch (1127:18): [True: 15, False: 11.9k]
  |  |  ------------------
  ------------------
  |  Branch (1179:13): [True: 11.9k, False: 187]
  ------------------
 1180|      7|      return;
 1181|       |
 1182|       |    // The worker thread may now assume that the team is valid.
 1183|  12.1k|    team = __kmp_threads[gtid]->th.th_team;
 1184|  12.1k|    KMP_DEBUG_ASSERT(team != NULL);
 1185|  12.1k|    tid = __kmp_tid_from_gtid(gtid);
 1186|       |
 1187|  12.1k|    TCW_4(thr_bar->b_go, KMP_INIT_BARRIER_STATE);
  ------------------
  |  | 1128|  12.1k|#define TCW_4(a, b) (a) = (b)
  ------------------
 1188|  12.1k|    KA_TRACE(20,
 1189|  12.1k|             ("__kmp_hyper_barrier_release: T#%d(%d:%d) set go(%p) = %u\n",
 1190|  12.1k|              gtid, team->t.t_id, tid, &thr_bar->b_go, KMP_INIT_BARRIER_STATE));
 1191|  12.1k|    KMP_MB(); // Flush all pending memory write invalidates.
 1192|  12.1k|  }
 1193|  12.5k|  num_threads = this_thr->th.th_team_nproc;
 1194|  12.5k|  other_threads = team->t.t_threads;
 1195|       |
 1196|  12.5k|#ifdef KMP_REVERSE_HYPER_BAR
 1197|       |  // Count up to correct level for parent
 1198|  12.5k|  for (level = 0, offset = 1;
 1199|  16.7k|       offset < num_threads && (((tid >> level) & (branch_factor - 1)) == 0);
  ------------------
  |  Branch (1199:8): [True: 15.8k, False: 873]
  |  Branch (1199:32): [True: 4.25k, False: 11.6k]
  ------------------
 1200|  12.5k|       level += branch_bits, offset <<= branch_bits)
 1201|  4.24k|    ;
 1202|       |
 1203|       |  // Now go down from there
 1204|  16.7k|  for (level -= branch_bits, offset >>= branch_bits; offset != 0;
  ------------------
  |  Branch (1204:54): [True: 4.18k, False: 12.5k]
  ------------------
 1205|  12.5k|       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|  4.18k|  {
 1212|  4.18k|#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|  4.18k|    child = num_threads >> ((level == 0) ? level : level - 1);
  ------------------
  |  Branch (1215:29): [True: 3.04k, False: 1.13k]
  ------------------
 1216|  4.18k|    for (child = (child < branch_factor - 1) ? child : branch_factor - 1,
  ------------------
  |  Branch (1216:18): [True: 0, False: 4.18k]
  ------------------
 1217|  4.18k|        child_tid = tid + (child << level);
 1218|  16.6k|         child >= 1; child--, child_tid -= (1 << level))
  ------------------
  |  Branch (1218:10): [True: 12.4k, False: 4.18k]
  ------------------
 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|  12.4k|    {
 1230|  12.4k|      if (child_tid >= num_threads)
  ------------------
  |  Branch (1230:11): [True: 784, False: 11.6k]
  ------------------
 1231|    784|        continue; // Child doesn't exist so keep going
 1232|  11.6k|      else {
 1233|  11.6k|        kmp_info_t *child_thr = other_threads[child_tid];
 1234|  11.6k|        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|  11.6k|#if KMP_BARRIER_ICV_PUSH
 1248|  11.6k|        if (propagate_icvs) // push my fixed ICVs to my child
  ------------------
  |  Branch (1248:13): [True: 11.6k, False: 12]
  ------------------
 1249|  11.6k|          copy_icvs(&child_bar->th_fixed_icvs, &thr_bar->th_fixed_icvs);
 1250|  11.6k|#endif // KMP_BARRIER_ICV_PUSH
 1251|       |
 1252|  11.6k|        KA_TRACE(
 1253|  11.6k|            20,
 1254|  11.6k|            ("__kmp_hyper_barrier_release: T#%d(%d:%d) releasing T#%d(%d:%u)"
 1255|  11.6k|             "go(%p): %u => %u\n",
 1256|  11.6k|             gtid, team->t.t_id, tid, __kmp_gtid_from_tid(child_tid, team),
 1257|  11.6k|             team->t.t_id, child_tid, &child_bar->b_go, child_bar->b_go,
 1258|  11.6k|             child_bar->b_go + KMP_BARRIER_STATE_BUMP));
 1259|       |        // Release child from barrier
 1260|  11.6k|        kmp_flag_64<> flag(&child_bar->b_go, child_thr);
 1261|  11.6k|        flag.release();
 1262|  11.6k|      }
 1263|  12.4k|    }
 1264|  4.18k|  }
 1265|  12.5k|#if KMP_BARRIER_ICV_PUSH
 1266|  12.5k|  if (propagate_icvs &&
  ------------------
  |  Branch (1266:7): [True: 11.9k, False: 549]
  ------------------
 1267|  11.9k|      !KMP_MASTER_TID(tid)) { // copy ICVs locally to final dest
  ------------------
  |  | 1271|  11.9k|#define KMP_MASTER_TID(tid) (0 == (tid))
  ------------------
  |  Branch (1267:7): [True: 11.6k, False: 334]
  ------------------
 1268|  11.6k|    __kmp_init_implicit_task(team->t.t_ident, team->t.t_threads[tid], team, tid,
 1269|  11.6k|                             FALSE);
  ------------------
  |  | 1279|  11.6k|#define FALSE 0
  ------------------
 1270|  11.6k|    copy_icvs(&team->t.t_implicit_task_taskdata[tid].td_icvs,
 1271|  11.6k|              &thr_bar->th_fixed_icvs);
 1272|  11.6k|  }
 1273|  12.5k|#endif
 1274|  12.5k|  KA_TRACE(
 1275|  12.5k|      20,
 1276|  12.5k|      ("__kmp_hyper_barrier_release: T#%d(%d:%d) exit for barrier type %d\n",
 1277|  12.5k|       gtid, team->t.t_id, tid, bt));
 1278|  12.5k|}
kmp_barrier.cpp:_ZL26__kmp_hyper_barrier_gather12barrier_typeP8kmp_infoiiPFvPvS2_E:
 1008|  12.4k|    void (*reduce)(void *, void *) USE_ITT_BUILD_ARG(void *itt_sync_obj)) {
 1009|  12.4k|  KMP_TIME_DEVELOPER_PARTITIONED_BLOCK(KMP_hyper_gather);
  ------------------
  |  | 1008|  12.4k|#define KMP_TIME_DEVELOPER_PARTITIONED_BLOCK(n) ((void)0)
  ------------------
 1010|  12.4k|  kmp_team_t *team = this_thr->th.th_team;
 1011|  12.4k|  kmp_bstate_t *thr_bar = &this_thr->th.th_bar[bt].bb;
 1012|  12.4k|  kmp_info_t **other_threads = team->t.t_threads;
 1013|  12.4k|  kmp_uint64 new_state = KMP_BARRIER_UNUSED_STATE;
  ------------------
  |  | 2024|  12.4k|#define KMP_BARRIER_UNUSED_STATE (1 << KMP_BARRIER_UNUSED_BIT)
  |  |  ------------------
  |  |  |  | 2020|  12.4k|#define KMP_BARRIER_UNUSED_BIT 1 // bit that must never be set for valid state
  |  |  ------------------
  ------------------
 1014|  12.4k|  kmp_uint32 num_threads = this_thr->th.th_team_nproc;
 1015|  12.4k|  kmp_uint32 branch_bits = __kmp_barrier_gather_branch_bits[bt];
 1016|  12.4k|  kmp_uint32 branch_factor = 1 << branch_bits;
 1017|  12.4k|  kmp_uint32 offset;
 1018|  12.4k|  kmp_uint32 level;
 1019|       |
 1020|  12.4k|  KA_TRACE(
 1021|  12.4k|      20,
 1022|  12.4k|      ("__kmp_hyper_barrier_gather: T#%d(%d:%d) enter for barrier type %d\n",
 1023|  12.4k|       gtid, team->t.t_id, tid, bt));
 1024|  12.4k|  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|  12.4k|  kmp_flag_64<> p_flag(&thr_bar->b_arrived);
 1036|  16.7k|  for (level = 0, offset = 1; offset < num_threads;
  ------------------
  |  Branch (1036:31): [True: 16.3k, False: 358]
  ------------------
 1037|  16.3k|       level += branch_bits, offset <<= branch_bits) {
 1038|  16.3k|    kmp_uint32 child;
 1039|  16.3k|    kmp_uint32 child_tid;
 1040|       |
 1041|  16.3k|    if (((tid >> level) & (branch_factor - 1)) != 0) {
  ------------------
  |  Branch (1041:9): [True: 12.1k, False: 4.25k]
  ------------------
 1042|  12.1k|      kmp_int32 parent_tid = tid & ~((1 << (level + branch_bits)) - 1);
 1043|       |
 1044|  12.1k|      KMP_MB(); // Synchronize parent and child threads.
 1045|  12.1k|      KA_TRACE(20,
 1046|  12.1k|               ("__kmp_hyper_barrier_gather: T#%d(%d:%d) releasing T#%d(%d:%d) "
 1047|  12.1k|                "arrived(%p): %llu => %llu\n",
 1048|  12.1k|                gtid, team->t.t_id, tid, __kmp_gtid_from_tid(parent_tid, team),
 1049|  12.1k|                team->t.t_id, parent_tid, &thr_bar->b_arrived,
 1050|  12.1k|                thr_bar->b_arrived,
 1051|  12.1k|                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|  12.1k|      p_flag.set_waiter(other_threads[parent_tid]);
 1057|  12.1k|      p_flag.release();
 1058|  12.1k|      break;
 1059|  12.1k|    }
 1060|       |
 1061|       |    // Parent threads wait for children to arrive
 1062|  4.25k|    if (new_state == KMP_BARRIER_UNUSED_STATE)
  ------------------
  |  | 2024|  4.25k|#define KMP_BARRIER_UNUSED_STATE (1 << KMP_BARRIER_UNUSED_BIT)
  |  |  ------------------
  |  |  |  | 2020|  4.25k|#define KMP_BARRIER_UNUSED_BIT 1 // bit that must never be set for valid state
  |  |  ------------------
  ------------------
  |  Branch (1062:9): [True: 3.12k, False: 1.12k]
  ------------------
 1063|  3.12k|      new_state = team->t.t_bar[bt].b_arrived + KMP_BARRIER_STATE_BUMP;
  ------------------
  |  | 2025|  3.12k|#define KMP_BARRIER_STATE_BUMP (1 << KMP_BARRIER_BUMP_BIT)
  |  |  ------------------
  |  |  |  | 2021|  3.12k|#define KMP_BARRIER_BUMP_BIT 2 /* lsb used for bump of go/arrived state */
  |  |  ------------------
  ------------------
 1064|  4.25k|    for (child = 1, child_tid = tid + (1 << level);
 1065|  16.3k|         child < branch_factor && child_tid < num_threads;
  ------------------
  |  Branch (1065:10): [True: 12.5k, False: 3.86k]
  |  Branch (1065:35): [True: 12.1k, False: 391]
  ------------------
 1066|  12.1k|         child++, child_tid += (1 << level)) {
 1067|  12.1k|      kmp_info_t *child_thr = other_threads[child_tid];
 1068|  12.1k|      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|  12.1k|      KA_TRACE(20,
 1077|  12.1k|               ("__kmp_hyper_barrier_gather: T#%d(%d:%d) wait T#%d(%d:%u) "
 1078|  12.1k|                "arrived(%p) == %llu\n",
 1079|  12.1k|                gtid, team->t.t_id, tid, __kmp_gtid_from_tid(child_tid, team),
 1080|  12.1k|                team->t.t_id, child_tid, &child_bar->b_arrived, new_state));
 1081|       |      // Wait for child to arrive
 1082|  12.1k|      kmp_flag_64<> c_flag(&child_bar->b_arrived, new_state);
 1083|  12.1k|      c_flag.wait(this_thr, FALSE USE_ITT_BUILD_ARG(itt_sync_obj));
  ------------------
  |  | 1279|  12.1k|#define FALSE 0
  ------------------
 1084|  12.1k|      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|  12.1k|      if (reduce) {
  ------------------
  |  Branch (1093:11): [True: 0, False: 12.1k]
  ------------------
 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|  12.1k|    }
 1105|  4.25k|  }
 1106|       |
 1107|  12.4k|  if (KMP_MASTER_TID(tid)) {
  ------------------
  |  | 1271|  12.4k|#define KMP_MASTER_TID(tid) (0 == (tid))
  |  |  ------------------
  |  |  |  Branch (1271:29): [True: 392, False: 12.0k]
  |  |  ------------------
  ------------------
 1108|       |    // Need to update the team arrived pointer if we are the primary thread
 1109|    392|    if (new_state == KMP_BARRIER_UNUSED_STATE)
  ------------------
  |  | 2024|    392|#define KMP_BARRIER_UNUSED_STATE (1 << KMP_BARRIER_UNUSED_BIT)
  |  |  ------------------
  |  |  |  | 2020|    392|#define KMP_BARRIER_UNUSED_BIT 1 // bit that must never be set for valid state
  |  |  ------------------
  ------------------
  |  Branch (1109:9): [True: 0, False: 392]
  ------------------
 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|    392|    else
 1112|    392|      team->t.t_bar[bt].b_arrived = new_state;
 1113|    392|    KA_TRACE(20, ("__kmp_hyper_barrier_gather: T#%d(%d:%d) set team %d "
 1114|    392|                  "arrived(%p) = %llu\n",
 1115|    392|                  gtid, team->t.t_id, tid, team->t.t_id,
 1116|    392|                  &team->t.t_bar[bt].b_arrived, team->t.t_bar[bt].b_arrived));
 1117|    392|  }
 1118|  12.4k|  KA_TRACE(
 1119|  12.4k|      20, ("__kmp_hyper_barrier_gather: T#%d(%d:%d) exit for barrier type %d\n",
 1120|  12.4k|           gtid, team->t.t_id, tid, bt));
 1121|  12.4k|}

__kmpc_global_thread_num:
   99|    392|kmp_int32 __kmpc_global_thread_num(ident_t *loc) {
  100|    392|  kmp_int32 gtid = __kmp_entry_gtid();
  ------------------
  |  | 3467|    392|#define __kmp_entry_gtid() __kmp_get_global_thread_id_reg()
  ------------------
  101|       |
  102|    392|  KC_TRACE(10, ("__kmpc_global_thread_num: T#%d\n", gtid));
  103|       |
  104|    392|  return gtid;
  105|    392|}
__kmpc_push_num_threads:
  232|    392|                             kmp_int32 num_threads) {
  233|    392|  KA_TRACE(20, ("__kmpc_push_num_threads: enter T#%d num_threads=%d\n",
  234|    392|                global_tid, num_threads));
  235|    392|  __kmp_assert_valid_gtid(global_tid);
  236|    392|  __kmp_push_num_threads(loc, global_tid, num_threads);
  237|    392|}
__kmpc_fork_call:
  262|    392|void __kmpc_fork_call(ident_t *loc, kmp_int32 argc, kmpc_micro microtask, ...) {
  263|    392|  int gtid = __kmp_entry_gtid();
  ------------------
  |  | 3467|    392|#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|    392|  {
  284|    392|    va_list ap;
  285|    392|    va_start(ap, microtask);
  286|       |
  287|    392|#if OMPT_SUPPORT
  288|    392|    ompt_frame_t *ompt_frame;
  289|    392|    if (ompt_enabled.enabled) {
  ------------------
  |  Branch (289:9): [True: 0, False: 392]
  ------------------
  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|    392|    OMPT_STORE_RETURN_ADDRESS(gtid);
  ------------------
  |  |   92|    392|  OmptReturnAddressGuard ReturnAddressGuard{gtid, __builtin_return_address(0)};
  ------------------
  295|    392|#endif
  296|       |
  297|       |#if INCLUDE_SSC_MARKS
  298|       |    SSC_MARK_FORKING();
  299|       |#endif
  300|    392|    __kmp_fork_call(loc, gtid, fork_context_intel, argc,
  301|    392|                    VOLATILE_CAST(microtask_t) microtask, // "wrapped" task
  ------------------
  |  | 1180|    392|#define VOLATILE_CAST(x) (x)
  ------------------
  302|    392|                    VOLATILE_CAST(launch_t) __kmp_invoke_task_func,
  ------------------
  |  | 1180|    392|#define VOLATILE_CAST(x) (x)
  ------------------
  303|    392|                    kmp_va_addr_of(ap));
  ------------------
  |  |  220|    392|#define kmp_va_addr_of(ap) (&(ap))
  ------------------
  304|       |#if INCLUDE_SSC_MARKS
  305|       |    SSC_MARK_JOINING();
  306|       |#endif
  307|    392|    __kmp_join_call(loc, gtid
  308|    392|#if OMPT_SUPPORT
  309|    392|                    ,
  310|    392|                    fork_context_intel
  311|    392|#endif
  312|    392|    );
  313|       |
  314|    392|    va_end(ap);
  315|       |
  316|    392|#if OMPT_SUPPORT
  317|    392|    if (ompt_enabled.enabled) {
  ------------------
  |  Branch (317:9): [True: 0, False: 392]
  ------------------
  318|      0|      ompt_frame->enter_frame = ompt_data_none;
  ------------------
  |  | 1408|      0|#define ompt_data_none {0}
  ------------------
  319|      0|    }
  320|    392|#endif
  321|    392|  }
  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|    392|}
__kmpc_for_static_fini:
 1910|  12.4k|void __kmpc_for_static_fini(ident_t *loc, kmp_int32 global_tid) {
 1911|  12.4k|  KMP_POP_PARTITIONED_TIMER();
  ------------------
  |  | 1015|  12.4k|#define KMP_POP_PARTITIONED_TIMER() ((void)0)
  ------------------
 1912|  12.4k|  KE_TRACE(10, ("__kmpc_for_static_fini called T#%d\n", global_tid));
 1913|       |
 1914|  12.4k|#if OMPT_SUPPORT && OMPT_OPTIONAL
 1915|  12.4k|  if (ompt_enabled.ompt_callback_work) {
  ------------------
  |  Branch (1915:7): [True: 0, False: 12.4k]
  ------------------
 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|  12.4k|#endif
 1938|  12.4k|  if (__kmp_env_consistency_check)
  ------------------
  |  Branch (1938:7): [True: 0, False: 12.4k]
  ------------------
 1939|      0|    __kmp_pop_workshare(global_tid, ct_pdo, loc);
 1940|  12.4k|}
__kmpc_init_lock:
 2419|  1.32k|void __kmpc_init_lock(ident_t *loc, kmp_int32 gtid, void **user_lock) {
 2420|  1.32k|#if KMP_USE_DYNAMIC_LOCK
 2421|       |
 2422|  1.32k|  KMP_DEBUG_ASSERT(__kmp_init_serial);
 2423|  1.32k|  if (__kmp_env_consistency_check && user_lock == NULL) {
  ------------------
  |  Branch (2423:7): [True: 0, False: 1.32k]
  |  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|  1.32k|  __kmp_init_lock_with_hint(loc, user_lock, __kmp_user_lock_seq);
 2427|       |
 2428|  1.32k|#if OMPT_SUPPORT && OMPT_OPTIONAL
 2429|       |  // This is the case, if called from omp_init_lock_with_hint:
 2430|  1.32k|  void *codeptr = OMPT_LOAD_RETURN_ADDRESS(gtid);
  ------------------
  |  |   93|  1.32k|#define OMPT_LOAD_RETURN_ADDRESS(gtid) __ompt_load_return_address(gtid)
  ------------------
 2431|  1.32k|  if (!codeptr)
  ------------------
  |  Branch (2431:7): [True: 1.32k, False: 0]
  ------------------
 2432|  1.32k|    codeptr = OMPT_GET_RETURN_ADDRESS(0);
  ------------------
  |  |  108|  1.32k|#define OMPT_GET_RETURN_ADDRESS(level) __builtin_return_address(level)
  ------------------
 2433|  1.32k|  if (ompt_enabled.ompt_callback_lock_init) {
  ------------------
  |  Branch (2433:7): [True: 0, False: 1.32k]
  ------------------
 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|  1.32k|#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|  1.32k|} // __kmpc_init_lock
__kmpc_destroy_lock:
 2565|  1.32k|void __kmpc_destroy_lock(ident_t *loc, kmp_int32 gtid, void **user_lock) {
 2566|  1.32k|#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|  1.32k|#if OMPT_SUPPORT && OMPT_OPTIONAL
 2578|       |  // This is the case, if called from omp_init_lock_with_hint:
 2579|  1.32k|  void *codeptr = OMPT_LOAD_RETURN_ADDRESS(gtid);
  ------------------
  |  |   93|  1.32k|#define OMPT_LOAD_RETURN_ADDRESS(gtid) __ompt_load_return_address(gtid)
  ------------------
 2580|  1.32k|  if (!codeptr)
  ------------------
  |  Branch (2580:7): [True: 1.32k, False: 0]
  ------------------
 2581|  1.32k|    codeptr = OMPT_GET_RETURN_ADDRESS(0);
  ------------------
  |  |  108|  1.32k|#define OMPT_GET_RETURN_ADDRESS(level) __builtin_return_address(level)
  ------------------
 2582|  1.32k|  if (ompt_enabled.ompt_callback_lock_destroy) {
  ------------------
  |  Branch (2582:7): [True: 0, False: 1.32k]
  ------------------
 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|  1.32k|#endif
 2587|  1.32k|  KMP_D_LOCK_FUNC(user_lock, destroy)((kmp_dyna_lock_t *)user_lock);
  ------------------
  |  | 1149|  1.32k|#define KMP_D_LOCK_FUNC(l, op) __kmp_direct_##op[KMP_EXTRACT_D_TAG(l)]
  |  |  ------------------
  |  |  |  | 1141|  1.32k|  (*((kmp_dyna_lock_t *)(l)) & ((1 << KMP_LOCK_SHIFT) - 1) &                   \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1076|  1.32k|  8 // number of low bits to be used as tag for direct locks
  |  |  |  |  ------------------
  |  |  |  | 1142|  1.32k|   -(*((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|  1.32k|} // __kmpc_destroy_lock
kmp_csupport.cpp:_ZL25__kmp_init_lock_with_hintP5identPPv18kmp_dyna_lockseq_t:
 2315|  1.32k|                                                    kmp_dyna_lockseq_t seq) {
 2316|  1.32k|  if (KMP_IS_D_LOCK(seq)) {
  ------------------
  |  | 1104|  1.32k|  ((seq) >= KMP_FIRST_D_LOCK && (seq) <= KMP_LAST_D_LOCK)
  |  |  ------------------
  |  |  |  | 1077|  2.65k|#define KMP_FIRST_D_LOCK lockseq_tas
  |  |  ------------------
  |  |                 ((seq) >= KMP_FIRST_D_LOCK && (seq) <= KMP_LAST_D_LOCK)
  |  |  ------------------
  |  |  |  | 1057|  1.32k|#define KMP_LAST_D_LOCK lockseq_rtm_spin
  |  |  ------------------
  |  |  |  Branch (1104:4): [True: 1.32k, False: 0]
  |  |  |  Branch (1104:33): [True: 0, False: 1.32k]
  |  |  ------------------
  ------------------
 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|  1.32k|  } else {
 2322|  1.32k|    KMP_INIT_I_LOCK(lock, seq);
  ------------------
  |  | 1162|  1.32k|  __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|  1.32k|  }
 2328|  1.32k|}

__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|    392|int FTN_STDCALL KMP_EXPAND_NAME(FTN_GET_MAX_THREADS)(void) {
  358|       |#ifdef KMP_STUB
  359|       |  return 1;
  360|       |#else
  361|    392|  int gtid;
  362|    392|  kmp_info_t *thread;
  363|    392|  if (!TCR_4(__kmp_init_middle)) {
  ------------------
  |  | 1127|    392|#define TCR_4(a) (a)
  ------------------
  |  Branch (363:7): [True: 1, False: 391]
  ------------------
  364|      1|    __kmp_middle_initialize();
  365|      1|  }
  366|    392|  gtid = __kmp_entry_gtid();
  ------------------
  |  | 3467|    392|#define __kmp_entry_gtid() __kmp_get_global_thread_id_reg()
  ------------------
  367|    392|  thread = __kmp_threads[gtid];
  368|    392|#if KMP_AFFINITY_SUPPORTED
  369|    392|  if (thread->th.th_team->t.t_level == 0 && !__kmp_affinity.flags.reset) {
  ------------------
  |  Branch (369:7): [True: 392, False: 0]
  |  Branch (369:45): [True: 392, False: 0]
  ------------------
  370|    392|    __kmp_assign_root_init_mask();
  371|    392|  }
  372|    392|#endif
  373|       |  // return thread -> th.th_team -> t.t_current_task[
  374|       |  // thread->th.th_info.ds.ds_tid ] -> icvs.nproc;
  375|    392|  return thread->th.th_current_task->td_icvs.nproc;
  376|    392|#endif
  377|    392|}
omp_init_lock:
 1136|  1.32k|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|  1.32k|  int gtid = __kmp_entry_gtid();
  ------------------
  |  | 3467|  1.32k|#define __kmp_entry_gtid() __kmp_get_global_thread_id_reg()
  ------------------
 1141|  1.32k|#if OMPT_SUPPORT && OMPT_OPTIONAL
 1142|  1.32k|  OMPT_STORE_RETURN_ADDRESS(gtid);
  ------------------
  |  |   92|  1.32k|  OmptReturnAddressGuard ReturnAddressGuard{gtid, __builtin_return_address(0)};
  ------------------
 1143|  1.32k|#endif
 1144|       |  __kmpc_init_lock(NULL, gtid, user_lock);
 1145|  1.32k|#endif
 1146|  1.32k|}
omp_destroy_lock:
 1161|  1.32k|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|  1.32k|  int gtid = __kmp_entry_gtid();
  ------------------
  |  | 3467|  1.32k|#define __kmp_entry_gtid() __kmp_get_global_thread_id_reg()
  ------------------
 1166|  1.32k|#if OMPT_SUPPORT && OMPT_OPTIONAL
 1167|  1.32k|  OMPT_STORE_RETURN_ADDRESS(gtid);
  ------------------
  |  |   92|  1.32k|  OmptReturnAddressGuard ReturnAddressGuard{gtid, __builtin_return_address(0)};
  ------------------
 1168|  1.32k|#endif
 1169|       |  __kmpc_destroy_lock(NULL, gtid, user_lock);
 1170|  1.32k|#endif
 1171|  1.32k|}

__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|  3.44k|int __kmp_acquire_ticket_lock(kmp_ticket_lock_t *lck, kmp_int32 gtid) {
  645|  3.44k|  int retval = __kmp_acquire_ticket_lock_timed_template(lck, gtid);
  646|  3.44k|  return retval;
  647|  3.44k|}
__kmp_release_ticket_lock:
  714|  3.44k|int __kmp_release_ticket_lock(kmp_ticket_lock_t *lck, kmp_int32 gtid) {
  715|  3.44k|  kmp_uint32 distance = std::atomic_load_explicit(&lck->lk.next_ticket,
  716|  3.44k|                                                  std::memory_order_relaxed) -
  717|  3.44k|                        std::atomic_load_explicit(&lck->lk.now_serving,
  718|  3.44k|                                                  std::memory_order_relaxed);
  719|       |
  720|  3.44k|  std::atomic_fetch_add_explicit(&lck->lk.now_serving, 1U,
  721|  3.44k|                                 std::memory_order_release);
  722|       |
  723|  3.44k|  KMP_YIELD(distance >
  ------------------
  |  | 1529|  3.44k|  {                                                                            \
  |  | 1530|  3.44k|    KMP_CPU_PAUSE();                                                           \
  |  |  ------------------
  |  |  |  | 1498|  3.44k|#define KMP_CPU_PAUSE() __kmp_x86_pause()
  |  |  ------------------
  |  | 1531|  6.89k|    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: 3.44k]
  |  |  |  Branch (1531:10): [True: 2.51k, False: 933]
  |  |  ------------------
  |  | 1532|  3.44k|      __kmp_yield();                                                           \
  |  | 1533|  3.44k|  }
  ------------------
  724|  3.44k|            (kmp_uint32)(__kmp_avail_proc ? __kmp_avail_proc : __kmp_xproc));
  725|  3.44k|  return KMP_LOCK_RELEASED;
  ------------------
  |  |  156|  3.44k|#define KMP_LOCK_RELEASED 1
  ------------------
  726|  3.44k|}
__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_init_queuing_lock:
 1516|  1.34k|void __kmp_init_queuing_lock(kmp_queuing_lock_t *lck) {
 1517|  1.34k|  lck->lk.location = NULL;
 1518|  1.34k|  lck->lk.head_id = 0;
 1519|  1.34k|  lck->lk.tail_id = 0;
 1520|  1.34k|  lck->lk.next_ticket = 0;
 1521|  1.34k|  lck->lk.now_serving = 0;
 1522|  1.34k|  lck->lk.owner_id = 0; // no thread owns the lock.
 1523|  1.34k|  lck->lk.depth_locked = -1; // >= 0 for nestable locks, -1 for simple locks.
 1524|  1.34k|  lck->lk.initialized = lck;
 1525|       |
 1526|  1.34k|  KA_TRACE(1000, ("__kmp_init_queuing_lock: lock %p initialized\n", lck));
 1527|  1.34k|}
__kmp_destroy_queuing_lock:
 1529|  1.32k|void __kmp_destroy_queuing_lock(kmp_queuing_lock_t *lck) {
 1530|  1.32k|  lck->lk.initialized = NULL;
 1531|       |  lck->lk.location = NULL;
 1532|  1.32k|  lck->lk.head_id = 0;
 1533|  1.32k|  lck->lk.tail_id = 0;
 1534|  1.32k|  lck->lk.next_ticket = 0;
 1535|  1.32k|  lck->lk.now_serving = 0;
 1536|  1.32k|  lck->lk.owner_id = 0;
 1537|  1.32k|  lck->lk.depth_locked = -1;
 1538|  1.32k|}
__kmp_allocate_indirect_lock:
 3122|  1.32k|                                                  kmp_indirect_locktag_t tag) {
 3123|  1.32k|  kmp_indirect_lock_t *lck;
 3124|  1.32k|  kmp_lock_index_t idx, table_idx;
 3125|       |
 3126|  1.32k|  __kmp_acquire_lock(&__kmp_global_lock, gtid);
 3127|       |
 3128|  1.32k|  if (__kmp_indirect_lock_pool[tag] != NULL) {
  ------------------
  |  Branch (3128:7): [True: 1.32k, False: 2]
  ------------------
 3129|       |    // Reuse the allocated and destroyed lock object
 3130|  1.32k|    lck = __kmp_indirect_lock_pool[tag];
 3131|  1.32k|    if (OMP_LOCK_T_SIZE < sizeof(void *))
  ------------------
  |  |   54|  1.32k|#define OMP_LOCK_T_SIZE sizeof(int)
  ------------------
  |  Branch (3131:9): [True: 1.32k, Folded]
  ------------------
 3132|  1.32k|      idx = lck->lock->pool.index;
 3133|  1.32k|    __kmp_indirect_lock_pool[tag] = (kmp_indirect_lock_t *)lck->lock->pool.next;
 3134|  1.32k|    KA_TRACE(20, ("__kmp_allocate_indirect_lock: reusing an existing lock %p\n",
 3135|  1.32k|                  lck));
 3136|  1.32k|  } else {
 3137|      2|    kmp_uint32 row, col;
 3138|      2|    kmp_indirect_lock_table_t *lock_table = &__kmp_i_lock_table;
 3139|      2|    idx = 0;
 3140|       |    // Find location in list of lock tables to put new lock
 3141|      2|    while (1) {
  ------------------
  |  Branch (3141:12): [True: 2, Folded]
  ------------------
 3142|      2|      table_idx = lock_table->next; // index within this table
 3143|      2|      idx += lock_table->next; // global index within list of tables
 3144|      2|      if (table_idx < lock_table->nrow_ptrs * KMP_I_LOCK_CHUNK) {
  ------------------
  |  | 1222|      2|#define KMP_I_LOCK_CHUNK 1024
  ------------------
  |  Branch (3144:11): [True: 2, False: 0]
  ------------------
 3145|      2|        row = table_idx / KMP_I_LOCK_CHUNK;
  ------------------
  |  | 1222|      2|#define KMP_I_LOCK_CHUNK 1024
  ------------------
 3146|      2|        col = table_idx % KMP_I_LOCK_CHUNK;
  ------------------
  |  | 1222|      2|#define KMP_I_LOCK_CHUNK 1024
  ------------------
 3147|       |        // Allocate a new row of locks if necessary
 3148|      2|        if (!lock_table->table[row]) {
  ------------------
  |  Branch (3148:13): [True: 0, False: 2]
  ------------------
 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|      2|        break;
 3153|      2|      }
 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|      2|    lock_table->next++;
 3170|       |
 3171|      2|    lck = &lock_table->table[row][col];
 3172|       |    // Allocate a new base lock object
 3173|      2|    lck->lock = (kmp_user_lock_p)__kmp_allocate(__kmp_indirect_lock_size[tag]);
  ------------------
  |  | 3617|      2|#define __kmp_allocate(size) ___kmp_allocate((size)KMP_SRC_LOC_CURR)
  ------------------
 3174|      2|    KA_TRACE(20,
 3175|      2|             ("__kmp_allocate_indirect_lock: allocated a new lock %p\n", lck));
 3176|      2|  }
 3177|       |
 3178|  1.32k|  __kmp_release_lock(&__kmp_global_lock, gtid);
 3179|       |
 3180|  1.32k|  lck->type = tag;
 3181|       |
 3182|  1.32k|  if (OMP_LOCK_T_SIZE < sizeof(void *)) {
  ------------------
  |  |   54|  1.32k|#define OMP_LOCK_T_SIZE sizeof(int)
  ------------------
  |  Branch (3182:7): [True: 1.32k, Folded]
  ------------------
 3183|  1.32k|    *((kmp_lock_index_t *)user_lock) = idx
 3184|  1.32k|                                       << 1; // indirect lock word must be even
 3185|  1.32k|  } else {
 3186|      0|    *((kmp_indirect_lock_t **)user_lock) = lck;
 3187|      0|  }
 3188|       |
 3189|  1.32k|  return lck;
 3190|  1.32k|}
__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|     12|    while (l != NULL) {
  ------------------
  |  Branch (3432:12): [True: 2, False: 10]
  ------------------
 3433|      2|      kmp_indirect_lock_t *ll = l;
 3434|      2|      l = (kmp_indirect_lock_t *)l->lock->pool.next;
 3435|      2|      KA_TRACE(20, ("__kmp_cleanup_indirect_user_locks: freeing %p from pool\n",
 3436|      2|                    ll));
 3437|      2|      __kmp_free(ll->lock);
  ------------------
  |  | 3619|      2|#define __kmp_free(ptr) ___kmp_free((ptr)KMP_SRC_LOC_CURR)
  ------------------
 3438|      2|      ll->lock = NULL;
 3439|      2|    }
 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|  3.44k|                                         kmp_int32 gtid) {
  626|  3.44k|  kmp_uint32 my_ticket = std::atomic_fetch_add_explicit(
  627|  3.44k|      &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|  3.44k|  if (std::atomic_load_explicit(&lck->lk.now_serving,
  ------------------
  |  Branch (636:7): [True: 3.44k, False: 0]
  ------------------
  637|  3.44k|                                std::memory_order_acquire) == my_ticket) {
  638|  3.44k|    return KMP_LOCK_ACQUIRED_FIRST;
  ------------------
  |  |  158|  3.44k|#define KMP_LOCK_ACQUIRED_FIRST 1
  ------------------
  639|  3.44k|  }
  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|  3.44k|}
kmp_lock.cpp:_ZL23__kmp_init_queuing_lockP13kmp_user_lock:
 2953|  1.32k|  static void __kmp_##op##_##lk##_##lock(kmp_user_lock_p lock) {               \
 2954|  1.32k|    __kmp_##op##_##lk##_##lock(&lock->lk);                                     \
 2955|  1.32k|  }
kmp_lock.cpp:_ZL24__kmp_init_indirect_lockPj18kmp_dyna_lockseq_t:
 3220|  1.32k|                                     kmp_dyna_lockseq_t seq) {
 3221|  1.32k|#if KMP_USE_ADAPTIVE_LOCKS
 3222|  1.32k|  if (seq == lockseq_adaptive && !__kmp_cpuinfo.flags.rtm) {
  ------------------
  |  Branch (3222:7): [True: 0, False: 1.32k]
  |  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|  1.32k|#endif
 3227|  1.32k|#if KMP_USE_TSX
 3228|  1.32k|  if (seq == lockseq_rtm_queuing && !__kmp_cpuinfo.flags.rtm) {
  ------------------
  |  Branch (3228:7): [True: 0, False: 1.32k]
  |  Branch (3228:37): [True: 0, False: 0]
  ------------------
 3229|      0|    seq = lockseq_queuing;
 3230|      0|  }
 3231|  1.32k|#endif
 3232|  1.32k|  kmp_indirect_locktag_t tag = KMP_GET_I_TAG(seq);
  ------------------
  |  | 1107|  1.32k|#define KMP_GET_I_TAG(seq) (kmp_indirect_locktag_t)((seq)-KMP_FIRST_I_LOCK)
  |  |  ------------------
  |  |  |  | 1078|  1.32k|#define KMP_FIRST_I_LOCK lockseq_ticket
  |  |  ------------------
  ------------------
 3233|  1.32k|  kmp_indirect_lock_t *l =
 3234|  1.32k|      __kmp_allocate_indirect_lock((void **)lock, __kmp_entry_gtid(), tag);
  ------------------
  |  | 3467|  1.32k|#define __kmp_entry_gtid() __kmp_get_global_thread_id_reg()
  ------------------
 3235|  1.32k|  KMP_I_LOCK_FUNC(l, init)(l->lock);
  ------------------
  |  | 1154|  1.32k|  __kmp_indirect_##op[((kmp_indirect_lock_t *)(l))->type]
  ------------------
 3236|  1.32k|  KA_TRACE(
 3237|  1.32k|      20, ("__kmp_init_indirect_lock: initialized indirect lock with type#%d\n",
 3238|  1.32k|           seq));
 3239|  1.32k|}
kmp_lock.cpp:_ZL26__kmp_lookup_indirect_lockPPvPKc:
 3194|  1.32k|__kmp_lookup_indirect_lock(void **user_lock, const char *func) {
 3195|  1.32k|  if (__kmp_env_consistency_check) {
  ------------------
  |  Branch (3195:7): [True: 0, False: 1.32k]
  ------------------
 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|  1.32k|  } else {
 3211|  1.32k|    if (OMP_LOCK_T_SIZE < sizeof(void *)) {
  ------------------
  |  |   54|  1.32k|#define OMP_LOCK_T_SIZE sizeof(int)
  ------------------
  |  Branch (3211:9): [True: 1.32k, Folded]
  ------------------
 3212|  1.32k|      return __kmp_get_i_lock(KMP_EXTRACT_I_INDEX(user_lock));
  ------------------
  |  | 1145|  1.32k|#define KMP_EXTRACT_I_INDEX(l) (*(kmp_lock_index_t *)(l) >> 1)
  ------------------
 3213|  1.32k|    } else {
 3214|      0|      return *((kmp_indirect_lock_t **)user_lock);
 3215|      0|    }
 3216|  1.32k|  }
 3217|  1.32k|}
kmp_lock.cpp:_ZL27__kmp_destroy_indirect_lockPj:
 3241|  1.32k|static void __kmp_destroy_indirect_lock(kmp_dyna_lock_t *lock) {
 3242|  1.32k|  kmp_uint32 gtid = __kmp_entry_gtid();
  ------------------
  |  | 3467|  1.32k|#define __kmp_entry_gtid() __kmp_get_global_thread_id_reg()
  ------------------
 3243|  1.32k|  kmp_indirect_lock_t *l =
 3244|  1.32k|      __kmp_lookup_indirect_lock((void **)lock, "omp_destroy_lock");
 3245|  1.32k|  KMP_I_LOCK_FUNC(l, destroy)(l->lock);
  ------------------
  |  | 1154|  1.32k|  __kmp_indirect_##op[((kmp_indirect_lock_t *)(l))->type]
  ------------------
 3246|  1.32k|  kmp_indirect_locktag_t tag = l->type;
 3247|       |
 3248|  1.32k|  __kmp_acquire_lock(&__kmp_global_lock, gtid);
 3249|       |
 3250|       |  // Use the base lock's space to keep the pool chain.
 3251|  1.32k|  l->lock->pool.next = (kmp_user_lock_p)__kmp_indirect_lock_pool[tag];
 3252|  1.32k|  if (OMP_LOCK_T_SIZE < sizeof(void *)) {
  ------------------
  |  |   54|  1.32k|#define OMP_LOCK_T_SIZE sizeof(int)
  ------------------
  |  Branch (3252:7): [True: 1.32k, Folded]
  ------------------
 3253|  1.32k|    l->lock->pool.index = KMP_EXTRACT_I_INDEX(lock);
  ------------------
  |  | 1145|  1.32k|#define KMP_EXTRACT_I_INDEX(l) (*(kmp_lock_index_t *)(l) >> 1)
  ------------------
 3254|  1.32k|  }
 3255|  1.32k|  __kmp_indirect_lock_pool[tag] = l;
 3256|       |
 3257|  1.32k|  __kmp_release_lock(&__kmp_global_lock, gtid);
 3258|  1.32k|}
kmp_lock.cpp:_ZL26__kmp_destroy_queuing_lockP13kmp_user_lock:
 2953|  1.32k|  static void __kmp_##op##_##lk##_##lock(kmp_user_lock_p lock) {               \
 2954|  1.32k|    __kmp_##op##_##lk##_##lock(&lock->lk);                                     \
 2955|  1.32k|  }

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|    791|static inline int __kmp_acquire_bootstrap_lock(kmp_bootstrap_lock_t *lck) {
  520|    791|  return __kmp_acquire_ticket_lock(lck, KMP_GTID_DNE);
  ------------------
  |  |   34|    791|#define KMP_GTID_DNE (-2)
  ------------------
  521|    791|}
kmp_runtime.cpp:_ZL28__kmp_release_bootstrap_lockP15kmp_ticket_lock:
  527|    791|static inline void __kmp_release_bootstrap_lock(kmp_bootstrap_lock_t *lck) {
  528|    791|  __kmp_release_ticket_lock(lck, KMP_GTID_DNE);
  ------------------
  |  |   34|    791|#define KMP_GTID_DNE (-2)
  ------------------
  529|    791|}
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|  2.65k|static inline int __kmp_acquire_lock(kmp_lock_t *lck, kmp_int32 gtid) {
  552|  2.65k|  return __kmp_acquire_ticket_lock(lck, gtid);
  553|  2.65k|}
kmp_lock.cpp:_ZL18__kmp_release_lockP15kmp_ticket_locki:
  559|  2.65k|static inline void __kmp_release_lock(kmp_lock_t *lck, kmp_int32 gtid) {
  560|  2.65k|  __kmp_release_ticket_lock(lck, gtid);
  561|  2.65k|}
kmp_lock.cpp:_ZL16__kmp_get_i_lockj:
 1240|  1.32k|static inline kmp_indirect_lock_t *__kmp_get_i_lock(kmp_lock_index_t idx) {
 1241|  1.32k|  kmp_indirect_lock_table_t *lock_table = &__kmp_i_lock_table;
 1242|  1.32k|  while (lock_table) {
  ------------------
  |  Branch (1242:10): [True: 1.32k, False: 0]
  ------------------
 1243|  1.32k|    kmp_lock_index_t max_locks = lock_table->nrow_ptrs * KMP_I_LOCK_CHUNK;
  ------------------
  |  | 1222|  1.32k|#define KMP_I_LOCK_CHUNK 1024
  ------------------
 1244|  1.32k|    if (idx < max_locks) {
  ------------------
  |  Branch (1244:9): [True: 1.32k, False: 0]
  ------------------
 1245|  1.32k|      kmp_lock_index_t row = idx / KMP_I_LOCK_CHUNK;
  ------------------
  |  | 1222|  1.32k|#define KMP_I_LOCK_CHUNK 1024
  ------------------
 1246|  1.32k|      kmp_lock_index_t col = idx % KMP_I_LOCK_CHUNK;
  ------------------
  |  | 1222|  1.32k|#define KMP_I_LOCK_CHUNK 1024
  ------------------
 1247|  1.32k|      if (!lock_table->table[row] || idx >= lock_table->next)
  ------------------
  |  Branch (1247:11): [True: 0, False: 1.32k]
  |  Branch (1247:38): [True: 0, False: 1.32k]
  ------------------
 1248|      0|        break;
 1249|  1.32k|      return &lock_table->table[row][col];
 1250|  1.32k|    }
 1251|      0|    idx -= max_locks;
 1252|      0|    lock_table = lock_table->next_table;
 1253|      0|  }
 1254|      0|  return nullptr;
 1255|  1.32k|}

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

__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|  7.26k|int __kmp_get_global_thread_id_reg() {
  228|  7.26k|  int gtid;
  229|       |
  230|  7.26k|  if (!__kmp_init_serial) {
  ------------------
  |  Branch (230:7): [True: 1, False: 7.26k]
  ------------------
  231|      1|    gtid = KMP_GTID_DNE;
  ------------------
  |  | 1000|      1|#define KMP_GTID_DNE (-2) /* Does not exist */
  ------------------
  232|      1|  } else
  233|  7.26k|#ifdef KMP_TDATA_GTID
  234|  7.26k|      if (TCR_4(__kmp_gtid_mode) >= 3) {
  ------------------
  |  | 1127|  7.26k|#define TCR_4(a) (a)
  ------------------
  |  Branch (234:11): [True: 7.26k, False: 0]
  ------------------
  235|  7.26k|    KA_TRACE(1000, ("*** __kmp_get_global_thread_id_reg: using TDATA\n"));
  236|  7.26k|    gtid = __kmp_gtid;
  237|  7.26k|  } else
  238|      0|#endif
  239|      0|      if (TCR_4(__kmp_gtid_mode) >= 2) {
  ------------------
  |  | 1127|      0|#define TCR_4(a) (a)
  ------------------
  |  Branch (239:11): [True: 0, False: 0]
  ------------------
  240|      0|    KA_TRACE(1000, ("*** __kmp_get_global_thread_id_reg: using keyed TLS\n"));
  241|      0|    gtid = __kmp_gtid_get_specific();
  242|      0|  } else {
  243|      0|    KA_TRACE(1000,
  244|      0|             ("*** __kmp_get_global_thread_id_reg: using internal alg.\n"));
  245|      0|    gtid = __kmp_get_global_thread_id();
  246|      0|  }
  247|       |
  248|       |  /* we must be a new uber master sibling thread */
  249|  7.26k|  if (gtid == KMP_GTID_DNE) {
  ------------------
  |  | 1000|  7.26k|#define KMP_GTID_DNE (-2) /* Does not exist */
  ------------------
  |  Branch (249:7): [True: 1, False: 7.26k]
  ------------------
  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|  7.26k|  KMP_DEBUG_ASSERT(gtid >= 0);
  265|       |
  266|  7.26k|  return gtid;
  267|  7.26k|}
__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_fork_call:
 1863|    392|                    kmp_va_list ap) {
 1864|    392|  void **argv;
 1865|    392|  int i;
 1866|    392|  int master_tid;
 1867|    392|  int master_this_cons;
 1868|    392|  kmp_team_t *team;
 1869|    392|  kmp_team_t *parent_team;
 1870|    392|  kmp_info_t *master_th;
 1871|    392|  kmp_root_t *root;
 1872|    392|  int nthreads;
 1873|    392|  int master_active;
 1874|    392|  int master_set_numthreads;
 1875|    392|  int level;
 1876|    392|  int active_level;
 1877|    392|  int teams_level;
 1878|    392|#if KMP_NESTED_HOT_TEAMS
 1879|    392|  kmp_hot_team_ptr_t **p_hot_teams;
 1880|    392|#endif
 1881|    392|  { // KMP_TIME_BLOCK
 1882|    392|    KMP_TIME_DEVELOPER_PARTITIONED_BLOCK(KMP_fork_call);
  ------------------
  |  | 1008|    392|#define KMP_TIME_DEVELOPER_PARTITIONED_BLOCK(n) ((void)0)
  ------------------
 1883|    392|    KMP_COUNT_VALUE(OMP_PARALLEL_args, argc);
  ------------------
  |  | 1000|    392|#define KMP_COUNT_VALUE(n, v) ((void)0)
  ------------------
 1884|       |
 1885|    392|    KA_TRACE(20, ("__kmp_fork_call: enter T#%d\n", gtid));
 1886|    392|    if (__kmp_stkpadding > 0 && __kmp_root[gtid] != NULL) {
  ------------------
  |  Branch (1886:9): [True: 0, False: 392]
  |  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|    392|    KMP_DEBUG_ASSERT(
 1897|    392|        __kmp_init_serial); // AC: potentially unsafe, not in sync with shutdown
 1898|    392|    if (!TCR_4(__kmp_init_parallel))
  ------------------
  |  | 1127|    392|#define TCR_4(a) (a)
  ------------------
  |  Branch (1898:9): [True: 1, False: 391]
  ------------------
 1899|      1|      __kmp_parallel_initialize();
 1900|    392|    __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|    392|    master_th = __kmp_threads[gtid];
 1906|       |
 1907|    392|    parent_team = master_th->th.th_team;
 1908|    392|    master_tid = master_th->th.th_info.ds.ds_tid;
 1909|    392|    master_this_cons = master_th->th.th_local.this_construct;
 1910|    392|    root = master_th->th.th_root;
 1911|    392|    master_active = root->r.r_active;
 1912|    392|    master_set_numthreads = master_th->th.th_set_nproc;
 1913|       |
 1914|    392|#if OMPT_SUPPORT
 1915|    392|    ompt_data_t ompt_parallel_data = ompt_data_none;
  ------------------
  |  | 1408|    392|#define ompt_data_none {0}
  ------------------
 1916|    392|    ompt_data_t *parent_task_data;
 1917|    392|    ompt_frame_t *ompt_frame;
 1918|    392|    void *return_address = NULL;
 1919|       |
 1920|    392|    if (ompt_enabled.enabled) {
  ------------------
  |  Branch (1920:9): [True: 0, False: 392]
  ------------------
 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|    392|#endif
 1926|       |
 1927|       |    // Assign affinity to root thread if it hasn't happened yet
 1928|    392|    __kmp_assign_root_init_mask();
 1929|       |
 1930|       |    // Nested level will be an index in the nested nthreads array
 1931|    392|    level = parent_team->t.t_level;
 1932|       |    // used to launch non-serial teams even if nested is not allowed
 1933|    392|    active_level = parent_team->t.t_active_level;
 1934|       |    // needed to check nesting inside the teams
 1935|    392|    teams_level = master_th->th.th_teams_level;
 1936|    392|#if KMP_NESTED_HOT_TEAMS
 1937|    392|    p_hot_teams = &master_th->th.th_hot_teams;
 1938|    392|    if (*p_hot_teams == NULL && __kmp_hot_teams_max_level > 0) {
  ------------------
  |  Branch (1938:9): [True: 1, False: 391]
  |  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|    392|#endif
 1946|       |
 1947|    392|#if OMPT_SUPPORT
 1948|    392|    if (ompt_enabled.enabled) {
  ------------------
  |  Branch (1948:9): [True: 0, False: 392]
  ------------------
 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|    392|#endif
 1964|       |
 1965|    392|    master_th->th.th_ident = loc;
 1966|       |
 1967|       |    // Parallel closely nested in teams construct:
 1968|    392|    if (__kmp_is_fork_in_teams(master_th, microtask, level, teams_level, ap)) {
  ------------------
  |  Branch (1968:9): [True: 0, False: 392]
  ------------------
 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|    392|    int enter_teams =
 1991|    392|        __kmp_is_entering_teams(active_level, level, teams_level, ap);
 1992|    392|    if ((!enter_teams &&
  ------------------
  |  Branch (1992:10): [True: 392, False: 0]
  ------------------
 1993|    392|         (parent_team->t.t_active_level >=
  ------------------
  |  Branch (1993:10): [True: 0, False: 392]
  ------------------
 1994|    392|          master_th->th.th_current_task->td_icvs.max_active_levels)) ||
 1995|    392|        (__kmp_library == library_serial)) {
  ------------------
  |  Branch (1995:9): [True: 0, False: 392]
  ------------------
 1996|      0|      KC_TRACE(10, ("__kmp_fork_call: T#%d serializing team\n", gtid));
 1997|      0|      nthreads = 1;
 1998|    392|    } else {
 1999|    392|      nthreads = master_set_numthreads
  ------------------
  |  Branch (1999:18): [True: 392, False: 0]
  ------------------
 2000|    392|                     ? master_set_numthreads
 2001|       |                     // TODO: get nproc directly from current task
 2002|    392|                     : get__nproc_2(parent_team, master_tid);
  ------------------
  |  | 2298|    392|  ((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|    392|      if (nthreads > 1) {
  ------------------
  |  Branch (2005:11): [True: 392, False: 0]
  ------------------
 2006|       |        /* determine how many new threads we can use */
 2007|    392|        __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|    392|        nthreads = __kmp_reserve_threads(root, parent_team, master_tid,
 2013|    392|                                         nthreads, enter_teams);
 2014|    392|        if (nthreads == 1) {
  ------------------
  |  Branch (2014:13): [True: 0, False: 392]
  ------------------
 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|    392|      }
 2021|    392|    }
 2022|    392|    KMP_DEBUG_ASSERT(nthreads > 0);
 2023|       |
 2024|       |    // If we temporarily changed the set number of threads then restore it now
 2025|    392|    master_th->th.th_set_nproc = 0;
 2026|       |
 2027|    392|    if (nthreads == 1) {
  ------------------
  |  Branch (2027:9): [True: 0, False: 392]
  ------------------
 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|    392|    KF_TRACE(10, ("__kmp_fork_call: parent_team_aclevel=%d, master_th=%p, "
 2040|    392|                  "curtask=%p, curtask_max_aclevel=%d\n",
 2041|    392|                  parent_team->t.t_active_level, master_th,
 2042|    392|                  master_th->th.th_current_task,
 2043|    392|                  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|    392|    master_th->th.th_current_task->td_flags.executing = 0;
 2048|       |
 2049|    392|    if (!master_th->th.th_teams_microtask || level > teams_level) {
  ------------------
  |  Branch (2049:9): [True: 392, False: 0]
  |  Branch (2049:46): [True: 0, False: 0]
  ------------------
 2050|       |      /* Increment our nested depth level */
 2051|    392|      KMP_ATOMIC_INC(&root->r.r_in_parallel);
  ------------------
  |  | 1259|    392|#define KMP_ATOMIC_INC(p) KMP_ATOMIC_OP(fetch_add, p, 1, acq_rel)
  |  |  ------------------
  |  |  |  | 1246|    392|#define KMP_ATOMIC_OP(op, p, v, order) (p)->op(v, std::memory_order_##order)
  |  |  ------------------
  ------------------
 2052|    392|    }
 2053|       |
 2054|       |    // See if we need to make a copy of the ICVs.
 2055|    392|    int nthreads_icv = master_th->th.th_current_task->td_icvs.nproc;
 2056|    392|    if ((level + 1 < __kmp_nested_nth.used) &&
  ------------------
  |  Branch (2056:9): [True: 0, False: 392]
  ------------------
 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|    392|    } else {
 2060|    392|      nthreads_icv = 0; // don't update
 2061|    392|    }
 2062|       |
 2063|       |    // Figure out the proc_bind_policy for the new team.
 2064|    392|    kmp_proc_bind_t proc_bind = master_th->th.th_set_proc_bind;
 2065|       |    // proc_bind_default means don't update
 2066|    392|    kmp_proc_bind_t proc_bind_icv = proc_bind_default;
 2067|    392|    if (master_th->th.th_current_task->td_icvs.proc_bind == proc_bind_false) {
  ------------------
  |  Branch (2067:9): [True: 392, False: 0]
  ------------------
 2068|    392|      proc_bind = proc_bind_false;
 2069|    392|    } 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|    392|    master_th->th.th_set_proc_bind = proc_bind_default;
 2097|       |
 2098|    392|    if ((nthreads_icv > 0) || (proc_bind_icv != proc_bind_default)) {
  ------------------
  |  Branch (2098:9): [True: 0, False: 392]
  |  Branch (2098:31): [True: 0, False: 392]
  ------------------
 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|    392|    } else {
 2120|       |      /* allocate a new parallel team */
 2121|    392|      KF_TRACE(10, ("__kmp_fork_call: before __kmp_allocate_team\n"));
 2122|    392|      team = __kmp_allocate_team(root, nthreads, nthreads,
 2123|    392|#if OMPT_SUPPORT
 2124|    392|                                 ompt_parallel_data,
 2125|    392|#endif
 2126|    392|                                 proc_bind,
 2127|    392|                                 &master_th->th.th_current_task->td_icvs,
 2128|    392|                                 argc USE_NESTED_HOT_ARG(master_th));
  ------------------
  |  |  165|    392|#define USE_NESTED_HOT_ARG(x) , x
  ------------------
 2129|    392|      if (__kmp_barrier_release_pattern[bs_forkjoin_barrier] == bp_dist_bar)
  ------------------
  |  Branch (2129:11): [True: 0, False: 392]
  ------------------
 2130|      0|        copy_icvs((kmp_internal_control_t *)team->t.b->team_icvs,
 2131|      0|                  &master_th->th.th_current_task->td_icvs);
 2132|    392|    }
 2133|    392|    KF_TRACE(
 2134|    392|        10, ("__kmp_fork_call: after __kmp_allocate_team - team = %p\n", team));
 2135|       |
 2136|       |    /* setup the new team */
 2137|    392|    KMP_CHECK_UPDATE(team->t.t_master_tid, master_tid);
  ------------------
  |  | 2280|    392|  if ((a) != (b))                                                              \
  |  |  ------------------
  |  |  |  Branch (2280:7): [True: 0, False: 392]
  |  |  ------------------
  |  | 2281|    392|  (a) = (b)
  ------------------
 2138|    392|    KMP_CHECK_UPDATE(team->t.t_master_this_cons, master_this_cons);
  ------------------
  |  | 2280|    392|  if ((a) != (b))                                                              \
  |  |  ------------------
  |  |  |  Branch (2280:7): [True: 0, False: 392]
  |  |  ------------------
  |  | 2281|    392|  (a) = (b)
  ------------------
 2139|    392|    KMP_CHECK_UPDATE(team->t.t_ident, loc);
  ------------------
  |  | 2280|    392|  if ((a) != (b))                                                              \
  |  |  ------------------
  |  |  |  Branch (2280:7): [True: 0, False: 392]
  |  |  ------------------
  |  | 2281|    392|  (a) = (b)
  ------------------
 2140|    392|    KMP_CHECK_UPDATE(team->t.t_parent, parent_team);
  ------------------
  |  | 2280|    392|  if ((a) != (b))                                                              \
  |  |  ------------------
  |  |  |  Branch (2280:7): [True: 0, False: 392]
  |  |  ------------------
  |  | 2281|    392|  (a) = (b)
  ------------------
 2141|    392|    KMP_CHECK_UPDATE_SYNC(team->t.t_pkfn, microtask);
  ------------------
  |  | 2283|    392|  if ((a) != (b))                                                              \
  |  |  ------------------
  |  |  |  Branch (2283:7): [True: 392, False: 0]
  |  |  ------------------
  |  | 2284|    392|  TCW_SYNC_PTR((a), (b))
  |  |  ------------------
  |  |  |  | 1159|    392|#define TCW_SYNC_PTR(a, b) TCW_SYNC_8((a), (b))
  |  |  |  |  ------------------
  |  |  |  |  |  | 1141|    392|#define TCW_SYNC_8(a, b) (a) = (b)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2142|    392|#if OMPT_SUPPORT
 2143|    392|    KMP_CHECK_UPDATE_SYNC(team->t.ompt_team_info.master_return_address,
  ------------------
  |  | 2283|    392|  if ((a) != (b))                                                              \
  |  |  ------------------
  |  |  |  Branch (2283:7): [True: 0, False: 392]
  |  |  ------------------
  |  | 2284|    392|  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|    392|                          return_address);
 2145|    392|#endif
 2146|    392|    KMP_CHECK_UPDATE(team->t.t_invoke, invoker); // TODO move to root, maybe
  ------------------
  |  | 2280|    392|  if ((a) != (b))                                                              \
  |  |  ------------------
  |  |  |  Branch (2280:7): [True: 1, False: 391]
  |  |  ------------------
  |  | 2281|    392|  (a) = (b)
  ------------------
 2147|       |    // TODO: parent_team->t.t_level == INT_MAX ???
 2148|    392|    if (!master_th->th.th_teams_microtask || level > teams_level) {
  ------------------
  |  Branch (2148:9): [True: 392, False: 0]
  |  Branch (2148:46): [True: 0, False: 0]
  ------------------
 2149|    392|      int new_level = parent_team->t.t_level + 1;
 2150|    392|      KMP_CHECK_UPDATE(team->t.t_level, new_level);
  ------------------
  |  | 2280|    392|  if ((a) != (b))                                                              \
  |  |  ------------------
  |  |  |  Branch (2280:7): [True: 1, False: 391]
  |  |  ------------------
  |  | 2281|    392|  (a) = (b)
  ------------------
 2151|    392|      new_level = parent_team->t.t_active_level + 1;
 2152|    392|      KMP_CHECK_UPDATE(team->t.t_active_level, new_level);
  ------------------
  |  | 2280|    392|  if ((a) != (b))                                                              \
  |  |  ------------------
  |  |  |  Branch (2280:7): [True: 1, False: 391]
  |  |  ------------------
  |  | 2281|    392|  (a) = (b)
  ------------------
 2153|    392|    } 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|    392|    kmp_r_sched_t new_sched = get__sched_2(parent_team, master_tid);
  ------------------
  |  | 2300|    392|  ((xteam)->t.t_threads[(xtid)]->th.th_current_task->td_icvs.sched)
  ------------------
 2161|       |    // set primary thread's schedule as new run-time schedule
 2162|    392|    KMP_CHECK_UPDATE(team->t.t_sched.sched, new_sched.sched);
  ------------------
  |  | 2280|    392|  if ((a) != (b))                                                              \
  |  |  ------------------
  |  |  |  Branch (2280:7): [True: 0, False: 392]
  |  |  ------------------
  |  | 2281|    392|  (a) = (b)
  ------------------
 2163|       |
 2164|    392|    KMP_CHECK_UPDATE(team->t.t_cancel_request, cancel_noreq);
  ------------------
  |  | 2280|    392|  if ((a) != (b))                                                              \
  |  |  ------------------
  |  |  |  Branch (2280:7): [True: 0, False: 392]
  |  |  ------------------
  |  | 2281|    392|  (a) = (b)
  ------------------
 2165|    392|    KMP_CHECK_UPDATE(team->t.t_def_allocator, master_th->th.th_def_allocator);
  ------------------
  |  | 2280|    392|  if ((a) != (b))                                                              \
  |  |  ------------------
  |  |  |  Branch (2280:7): [True: 1, False: 391]
  |  |  ------------------
  |  | 2281|    392|  (a) = (b)
  ------------------
 2166|       |
 2167|       |    // Update the floating point rounding in the team if required.
 2168|    392|    propagateFPControl(team);
 2169|    392|#if OMPD_SUPPORT
 2170|    392|    if (ompd_state & OMPD_ENABLE_BP)
  ------------------
  |  |   35|    392|#define OMPD_ENABLE_BP 0x1
  ------------------
  |  Branch (2170:9): [True: 0, False: 392]
  ------------------
 2171|      0|      ompd_bp_parallel_begin();
 2172|    392|#endif
 2173|       |
 2174|    392|    if (__kmp_tasking_mode != tskm_immediate_exec) {
  ------------------
  |  Branch (2174:9): [True: 392, 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|    392|      KMP_DEBUG_ASSERT(master_th->th.th_task_team ==
 2178|    392|                       parent_team->t.t_task_team[master_th->th.th_task_state]);
 2179|    392|      KA_TRACE(20, ("__kmp_fork_call: Primary T#%d pushing task_team %p / team "
 2180|    392|                    "%p, new task_team %p / team %p\n",
 2181|    392|                    __kmp_gtid_from_thread(master_th),
 2182|    392|                    master_th->th.th_task_team, parent_team,
 2183|    392|                    team->t.t_task_team[master_th->th.th_task_state], team));
 2184|       |
 2185|    392|      if (active_level || master_th->th.th_task_team) {
  ------------------
  |  Branch (2185:11): [True: 0, False: 392]
  |  Branch (2185:27): [True: 0, False: 392]
  ------------------
 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|    392|    }
 2231|       |
 2232|    392|    KA_TRACE(
 2233|    392|        20,
 2234|    392|        ("__kmp_fork_call: T#%d(%d:%d)->(%d:0) created a team of %d threads\n",
 2235|    392|         gtid, parent_team->t.t_id, team->t.t_master_tid, team->t.t_id,
 2236|    392|         team->t.t_nproc));
 2237|    392|    KMP_DEBUG_ASSERT(team != root->r.r_hot_team ||
 2238|    392|                     (team->t.t_master_tid == 0 &&
 2239|    392|                      (team->t.t_parent == root->r.r_root_team ||
 2240|    392|                       team->t.t_parent->t.t_serialized)));
 2241|    392|    KMP_MB();
 2242|       |
 2243|       |    /* now, setup the arguments */
 2244|    392|    argv = (void **)team->t.t_argv;
 2245|    392|    if (ap) {
  ------------------
  |  Branch (2245:9): [True: 392, False: 0]
  ------------------
 2246|    784|      for (i = argc - 1; i >= 0; --i) {
  ------------------
  |  Branch (2246:26): [True: 392, False: 392]
  ------------------
 2247|    392|        void *new_argv = va_arg(kmp_va_deref(ap), void *);
 2248|    392|        KMP_CHECK_UPDATE(*argv, new_argv);
  ------------------
  |  | 2280|    392|  if ((a) != (b))                                                              \
  |  |  ------------------
  |  |  |  Branch (2280:7): [True: 1, False: 391]
  |  |  ------------------
  |  | 2281|    392|  (a) = (b)
  ------------------
 2249|    392|        argv++;
 2250|    392|      }
 2251|    392|    } 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|    392|    KMP_CHECK_UPDATE(team->t.t_master_active, master_active);
  ------------------
  |  | 2280|    392|  if ((a) != (b))                                                              \
  |  |  ------------------
  |  |  |  Branch (2280:7): [True: 0, False: 392]
  |  |  ------------------
  |  | 2281|    392|  (a) = (b)
  ------------------
 2260|    392|    if (!root->r.r_active) // Only do assignment if it prevents cache ping-pong
  ------------------
  |  Branch (2260:9): [True: 392, False: 0]
  ------------------
 2261|    392|      root->r.r_active = TRUE;
  ------------------
  |  | 1280|    392|#define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  | 1279|    392|#define FALSE 0
  |  |  ------------------
  ------------------
 2262|       |
 2263|    392|    __kmp_fork_team_threads(root, team, master_th, gtid, !ap);
 2264|    392|    __kmp_setup_icv_copy(team, nthreads,
 2265|    392|                         &master_th->th.th_current_task->td_icvs, loc);
 2266|       |
 2267|    392|#if OMPT_SUPPORT
 2268|    392|    master_th->th.ompt_thread_info.state = ompt_state_work_parallel;
 2269|    392|#endif
 2270|       |
 2271|    392|    __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|    392|    KMP_DEBUG_ASSERT(team == __kmp_threads[gtid]->th.th_team);
 2300|    392|    KMP_MB();
 2301|    392|    KF_TRACE(10,
 2302|    392|             ("__kmp_internal_fork : root=%p, team=%p, master_th=%p, gtid=%d\n",
 2303|    392|              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|    392|    if (ap) {
  ------------------
  |  Branch (2324:9): [True: 392, False: 0]
  ------------------
 2325|    392|      __kmp_internal_fork(loc, gtid, team);
 2326|    392|      KF_TRACE(10, ("__kmp_internal_fork : after : root=%p, team=%p, "
 2327|    392|                    "master_th=%p, gtid=%d\n",
 2328|    392|                    root, team, master_th, gtid));
 2329|    392|    }
 2330|       |
 2331|    392|    if (call_context == fork_context_gnu) {
  ------------------
  |  Branch (2331:9): [True: 0, False: 392]
  ------------------
 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|    392|    KA_TRACE(20, ("__kmp_fork_call: T#%d(%d:0) invoke microtask = %p\n", gtid,
 2338|    392|                  team->t.t_id, team->t.t_pkfn));
 2339|    392|  } // 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|    392|  if (!team->t.t_invoke(gtid)) {
  ------------------
  |  Branch (2349:7): [True: 0, False: 392]
  ------------------
 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|    392|  KA_TRACE(20, ("__kmp_fork_call: T#%d(%d:0) done microtask = %p\n", gtid,
 2361|    392|                team->t.t_id, team->t.t_pkfn));
 2362|    392|  KMP_MB(); /* Flush all pending memory write invalidates.  */
 2363|       |
 2364|    392|  KA_TRACE(20, ("__kmp_fork_call: parallel exit T#%d\n", gtid));
 2365|    392|#if OMPT_SUPPORT
 2366|    392|  if (ompt_enabled.enabled) {
  ------------------
  |  Branch (2366:7): [True: 0, False: 392]
  ------------------
 2367|      0|    master_th->th.ompt_thread_info.state = ompt_state_overhead;
 2368|      0|  }
 2369|    392|#endif
 2370|       |
 2371|    392|  return TRUE;
  ------------------
  |  | 1280|    392|#define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  | 1279|    392|#define FALSE 0
  |  |  ------------------
  ------------------
 2372|    392|}
__kmp_join_call:
 2403|    392|                     int exit_teams) {
 2404|    392|  KMP_TIME_DEVELOPER_PARTITIONED_BLOCK(KMP_join_call);
  ------------------
  |  | 1008|    392|#define KMP_TIME_DEVELOPER_PARTITIONED_BLOCK(n) ((void)0)
  ------------------
 2405|    392|  kmp_team_t *team;
 2406|    392|  kmp_team_t *parent_team;
 2407|    392|  kmp_info_t *master_th;
 2408|    392|  kmp_root_t *root;
 2409|    392|  int master_active;
 2410|       |
 2411|    392|  KA_TRACE(20, ("__kmp_join_call: enter T#%d\n", gtid));
 2412|       |
 2413|       |  /* setup current data */
 2414|    392|  master_th = __kmp_threads[gtid];
 2415|    392|  root = master_th->th.th_root;
 2416|    392|  team = master_th->th.th_team;
 2417|    392|  parent_team = team->t.t_parent;
 2418|       |
 2419|    392|  master_th->th.th_ident = loc;
 2420|       |
 2421|    392|#if OMPT_SUPPORT
 2422|    392|  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|    392|  if (ompt_enabled.enabled &&
  ------------------
  |  Branch (2426:7): [True: 0, False: 392]
  ------------------
 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|    392|#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|    392|  if (team->t.t_serialized) {
  ------------------
  |  Branch (2444:7): [True: 0, False: 392]
  ------------------
 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|    392|  master_active = team->t.t_master_active;
 2475|       |
 2476|    392|  if (!exit_teams) {
  ------------------
  |  Branch (2476:7): [True: 392, False: 0]
  ------------------
 2477|       |    // AC: No barrier for internal teams at exit from teams construct.
 2478|       |    //     But there is barrier for external team (league).
 2479|    392|    __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|    392|  } 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|    392|  KMP_MB();
 2504|       |
 2505|    392|#if OMPT_SUPPORT
 2506|    392|  ompt_data_t *parallel_data = &(team->t.ompt_team_info.parallel_data);
 2507|    392|  void *codeptr = team->t.ompt_team_info.master_return_address;
 2508|    392|#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|    392|#if KMP_AFFINITY_SUPPORTED
 2530|    392|  if (!exit_teams) {
  ------------------
  |  Branch (2530:7): [True: 392, False: 0]
  ------------------
 2531|       |    // Restore master thread's partition.
 2532|    392|    master_th->th.th_first_place = team->t.t_first_place;
 2533|    392|    master_th->th.th_last_place = team->t.t_last_place;
 2534|    392|  }
 2535|    392|#endif // KMP_AFFINITY_SUPPORTED
 2536|       |
 2537|    392|  if (master_th->th.th_teams_microtask && !exit_teams &&
  ------------------
  |  Branch (2537:7): [True: 0, False: 392]
  |  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|    392|  master_th->th.th_info.ds.ds_tid = team->t.t_master_tid;
 2607|    392|  master_th->th.th_local.this_construct = team->t.t_master_this_cons;
 2608|       |
 2609|    392|  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|    392|  __kmp_acquire_bootstrap_lock(&__kmp_forkjoin_lock);
 2615|       |
 2616|    392|  if (!master_th->th.th_teams_microtask ||
  ------------------
  |  Branch (2616:7): [True: 392, False: 0]
  ------------------
 2617|    392|      team->t.t_level > master_th->th.th_teams_level) {
  ------------------
  |  Branch (2617:7): [True: 0, False: 0]
  ------------------
 2618|       |    /* Decrement our nested depth level */
 2619|    392|    KMP_ATOMIC_DEC(&root->r.r_in_parallel);
  ------------------
  |  | 1260|    392|#define KMP_ATOMIC_DEC(p) KMP_ATOMIC_OP(fetch_sub, p, 1, acq_rel)
  |  |  ------------------
  |  |  |  | 1246|    392|#define KMP_ATOMIC_OP(op, p, v, order) (p)->op(v, std::memory_order_##order)
  |  |  ------------------
  ------------------
 2620|    392|  }
 2621|    392|  KMP_DEBUG_ASSERT(root->r.r_in_parallel >= 0);
 2622|       |
 2623|    392|#if OMPT_SUPPORT
 2624|    392|  if (ompt_enabled.enabled) {
  ------------------
  |  Branch (2624:7): [True: 0, False: 392]
  ------------------
 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|    392|#endif
 2639|       |
 2640|    392|  KF_TRACE(10, ("__kmp_join_call1: T#%d, this_thread=%p team=%p\n", 0,
 2641|    392|                master_th, team));
 2642|    392|  __kmp_pop_current_task_from_thread(master_th);
 2643|       |
 2644|    392|  master_th->th.th_def_allocator = team->t.t_def_allocator;
 2645|       |
 2646|    392|#if OMPD_SUPPORT
 2647|    392|  if (ompd_state & OMPD_ENABLE_BP)
  ------------------
  |  |   35|    392|#define OMPD_ENABLE_BP 0x1
  ------------------
  |  Branch (2647:7): [True: 0, False: 392]
  ------------------
 2648|      0|    ompd_bp_parallel_end();
 2649|    392|#endif
 2650|    392|  updateHWFPControl(team);
 2651|       |
 2652|    392|  if (root->r.r_active != master_active)
  ------------------
  |  Branch (2652:7): [True: 392, False: 0]
  ------------------
 2653|    392|    root->r.r_active = master_active;
 2654|       |
 2655|    392|  __kmp_free_team(root, team USE_NESTED_HOT_ARG(
  ------------------
  |  |  165|    392|#define USE_NESTED_HOT_ARG(x) , x
  ------------------
 2656|    392|                            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|    392|  master_th->th.th_team = parent_team;
 2664|    392|  master_th->th.th_team_nproc = parent_team->t.t_nproc;
 2665|    392|  master_th->th.th_team_master = parent_team->t.t_threads[0];
 2666|    392|  master_th->th.th_team_serialized = parent_team->t.t_serialized;
 2667|       |
 2668|       |  /* restore serialized team, if need be */
 2669|    392|  if (parent_team->t.t_serialized &&
  ------------------
  |  Branch (2669:7): [True: 392, False: 0]
  ------------------
 2670|    392|      parent_team != master_th->th.th_serial_team &&
  ------------------
  |  Branch (2670:7): [True: 392, False: 0]
  ------------------
 2671|    392|      parent_team != root->r.r_root_team) {
  ------------------
  |  Branch (2671:7): [True: 0, False: 392]
  ------------------
 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|    392|  if (__kmp_tasking_mode != tskm_immediate_exec) {
  ------------------
  |  Branch (2677:7): [True: 392, False: 0]
  ------------------
 2678|    392|    if (master_th->th.th_task_state_top >
  ------------------
  |  Branch (2678:9): [True: 0, False: 392]
  ------------------
 2679|    392|        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|    392|    } else if (team != root->r.r_hot_team) {
  ------------------
  |  Branch (2689:16): [True: 0, False: 392]
  ------------------
 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|    392|    master_th->th.th_task_team =
 2698|    392|        parent_team->t.t_task_team[master_th->th.th_task_state];
 2699|    392|    KA_TRACE(20,
 2700|    392|             ("__kmp_join_call: Primary T#%d restoring task_team %p, team %p\n",
 2701|    392|              __kmp_gtid_from_thread(master_th), master_th->th.th_task_team,
 2702|    392|              parent_team));
 2703|    392|  }
 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|    392|  master_th->th.th_current_task->td_flags.executing = 1;
 2709|       |
 2710|    392|  __kmp_release_bootstrap_lock(&__kmp_forkjoin_lock);
 2711|       |
 2712|    392|#if KMP_AFFINITY_SUPPORTED
 2713|    392|  if (master_th->th.th_team->t.t_level == 0 && __kmp_affinity.flags.reset) {
  ------------------
  |  Branch (2713:7): [True: 392, False: 0]
  |  Branch (2713:48): [True: 0, False: 392]
  ------------------
 2714|      0|    __kmp_reset_root_init_mask(gtid);
 2715|      0|  }
 2716|    392|#endif
 2717|    392|#if OMPT_SUPPORT
 2718|    392|  int flags =
 2719|    392|      OMPT_INVOKER(fork_context) |
  ------------------
  |  |   24|    392|  ((x == fork_context_gnu) ? ompt_parallel_invoker_program                     \
  |  |  ------------------
  |  |  |  Branch (24:4): [True: 0, False: 392]
  |  |  ------------------
  |  |   25|    392|                           : ompt_parallel_invoker_runtime)
  ------------------
 2720|    392|      ((team_microtask == (void *)__kmp_teams_master) ? ompt_parallel_league
  ------------------
  |  Branch (2720:8): [True: 0, False: 392]
  ------------------
 2721|    392|                                                      : ompt_parallel_team);
 2722|    392|  if (ompt_enabled.enabled) {
  ------------------
  |  Branch (2722:7): [True: 0, False: 392]
  ------------------
 2723|      0|    __kmp_join_ompt(gtid, master_th, parent_team, parallel_data, flags,
 2724|      0|                    codeptr);
 2725|      0|  }
 2726|    392|#endif
 2727|       |
 2728|    392|  KMP_MB();
 2729|    392|  KA_TRACE(20, ("__kmp_join_call: exit T#%d\n", gtid));
 2730|    392|}
__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|    426|                    int argc USE_NESTED_HOT_ARG(kmp_info_t *master)) {
 5131|    426|  KMP_TIME_DEVELOPER_PARTITIONED_BLOCK(KMP_allocate_team);
  ------------------
  |  | 1008|    426|#define KMP_TIME_DEVELOPER_PARTITIONED_BLOCK(n) ((void)0)
  ------------------
 5132|    426|  int f;
 5133|    426|  kmp_team_t *team;
 5134|    426|  int use_hot_team = !root->r.r_active;
 5135|    426|  int level = 0;
 5136|    426|  int do_place_partition = 1;
 5137|       |
 5138|    426|  KA_TRACE(20, ("__kmp_allocate_team: called\n"));
 5139|    426|  KMP_DEBUG_ASSERT(new_nproc >= 1 && argc >= 0);
 5140|    426|  KMP_DEBUG_ASSERT(max_nproc >= new_nproc);
 5141|    426|  KMP_MB();
 5142|       |
 5143|    426|#if KMP_NESTED_HOT_TEAMS
 5144|    426|  kmp_hot_team_ptr_t *hot_teams;
 5145|    426|  if (master) {
  ------------------
  |  Branch (5145:7): [True: 392, False: 34]
  ------------------
 5146|    392|    team = master->th.th_team;
 5147|    392|    level = team->t.t_active_level;
 5148|    392|    if (master->th.th_teams_microtask) { // in teams construct?
  ------------------
  |  Branch (5148:9): [True: 0, False: 392]
  ------------------
 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|    392|    hot_teams = master->th.th_hot_teams;
 5166|    392|    if (level < __kmp_hot_teams_max_level && hot_teams &&
  ------------------
  |  Branch (5166:9): [True: 392, False: 0]
  |  Branch (5166:46): [True: 392, False: 0]
  ------------------
 5167|    392|        hot_teams[level].hot_team) {
  ------------------
  |  Branch (5167:9): [True: 392, False: 0]
  ------------------
 5168|       |      // hot team has already been allocated for given level
 5169|    392|      use_hot_team = 1;
 5170|    392|    } else {
 5171|      0|      use_hot_team = 0;
 5172|      0|    }
 5173|    392|  } else {
 5174|       |    // check we won't access uninitialized hot_teams, just in case
 5175|     34|    KMP_DEBUG_ASSERT(new_nproc == 1);
 5176|     34|  }
 5177|    426|#endif
 5178|       |  // Optimization to use a "hot" team
 5179|    426|  if (use_hot_team && new_nproc > 1) {
  ------------------
  |  Branch (5179:7): [True: 426, False: 0]
  |  Branch (5179:23): [True: 392, False: 34]
  ------------------
 5180|    392|    KMP_DEBUG_ASSERT(new_nproc <= max_nproc);
 5181|    392|#if KMP_NESTED_HOT_TEAMS
 5182|    392|    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|    392|    if (team->t.t_nproc != new_nproc &&
  ------------------
  |  Branch (5194:9): [True: 1, False: 391]
  ------------------
 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|    392|    if (do_place_partition == 0)
  ------------------
  |  Branch (5203:9): [True: 0, False: 392]
  ------------------
 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|    392|    if (team->t.t_nproc == new_nproc) { // Check changes in number of threads
  ------------------
  |  Branch (5208:9): [True: 391, False: 1]
  ------------------
 5209|    391|      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|    391|      if (team->t.t_size_changed == -1) {
  ------------------
  |  Branch (5212:11): [True: 0, False: 391]
  ------------------
 5213|      0|        team->t.t_size_changed = 1;
 5214|    391|      } else {
 5215|    391|        KMP_CHECK_UPDATE(team->t.t_size_changed, 0);
  ------------------
  |  | 2280|    391|  if ((a) != (b))                                                              \
  |  |  ------------------
  |  |  |  Branch (2280:7): [True: 1, False: 390]
  |  |  ------------------
  |  | 2281|    391|  (a) = (b)
  ------------------
 5216|    391|      }
 5217|       |
 5218|       |      // TODO???: team->t.t_max_active_levels = new_max_active_levels;
 5219|    391|      kmp_r_sched_t new_sched = new_icvs->sched;
 5220|       |      // set primary thread's schedule as new run-time schedule
 5221|    391|      KMP_CHECK_UPDATE(team->t.t_sched.sched, new_sched.sched);
  ------------------
  |  | 2280|    391|  if ((a) != (b))                                                              \
  |  |  ------------------
  |  |  |  Branch (2280:7): [True: 0, False: 391]
  |  |  ------------------
  |  | 2281|    391|  (a) = (b)
  ------------------
 5222|       |
 5223|    391|      __kmp_reinitialize_team(team, new_icvs,
 5224|    391|                              root->r.r_uber_thread->th.th_ident);
 5225|       |
 5226|    391|      KF_TRACE(10, ("__kmp_allocate_team2: T#%d, this_thread=%p team=%p\n", 0,
 5227|    391|                    team->t.t_threads[0], team));
 5228|    391|      __kmp_push_current_task_to_thread(team->t.t_threads[0], team, 0);
 5229|       |
 5230|    391|#if KMP_AFFINITY_SUPPORTED
 5231|    391|      if ((team->t.t_size_changed == 0) &&
  ------------------
  |  Branch (5231:11): [True: 391, False: 0]
  ------------------
 5232|    391|          (team->t.t_proc_bind == new_proc_bind)) {
  ------------------
  |  Branch (5232:11): [True: 391, False: 0]
  ------------------
 5233|    391|        if (new_proc_bind == proc_bind_spread) {
  ------------------
  |  Branch (5233:13): [True: 0, False: 391]
  ------------------
 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|    391|        KA_TRACE(200, ("__kmp_allocate_team: reusing hot team #%d bindings: "
 5240|    391|                       "proc_bind = %d, partition = [%d,%d]\n",
 5241|    391|                       team->t.t_id, new_proc_bind, team->t.t_first_place,
 5242|    391|                       team->t.t_last_place));
 5243|    391|      } 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|    391|    } 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|    392|    kmp_info_t *master = team->t.t_threads[0];
 5454|    392|    if (master->th.th_teams_microtask) {
  ------------------
  |  Branch (5454:9): [True: 0, False: 392]
  ------------------
 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|    392|#if KMP_NESTED_HOT_TEAMS
 5464|    392|    if (level) {
  ------------------
  |  Branch (5464:9): [True: 0, False: 392]
  ------------------
 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|    392|#endif // KMP_NESTED_HOT_TEAMS
 5481|       |
 5482|       |    /* reallocate space for arguments if necessary */
 5483|    392|    __kmp_alloc_argv_entries(argc, team, TRUE);
  ------------------
  |  | 1280|    392|#define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  | 1279|    392|#define FALSE 0
  |  |  ------------------
  ------------------
 5484|    392|    KMP_CHECK_UPDATE(team->t.t_argc, argc);
  ------------------
  |  | 2280|    392|  if ((a) != (b))                                                              \
  |  |  ------------------
  |  |  |  Branch (2280:7): [True: 1, False: 391]
  |  |  ------------------
  |  | 2281|    392|  (a) = (b)
  ------------------
 5485|       |    // The hot team re-uses the previous task team,
 5486|       |    // if untouched during the previous release->gather phase.
 5487|       |
 5488|    392|    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|    392|#if OMPT_SUPPORT
 5499|    392|    __ompt_team_assign_id(team, ompt_parallel_data);
 5500|    392|#endif
 5501|       |
 5502|    392|    KMP_MB();
 5503|       |
 5504|    392|    return team;
 5505|    392|  }
 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|    394|                     kmp_team_t *team USE_NESTED_HOT_ARG(kmp_info_t *master)) {
 5643|    394|  int f;
 5644|    394|  KA_TRACE(20, ("__kmp_free_team: T#%d freeing team %d\n", __kmp_get_gtid(),
 5645|    394|                team->t.t_id));
 5646|       |
 5647|       |  /* verify state */
 5648|    394|  KMP_DEBUG_ASSERT(root);
 5649|    394|  KMP_DEBUG_ASSERT(team);
 5650|    394|  KMP_DEBUG_ASSERT(team->t.t_nproc <= team->t.t_max_nproc);
 5651|    394|  KMP_DEBUG_ASSERT(team->t.t_threads);
 5652|       |
 5653|    394|  int use_hot_team = team == root->r.r_hot_team;
 5654|    394|#if KMP_NESTED_HOT_TEAMS
 5655|    394|  int level;
 5656|    394|  if (master) {
  ------------------
  |  Branch (5656:7): [True: 392, False: 2]
  ------------------
 5657|    392|    level = team->t.t_active_level - 1;
 5658|    392|    if (master->th.th_teams_microtask) { // in teams construct?
  ------------------
  |  Branch (5658:9): [True: 0, False: 392]
  ------------------
 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|    392|    if (level < __kmp_hot_teams_max_level) {
  ------------------
  |  Branch (5672:9): [True: 392, False: 0]
  ------------------
 5673|    392|      KMP_DEBUG_ASSERT(team == hot_teams[level].hot_team);
 5674|    392|      use_hot_team = 1;
 5675|    392|    }
 5676|    392|  }
 5677|    394|#endif // KMP_NESTED_HOT_TEAMS
 5678|       |
 5679|       |  /* team is done working */
 5680|    394|  TCW_SYNC_PTR(team->t.t_pkfn,
  ------------------
  |  | 1159|    394|#define TCW_SYNC_PTR(a, b) TCW_SYNC_8((a), (b))
  |  |  ------------------
  |  |  |  | 1141|    394|#define TCW_SYNC_8(a, b) (a) = (b)
  |  |  ------------------
  ------------------
 5681|    394|               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|    394|  if (!use_hot_team) {
  ------------------
  |  Branch (5688:7): [True: 2, False: 392]
  ------------------
 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|    392|  } else { // Check if team was created for primary threads in teams construct
 5783|       |    // See if first worker is a CG root
 5784|    392|    KMP_DEBUG_ASSERT(team->t.t_threads[1] &&
 5785|    392|                     team->t.t_threads[1]->th.th_cg_roots);
 5786|    392|    if (team->t.t_threads[1]->th.th_cg_roots->cg_root == team->t.t_threads[1]) {
  ------------------
  |  Branch (5786:9): [True: 0, False: 392]
  ------------------
 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|    392|  }
 5809|       |
 5810|    394|  KMP_MB();
 5811|    394|}
__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: 30, False: 1]
  ------------------
 5953|     30|    KMP_ATOMIC_INC(&__kmp_thread_pool_active_nth);
  ------------------
  |  | 1259|     30|#define KMP_ATOMIC_INC(p) KMP_ATOMIC_OP(fetch_add, p, 1, acq_rel)
  |  |  ------------------
  |  |  |  | 1246|     30|#define KMP_ATOMIC_OP(op, p, v, order) (p)->op(v, std::memory_order_##order)
  |  |  ------------------
  ------------------
 5954|     30|    this_th->th.th_active_in_pool = TRUE;
  ------------------
  |  | 1280|     30|#define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  | 1279|     30|#define FALSE 0
  |  |  ------------------
  ------------------
 5955|     30|  }
 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|  12.1k|  while (!TCR_4(__kmp_global.g.g_done)) {
  ------------------
  |  | 1127|  12.1k|#define TCR_4(a) (a)
  ------------------
  |  Branch (6024:10): [True: 12.1k, False: 31]
  ------------------
 6025|  12.1k|    KMP_DEBUG_ASSERT(this_thr == __kmp_threads[gtid]);
 6026|  12.1k|    KMP_MB();
 6027|       |
 6028|       |    /* wait for work to do */
 6029|  12.1k|    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|  12.1k|    __kmp_fork_barrier(gtid, KMP_GTID_DNE);
  ------------------
  |  | 1000|  12.1k|#define KMP_GTID_DNE (-2) /* Does not exist */
  ------------------
 6033|       |
 6034|  12.1k|#if OMPT_SUPPORT
 6035|  12.1k|    if (ompt_enabled.enabled) {
  ------------------
  |  Branch (6035:9): [True: 0, False: 12.1k]
  ------------------
 6036|      0|      this_thr->th.ompt_thread_info.state = ompt_state_overhead;
 6037|      0|    }
 6038|  12.1k|#endif
 6039|       |
 6040|  12.1k|    pteam = &this_thr->th.th_team;
 6041|       |
 6042|       |    /* have we been allocated? */
 6043|  12.1k|    if (TCR_SYNC_PTR(*pteam) && !TCR_4(__kmp_global.g.g_done)) {
  ------------------
  |  | 1158|  24.2k|#define TCR_SYNC_PTR(a) ((void *)TCR_SYNC_8(a))
  |  |  ------------------
  |  |  |  | 1140|  12.1k|#define TCR_SYNC_8(a) (a)
  |  |  ------------------
  |  |  |  Branch (1158:25): [True: 11.7k, False: 442]
  |  |  ------------------
  ------------------
                  if (TCR_SYNC_PTR(*pteam) && !TCR_4(__kmp_global.g.g_done)) {
  ------------------
  |  | 1127|  11.7k|#define TCR_4(a) (a)
  ------------------
  |  Branch (6043:33): [True: 11.7k, False: 18.4E]
  ------------------
 6044|       |      /* we were just woken up, so run our new task */
 6045|  11.7k|      if (TCR_SYNC_PTR((*pteam)->t.t_pkfn) != NULL) {
  ------------------
  |  | 1158|  11.7k|#define TCR_SYNC_PTR(a) ((void *)TCR_SYNC_8(a))
  |  |  ------------------
  |  |  |  | 1140|  11.7k|#define TCR_SYNC_8(a) (a)
  |  |  ------------------
  ------------------
  |  Branch (6045:11): [True: 11.7k, False: 18.4E]
  ------------------
 6046|  11.7k|        int rc;
 6047|  11.7k|        KA_TRACE(20,
 6048|  11.7k|                 ("__kmp_launch_thread: T#%d(%d:%d) invoke microtask = %p\n",
 6049|  11.7k|                  gtid, (*pteam)->t.t_id, __kmp_tid_from_gtid(gtid),
 6050|  11.7k|                  (*pteam)->t.t_pkfn));
 6051|       |
 6052|  11.7k|        updateHWFPControl(*pteam);
 6053|       |
 6054|  11.7k|#if OMPT_SUPPORT
 6055|  11.7k|        if (ompt_enabled.enabled) {
  ------------------
  |  Branch (6055:13): [True: 0, False: 11.7k]
  ------------------
 6056|      0|          this_thr->th.ompt_thread_info.state = ompt_state_work_parallel;
 6057|      0|        }
 6058|  11.7k|#endif
 6059|       |
 6060|  11.7k|        rc = (*pteam)->t.t_invoke(gtid);
 6061|  11.7k|        KMP_ASSERT(rc);
  ------------------
  |  |   50|  11.7k|  if (!(cond)) {                                                               \
  |  |  ------------------
  |  |  |  Branch (50:7): [True: 0, False: 11.7k]
  |  |  ------------------
  |  |   51|      0|    __kmp_debug_assert("assertion failure", __FILE__, __LINE__);               \
  |  |   52|      0|  }
  ------------------
 6062|       |
 6063|  11.7k|        KMP_MB();
 6064|  11.7k|        KA_TRACE(20, ("__kmp_launch_thread: T#%d(%d:%d) done microtask = %p\n",
 6065|  11.7k|                      gtid, (*pteam)->t.t_id, __kmp_tid_from_gtid(gtid),
 6066|  11.7k|                      (*pteam)->t.t_pkfn));
 6067|  11.7k|      }
 6068|  11.7k|#if OMPT_SUPPORT
 6069|  11.7k|      if (ompt_enabled.enabled) {
  ------------------
  |  Branch (6069:11): [True: 0, False: 11.7k]
  ------------------
 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|  11.7k|#endif
 6076|       |      /* join barrier after parallel region */
 6077|  11.7k|      __kmp_join_barrier(gtid);
 6078|  11.7k|    }
 6079|  12.1k|  }
 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|     30|void __kmp_internal_end_dest(void *specific_gtid) {
 6108|       |  // Make sure no significant bits are lost
 6109|     30|  int gtid;
 6110|     30|  __kmp_type_convert((kmp_intptr_t)specific_gtid - 1, &gtid);
 6111|       |
 6112|     30|  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|     30|  __kmp_internal_end_thread(gtid);
 6117|     30|}
__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|     28|void __kmp_internal_end_thread(int gtid_req) {
 6558|     28|  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|     28|  if (__kmp_global.g.g_abort) {
  ------------------
  |  Branch (6566:7): [True: 0, False: 28]
  ------------------
 6567|      0|    KA_TRACE(11, ("__kmp_internal_end_thread: abort, exiting\n"));
 6568|       |    /* TODO abort? */
 6569|      0|    return;
 6570|      0|  }
 6571|     29|  if (TCR_4(__kmp_global.g.g_done) || !__kmp_init_serial) {
  ------------------
  |  | 1127|     56|#define TCR_4(a) (a)
  |  |  ------------------
  |  |  |  Branch (1127:18): [True: 28, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (6571:39): [True: 0, False: 0]
  ------------------
 6572|     29|    KA_TRACE(10, ("__kmp_internal_end_thread: already finished\n"));
 6573|     29|    return;
 6574|     29|  }
 6575|       |
 6576|       |  // If hidden helper team has been initialized, we need to deinit it
 6577|  18.4E|  if (TCR_4(__kmp_init_hidden_helper) &&
  ------------------
  |  | 1127|  18.4E|#define TCR_4(a) (a)
  |  |  ------------------
  |  |  |  Branch (1127:18): [True: 0, False: 18.4E]
  |  |  ------------------
  ------------------
 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|  18.4E|  KMP_MB(); /* Flush all pending memory write invalidates.  */
 6587|       |
 6588|       |  /* find out who we are and what we should do */
 6589|  18.4E|  {
 6590|  18.4E|    int gtid = (gtid_req >= 0) ? gtid_req : __kmp_gtid_get_specific();
  ------------------
  |  Branch (6590:16): [True: 0, False: 18.4E]
  ------------------
 6591|  18.4E|    KA_TRACE(10,
 6592|  18.4E|             ("__kmp_internal_end_thread: enter T#%d  (%d)\n", gtid, gtid_req));
 6593|  18.4E|    if (gtid == KMP_GTID_SHUTDOWN) {
  ------------------
  |  | 1001|  18.4E|#define KMP_GTID_SHUTDOWN (-3) /* Library is shutting down */
  ------------------
  |  Branch (6593:9): [True: 0, False: 18.4E]
  ------------------
 6594|      0|      KA_TRACE(10, ("__kmp_internal_end_thread: !__kmp_init_runtime, system "
 6595|      0|                    "already shutdown\n"));
 6596|      0|      return;
 6597|  18.4E|    } else if (gtid == KMP_GTID_MONITOR) {
  ------------------
  |  | 1002|  18.4E|#define KMP_GTID_MONITOR (-4) /* Monitor thread ID */
  ------------------
  |  Branch (6597:16): [True: 0, False: 18.4E]
  ------------------
 6598|      0|      KA_TRACE(10, ("__kmp_internal_end_thread: monitor thread, gtid not "
 6599|      0|                    "registered, or system shutdown\n"));
 6600|      0|      return;
 6601|  18.4E|    } else if (gtid == KMP_GTID_DNE) {
  ------------------
  |  | 1000|  18.4E|#define KMP_GTID_DNE (-2) /* Does not exist */
  ------------------
  |  Branch (6601:16): [True: 0, False: 18.4E]
  ------------------
 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|  18.4E|    } else if (KMP_UBER_GTID(gtid)) {
  ------------------
  |  Branch (6606:16): [True: 0, False: 18.4E]
  ------------------
 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|  18.4E|    } else {
 6621|       |      /* just a worker thread, let's leave */
 6622|  18.4E|      KA_TRACE(10, ("__kmp_internal_end_thread: worker thread T#%d\n", gtid));
 6623|       |
 6624|  18.4E|      if (gtid >= 0) {
  ------------------
  |  Branch (6624:11): [True: 0, False: 18.4E]
  ------------------
 6625|      0|        __kmp_threads[gtid]->th.th_task_team = NULL;
 6626|      0|      }
 6627|       |
 6628|  18.4E|      KA_TRACE(10,
 6629|  18.4E|               ("__kmp_internal_end_thread: worker thread done, exiting T#%d\n",
 6630|  18.4E|                gtid));
 6631|  18.4E|      return;
 6632|  18.4E|    }
 6633|  18.4E|  }
 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|  12.1k|                                   kmp_team_t *team) {
 7564|  12.1k|  kmp_disp_t *dispatch;
 7565|       |
 7566|  12.1k|  KMP_MB();
 7567|       |
 7568|       |  /* none of the threads have encountered any constructs, yet. */
 7569|  12.1k|  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|  12.1k|  dispatch = (kmp_disp_t *)TCR_PTR(this_thr->th.th_dispatch);
  ------------------
  |  | 1156|  12.1k|#define TCR_PTR(a) ((void *)TCR_8(a))
  |  |  ------------------
  |  |  |  | 1131|  12.1k|#define TCR_8(a) (a)
  |  |  ------------------
  ------------------
 7574|  12.1k|  KMP_DEBUG_ASSERT(dispatch);
 7575|  12.1k|  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|  12.1k|  dispatch->th_disp_index = 0; /* reset the dispatch buffer counter */
 7580|  12.1k|  dispatch->th_doacross_buf_idx = 0; // reset doacross dispatch buffer counter
 7581|  12.1k|  if (__kmp_env_consistency_check)
  ------------------
  |  Branch (7581:7): [True: 0, False: 12.1k]
  ------------------
 7582|      0|    __kmp_push_parallel(gtid, team->t.t_ident);
 7583|       |
 7584|  12.1k|  KMP_MB(); /* Flush all pending memory write invalidates.  */
 7585|  12.1k|}
__kmp_run_after_invoked_task:
 7588|  12.4k|                                  kmp_team_t *team) {
 7589|  12.4k|  if (__kmp_env_consistency_check)
  ------------------
  |  Branch (7589:7): [True: 0, False: 12.4k]
  ------------------
 7590|      0|    __kmp_pop_parallel(gtid, team->t.t_ident);
 7591|       |
 7592|  12.4k|  __kmp_finish_implicit_task(this_thr);
 7593|  12.4k|}
__kmp_invoke_task_func:
 7595|  12.0k|int __kmp_invoke_task_func(int gtid) {
 7596|  12.0k|  int rc;
 7597|  12.0k|  int tid = __kmp_tid_from_gtid(gtid);
 7598|  12.0k|  kmp_info_t *this_thr = __kmp_threads[gtid];
 7599|  12.0k|  kmp_team_t *team = this_thr->th.th_team;
 7600|       |
 7601|  12.0k|  __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|  12.0k|#if OMPT_SUPPORT
 7619|  12.0k|  void *dummy;
 7620|  12.0k|  void **exit_frame_p;
 7621|  12.0k|  ompt_data_t *my_task_data;
 7622|  12.0k|  ompt_data_t *my_parallel_data;
 7623|  12.0k|  int ompt_team_size;
 7624|       |
 7625|  12.0k|  if (ompt_enabled.enabled) {
  ------------------
  |  Branch (7625:7): [True: 0, False: 12.0k]
  ------------------
 7626|      0|    exit_frame_p = &(team->t.t_implicit_task_taskdata[tid]
 7627|      0|                         .ompt_task_info.frame.exit_frame.ptr);
 7628|  12.0k|  } else {
 7629|  12.0k|    exit_frame_p = &dummy;
 7630|  12.0k|  }
 7631|       |
 7632|  12.0k|  my_task_data =
 7633|  12.0k|      &(team->t.t_implicit_task_taskdata[tid].ompt_task_info.task_data);
 7634|  12.0k|  my_parallel_data = &(team->t.ompt_team_info.parallel_data);
 7635|  12.0k|  if (ompt_enabled.ompt_callback_implicit_task) {
  ------------------
  |  Branch (7635:7): [True: 0, False: 12.0k]
  ------------------
 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|  12.0k|#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|  12.0k|  rc = __kmp_invoke_microtask((microtask_t)TCR_SYNC_PTR(team->t.t_pkfn), gtid,
  ------------------
  |  | 1158|  12.0k|#define TCR_SYNC_PTR(a) ((void *)TCR_SYNC_8(a))
  |  |  ------------------
  |  |  |  | 1140|  12.0k|#define TCR_SYNC_8(a) (a)
  |  |  ------------------
  ------------------
 7655|  12.0k|                              tid, (int)team->t.t_argc, (void **)team->t.t_argv
 7656|  12.0k|#if OMPT_SUPPORT
 7657|  12.0k|                              ,
 7658|  12.0k|                              exit_frame_p
 7659|  12.0k|#endif
 7660|  12.0k|  );
 7661|  12.0k|#if OMPT_SUPPORT
 7662|  12.0k|  *exit_frame_p = NULL;
 7663|  12.0k|  this_thr->th.ompt_thread_info.parallel_flags |= ompt_parallel_team;
 7664|  12.0k|#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|  12.0k|  __kmp_run_after_invoked_task(gtid, tid, this_thr, team);
 7686|       |
 7687|  12.0k|  return rc;
 7688|  12.0k|}
__kmp_push_num_threads:
 7772|    392|void __kmp_push_num_threads(ident_t *id, int gtid, int num_threads) {
 7773|    392|  kmp_info_t *thr = __kmp_threads[gtid];
 7774|       |
 7775|    392|  if (num_threads > 0)
  ------------------
  |  Branch (7775:7): [True: 392, False: 0]
  ------------------
 7776|    392|    thr->th.th_set_nproc = num_threads;
 7777|    392|}
__kmp_internal_fork:
 7942|    392|void __kmp_internal_fork(ident_t *id, int gtid, kmp_team_t *team) {
 7943|    392|  kmp_info_t *this_thr = __kmp_threads[gtid];
 7944|       |
 7945|       |#ifdef KMP_DEBUG
 7946|       |  int f;
 7947|       |#endif /* KMP_DEBUG */
 7948|       |
 7949|    392|  KMP_DEBUG_ASSERT(team);
 7950|    392|  KMP_DEBUG_ASSERT(this_thr->th.th_team == team);
 7951|    392|  KMP_ASSERT(KMP_MASTER_GTID(gtid));
  ------------------
  |  |   50|    392|  if (!(cond)) {                                                               \
  |  |  ------------------
  |  |  |  Branch (50:7): [True: 0, False: 392]
  |  |  ------------------
  |  |   51|      0|    __kmp_debug_assert("assertion failure", __FILE__, __LINE__);               \
  |  |   52|      0|  }
  ------------------
 7952|    392|  KMP_MB(); /* Flush all pending memory write invalidates.  */
 7953|       |
 7954|    392|  team->t.t_construct = 0; /* no single directives seen yet */
 7955|    392|  team->t.t_ordered.dt.t_value =
 7956|    392|      0; /* thread 0 enters the ordered section first */
 7957|       |
 7958|       |  /* Reset the identifiers on the dispatch buffer */
 7959|    392|  KMP_DEBUG_ASSERT(team->t.t_disp_buffer);
 7960|    392|  if (team->t.t_max_nproc > 1) {
  ------------------
  |  Branch (7960:7): [True: 392, False: 0]
  ------------------
 7961|    392|    int i;
 7962|  3.13k|    for (i = 0; i < __kmp_dispatch_num_buffers; ++i) {
  ------------------
  |  Branch (7962:17): [True: 2.74k, False: 392]
  ------------------
 7963|  2.74k|      team->t.t_disp_buffer[i].buffer_index = i;
 7964|  2.74k|      team->t.t_disp_buffer[i].doacross_buf_idx = i;
 7965|  2.74k|    }
 7966|    392|  } 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|    392|  KMP_MB(); /* Flush all pending memory write invalidates.  */
 7972|    392|  KMP_ASSERT(this_thr->th.th_team == team);
  ------------------
  |  |   50|    392|  if (!(cond)) {                                                               \
  |  |  ------------------
  |  |  |  Branch (50:7): [True: 0, False: 392]
  |  |  ------------------
  |  |   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|    392|  __kmp_fork_barrier(gtid, 0);
 7983|    392|}
__kmp_internal_join:
 7985|    392|void __kmp_internal_join(ident_t *id, int gtid, kmp_team_t *team) {
 7986|    392|  kmp_info_t *this_thr = __kmp_threads[gtid];
 7987|       |
 7988|    392|  KMP_DEBUG_ASSERT(team);
 7989|    392|  KMP_DEBUG_ASSERT(this_thr->th.th_team == team);
 7990|    392|  KMP_ASSERT(KMP_MASTER_GTID(gtid));
  ------------------
  |  |   50|    392|  if (!(cond)) {                                                               \
  |  |  ------------------
  |  |  |  Branch (50:7): [True: 0, False: 392]
  |  |  ------------------
  |  |   51|      0|    __kmp_debug_assert("assertion failure", __FILE__, __LINE__);               \
  |  |   52|      0|  }
  ------------------
 7991|    392|  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|    392|  __kmp_join_barrier(gtid); /* wait for everyone */
 8011|    392|#if OMPT_SUPPORT
 8012|    392|  if (ompt_enabled.enabled &&
  ------------------
  |  Branch (8012:7): [True: 0, False: 392]
  ------------------
 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|    392|#endif
 8042|       |
 8043|    392|  KMP_MB(); /* Flush all pending memory write invalidates.  */
 8044|    392|  KMP_ASSERT(this_thr->th.th_team == team);
  ------------------
  |  |   50|    392|  if (!(cond)) {                                                               \
  |  |  ------------------
  |  |  |  Branch (50:7): [True: 0, False: 392]
  |  |  ------------------
  |  |   51|      0|    __kmp_debug_assert("assertion failure", __FILE__, __LINE__);               \
  |  |   52|      0|  }
  ------------------
 8045|    392|}
__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|    392|void __kmp_resume_if_soft_paused() {
 8961|    392|  if (__kmp_pause_status == kmp_soft_paused) {
  ------------------
  |  Branch (8961:7): [True: 0, False: 392]
  ------------------
 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|    392|}
_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|    392|inline static void propagateFPControl(kmp_team_t *team) {
 1051|    392|  if (__kmp_inherit_fp_control) {
  ------------------
  |  Branch (1051:7): [True: 392, False: 0]
  ------------------
 1052|    392|    kmp_int16 x87_fpu_control_word;
 1053|    392|    kmp_uint32 mxcsr;
 1054|       |
 1055|       |    // Get primary thread's values of FPU control flags (both X87 and vector)
 1056|    392|    __kmp_store_x87_fpu_control_word(&x87_fpu_control_word);
 1057|    392|    __kmp_store_mxcsr(&mxcsr);
 1058|    392|    mxcsr &= KMP_X86_MXCSR_MASK;
  ------------------
  |  | 1403|    392|#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|    392|    KMP_CHECK_UPDATE(team->t.t_x87_fpu_control_word, x87_fpu_control_word);
  ------------------
  |  | 2280|    392|  if ((a) != (b))                                                              \
  |  |  ------------------
  |  |  |  Branch (2280:7): [True: 1, False: 391]
  |  |  ------------------
  |  | 2281|    392|  (a) = (b)
  ------------------
 1070|    392|    KMP_CHECK_UPDATE(team->t.t_mxcsr, mxcsr);
  ------------------
  |  | 2280|    392|  if ((a) != (b))                                                              \
  |  |  ------------------
  |  |  |  Branch (2280:7): [True: 1, False: 391]
  |  |  ------------------
  |  | 2281|    392|  (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|    392|    KMP_CHECK_UPDATE(team->t.t_fp_control_saved, TRUE);
  ------------------
  |  | 2280|    392|  if ((a) != (b))                                                              \
  |  |  ------------------
  |  |  |  Branch (2280:7): [True: 1, False: 391]
  |  |  ------------------
  |  | 2281|    392|  (a) = (b)
  ------------------
 1074|    392|  } 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|    392|}
kmp_runtime.cpp:_ZL22__kmp_is_fork_in_teamsP8kmp_infoPFvPiS1_zEiiPA1_13__va_list_tag:
 1375|    392|                                          int teams_level, kmp_va_list ap) {
 1376|    392|  return (master_th->th.th_teams_microtask && ap &&
  ------------------
  |  Branch (1376:11): [True: 0, False: 392]
  |  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|    392|}
kmp_runtime.cpp:_ZL23__kmp_is_entering_teamsiiiPA1_13__va_list_tag:
 1383|    392|                                           int teams_level, kmp_va_list ap) {
 1384|    392|  return ((ap == NULL && active_level == 0) ||
  ------------------
  |  Branch (1384:12): [True: 0, False: 392]
  |  Branch (1384:26): [True: 0, False: 0]
  ------------------
 1385|    392|          (ap && teams_level > 0 && teams_level == level));
  ------------------
  |  Branch (1385:12): [True: 392, False: 0]
  |  Branch (1385:18): [True: 0, False: 392]
  |  Branch (1385:37): [True: 0, False: 0]
  ------------------
 1386|    392|}
kmp_runtime.cpp:_ZL21__kmp_reserve_threadsP8kmp_rootP8kmp_teamiii:
  740|    392|                                 int enter_teams) {
  741|    392|  int capacity;
  742|    392|  int new_nthreads;
  743|    392|  KMP_DEBUG_ASSERT(__kmp_init_serial);
  744|    392|  KMP_DEBUG_ASSERT(root && parent_team);
  745|    392|  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|    392|  new_nthreads = set_nthreads;
  750|    392|  if (!get__dynamic_2(parent_team, master_tid)) {
  ------------------
  |  | 2296|    392|  ((xteam)->t.t_threads[(xtid)]->th.th_current_task->td_icvs.dynamic)
  ------------------
  |  Branch (750:7): [True: 392, False: 0]
  ------------------
  751|    392|    ;
  752|    392|  }
  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|    392|  if (__kmp_nth + new_nthreads -
  ------------------
  |  Branch (806:7): [True: 0, False: 392]
  ------------------
  807|    392|          (root->r.r_active ? 1 : root->r.r_hot_team->t.t_nproc) >
  ------------------
  |  Branch (807:12): [True: 0, False: 392]
  ------------------
  808|    392|      __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|    392|  int cg_nthreads = this_thr->th.th_cg_roots->cg_nthreads;
  836|    392|  int max_cg_threads = this_thr->th.th_cg_roots->cg_thread_limit;
  837|    392|  if (cg_nthreads + new_nthreads -
  ------------------
  |  Branch (837:7): [True: 0, False: 392]
  ------------------
  838|    392|          (root->r.r_active ? 1 : root->r.r_hot_team->t.t_nproc) >
  ------------------
  |  Branch (838:12): [True: 0, False: 392]
  ------------------
  839|    392|      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|    392|  capacity = __kmp_threads_capacity;
  869|    392|  if (TCR_PTR(__kmp_threads[0]) == NULL) {
  ------------------
  |  | 1156|    392|#define TCR_PTR(a) ((void *)TCR_8(a))
  |  |  ------------------
  |  |  |  | 1131|    392|#define TCR_8(a) (a)
  |  |  ------------------
  ------------------
  |  Branch (869:7): [True: 0, False: 392]
  ------------------
  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|    392|  if (__kmp_enable_hidden_helper && !TCR_4(__kmp_init_hidden_helper_threads)) {
  ------------------
  |  | 1127|    392|#define TCR_4(a) (a)
  ------------------
  |  Branch (875:7): [True: 392, False: 0]
  |  Branch (875:37): [True: 392, False: 0]
  ------------------
  876|    392|    capacity -= __kmp_hidden_helper_threads_num;
  877|    392|  }
  878|    392|  if (__kmp_nth + new_nthreads -
  ------------------
  |  Branch (878:7): [True: 0, False: 392]
  ------------------
  879|    392|          (root->r.r_active ? 1 : root->r.r_hot_team->t.t_nproc) >
  ------------------
  |  Branch (879:12): [True: 0, False: 392]
  ------------------
  880|    392|      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|    392|  return new_nthreads;
  921|    392|}
kmp_runtime.cpp:_ZL23__kmp_fork_team_threadsP8kmp_rootP8kmp_teamP8kmp_infoii:
  928|    392|                                    int fork_teams_workers) {
  929|    392|  int i;
  930|    392|  int use_hot_team;
  931|       |
  932|    392|  KA_TRACE(10, ("__kmp_fork_team_threads: new_nprocs = %d\n", team->t.t_nproc));
  933|    392|  KMP_DEBUG_ASSERT(master_gtid == __kmp_get_gtid());
  934|    392|  KMP_MB();
  935|       |
  936|       |  /* first, let's setup the primary thread */
  937|    392|  master_th->th.th_info.ds.ds_tid = 0;
  938|    392|  master_th->th.th_team = team;
  939|    392|  master_th->th.th_team_nproc = team->t.t_nproc;
  940|    392|  master_th->th.th_team_master = master_th;
  941|    392|  master_th->th.th_team_serialized = FALSE;
  ------------------
  |  | 1279|    392|#define FALSE 0
  ------------------
  942|    392|  master_th->th.th_dispatch = &team->t.t_dispatch[0];
  943|       |
  944|       |/* make sure we are not the optimized hot team */
  945|    392|#if KMP_NESTED_HOT_TEAMS
  946|    392|  use_hot_team = 0;
  947|    392|  kmp_hot_team_ptr_t *hot_teams = master_th->th.th_hot_teams;
  948|    392|  if (hot_teams) { // hot teams array is not allocated if
  ------------------
  |  Branch (948:7): [True: 392, False: 0]
  ------------------
  949|       |    // KMP_HOT_TEAMS_MAX_LEVEL=0
  950|    392|    int level = team->t.t_active_level - 1; // index in array of hot teams
  951|    392|    if (master_th->th.th_teams_microtask) { // are we inside the teams?
  ------------------
  |  Branch (951:9): [True: 0, False: 392]
  ------------------
  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|    392|    if (level < __kmp_hot_teams_max_level) {
  ------------------
  |  Branch (962:9): [True: 392, False: 0]
  ------------------
  963|    392|      if (hot_teams[level].hot_team) {
  ------------------
  |  Branch (963:11): [True: 392, False: 0]
  ------------------
  964|       |        // hot team has already been allocated for given level
  965|    392|        KMP_DEBUG_ASSERT(hot_teams[level].hot_team == team);
  966|    392|        use_hot_team = 1; // the team is ready to use
  967|    392|      } 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|    392|    } else {
  973|      0|      use_hot_team = 0;
  974|      0|    }
  975|    392|  }
  976|       |#else
  977|       |  use_hot_team = team == root->r.r_hot_team;
  978|       |#endif
  979|    392|  if (!use_hot_team) {
  ------------------
  |  Branch (979:7): [True: 0, False: 392]
  ------------------
  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|    392|  if (__kmp_display_affinity && team->t.t_display_affinity != 1) {
  ------------------
  |  Branch (1032:7): [True: 0, False: 392]
  |  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|    392|  KMP_MB();
 1044|    392|}
kmp_runtime.cpp:_ZL17updateHWFPControlP8kmp_team:
 1083|  12.1k|inline static void updateHWFPControl(kmp_team_t *team) {
 1084|  12.1k|  if (__kmp_inherit_fp_control && team->t.t_fp_control_saved) {
  ------------------
  |  Branch (1084:7): [True: 12.1k, False: 4]
  |  Branch (1084:35): [True: 12.0k, False: 10]
  ------------------
 1085|       |    // Only reset the fp control regs if they have been changed in the team.
 1086|       |    // the parallel region that we are exiting.
 1087|  12.1k|    kmp_int16 x87_fpu_control_word;
 1088|  12.1k|    kmp_uint32 mxcsr;
 1089|  12.1k|    __kmp_store_x87_fpu_control_word(&x87_fpu_control_word);
 1090|  12.1k|    __kmp_store_mxcsr(&mxcsr);
 1091|  12.1k|    mxcsr &= KMP_X86_MXCSR_MASK;
  ------------------
  |  | 1403|  12.1k|#define KMP_X86_MXCSR_MASK 0xffffffc0 /* ignore status flags (6 lsb) */
  ------------------
 1092|       |
 1093|  12.1k|    if (team->t.t_x87_fpu_control_word != x87_fpu_control_word) {
  ------------------
  |  Branch (1093:9): [True: 0, False: 12.1k]
  ------------------
 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|  12.1k|    if (team->t.t_mxcsr != mxcsr) {
  ------------------
  |  Branch (1098:9): [True: 0, False: 12.1k]
  ------------------
 1099|      0|      __kmp_load_mxcsr(&team->t.t_mxcsr);
 1100|      0|    }
 1101|  12.1k|  }
 1102|  12.1k|}
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: 30, False: 1]
  ------------------
 6203|     30|      thread->th.th_active_in_pool = FALSE;
  ------------------
  |  | 1279|     30|#define FALSE 0
  ------------------
 6204|     30|      KMP_ATOMIC_DEC(&__kmp_thread_pool_active_nth);
  ------------------
  |  | 1260|     30|#define KMP_ATOMIC_DEC(p) KMP_ATOMIC_OP(fetch_sub, p, 1, acq_rel)
  |  |  ------------------
  |  |  |  | 1246|     30|#define KMP_ATOMIC_OP(op, p, v, order) (p)->op(v, std::memory_order_##order)
  |  |  ------------------
  ------------------
 6205|     30|      KMP_DEBUG_ASSERT(__kmp_thread_pool_active_nth >= 0);
 6206|     30|    }
 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|    426|                                    ident_t *loc) {
 4695|    426|  KF_TRACE(10, ("__kmp_reinitialize_team: enter this_thread=%p team=%p\n",
 4696|    426|                team->t.t_threads[0], team));
 4697|    426|  KMP_DEBUG_ASSERT(team && new_icvs);
 4698|    426|  KMP_DEBUG_ASSERT((!TCR_4(__kmp_init_parallel)) || new_icvs->nproc);
 4699|    426|  KMP_CHECK_UPDATE(team->t.t_ident, loc);
  ------------------
  |  | 2280|    426|  if ((a) != (b))                                                              \
  |  |  ------------------
  |  |  |  Branch (2280:7): [True: 1, False: 425]
  |  |  ------------------
  |  | 2281|    426|  (a) = (b)
  ------------------
 4700|       |
 4701|    426|  KMP_CHECK_UPDATE(team->t.t_id, KMP_GEN_TEAM_ID());
  ------------------
  |  | 2280|    426|  if ((a) != (b))                                                              \
  |  |  ------------------
  |  |  |  Branch (2280:7): [True: 34, False: 392]
  |  |  ------------------
  |  | 2281|    426|  (a) = (b)
  ------------------
 4702|       |  // Copy ICVs to the primary thread's implicit taskdata
 4703|    426|  __kmp_init_implicit_task(loc, team->t.t_threads[0], team, 0, FALSE);
  ------------------
  |  | 1279|    426|#define FALSE 0
  ------------------
 4704|    426|  copy_icvs(&team->t.t_implicit_task_taskdata[0].td_icvs, new_icvs);
 4705|       |
 4706|    426|  KF_TRACE(10, ("__kmp_reinitialize_team: exit this_thread=%p team=%p\n",
 4707|    426|                team->t.t_threads[0], team));
 4708|    426|}
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|    426|static void __kmp_alloc_argv_entries(int argc, kmp_team_t *team, int realloc) {
 3171|       |
 3172|    426|  KMP_DEBUG_ASSERT(team);
 3173|    426|  if (!realloc || argc > team->t.t_max_argc) {
  ------------------
  |  Branch (3173:7): [True: 34, False: 392]
  |  Branch (3173:19): [True: 0, False: 392]
  ------------------
 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|    426|}
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|  12.1k|                              kmp_int32 incr, kmp_int32 chunk) {
  876|  12.1k|  __kmp_for_static_init<kmp_int32>(loc, gtid, schedtype, plastiter, plower,
  877|  12.1k|                                   pupper, pstride, incr, chunk
  878|  12.1k|#if OMPT_SUPPORT && OMPT_OPTIONAL
  879|  12.1k|                                   ,
  880|  12.1k|                                   OMPT_GET_RETURN_ADDRESS(0)
  ------------------
  |  |  108|  12.1k|#define OMPT_GET_RETURN_ADDRESS(level) __builtin_return_address(level)
  ------------------
  881|  12.1k|#endif
  882|  12.1k|  );
  883|  12.1k|}
kmp_sched.cpp:_ZL21__kmp_for_static_initIiEvP5identiiPiPT_S4_PN8traits_tIS3_E8signed_tES7_S7_Pv:
   83|  12.1k|) {
   84|  12.1k|  KMP_COUNT_BLOCK(OMP_LOOP_STATIC);
  ------------------
  |  | 1001|  12.1k|#define KMP_COUNT_BLOCK(n) ((void)0)
  ------------------
   85|  12.1k|  KMP_PUSH_PARTITIONED_TIMER(OMP_loop_static);
  ------------------
  |  | 1014|  12.1k|#define KMP_PUSH_PARTITIONED_TIMER(name) ((void)0)
  ------------------
   86|  12.1k|  KMP_PUSH_PARTITIONED_TIMER(OMP_loop_static_scheduling);
  ------------------
  |  | 1014|  12.1k|#define KMP_PUSH_PARTITIONED_TIMER(name) ((void)0)
  ------------------
   87|       |
   88|       |  // Clear monotonic/nonmonotonic bits (ignore it)
   89|  12.1k|  schedtype = SCHEDULE_WITHOUT_MODIFIERS(schedtype);
  ------------------
  |  |  451|  12.1k|  (enum sched_type)(                                                           \
  |  |  452|  12.1k|      (s) & ~(kmp_sch_modifier_nonmonotonic | kmp_sch_modifier_monotonic))
  ------------------
   90|       |
   91|  12.1k|  typedef typename traits_t<T>::unsigned_t UT;
   92|  12.1k|  typedef typename traits_t<T>::signed_t ST;
   93|       |  /*  this all has to be changed back to TID and such.. */
   94|  12.1k|  kmp_int32 gtid = global_tid;
   95|  12.1k|  kmp_uint32 tid;
   96|  12.1k|  kmp_uint32 nth;
   97|  12.1k|  UT trip_count;
   98|  12.1k|  kmp_team_t *team;
   99|  12.1k|  __kmp_assert_valid_gtid(gtid);
  100|  12.1k|  kmp_info_t *th = __kmp_threads[gtid];
  101|       |
  102|  12.1k|#if OMPT_SUPPORT && OMPT_OPTIONAL
  103|  12.1k|  ompt_team_info_t *team_info = NULL;
  104|  12.1k|  ompt_task_info_t *task_info = NULL;
  105|  12.1k|  ompt_work_t ompt_work_type = ompt_work_loop;
  106|       |
  107|  12.1k|  static kmp_int8 warn = 0;
  108|       |
  109|  12.1k|  if (ompt_enabled.ompt_callback_work || ompt_enabled.ompt_callback_dispatch) {
  ------------------
  |  Branch (109:7): [True: 16, False: 12.1k]
  |  Branch (109:42): [True: 12, False: 12.1k]
  ------------------
  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|  12.1k|#endif
  131|       |
  132|  12.1k|  KMP_DEBUG_ASSERT(plastiter && plower && pupper && pstride);
  133|  12.1k|  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|  12.1k|  if (__kmp_env_consistency_check) {
  ------------------
  |  Branch (149:7): [True: 0, False: 12.1k]
  ------------------
  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: 12.1k, False: 18.4E]
  |  Branch (157:7): [True: 0, False: 12.1k]
  ------------------
  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|  12.1k|  if (schedtype > kmp_ord_upper) {
  ------------------
  |  Branch (198:7): [True: 0, False: 12.1k]
  ------------------
  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|  12.1k|  } else {
  210|  12.1k|    tid = __kmp_tid_from_gtid(global_tid);
  211|  12.1k|    team = th->th.th_team;
  212|  12.1k|  }
  213|       |
  214|       |  /* determine if "for" loop is an active worksharing construct */
  215|  12.1k|  if (team->t.t_serialized) {
  ------------------
  |  Branch (215:7): [True: 0, False: 12.1k]
  ------------------
  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|  12.1k|  nth = team->t.t_nproc;
  248|  12.1k|  if (nth == 1) {
  ------------------
  |  Branch (248:7): [True: 0, False: 12.1k]
  ------------------
  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|  12.1k|  if (incr == 1) {
  ------------------
  |  Branch (279:7): [True: 12.1k, False: 18.4E]
  ------------------
  280|  12.1k|    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|  12.1k|  if (__kmp_env_consistency_check) {
  ------------------
  |  Branch (296:7): [True: 0, False: 12.1k]
  ------------------
  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|  12.1k|  switch (schedtype) {
  306|  12.1k|  case kmp_sch_static: {
  ------------------
  |  Branch (306:3): [True: 12.1k, False: 18.4E]
  ------------------
  307|  12.1k|    if (trip_count < nth) {
  ------------------
  |  Branch (307:9): [True: 5.13k, False: 7.04k]
  ------------------
  308|  5.13k|      KMP_DEBUG_ASSERT(
  309|  5.13k|          __kmp_static == kmp_sch_static_greedy ||
  310|  5.13k|          __kmp_static ==
  311|  5.13k|              kmp_sch_static_balanced); // Unknown static scheduling type.
  312|  5.13k|      if (tid < trip_count) {
  ------------------
  |  Branch (312:11): [True: 901, False: 4.23k]
  ------------------
  313|    901|        *pupper = *plower = *plower + tid * incr;
  314|  4.23k|      } else {
  315|       |        // set bounds so non-active threads execute no iterations
  316|  18.4E|        *plower = *pupper + (incr > 0 ? 1 : -1);
  ------------------
  |  Branch (316:30): [True: 4.26k, False: 18.4E]
  ------------------
  317|  4.23k|      }
  318|  5.13k|      if (plastiter != NULL)
  ------------------
  |  Branch (318:11): [True: 5.14k, False: 18.4E]
  ------------------
  319|  5.14k|        *plastiter = (tid == trip_count - 1);
  320|  7.04k|    } else {
  321|  7.04k|      if (__kmp_static == kmp_sch_static_balanced) {
  ------------------
  |  Branch (321:11): [True: 7.03k, False: 9]
  ------------------
  322|  7.03k|        UT small_chunk = trip_count / nth;
  323|  7.03k|        UT extras = trip_count % nth;
  324|  7.03k|        *plower += incr * (tid * small_chunk + (tid < extras ? tid : extras));
  ------------------
  |  Branch (324:49): [True: 2.57k, False: 4.45k]
  ------------------
  325|  7.03k|        *pupper = *plower + small_chunk * incr - (tid < extras ? 0 : incr);
  ------------------
  |  Branch (325:51): [True: 2.57k, False: 4.45k]
  ------------------
  326|  7.03k|        if (plastiter != NULL)
  ------------------
  |  Branch (326:13): [True: 7.03k, False: 4]
  ------------------
  327|  7.03k|          *plastiter = (tid == nth - 1);
  328|  7.03k|      } else {
  329|      9|        T big_chunk_inc_count =
  330|      9|            (trip_count / nth + ((trip_count % nth) ? 1 : 0)) * incr;
  ------------------
  |  Branch (330:34): [True: 0, False: 9]
  ------------------
  331|      9|        T old_upper = *pupper;
  332|       |
  333|      9|        KMP_DEBUG_ASSERT(__kmp_static == kmp_sch_static_greedy);
  334|       |        // Unknown static scheduling type.
  335|       |
  336|      9|        *plower += tid * big_chunk_inc_count;
  337|      9|        *pupper = *plower + big_chunk_inc_count - incr;
  338|      9|        if (incr > 0) {
  ------------------
  |  Branch (338:13): [True: 0, False: 9]
  ------------------
  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|      9|        } else {
  346|      9|          if (*pupper > *plower)
  ------------------
  |  Branch (346:15): [True: 0, False: 9]
  ------------------
  347|      0|            *pupper = traits_t<T>::min_value;
  348|      9|          if (plastiter != NULL)
  ------------------
  |  Branch (348:15): [True: 0, False: 9]
  ------------------
  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|      9|          if (*pupper < old_upper)
  ------------------
  |  Branch (350:15): [True: 0, False: 9]
  ------------------
  351|      0|            *pupper = old_upper; // tracker C73258
  352|      9|        }
  353|      9|      }
  354|  7.04k|    }
  355|  12.1k|    *pstride = trip_count;
  356|  12.1k|    break;
  357|      0|  }
  358|      0|  case kmp_sch_static_chunked: {
  ------------------
  |  Branch (358:3): [True: 0, False: 12.1k]
  ------------------
  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: 12.1k]
  ------------------
  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: 12.1k]
  ------------------
  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|  12.1k|  }
  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|  12.1k|  KE_TRACE(10, ("__kmpc_for_static_init: T#%d return\n", global_tid));
  439|       |
  440|  12.1k|#if OMPT_SUPPORT && OMPT_OPTIONAL
  441|  12.1k|  if (ompt_enabled.ompt_callback_work) {
  ------------------
  |  Branch (441:7): [True: 0, False: 12.1k]
  ------------------
  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|  12.1k|  if (ompt_enabled.ompt_callback_dispatch) {
  ------------------
  |  Branch (446:7): [True: 0, False: 12.1k]
  ------------------
  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|  12.1k|#endif
  465|       |
  466|  12.1k|  KMP_STATS_LOOP_END(OMP_loop_static_iterations);
  467|  12.1k|  return;
  468|  12.1k|}

__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|    392|void __kmp_pop_current_task_from_thread(kmp_info_t *this_thr) {
  613|    392|  KF_TRACE(10, ("__kmp_pop_current_task_from_thread(enter): T#%d "
  614|    392|                "this_thread=%p, curtask=%p, "
  615|    392|                "curtask_parent=%p\n",
  616|    392|                0, this_thr, this_thr->th.th_current_task,
  617|    392|                this_thr->th.th_current_task->td_parent));
  618|       |
  619|    392|  this_thr->th.th_current_task = this_thr->th.th_current_task->td_parent;
  620|       |
  621|    392|  KF_TRACE(10, ("__kmp_pop_current_task_from_thread(exit): T#%d "
  622|    392|                "this_thread=%p, curtask=%p, "
  623|    392|                "curtask_parent=%p\n",
  624|    392|                0, this_thr, this_thr->th.th_current_task,
  625|    392|                this_thr->th.th_current_task->td_parent));
  626|    392|}
__kmp_push_current_task_to_thread:
  635|    455|                                       int tid) {
  636|       |  // current task of the thread is a parent of the new just created implicit
  637|       |  // tasks of new team
  638|    455|  KF_TRACE(10, ("__kmp_push_current_task_to_thread(enter): T#%d this_thread=%p "
  639|    455|                "curtask=%p "
  640|    455|                "parent_task=%p\n",
  641|    455|                tid, this_thr, this_thr->th.th_current_task,
  642|    455|                team->t.t_implicit_task_taskdata[tid].td_parent));
  643|       |
  644|    455|  KMP_DEBUG_ASSERT(this_thr != NULL);
  645|       |
  646|    455|  if (tid == 0) {
  ------------------
  |  Branch (646:7): [True: 393, False: 62]
  ------------------
  647|    393|    if (this_thr->th.th_current_task != &team->t.t_implicit_task_taskdata[0]) {
  ------------------
  |  Branch (647:9): [True: 393, False: 0]
  ------------------
  648|    393|      team->t.t_implicit_task_taskdata[0].td_parent =
  649|    393|          this_thr->th.th_current_task;
  650|    393|      this_thr->th.th_current_task = &team->t.t_implicit_task_taskdata[0];
  651|    393|    }
  652|    393|  } 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|    455|  KF_TRACE(10, ("__kmp_push_current_task_to_thread(exit): T#%d this_thread=%p "
  659|    455|                "curtask=%p "
  660|    455|                "parent_task=%p\n",
  661|    455|                tid, this_thr, this_thr->th.th_current_task,
  662|    455|                team->t.t_implicit_task_taskdata[tid].td_parent));
  663|    455|}
__kmp_init_implicit_task:
 1320|  12.1k|                              kmp_team_t *team, int tid, int set_curr_task) {
 1321|  12.1k|  kmp_taskdata_t *task = &team->t.t_implicit_task_taskdata[tid];
 1322|       |
 1323|  12.1k|  KF_TRACE(
 1324|  12.1k|      10,
 1325|  12.1k|      ("__kmp_init_implicit_task(enter): T#:%d team=%p task=%p, reinit=%s\n",
 1326|  12.1k|       tid, team, task, set_curr_task ? "TRUE" : "FALSE"));
 1327|       |
 1328|  12.1k|  task->td_task_id = KMP_GEN_TASK_ID();
  ------------------
  |  | 3546|  12.1k|#define KMP_GEN_TASK_ID() _KMP_GEN_ID(__kmp_task_counter)
  |  |  ------------------
  |  |  |  | 3543|  12.1k|#define _KMP_GEN_ID(counter) (~0)
  |  |  ------------------
  ------------------
 1329|  12.1k|  task->td_team = team;
 1330|       |  //    task->td_parent   = NULL;  // fix for CQ230101 (broken parent task info
 1331|       |  //    in debugger)
 1332|  12.1k|  task->td_ident = loc_ref;
 1333|  12.1k|  task->td_taskwait_ident = NULL;
 1334|  12.1k|  task->td_taskwait_counter = 0;
 1335|  12.1k|  task->td_taskwait_thread = 0;
 1336|       |
 1337|  12.1k|  task->td_flags.tiedness = TASK_TIED;
  ------------------
  |  |   45|  12.1k|#define TASK_TIED 1
  ------------------
 1338|  12.1k|  task->td_flags.tasktype = TASK_IMPLICIT;
  ------------------
  |  |   48|  12.1k|#define TASK_IMPLICIT 0
  ------------------
 1339|  12.1k|  task->td_flags.proxy = TASK_FULL;
  ------------------
  |  |   50|  12.1k|#define TASK_FULL 0
  ------------------
 1340|       |
 1341|       |  // All implicit tasks are executed immediately, not deferred
 1342|  12.1k|  task->td_flags.task_serial = 1;
 1343|  12.1k|  task->td_flags.tasking_ser = (__kmp_tasking_mode == tskm_immediate_exec);
 1344|  12.1k|  task->td_flags.team_serial = (team->t.t_serialized) ? 1 : 0;
  ------------------
  |  Branch (1344:32): [True: 66, False: 12.0k]
  ------------------
 1345|       |
 1346|  12.1k|  task->td_flags.started = 1;
 1347|  12.1k|  task->td_flags.executing = 1;
 1348|  12.1k|  task->td_flags.complete = 0;
 1349|  12.1k|  task->td_flags.freed = 0;
 1350|       |#if OMPX_TASKGRAPH
 1351|       |  task->td_flags.onced = 0;
 1352|       |#endif
 1353|       |
 1354|  12.1k|  task->td_depnode = NULL;
 1355|  12.1k|  task->td_last_tied = task;
 1356|  12.1k|  task->td_allow_completion_event.type = KMP_EVENT_UNINITIALIZED;
 1357|       |
 1358|  12.1k|  if (set_curr_task) { // only do this init first time thread is created
  ------------------
  |  Branch (1358:7): [True: 64, False: 12.0k]
  ------------------
 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|  12.0k|  } else {
 1366|  12.0k|    KMP_DEBUG_ASSERT(task->td_incomplete_child_tasks == 0);
 1367|  12.0k|    KMP_DEBUG_ASSERT(task->td_allocated_child_tasks == 0);
 1368|  12.0k|  }
 1369|       |
 1370|  12.1k|#if OMPT_SUPPORT
 1371|  12.1k|  if (UNLIKELY(ompt_enabled.enabled))
  ------------------
  |  |  119|  12.1k|#define UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (119:21): [True: 0, False: 12.1k]
  |  |  ------------------
  ------------------
 1372|      0|    __ompt_task_init(task, tid);
 1373|  12.1k|#endif
 1374|       |
 1375|  12.1k|  KF_TRACE(10, ("__kmp_init_implicit_task(exit): T#:%d team=%p task=%p\n", tid,
 1376|  12.1k|                team, task));
 1377|  12.1k|}
__kmp_finish_implicit_task:
 1384|  12.4k|void __kmp_finish_implicit_task(kmp_info_t *thread) {
 1385|  12.4k|  kmp_taskdata_t *task = thread->th.th_current_task;
 1386|  12.4k|  if (task->td_dephash) {
  ------------------
  |  Branch (1386:7): [True: 0, False: 12.4k]
  ------------------
 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|  12.4k|}
__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|    392|void __kmp_task_team_setup(kmp_info_t *this_thr, kmp_team_t *team, int always) {
 4142|    392|  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|    392|  if (team->t.t_task_team[this_thr->th.th_task_state] == NULL &&
  ------------------
  |  Branch (4148:7): [True: 1, False: 391]
  ------------------
 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|    392|  if (this_thr->th.th_task_state == 1 && always && team->t.t_nproc == 1) {
  ------------------
  |  Branch (4158:7): [True: 196, False: 196]
  |  Branch (4158:42): [True: 0, False: 196]
  |  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|    392|  if (team->t.t_nproc > 1) {
  ------------------
  |  Branch (4174:7): [True: 392, False: 0]
  ------------------
 4175|    392|    int other_team = 1 - this_thr->th.th_task_state;
 4176|    392|    KMP_DEBUG_ASSERT(other_team >= 0 && other_team < 2);
 4177|    392|    if (team->t.t_task_team[other_team] == NULL) { // setup other team as well
  ------------------
  |  Branch (4177:9): [True: 1, False: 391]
  ------------------
 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|    391|    } else { // Leave the old task team struct in place for the upcoming region;
 4185|       |      // adjust as needed
 4186|    391|      kmp_task_team_t *task_team = team->t.t_task_team[other_team];
 4187|    391|      if (!task_team->tt.tt_active ||
  ------------------
  |  Branch (4187:11): [True: 0, False: 391]
  ------------------
 4188|    391|          team->t.t_nproc != task_team->tt.tt_nproc) {
  ------------------
  |  Branch (4188:11): [True: 0, False: 391]
  ------------------
 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|    391|      KA_TRACE(20, ("__kmp_task_team_setup: Primary T#%d reset next task_team "
 4200|    391|                    "%p for team %d at parity=%d\n",
 4201|    391|                    __kmp_gtid_from_thread(this_thr),
 4202|    391|                    team->t.t_task_team[other_team], team->t.t_id, other_team));
 4203|    391|    }
 4204|    392|  }
 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|    392|  if (this_thr == __kmp_hidden_helper_main_thread) {
  ------------------
  |  Branch (4210:7): [True: 0, False: 392]
  ------------------
 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|    392|}
__kmp_task_team_sync:
 4230|  11.9k|void __kmp_task_team_sync(kmp_info_t *this_thr, kmp_team_t *team) {
 4231|  11.9k|  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|  11.9k|  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|  11.9k|  TCW_PTR(this_thr->th.th_task_team,
  ------------------
  |  | 1157|  11.9k|#define TCW_PTR(a, b) TCW_8((a), (b))
  |  |  ------------------
  |  |  |  | 1132|  11.9k|#define TCW_8(a, b) (a) = (b)
  |  |  ------------------
  ------------------
 4240|  11.9k|          team->t.t_task_team[this_thr->th.th_task_state]);
 4241|  11.9k|  KA_TRACE(20,
 4242|  11.9k|           ("__kmp_task_team_sync: Thread T#%d task team switched to task_team "
 4243|  11.9k|            "%p from Team #%d (parity=%d)\n",
 4244|  11.9k|            __kmp_gtid_from_thread(this_thr), this_thr->th.th_task_team,
 4245|  11.9k|            team->t.t_id, this_thr->th.th_task_state));
 4246|  11.9k|}
__kmp_task_team_wait:
 4257|    392|    kmp_team_t *team USE_ITT_BUILD_ARG(void *itt_sync_obj), int wait) {
 4258|    392|  kmp_task_team_t *task_team = team->t.t_task_team[this_thr->th.th_task_state];
 4259|       |
 4260|    392|  KMP_DEBUG_ASSERT(__kmp_tasking_mode != tskm_immediate_exec);
 4261|    392|  KMP_DEBUG_ASSERT(task_team == this_thr->th.th_task_team);
 4262|       |
 4263|    392|  if ((task_team != NULL) && KMP_TASKING_ENABLED(task_team)) {
  ------------------
  |  | 2368|    392|  (TRUE == TCR_SYNC_4((task_team)->tt.tt_found_tasks))
  |  |  ------------------
  |  |  |  | 1280|    392|#define TRUE (!FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1279|    392|#define FALSE 0
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 (TRUE == TCR_SYNC_4((task_team)->tt.tt_found_tasks))
  |  |  ------------------
  |  |  |  | 1135|    392|#define TCR_SYNC_4(a) (a)
  |  |  ------------------
  |  |  |  Branch (2368:3): [True: 0, False: 392]
  |  |  ------------------
  ------------------
  |  Branch (4263:7): [True: 392, 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|    392|}
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|     29|void __kmp_common_destroy_gtid(int gtid) {
  224|     29|  struct private_common *tn;
  225|     29|  struct shared_common *d_tn;
  226|       |
  227|     29|  if (!TCR_4(__kmp_init_gtid)) {
  ------------------
  |  | 1127|     29|#define TCR_4(a) (a)
  ------------------
  |  Branch (227:7): [True: 0, False: 29]
  ------------------
  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|     29|  KC_TRACE(10, ("__kmp_common_destroy_gtid: T#%d called\n", gtid));
  235|     29|  if ((__kmp_foreign_tp) ? (!KMP_INITIAL_GTID(gtid)) : (!KMP_UBER_GTID(gtid))) {
  ------------------
  |  | 1276|     28|#define KMP_INITIAL_GTID(gtid) (0 == (gtid))
  ------------------
  |  Branch (235:7): [True: 28, False: 1]
  |  Branch (235:7): [True: 28, False: 1]
  ------------------
  236|       |
  237|     28|    if (TCR_4(__kmp_init_common)) {
  ------------------
  |  | 1127|     28|#define TCR_4(a) (a)
  |  |  ------------------
  |  |  |  Branch (1127:18): [True: 27, False: 1]
  |  |  ------------------
  ------------------
  238|       |
  239|       |      /* Cannot do this here since not all threads have destroyed their data */
  240|       |      /* TCW_4(__kmp_init_common, FALSE); */
  241|       |
  242|     27|      for (tn = __kmp_threads[gtid]->th.th_pri_head; tn; tn = tn->link) {
  ------------------
  |  Branch (242:54): [True: 0, False: 27]
  ------------------
  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|     27|      KC_TRACE(30, ("__kmp_common_destroy_gtid: T#%d threadprivate destructors "
  265|     27|                    "complete\n",
  266|     27|                    gtid));
  267|     27|    }
  268|     28|  }
  269|     29|}
__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|  47.6k|  virtual ~kmp_flag_native() {}
_ZN11kmp_flag_64ILb0ELb1EEC2EPVyP8kmp_info:
  861|  11.5k|      : kmp_flag_native<kmp_uint64, flag64, Sleepable>(p, thr) {}
_ZN15kmp_flag_nativeIyL9flag_type1ELb1EEC2EPVyP8kmp_info:
  150|  11.5k|      : kmp_flag<FlagType>(1), loc(p) {
  151|  11.5k|    this->waiting_threads[0] = thr;
  152|  11.5k|  }
_ZN8kmp_flagIL9flag_type1EEC2Ei:
  115|  11.6k|      : t({FlagType, 0U}), num_waiting_threads(nwaiters), sleepLoc(nullptr) {}
_ZN15kmp_flag_nativeIyL9flag_type1ELb1EE10done_checkEv:
  166|  24.2k|  virtual bool done_check() {
  167|  24.2k|    if (Sleepable && !(this->sleepLoc))
  ------------------
  |  Branch (167:9): [True: 24.1k, Folded]
  |  Branch (167:22): [True: 24.1k, False: 18.4E]
  ------------------
  168|  24.1k|      return (traits_type::tcr(*(this->get())) & ~KMP_BARRIER_SLEEP_STATE) ==
  ------------------
  |  | 2023|  24.1k|#define KMP_BARRIER_SLEEP_STATE (1 << KMP_BARRIER_SLEEP_BIT)
  |  |  ------------------
  |  |  |  | 2019|  24.1k|#define KMP_BARRIER_SLEEP_BIT 0 /* bit used for suspend/sleep part of state */
  |  |  ------------------
  ------------------
  169|  24.1k|             checker;
  170|     75|    else
  171|     75|      return traits_type::tcr(*(this->get())) == checker;
  172|  24.2k|  }
_ZN11flag_traitsIL9flag_type1EE3tcrEy:
   76|   227M|  static inline flag_t tcr(flag_t f) { return TCR_8(f); }
  ------------------
  |  | 1131|   227M|#define TCR_8(a) (a)
  ------------------
_ZN15kmp_flag_nativeIyL9flag_type1ELb1EE3getEv:
  160|   227M|  volatile PtrType *get() { return loc; }
_ZN15kmp_flag_nativeIyL9flag_type1ELb1EE14done_check_valEy:
  175|    171|  virtual bool done_check_val(PtrType old_loc) { return old_loc == checker; }
_ZN15kmp_flag_nativeIyL9flag_type1ELb1EE13notdone_checkEv:
  181|   226M|  virtual bool notdone_check() {
  182|   226M|    return traits_type::tcr(*(this->get())) != checker;
  183|   226M|  }
_ZN15kmp_flag_nativeIyL9flag_type1ELb1EE11is_sleepingEv:
  219|    676|  bool is_sleeping() {
  220|    676|    if (this->sleepLoc)
  ------------------
  |  Branch (220:9): [True: 0, False: 676]
  ------------------
  221|      0|      return this->sleepLoc->load();
  222|    676|    return is_sleeping_val(*(this->get()));
  223|    676|  }
_ZN15kmp_flag_nativeIyL9flag_type1ELb1EE15is_sleeping_valEy:
  213|  24.7k|  bool is_sleeping_val(PtrType old_loc) {
  214|  24.7k|    if (this->sleepLoc)
  ------------------
  |  Branch (214:9): [True: 0, False: 24.7k]
  ------------------
  215|      0|      return this->sleepLoc->load();
  216|  24.7k|    return old_loc & KMP_BARRIER_SLEEP_STATE;
  ------------------
  |  | 2023|  24.7k|#define KMP_BARRIER_SLEEP_STATE (1 << KMP_BARRIER_SLEEP_BIT)
  |  |  ------------------
  |  |  |  | 2019|  24.7k|#define KMP_BARRIER_SLEEP_BIT 0 /* bit used for suspend/sleep part of state */
  |  |  ------------------
  ------------------
  217|  24.7k|  }
_ZN11kmp_flag_64ILb0ELb1EE6resumeEi:
  870|    166|  void resume(int th_gtid) { __kmp_resume_64(th_gtid, this); }
_ZN11flag_traitsIL9flag_type1EE14test_then_add4EPVy:
   77|  23.6k|  static inline flag_t test_then_add4(volatile flag_t *f) {
   78|  23.6k|    return KMP_TEST_THEN_ADD4_64(RCAST(volatile kmp_int64 *, f));
  ------------------
  |  |  747|  23.6k|  __sync_fetch_and_add((volatile kmp_int64 *)(p), 4LL)
  ------------------
   79|  23.6k|  }
_ZN11flag_traitsIL9flag_type1EE12test_then_orEPVyy:
   80|    171|  static inline flag_t test_then_or(volatile flag_t *f, flag_t v) {
   81|    171|    return KMP_TEST_THEN_OR64(f, v);
  ------------------
  |  |  789|    171|  __sync_fetch_and_or((volatile kmp_uint64 *)(p), (kmp_uint64)(v))
  ------------------
   82|    171|  }
_ZN11flag_traitsIL9flag_type1EE13test_then_andEPVyy:
   83|    171|  static inline flag_t test_then_and(volatile flag_t *f, flag_t v) {
   84|    171|    return KMP_TEST_THEN_AND64(f, v);
  ------------------
  |  |  791|    171|  __sync_fetch_and_and((volatile kmp_uint64 *)(p), (kmp_uint64)(v))
  ------------------
   85|    171|  }
_ZN11kmp_flag_64ILb0ELb1EEC2EPVyy:
  863|  24.0k|      : kmp_flag_native<kmp_uint64, flag64, Sleepable>(p, c) {}
_ZN15kmp_flag_nativeIyL9flag_type1ELb1EEC2EPVyy:
  154|  24.0k|      : kmp_flag<FlagType>(), loc(p), checker(c) {}
_ZN8kmp_flagIL9flag_type1EEC2Ev:
  113|  36.3k|  kmp_flag() : t({FlagType, 0U}), num_waiting_threads(0), sleepLoc(nullptr) {}
_ZN11kmp_flag_64ILb0ELb1EE4waitEP8kmp_infoi:
  879|  23.9k|            int final_spin USE_ITT_BUILD_ARG(void *itt_sync_obj)) {
  880|  23.9k|    if (final_spin)
  ------------------
  |  Branch (880:9): [True: 12.1k, False: 11.8k]
  ------------------
  881|  12.1k|      return __kmp_wait_template<kmp_flag_64, TRUE, Cancellable, Sleepable>(
  882|  12.1k|          this_thr, this USE_ITT_BUILD_ARG(itt_sync_obj));
  883|  11.8k|    else
  884|  11.8k|      return __kmp_wait_template<kmp_flag_64, FALSE, Cancellable, Sleepable>(
  885|  11.8k|          this_thr, this USE_ITT_BUILD_ARG(itt_sync_obj));
  886|  23.9k|  }
kmp_barrier.cpp:_ZL19__kmp_wait_templateI11kmp_flag_64ILb0ELb1EELb1ELb0ELb1EEbP8kmp_infoPT_:
  367|  12.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|  12.1k|  kmp_uint32 spins;
  372|  12.1k|  int th_gtid;
  373|  12.1k|  int tasks_completed = FALSE;
  ------------------
  |  | 1279|  12.1k|#define FALSE 0
  ------------------
  374|  12.1k|#if !KMP_USE_MONITOR
  375|  12.1k|  kmp_uint64 poll_count;
  376|  12.1k|  kmp_uint64 hibernate_goal;
  377|       |#else
  378|       |  kmp_uint32 hibernate;
  379|       |#endif
  380|  12.1k|  kmp_uint64 time;
  381|       |
  382|  12.1k|  KMP_FSYNC_SPIN_INIT(spin, NULL);
  ------------------
  |  |  337|  12.1k|#define KMP_FSYNC_SPIN_INIT(obj, spin) ((void)0)
  ------------------
  383|  12.1k|  if (flag->done_check()) {
  ------------------
  |  Branch (383:7): [True: 4, False: 12.1k]
  ------------------
  384|      4|    KMP_FSYNC_SPIN_ACQUIRED(CCAST(void *, spin));
  ------------------
  |  |  339|      4|#define KMP_FSYNC_SPIN_ACQUIRED(obj) ((void)0)
  ------------------
  385|      4|    return false;
  386|      4|  }
  387|  12.1k|  th_gtid = this_thr->th.th_info.ds.ds_gtid;
  388|  12.1k|  if (Cancellable) {
  ------------------
  |  Branch (388:7): [Folded, False: 12.1k]
  ------------------
  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|  12.1k|#if KMP_OS_UNIX
  394|  12.1k|  if (final_spin)
  ------------------
  |  Branch (394:7): [True: 12.1k, Folded]
  ------------------
  395|  12.1k|    KMP_ATOMIC_ST_REL(&this_thr->th.th_blocking, true);
  ------------------
  |  | 1251|  12.1k|#define KMP_ATOMIC_ST_REL(p, v) KMP_ATOMIC_OP(store, p, v, release)
  |  |  ------------------
  |  |  |  | 1246|  12.1k|#define KMP_ATOMIC_OP(op, p, v, order) (p)->op(v, std::memory_order_##order)
  |  |  ------------------
  ------------------
  396|  12.1k|#endif
  397|  12.1k|  KA_TRACE(20,
  398|  12.1k|           ("__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|  12.1k|#if OMPT_SUPPORT
  454|  12.1k|  ompt_state_t ompt_entry_state;
  455|  12.1k|  ompt_data_t *tId;
  456|  12.1k|  if (ompt_enabled.enabled) {
  ------------------
  |  Branch (456:7): [True: 0, False: 12.1k]
  ------------------
  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|  12.1k|#endif
  478|       |
  479|  12.1k|  KMP_INIT_YIELD(spins); // Setup for waiting
  ------------------
  |  | 1514|  12.1k|  { (count) = __kmp_yield_init; }
  ------------------
  480|  12.1k|  KMP_INIT_BACKOFF(time);
  ------------------
  |  | 1517|  12.1k|  { (time) = __kmp_pause_init; }
  ------------------
  481|       |
  482|  12.1k|  if (__kmp_dflt_blocktime != KMP_MAX_BLOCKTIME ||
  ------------------
  |  | 1184|  24.2k|  (INT_MAX) /* Must be this for "infinite" setting the work */
  ------------------
  |  Branch (482:7): [True: 12.1k, False: 0]
  ------------------
  483|  12.1k|      __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|  12.1k|    if (__kmp_pause_status == kmp_soft_paused) {
  ------------------
  |  Branch (512:9): [True: 0, False: 12.1k]
  ------------------
  513|       |      // Force immediate suspend
  514|      0|      hibernate_goal = KMP_NOW();
  ------------------
  |  | 1217|      0|#define KMP_NOW() __kmp_hardware_timestamp()
  ------------------
  515|      0|    } else
  516|  12.1k|      hibernate_goal = KMP_NOW() + this_thr->th.th_team_bt_intervals;
  ------------------
  |  | 1217|  12.1k|#define KMP_NOW() __kmp_hardware_timestamp()
  ------------------
  517|  12.1k|    poll_count = 0;
  518|  12.1k|    (void)poll_count;
  519|  12.1k|#endif // KMP_USE_MONITOR
  520|  12.1k|  }
  521|       |
  522|  12.1k|  KMP_MB();
  523|       |
  524|       |  // Main wait spin loop
  525|   167M|  while (flag->notdone_check()) {
  ------------------
  |  Branch (525:10): [True: 167M, False: 12.1k]
  ------------------
  526|   167M|    kmp_task_team_t *task_team = NULL;
  527|   167M|    if (__kmp_tasking_mode != tskm_immediate_exec) {
  ------------------
  |  Branch (527:9): [True: 167M, False: 18.4E]
  ------------------
  528|   167M|      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|   167M|      if (task_team != NULL) {
  ------------------
  |  Branch (536:11): [True: 167M, False: 18.4E]
  ------------------
  537|   167M|        if (TCR_SYNC_4(task_team->tt.tt_active)) {
  ------------------
  |  | 1135|   167M|#define TCR_SYNC_4(a) (a)
  |  |  ------------------
  |  |  |  Branch (1135:23): [True: 167M, False: 18.4E]
  |  |  ------------------
  ------------------
  538|   167M|          if (KMP_TASKING_ENABLED(task_team)) {
  ------------------
  |  | 2368|   167M|  (TRUE == TCR_SYNC_4((task_team)->tt.tt_found_tasks))
  |  |  ------------------
  |  |  |  | 1280|   167M|#define TRUE (!FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1279|   167M|#define FALSE 0
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 (TRUE == TCR_SYNC_4((task_team)->tt.tt_found_tasks))
  |  |  ------------------
  |  |  |  | 1135|   167M|#define TCR_SYNC_4(a) (a)
  |  |  ------------------
  |  |  |  Branch (2368:3): [True: 0, False: 167M]
  |  |  ------------------
  ------------------
  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|   167M|            this_thr->th.th_reap_state = KMP_SAFE_TO_REAP;
  ------------------
  |  | 2047|   167M|#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|  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|   167M|    } // if
  558|       |
  559|   167M|    KMP_FSYNC_SPIN_PREPARE(CCAST(void *, spin));
  ------------------
  |  |  338|   167M|#define KMP_FSYNC_SPIN_PREPARE(obj) ((void)0)
  ------------------
  560|   167M|    if (TCR_4(__kmp_global.g.g_done)) {
  ------------------
  |  | 1127|   167M|#define TCR_4(a) (a)
  |  |  ------------------
  |  |  |  Branch (1127:18): [True: 8, False: 167M]
  |  |  ------------------
  ------------------
  561|      8|      if (__kmp_global.g.g_abort)
  ------------------
  |  Branch (561:11): [True: 0, False: 8]
  ------------------
  562|      0|        __kmp_abort_thread();
  563|      8|      break;
  564|      8|    }
  565|       |
  566|       |    // If we are oversubscribed, or have waited a bit (and
  567|       |    // KMP_LIBRARY=throughput), then yield
  568|   167M|    KMP_YIELD_OVERSUB_ELSE_SPIN(spins, time);
  ------------------
  |  | 1564|   167M|  {                                                                            \
  |  | 1565|   167M|    if (__kmp_tpause_enabled) {                                                \
  |  |  ------------------
  |  |  |  Branch (1565:9): [True: 0, False: 167M]
  |  |  ------------------
  |  | 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|   167M|    } else {                                                                   \
  |  | 1573|   167M|      KMP_CPU_PAUSE();                                                         \
  |  |  ------------------
  |  |  |  | 1498|   167M|#define KMP_CPU_PAUSE() __kmp_x86_pause()
  |  |  ------------------
  |  | 1574|   167M|      if ((KMP_TRY_YIELD_OVERSUB)) {                                           \
  |  |  ------------------
  |  |  |  | 1526|   168M|  ((__kmp_use_yield == 1 || __kmp_use_yield == 2) && (KMP_OVERSUBSCRIBED))
  |  |  |  |  ------------------
  |  |  |  |  |  | 1520|   168M|  (TCR_4(__kmp_nth) > (__kmp_avail_proc ? __kmp_avail_proc : __kmp_xproc))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 1127|   168M|#define TCR_4(a) (a)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1520:24): [True: 168M, False: 237k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1526:5): [True: 167M, False: 0]
  |  |  |  |  |  Branch (1526:29): [True: 0, False: 0]
  |  |  |  |  |  Branch (1526:54): [True: 0, False: 168M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1575|      0|        __kmp_yield();                                                         \
  |  | 1576|   168M|      } else if (__kmp_use_yield == 1) {                                       \
  |  |  ------------------
  |  |  |  Branch (1576:18): [True: 168M, False: 18.4E]
  |  |  ------------------
  |  | 1577|   168M|        (count) -= 2;                                                          \
  |  | 1578|   168M|        if (!(count)) {                                                        \
  |  |  ------------------
  |  |  |  Branch (1578:13): [True: 732k, False: 168M]
  |  |  ------------------
  |  | 1579|   732k|          __kmp_yield();                                                       \
  |  | 1580|   732k|          (count) = __kmp_yield_next;                                          \
  |  | 1581|   732k|        }                                                                      \
  |  | 1582|   168M|      }                                                                        \
  |  | 1583|   167M|    }                                                                          \
  |  | 1584|   167M|  }
  ------------------
  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|   167M|    if (Cancellable) {
  ------------------
  |  Branch (580:9): [Folded, False: 167M]
  ------------------
  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|   168M|    if (task_team && KMP_HIDDEN_HELPER_WORKER_THREAD(th_gtid) &&
  ------------------
  |  | 4420|   336M|  ((gtid) > 1 && (gtid) <= __kmp_hidden_helper_threads_num)
  |  |  ------------------
  |  |  |  Branch (4420:4): [True: 168M, False: 126k]
  |  |  |  Branch (4420:18): [True: 0, False: 168M]
  |  |  ------------------
  ------------------
  |  Branch (596:9): [True: 168M, 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|   167M|    if (__kmp_dflt_blocktime == KMP_MAX_BLOCKTIME &&
  ------------------
  |  | 1184|   334M|  (INT_MAX) /* Must be this for "infinite" setting the work */
  ------------------
  |  Branch (607:9): [True: 0, False: 167M]
  ------------------
  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|   168M|    if (task_team != NULL && TCR_4(task_team->tt.tt_found_tasks) &&
  ------------------
  |  | 1127|   336M|#define TCR_4(a) (a)
  |  |  ------------------
  |  |  |  Branch (1127:18): [True: 0, False: 168M]
  |  |  ------------------
  ------------------
  |  Branch (612:9): [True: 168M, 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|   167M|    if (KMP_BLOCKING(hibernate_goal, poll_count++))
  ------------------
  |  | 1222|   167M|#define KMP_BLOCKING(goal, count) ((goal) > KMP_NOW())
  |  |  ------------------
  |  |  |  | 1217|   167M|#define KMP_NOW() __kmp_hardware_timestamp()
  |  |  ------------------
  |  |  |  Branch (1222:35): [True: 164M, False: 3.08M]
  |  |  ------------------
  ------------------
  622|   164M|      continue;
  623|  3.08M|#endif
  624|       |    // Don't suspend if wait loop designated non-sleepable
  625|       |    // in template parameters
  626|  3.08M|    if (!Sleepable)
  ------------------
  |  Branch (626:9): [Folded, False: 3.08M]
  ------------------
  627|      0|      continue;
  628|       |
  629|  3.08M|#if KMP_HAVE_MWAIT || KMP_HAVE_UMWAIT
  630|  3.08M|    if (__kmp_mwait_enabled || __kmp_umwait_enabled) {
  ------------------
  |  Branch (630:9): [True: 3.08M, False: 144]
  |  Branch (630:32): [True: 0, False: 144]
  ------------------
  631|      0|      KF_TRACE(50, ("__kmp_wait_sleep: T#%d using monitor/mwait\n", th_gtid));
  632|      0|      flag->mwait(th_gtid);
  633|  3.08M|    } else {
  634|  3.08M|#endif
  635|  3.08M|      KF_TRACE(50, ("__kmp_wait_sleep: T#%d suspend time reached\n", th_gtid));
  636|  3.08M|#if KMP_OS_UNIX
  637|  3.08M|      if (final_spin)
  ------------------
  |  Branch (637:11): [True: 144, Folded]
  ------------------
  638|  3.08M|        KMP_ATOMIC_ST_REL(&this_thr->th.th_blocking, false);
  ------------------
  |  | 1251|    144|#define KMP_ATOMIC_ST_REL(p, v) KMP_ATOMIC_OP(store, p, v, release)
  |  |  ------------------
  |  |  |  | 1246|    144|#define KMP_ATOMIC_OP(op, p, v, order) (p)->op(v, std::memory_order_##order)
  |  |  ------------------
  ------------------
  639|  3.08M|#endif
  640|  3.08M|      flag->suspend(th_gtid);
  641|  3.08M|#if KMP_OS_UNIX
  642|  3.08M|      if (final_spin)
  ------------------
  |  Branch (642:11): [True: 144, Folded]
  ------------------
  643|  3.08M|        KMP_ATOMIC_ST_REL(&this_thr->th.th_blocking, true);
  ------------------
  |  | 1251|    144|#define KMP_ATOMIC_ST_REL(p, v) KMP_ATOMIC_OP(store, p, v, release)
  |  |  ------------------
  |  |  |  | 1246|    144|#define KMP_ATOMIC_OP(op, p, v, order) (p)->op(v, std::memory_order_##order)
  |  |  ------------------
  ------------------
  644|  3.08M|#endif
  645|  3.08M|#if KMP_HAVE_MWAIT || KMP_HAVE_UMWAIT
  646|  3.08M|    }
  647|  3.08M|#endif
  648|       |
  649|  3.08M|    if (TCR_4(__kmp_global.g.g_done)) {
  ------------------
  |  | 1127|  3.08M|#define TCR_4(a) (a)
  |  |  ------------------
  |  |  |  Branch (1127:18): [True: 1, False: 3.08M]
  |  |  ------------------
  ------------------
  650|      1|      if (__kmp_global.g.g_abort)
  ------------------
  |  Branch (650:11): [True: 0, False: 1]
  ------------------
  651|      0|        __kmp_abort_thread();
  652|      1|      break;
  653|  3.08M|    } else if (__kmp_tasking_mode != tskm_immediate_exec &&
  ------------------
  |  Branch (653:16): [True: 142, False: 3.08M]
  ------------------
  654|    142|               this_thr->th.th_reap_state == KMP_SAFE_TO_REAP) {
  ------------------
  |  | 2047|    142|#define KMP_SAFE_TO_REAP 1 // Thread th_reap_state: safe to reap (not tasking)
  ------------------
  |  Branch (654:16): [True: 120, False: 22]
  ------------------
  655|    120|      this_thr->th.th_reap_state = KMP_NOT_SAFE_TO_REAP;
  ------------------
  |  | 2046|    120|  0 // Thread th_reap_state: not safe to reap (tasking)
  ------------------
  656|    120|    }
  657|       |    // TODO: If thread is done with work and times out, disband/free
  658|  3.08M|  }
  659|       |
  660|  12.1k|#if OMPT_SUPPORT
  661|  12.1k|  ompt_state_t ompt_exit_state = this_thr->th.ompt_thread_info.state;
  662|  12.1k|  if (ompt_enabled.enabled && ompt_exit_state != ompt_state_undefined) {
  ------------------
  |  Branch (662:7): [True: 0, False: 12.1k]
  |  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|  12.1k|#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|  12.1k|#if KMP_OS_UNIX
  684|  12.1k|  if (final_spin)
  ------------------
  |  Branch (684:7): [True: 11.9k, Folded]
  ------------------
  685|  12.1k|    KMP_ATOMIC_ST_REL(&this_thr->th.th_blocking, false);
  ------------------
  |  | 1251|  11.9k|#define KMP_ATOMIC_ST_REL(p, v) KMP_ATOMIC_OP(store, p, v, release)
  |  |  ------------------
  |  |  |  | 1246|  11.9k|#define KMP_ATOMIC_OP(op, p, v, order) (p)->op(v, std::memory_order_##order)
  |  |  ------------------
  ------------------
  686|  12.1k|#endif
  687|  12.1k|  KMP_FSYNC_SPIN_ACQUIRED(CCAST(void *, spin));
  ------------------
  |  |  339|  12.1k|#define KMP_FSYNC_SPIN_ACQUIRED(obj) ((void)0)
  ------------------
  688|  12.1k|  if (Cancellable) {
  ------------------
  |  Branch (688:7): [Folded, False: 12.1k]
  ------------------
  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|  12.1k|  return false;
  703|  12.1k|}
_ZN11kmp_flag_64ILb0ELb1EE7suspendEi:
  866|    171|  void suspend(int th_gtid) { __kmp_suspend_64(th_gtid, this); }
kmp_barrier.cpp:_ZL19__kmp_wait_templateI11kmp_flag_64ILb0ELb1EELb0ELb0ELb1EEbP8kmp_infoPT_:
  367|  12.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|  12.1k|  kmp_uint32 spins;
  372|  12.1k|  int th_gtid;
  373|  12.1k|  int tasks_completed = FALSE;
  ------------------
  |  | 1279|  12.1k|#define FALSE 0
  ------------------
  374|  12.1k|#if !KMP_USE_MONITOR
  375|  12.1k|  kmp_uint64 poll_count;
  376|  12.1k|  kmp_uint64 hibernate_goal;
  377|       |#else
  378|       |  kmp_uint32 hibernate;
  379|       |#endif
  380|  12.1k|  kmp_uint64 time;
  381|       |
  382|  12.1k|  KMP_FSYNC_SPIN_INIT(spin, NULL);
  ------------------
  |  |  337|  12.1k|#define KMP_FSYNC_SPIN_INIT(obj, spin) ((void)0)
  ------------------
  383|  12.1k|  if (flag->done_check()) {
  ------------------
  |  Branch (383:7): [True: 6.83k, False: 5.27k]
  ------------------
  384|  6.83k|    KMP_FSYNC_SPIN_ACQUIRED(CCAST(void *, spin));
  ------------------
  |  |  339|  6.83k|#define KMP_FSYNC_SPIN_ACQUIRED(obj) ((void)0)
  ------------------
  385|  6.83k|    return false;
  386|  6.83k|  }
  387|  5.27k|  th_gtid = this_thr->th.th_info.ds.ds_gtid;
  388|  5.27k|  if (Cancellable) {
  ------------------
  |  Branch (388:7): [Folded, False: 5.27k]
  ------------------
  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|  5.27k|#if KMP_OS_UNIX
  394|  5.27k|  if (final_spin)
  ------------------
  |  Branch (394:7): [Folded, False: 5.27k]
  ------------------
  395|  5.27k|    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|  5.27k|#endif
  397|  5.27k|  KA_TRACE(20,
  398|  5.27k|           ("__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|  5.27k|#if OMPT_SUPPORT
  454|  5.27k|  ompt_state_t ompt_entry_state;
  455|  5.27k|  ompt_data_t *tId;
  456|  5.27k|  if (ompt_enabled.enabled) {
  ------------------
  |  Branch (456:7): [True: 0, False: 5.27k]
  ------------------
  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|  5.27k|#endif
  478|       |
  479|  5.27k|  KMP_INIT_YIELD(spins); // Setup for waiting
  ------------------
  |  | 1514|  5.27k|  { (count) = __kmp_yield_init; }
  ------------------
  480|  5.27k|  KMP_INIT_BACKOFF(time);
  ------------------
  |  | 1517|  5.27k|  { (time) = __kmp_pause_init; }
  ------------------
  481|       |
  482|  5.27k|  if (__kmp_dflt_blocktime != KMP_MAX_BLOCKTIME ||
  ------------------
  |  | 1184|  10.5k|  (INT_MAX) /* Must be this for "infinite" setting the work */
  ------------------
  |  Branch (482:7): [True: 5.27k, False: 0]
  ------------------
  483|  5.28k|      __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|  5.28k|    if (__kmp_pause_status == kmp_soft_paused) {
  ------------------
  |  Branch (512:9): [True: 0, False: 5.28k]
  ------------------
  513|       |      // Force immediate suspend
  514|      0|      hibernate_goal = KMP_NOW();
  ------------------
  |  | 1217|      0|#define KMP_NOW() __kmp_hardware_timestamp()
  ------------------
  515|      0|    } else
  516|  5.28k|      hibernate_goal = KMP_NOW() + this_thr->th.th_team_bt_intervals;
  ------------------
  |  | 1217|  5.28k|#define KMP_NOW() __kmp_hardware_timestamp()
  ------------------
  517|  5.28k|    poll_count = 0;
  518|  5.28k|    (void)poll_count;
  519|  5.28k|#endif // KMP_USE_MONITOR
  520|  5.28k|  }
  521|       |
  522|  5.27k|  KMP_MB();
  523|       |
  524|       |  // Main wait spin loop
  525|  79.6M|  while (flag->notdone_check()) {
  ------------------
  |  Branch (525:10): [True: 79.6M, False: 5.27k]
  ------------------
  526|  79.6M|    kmp_task_team_t *task_team = NULL;
  527|  79.6M|    if (__kmp_tasking_mode != tskm_immediate_exec) {
  ------------------
  |  Branch (527:9): [True: 79.6M, False: 8.72k]
  ------------------
  528|  79.6M|      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|  79.6M|      if (task_team != NULL) {
  ------------------
  |  Branch (536:11): [True: 79.6M, False: 18.4E]
  ------------------
  537|  79.6M|        if (TCR_SYNC_4(task_team->tt.tt_active)) {
  ------------------
  |  | 1135|  79.6M|#define TCR_SYNC_4(a) (a)
  |  |  ------------------
  |  |  |  Branch (1135:23): [True: 79.6M, False: 18.4E]
  |  |  ------------------
  ------------------
  538|  79.6M|          if (KMP_TASKING_ENABLED(task_team)) {
  ------------------
  |  | 2368|  79.6M|  (TRUE == TCR_SYNC_4((task_team)->tt.tt_found_tasks))
  |  |  ------------------
  |  |  |  | 1280|  79.6M|#define TRUE (!FALSE)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1279|  79.6M|#define FALSE 0
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 (TRUE == TCR_SYNC_4((task_team)->tt.tt_found_tasks))
  |  |  ------------------
  |  |  |  | 1135|  79.6M|#define TCR_SYNC_4(a) (a)
  |  |  ------------------
  |  |  |  Branch (2368:3): [True: 0, False: 79.6M]
  |  |  ------------------
  ------------------
  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|  79.6M|            this_thr->th.th_reap_state = KMP_SAFE_TO_REAP;
  ------------------
  |  | 2047|  79.6M|#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): [Folded, False: 18.4E]
  |  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|  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|  79.6M|    } // if
  558|       |
  559|  79.6M|    KMP_FSYNC_SPIN_PREPARE(CCAST(void *, spin));
  ------------------
  |  |  338|  79.6M|#define KMP_FSYNC_SPIN_PREPARE(obj) ((void)0)
  ------------------
  560|  79.6M|    if (TCR_4(__kmp_global.g.g_done)) {
  ------------------
  |  | 1127|  79.6M|#define TCR_4(a) (a)
  |  |  ------------------
  |  |  |  Branch (1127:18): [True: 0, False: 79.6M]
  |  |  ------------------
  ------------------
  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|  79.6M|    KMP_YIELD_OVERSUB_ELSE_SPIN(spins, time);
  ------------------
  |  | 1564|  79.6M|  {                                                                            \
  |  | 1565|  79.6M|    if (__kmp_tpause_enabled) {                                                \
  |  |  ------------------
  |  |  |  Branch (1565:9): [True: 0, False: 79.6M]
  |  |  ------------------
  |  | 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|  79.6M|    } else {                                                                   \
  |  | 1573|  79.6M|      KMP_CPU_PAUSE();                                                         \
  |  |  ------------------
  |  |  |  | 1498|  79.6M|#define KMP_CPU_PAUSE() __kmp_x86_pause()
  |  |  ------------------
  |  | 1574|  79.6M|      if ((KMP_TRY_YIELD_OVERSUB)) {                                           \
  |  |  ------------------
  |  |  |  | 1526|  80.0M|  ((__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|  80.0M|#define TCR_4(a) (a)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1520:24): [True: 80.1M, False: 18.4E]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1526:5): [True: 79.6M, False: 0]
  |  |  |  |  |  Branch (1526:29): [True: 0, False: 0]
  |  |  |  |  |  Branch (1526:54): [True: 0, False: 80.0M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1575|      0|        __kmp_yield();                                                         \
  |  | 1576|  80.1M|      } else if (__kmp_use_yield == 1) {                                       \
  |  |  ------------------
  |  |  |  Branch (1576:18): [True: 80.1M, False: 18.4E]
  |  |  ------------------
  |  | 1577|  80.1M|        (count) -= 2;                                                          \
  |  | 1578|  80.1M|        if (!(count)) {                                                        \
  |  |  ------------------
  |  |  |  Branch (1578:13): [True: 321k, False: 79.8M]
  |  |  ------------------
  |  | 1579|   321k|          __kmp_yield();                                                       \
  |  | 1580|   321k|          (count) = __kmp_yield_next;                                          \
  |  | 1581|   321k|        }                                                                      \
  |  | 1582|  80.1M|      }                                                                        \
  |  | 1583|  79.6M|    }                                                                          \
  |  | 1584|  79.6M|  }
  ------------------
  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|  79.6M|    if (Cancellable) {
  ------------------
  |  Branch (580:9): [Folded, False: 79.6M]
  ------------------
  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|  80.0M|    if (task_team && KMP_HIDDEN_HELPER_WORKER_THREAD(th_gtid) &&
  ------------------
  |  | 4420|   159M|  ((gtid) > 1 && (gtid) <= __kmp_hidden_helper_threads_num)
  |  |  ------------------
  |  |  |  Branch (4420:4): [True: 74.4M, False: 5.60M]
  |  |  |  Branch (4420:18): [True: 0, False: 74.4M]
  |  |  ------------------
  ------------------
  |  Branch (596:9): [True: 80.0M, 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|  79.6M|    if (__kmp_dflt_blocktime == KMP_MAX_BLOCKTIME &&
  ------------------
  |  | 1184|   159M|  (INT_MAX) /* Must be this for "infinite" setting the work */
  ------------------
  |  Branch (607:9): [True: 0, False: 79.6M]
  ------------------
  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|  80.0M|    if (task_team != NULL && TCR_4(task_team->tt.tt_found_tasks) &&
  ------------------
  |  | 1127|   159M|#define TCR_4(a) (a)
  |  |  ------------------
  |  |  |  Branch (1127:18): [True: 0, False: 80.0M]
  |  |  ------------------
  ------------------
  |  Branch (612:9): [True: 80.0M, 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|  79.6M|    if (KMP_BLOCKING(hibernate_goal, poll_count++))
  ------------------
  |  | 1222|  79.6M|#define KMP_BLOCKING(goal, count) ((goal) > KMP_NOW())
  |  |  ------------------
  |  |  |  | 1217|  79.6M|#define KMP_NOW() __kmp_hardware_timestamp()
  |  |  ------------------
  |  |  |  Branch (1222:35): [True: 79.4M, False: 159k]
  |  |  ------------------
  ------------------
  622|  79.4M|      continue;
  623|   159k|#endif
  624|       |    // Don't suspend if wait loop designated non-sleepable
  625|       |    // in template parameters
  626|   159k|    if (!Sleepable)
  ------------------
  |  Branch (626:9): [Folded, False: 159k]
  ------------------
  627|      0|      continue;
  628|       |
  629|   159k|#if KMP_HAVE_MWAIT || KMP_HAVE_UMWAIT
  630|   159k|    if (__kmp_mwait_enabled || __kmp_umwait_enabled) {
  ------------------
  |  Branch (630:9): [True: 159k, False: 27]
  |  Branch (630:32): [True: 0, False: 27]
  ------------------
  631|      0|      KF_TRACE(50, ("__kmp_wait_sleep: T#%d using monitor/mwait\n", th_gtid));
  632|      0|      flag->mwait(th_gtid);
  633|   159k|    } else {
  634|   159k|#endif
  635|   159k|      KF_TRACE(50, ("__kmp_wait_sleep: T#%d suspend time reached\n", th_gtid));
  636|   159k|#if KMP_OS_UNIX
  637|   159k|      if (final_spin)
  ------------------
  |  Branch (637:11): [Folded, False: 159k]
  ------------------
  638|   159k|        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|   159k|#endif
  640|   159k|      flag->suspend(th_gtid);
  641|   159k|#if KMP_OS_UNIX
  642|   159k|      if (final_spin)
  ------------------
  |  Branch (642:11): [Folded, False: 159k]
  ------------------
  643|   159k|        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|   159k|#endif
  645|   159k|#if KMP_HAVE_MWAIT || KMP_HAVE_UMWAIT
  646|   159k|    }
  647|   159k|#endif
  648|       |
  649|   159k|    if (TCR_4(__kmp_global.g.g_done)) {
  ------------------
  |  | 1127|   159k|#define TCR_4(a) (a)
  |  |  ------------------
  |  |  |  Branch (1127:18): [True: 0, False: 159k]
  |  |  ------------------
  ------------------
  650|      0|      if (__kmp_global.g.g_abort)
  ------------------
  |  Branch (650:11): [True: 0, False: 0]
  ------------------
  651|      0|        __kmp_abort_thread();
  652|      0|      break;
  653|   159k|    } else if (__kmp_tasking_mode != tskm_immediate_exec &&
  ------------------
  |  Branch (653:16): [True: 27, False: 159k]
  ------------------
  654|     27|               this_thr->th.th_reap_state == KMP_SAFE_TO_REAP) {
  ------------------
  |  | 2047|     27|#define KMP_SAFE_TO_REAP 1 // Thread th_reap_state: safe to reap (not tasking)
  ------------------
  |  Branch (654:16): [True: 27, False: 0]
  ------------------
  655|     27|      this_thr->th.th_reap_state = KMP_NOT_SAFE_TO_REAP;
  ------------------
  |  | 2046|     27|  0 // Thread th_reap_state: not safe to reap (tasking)
  ------------------
  656|     27|    }
  657|       |    // TODO: If thread is done with work and times out, disband/free
  658|   159k|  }
  659|       |
  660|  5.27k|#if OMPT_SUPPORT
  661|  5.27k|  ompt_state_t ompt_exit_state = this_thr->th.ompt_thread_info.state;
  662|  5.27k|  if (ompt_enabled.enabled && ompt_exit_state != ompt_state_undefined) {
  ------------------
  |  Branch (662:7): [True: 0, False: 5.27k]
  |  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|  5.27k|#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|  5.27k|#if KMP_OS_UNIX
  684|  5.27k|  if (final_spin)
  ------------------
  |  Branch (684:7): [Folded, False: 5.27k]
  ------------------
  685|  5.27k|    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|  5.27k|#endif
  687|  5.27k|  KMP_FSYNC_SPIN_ACQUIRED(CCAST(void *, spin));
  ------------------
  |  |  339|  5.27k|#define KMP_FSYNC_SPIN_ACQUIRED(obj) ((void)0)
  ------------------
  688|  5.27k|  if (Cancellable) {
  ------------------
  |  Branch (688:7): [Folded, False: 5.27k]
  ------------------
  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|  5.27k|  return false;
  703|  5.27k|}
_ZN11kmp_flag_64ILb0ELb1EE7releaseEv:
  887|  23.7k|  void release() { __kmp_release_template(this); }
kmp_barrier.cpp:_ZL22__kmp_release_templateI11kmp_flag_64ILb0ELb1EEEvPT_:
  788|  23.7k|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|  23.7k|  KF_TRACE(20, ("__kmp_release: T#%d releasing flag(%x)\n", gtid, flag->get()));
  793|  23.7k|  KMP_DEBUG_ASSERT(flag->get());
  794|  23.7k|  KMP_FSYNC_RELEASING(flag->get_void_p());
  ------------------
  |  |  335|  23.7k|#define KMP_FSYNC_RELEASING(obj) ((void)0)
  ------------------
  795|       |
  796|  23.7k|  flag->internal_release();
  797|       |
  798|  23.7k|  KF_TRACE(100, ("__kmp_release: T#%d set new spin=%d\n", gtid, flag->get(),
  799|  23.7k|                 flag->load()));
  800|       |
  801|  24.2k|  if (__kmp_dflt_blocktime != KMP_MAX_BLOCKTIME) {
  ------------------
  |  | 1184|  23.7k|  (INT_MAX) /* Must be this for "infinite" setting the work */
  ------------------
  |  Branch (801:7): [True: 24.2k, 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|  24.2k|    if (flag->is_any_sleeping()) {
  ------------------
  |  Branch (804:9): [True: 168, False: 24.0k]
  ------------------
  805|    333|      for (unsigned int i = 0; i < flag->get_num_waiters(); ++i) {
  ------------------
  |  Branch (805:32): [True: 165, False: 168]
  ------------------
  806|       |        // if sleeping waiter exists at i, sets current_waiter to i inside flag
  807|    165|        kmp_info_t *waiter = flag->get_waiter(i);
  808|    165|        if (waiter) {
  ------------------
  |  Branch (808:13): [True: 165, False: 0]
  ------------------
  809|    165|          int wait_gtid = waiter->th.th_info.ds.ds_gtid;
  810|       |          // Wake up thread if needed
  811|    165|          KF_TRACE(50, ("__kmp_release: T#%d waking up thread T#%d since sleep "
  812|    165|                        "flag(%p) set\n",
  813|    165|                        gtid, wait_gtid, flag->get()));
  814|    165|          flag->resume(wait_gtid); // unsets flag's current_waiter when done
  815|    165|        }
  816|    165|      }
  817|    168|    }
  818|  24.2k|  }
  819|  23.7k|}
_ZN15kmp_flag_nativeIyL9flag_type1ELb1EE16internal_releaseEv:
  186|  23.7k|  void internal_release() {
  187|  23.7k|    (void)traits_type::test_then_add4((volatile PtrType *)this->get());
  188|  23.7k|  }
_ZN15kmp_flag_nativeIyL9flag_type1ELb1EE15is_any_sleepingEv:
  224|  24.2k|  bool is_any_sleeping() {
  225|  24.2k|    if (this->sleepLoc)
  ------------------
  |  Branch (225:9): [True: 0, False: 24.2k]
  ------------------
  226|      0|      return this->sleepLoc->load();
  227|  24.2k|    return is_sleeping_val(*(this->get()));
  228|  24.2k|  }
_ZN8kmp_flagIL9flag_type1EE15get_num_waitersEv:
  128|    336|  kmp_uint32 get_num_waiters() { return num_waiting_threads; }
_ZN8kmp_flagIL9flag_type1EE10get_waiterEj:
  123|    166|  kmp_info_t *get_waiter(kmp_uint32 i) {
  124|    166|    KMP_DEBUG_ASSERT(i < num_waiting_threads);
  125|    166|    return waiting_threads[i];
  126|    166|  }
_ZN11kmp_flag_64ILb0ELb1EEC2EPVy:
  859|  12.4k|      : kmp_flag_native<kmp_uint64, flag64, Sleepable>(p) {}
_ZN15kmp_flag_nativeIyL9flag_type1ELb1EEC2EPVy:
  148|  12.4k|  kmp_flag_native(volatile PtrType *p) : kmp_flag<FlagType>(), loc(p) {}
_ZN8kmp_flagIL9flag_type1EE10set_waiterEP8kmp_info:
  131|  12.1k|  void set_waiter(kmp_info_t *thr) {
  132|  12.1k|    waiting_threads[0] = thr;
  133|  12.1k|    num_waiting_threads = 1;
  134|  12.1k|  }
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: 1, False: 30]
  ------------------
  805|      2|      for (unsigned int i = 0; i < flag->get_num_waiters(); ++i) {
  ------------------
  |  Branch (805:32): [True: 1, False: 1]
  ------------------
  806|       |        // if sleeping waiter exists at i, sets current_waiter to i inside flag
  807|      1|        kmp_info_t *waiter = flag->get_waiter(i);
  808|      1|        if (waiter) {
  ------------------
  |  Branch (808:13): [True: 1, False: 0]
  ------------------
  809|      1|          int wait_gtid = waiter->th.th_info.ds.ds_gtid;
  810|       |          // Wake up thread if needed
  811|      1|          KF_TRACE(50, ("__kmp_release: T#%d waking up thread T#%d since sleep "
  812|      1|                        "flag(%p) set\n",
  813|      1|                        gtid, wait_gtid, flag->get()));
  814|      1|          flag->resume(wait_gtid); // unsets flag's current_waiter when done
  815|      1|        }
  816|      1|      }
  817|      1|    }
  818|     31|  }
  819|     31|}
_ZN15kmp_flag_nativeIyL9flag_type1ELb1EE12set_sleepingEv:
  192|    171|  PtrType set_sleeping() {
  193|    171|    if (this->sleepLoc) {
  ------------------
  |  Branch (193:9): [True: 0, False: 171]
  ------------------
  194|      0|      this->sleepLoc->store(true);
  195|      0|      return *(this->get());
  196|      0|    }
  197|    171|    return traits_type::test_then_or((volatile PtrType *)this->get(),
  198|    171|                                     KMP_BARRIER_SLEEP_STATE);
  ------------------
  |  | 2023|    171|#define KMP_BARRIER_SLEEP_STATE (1 << KMP_BARRIER_SLEEP_BIT)
  |  |  ------------------
  |  |  |  | 2019|    171|#define KMP_BARRIER_SLEEP_BIT 0 /* bit used for suspend/sleep part of state */
  |  |  ------------------
  ------------------
  199|    171|  }
_ZN15kmp_flag_nativeIyL9flag_type1ELb1EE14unset_sleepingEv:
  203|    171|  void unset_sleeping() {
  204|    171|    if (this->sleepLoc) {
  ------------------
  |  Branch (204:9): [True: 0, False: 171]
  ------------------
  205|      0|      this->sleepLoc->store(false);
  206|      0|      return;
  207|      0|    }
  208|    171|    traits_type::test_then_and((volatile PtrType *)this->get(),
  209|    171|                               ~KMP_BARRIER_SLEEP_STATE);
  ------------------
  |  | 2023|    171|#define KMP_BARRIER_SLEEP_STATE (1 << KMP_BARRIER_SLEEP_BIT)
  |  |  ------------------
  |  |  |  | 2019|    171|#define KMP_BARRIER_SLEEP_BIT 0 /* bit used for suspend/sleep part of state */
  |  |  ------------------
  ------------------
  210|    171|  }
_ZN8kmp_flagIL9flag_type1EE8get_typeEv:
  119|    340|  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|    426|void __ompt_team_assign_id(kmp_team_t *team, ompt_data_t ompt_pid) {
  502|    426|  team->t.ompt_team_info.parallel_data = ompt_pid;
  503|    426|}

_ZN22OmptReturnAddressGuardC2EiPv:
  139|  3.04k|  OmptReturnAddressGuard(int Gtid, void *ReturnAddress) : Gtid(Gtid) {
  140|  3.04k|    if (ompt_enabled.enabled && Gtid >= 0 && __kmp_threads[Gtid] &&
  ------------------
  |  Branch (140:9): [True: 0, False: 3.04k]
  |  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|  3.04k|  }
_ZN22OmptReturnAddressGuardD2Ev:
  146|  3.04k|  ~OmptReturnAddressGuard() {
  147|  3.04k|    if (SetAddress)
  ------------------
  |  Branch (147:9): [True: 0, False: 3.04k]
  ------------------
  148|      0|      __kmp_threads[Gtid]->th.ompt_thread_info.return_address = NULL;
  149|  3.04k|  }
_Z26__ompt_load_return_addressi:
   79|  2.65k|inline void *__ompt_load_return_address(int gtid) {
   80|  2.65k|  kmp_info_t *thr = __kmp_threads[gtid];
   81|  2.65k|  void *return_address = thr->th.ompt_thread_info.return_address;
   82|       |  thr->th.ompt_thread_info.return_address = NULL;
   83|  2.65k|  return return_address;
   84|  2.65k|}
_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|    370|void __kmp_suspend_initialize_thread(kmp_info_t *th) {
 1336|    370|  int old_value = KMP_ATOMIC_LD_RLX(&th->th.th_suspend_init_count);
  ------------------
  |  | 1250|    370|#define KMP_ATOMIC_LD_RLX(p) KMP_ATOMIC_LD(p, relaxed)
  |  |  ------------------
  |  |  |  | 1245|    370|#define KMP_ATOMIC_LD(p, order) (p)->load(std::memory_order_##order)
  |  |  ------------------
  ------------------
 1337|    370|  int new_value = __kmp_fork_count + 1;
 1338|       |  // Return if already initialized
 1339|    370|  if (old_value == new_value)
  ------------------
  |  Branch (1339:7): [True: 339, False: 31]
  ------------------
 1340|    339|    return;
 1341|       |  // Wait, then return if being initialized
 1342|     31|  if (old_value == -1 || !__kmp_atomic_compare_store(
  ------------------
  |  Branch (1342:7): [True: 0, False: 31]
  |  Branch (1342:26): [True: 0, False: 31]
  ------------------
 1343|     31|                             &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|     31|  } else {
 1348|       |    // Claim to be the initializer and do initializations
 1349|     31|    int status;
 1350|     31|    status = pthread_cond_init(&th->th.th_suspend_cv.c_cond,
 1351|     31|                               &__kmp_suspend_cond_attr);
 1352|     31|    KMP_CHECK_SYSFAIL("pthread_cond_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|  }
  ------------------
 1353|     31|    status = pthread_mutex_init(&th->th.th_suspend_mx.m_mutex,
 1354|     31|                                &__kmp_suspend_mutex_attr);
 1355|     31|    KMP_CHECK_SYSFAIL("pthread_mutex_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|  }
  ------------------
 1356|     31|    KMP_ATOMIC_ST_REL(&th->th.th_suspend_init_count, new_value);
  ------------------
  |  | 1251|     31|#define KMP_ATOMIC_ST_REL(p, v) KMP_ATOMIC_OP(store, p, v, release)
  |  |  ------------------
  |  |  |  | 1246|     31|#define KMP_ATOMIC_OP(op, p, v, order) (p)->op(v, std::memory_order_##order)
  |  |  ------------------
  ------------------
 1357|     31|  }
 1358|     31|}
__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: 31, False: 1]
  ------------------
 1362|       |    /* this means we have initialize the suspension pthread objects for this
 1363|       |       thread in this instance of the process */
 1364|     31|    int status;
 1365|       |
 1366|     31|    status = pthread_cond_destroy(&th->th.th_suspend_cv.c_cond);
 1367|     31|    if (status != 0 && status != EBUSY) {
  ------------------
  |  Branch (1367:9): [True: 0, False: 31]
  |  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|     31|    status = pthread_mutex_destroy(&th->th.th_suspend_mx.m_mutex);
 1371|     31|    if (status != 0 && status != EBUSY) {
  ------------------
  |  Branch (1371:9): [True: 0, False: 31]
  |  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|     31|    --th->th.th_suspend_init_count;
 1375|     31|    KMP_DEBUG_ASSERT(KMP_ATOMIC_LD_RLX(&th->th.th_suspend_init_count) ==
 1376|     31|                     __kmp_fork_count);
 1377|     31|  }
 1378|     32|}
__kmp_lock_suspend_mx:
 1385|    370|void __kmp_lock_suspend_mx(kmp_info_t *th) {
 1386|    370|  int status = pthread_mutex_lock(&th->th.th_suspend_mx.m_mutex);
 1387|    370|  KMP_CHECK_SYSFAIL("pthread_mutex_lock", status);
  ------------------
  |  |  153|    370|  {                                                                            \
  |  |  154|    370|    if (error) {                                                               \
  |  |  ------------------
  |  |  |  Branch (154:9): [True: 0, False: 370]
  |  |  ------------------
  |  |  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|    370|  }
  ------------------
 1388|    370|}
__kmp_unlock_suspend_mx:
 1390|    371|void __kmp_unlock_suspend_mx(kmp_info_t *th) {
 1391|    371|  int status = pthread_mutex_unlock(&th->th.th_suspend_mx.m_mutex);
 1392|    371|  KMP_CHECK_SYSFAIL("pthread_mutex_unlock", status);
  ------------------
  |  |  153|    371|  {                                                                            \
  |  |  154|    371|    if (error) {                                                               \
  |  |  ------------------
  |  |  |  Branch (154:9): [True: 0, False: 371]
  |  |  ------------------
  |  |  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|    371|  }
  ------------------
 1393|    371|}
_Z16__kmp_suspend_64ILb0ELb1EEviP11kmp_flag_64IXT_EXT0_EE:
 1561|    171|void __kmp_suspend_64(int th_gtid, kmp_flag_64<C, S> *flag) {
 1562|    171|  __kmp_suspend_template(th_gtid, flag);
 1563|    171|}
_Z15__kmp_resume_64ILb0ELb1EEviP11kmp_flag_64IXT_EXT0_EE:
 1667|    168|void __kmp_resume_64(int target_gtid, kmp_flag_64<C, S> *flag) {
 1668|    168|  __kmp_resume_template(target_gtid, flag);
 1669|    168|}
__kmp_yield:
 1714|  1.05M|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.91k|  while ((now = __kmp_hardware_timestamp()) < goal)
  ------------------
  |  Branch (2007:10): [True: 3.91k, False: 1]
  ------------------
 2008|  3.91k|    ;
 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|    171|static inline void __kmp_suspend_template(int th_gtid, C *flag) {
 1399|    171|  KMP_TIME_DEVELOPER_PARTITIONED_BLOCK(USER_suspend);
  ------------------
  |  | 1008|    171|#define KMP_TIME_DEVELOPER_PARTITIONED_BLOCK(n) ((void)0)
  ------------------
 1400|    171|  kmp_info_t *th = __kmp_threads[th_gtid];
 1401|    171|  int status;
 1402|    171|  typename C::flag_t old_spin;
 1403|       |
 1404|    171|  KF_TRACE(30, ("__kmp_suspend_template: T#%d enter for flag = %p\n", th_gtid,
 1405|    171|                flag->get()));
 1406|       |
 1407|    171|  __kmp_suspend_initialize_thread(th);
 1408|       |
 1409|    171|  __kmp_lock_suspend_mx(th);
 1410|       |
 1411|    171|  KF_TRACE(10, ("__kmp_suspend_template: T#%d setting sleep bit for spin(%p)\n",
 1412|    171|                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|    171|  old_spin = flag->set_sleeping();
 1417|    171|  TCW_PTR(th->th.th_sleep_loc, (void *)flag);
  ------------------
  |  | 1157|    171|#define TCW_PTR(a, b) TCW_8((a), (b))
  |  |  ------------------
  |  |  |  | 1132|    171|#define TCW_8(a, b) (a) = (b)
  |  |  ------------------
  ------------------
 1418|    171|  th->th.th_sleep_loc_type = flag->get_type();
 1419|    171|  if (__kmp_dflt_blocktime == KMP_MAX_BLOCKTIME &&
  ------------------
  |  | 1184|    342|  (INT_MAX) /* Must be this for "infinite" setting the work */
  ------------------
  |  Branch (1419:7): [True: 0, False: 171]
  ------------------
 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|    171|  KF_TRACE(5, ("__kmp_suspend_template: T#%d set sleep bit for spin(%p)==%x,"
 1428|    171|               " was %x\n",
 1429|    171|               th_gtid, flag->get(), flag->load(), old_spin));
 1430|       |
 1431|    171|  if (flag->done_check_val(old_spin) || flag->done_check()) {
  ------------------
  |  Branch (1431:7): [True: 2, False: 169]
  |  Branch (1431:41): [True: 0, False: 169]
  ------------------
 1432|      2|    flag->unset_sleeping();
 1433|      2|    TCW_PTR(th->th.th_sleep_loc, NULL);
  ------------------
  |  | 1157|      2|#define TCW_PTR(a, b) TCW_8((a), (b))
  |  |  ------------------
  |  |  |  | 1132|      2|#define TCW_8(a, b) (a) = (b)
  |  |  ------------------
  ------------------
 1434|      2|    th->th.th_sleep_loc_type = flag_unset;
 1435|      2|    KF_TRACE(5, ("__kmp_suspend_template: T#%d false alarm, reset sleep bit "
 1436|      2|                 "for spin(%p)\n",
 1437|      2|                 th_gtid, flag->get()));
 1438|    169|  } 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|    169|    int deactivated = FALSE;
  ------------------
  |  | 1279|    169|#define FALSE 0
  ------------------
 1443|       |
 1444|    338|    while (flag->is_sleeping()) {
  ------------------
  |  Branch (1444:12): [True: 169, False: 169]
  ------------------
 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|    169|      if (!deactivated) {
  ------------------
  |  Branch (1454:11): [True: 169, False: 0]
  ------------------
 1455|    169|        th->th.th_active = FALSE;
  ------------------
  |  | 1279|    169|#define FALSE 0
  ------------------
 1456|    169|        if (th->th.th_active_in_pool) {
  ------------------
  |  Branch (1456:13): [True: 0, False: 169]
  ------------------
 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|    169|        deactivated = TRUE;
  ------------------
  |  | 1280|    169|#define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  | 1279|    169|#define FALSE 0
  |  |  ------------------
  ------------------
 1462|    169|      }
 1463|       |
 1464|    169|      KMP_DEBUG_ASSERT(th->th.th_sleep_loc);
 1465|    169|      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|    169|      KF_TRACE(15, ("__kmp_suspend_template: T#%d about to perform"
 1487|    169|                    " pthread_cond_wait\n",
 1488|    169|                    th_gtid));
 1489|    169|      status = pthread_cond_wait(&th->th.th_suspend_cv.c_cond,
 1490|    169|                                 &th->th.th_suspend_mx.m_mutex);
 1491|    169|#endif // USE_SUSPEND_TIMEOUT
 1492|       |
 1493|    169|      if ((status != 0) && (status != EINTR) && (status != ETIMEDOUT)) {
  ------------------
  |  Branch (1493:11): [True: 0, False: 169]
  |  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|    169|      KMP_DEBUG_ASSERT(flag->get_type() == flag->get_ptr_type());
 1498|       |
 1499|    169|      if (!flag->is_sleeping() &&
  ------------------
  |  Branch (1499:11): [True: 169, False: 0]
  ------------------
 1500|    169|          ((status == EINTR) || (status == ETIMEDOUT))) {
  ------------------
  |  Branch (1500:12): [True: 0, False: 169]
  |  Branch (1500:33): [True: 0, False: 169]
  ------------------
 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|    169|    } // while
 1526|       |
 1527|       |    // Mark the thread as active again (if it was previous marked as inactive)
 1528|    169|    if (deactivated) {
  ------------------
  |  Branch (1528:9): [True: 169, False: 0]
  ------------------
 1529|    169|      th->th.th_active = TRUE;
  ------------------
  |  | 1280|    169|#define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  | 1279|    169|#define FALSE 0
  |  |  ------------------
  ------------------
 1530|    169|      if (TCR_4(th->th.th_in_pool)) {
  ------------------
  |  | 1127|    169|#define TCR_4(a) (a)
  |  |  ------------------
  |  |  |  Branch (1127:18): [True: 0, False: 169]
  |  |  ------------------
  ------------------
 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|    169|    }
 1535|    169|  }
 1536|       |  // We may have had the loop variable set before entering the loop body;
 1537|       |  // so we need to reset sleep_loc.
 1538|    171|  TCW_PTR(th->th.th_sleep_loc, NULL);
  ------------------
  |  | 1157|    171|#define TCW_PTR(a, b) TCW_8((a), (b))
  |  |  ------------------
  |  |  |  | 1132|    171|#define TCW_8(a, b) (a) = (b)
  |  |  ------------------
  ------------------
 1539|    171|  th->th.th_sleep_loc_type = flag_unset;
 1540|       |
 1541|    171|  KMP_DEBUG_ASSERT(!flag->is_sleeping());
 1542|    171|  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|    171|  __kmp_unlock_suspend_mx(th);
 1553|    171|  KF_TRACE(30, ("__kmp_suspend_template: T#%d exit\n", th_gtid));
 1554|    171|}
z_Linux_util.cpp:_ZL21__kmp_resume_templateI11kmp_flag_64ILb0ELb1EEEviPT_:
 1584|    168|static inline void __kmp_resume_template(int target_gtid, C *flag) {
 1585|    168|  KMP_TIME_DEVELOPER_PARTITIONED_BLOCK(USER_resume);
  ------------------
  |  | 1008|    168|#define KMP_TIME_DEVELOPER_PARTITIONED_BLOCK(n) ((void)0)
  ------------------
 1586|    168|  kmp_info_t *th = __kmp_threads[target_gtid];
 1587|    168|  int status;
 1588|       |
 1589|       |#ifdef KMP_DEBUG
 1590|       |  int gtid = TCR_4(__kmp_init_gtid) ? __kmp_get_gtid() : -1;
 1591|       |#endif
 1592|       |
 1593|    168|  KF_TRACE(30, ("__kmp_resume_template: T#%d wants to wakeup T#%d enter\n",
 1594|    168|                gtid, target_gtid));
 1595|    168|  KMP_DEBUG_ASSERT(gtid != target_gtid);
 1596|       |
 1597|    168|  __kmp_suspend_initialize_thread(th);
 1598|       |
 1599|    168|  __kmp_lock_suspend_mx(th);
 1600|       |
 1601|    169|  if (!flag || flag != th->th.th_sleep_loc) {
  ------------------
  |  Branch (1601:7): [True: 18.4E, False: 169]
  |  Branch (1601:16): [True: 169, 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|    169|    flag = (C *)CCAST(void *, th->th.th_sleep_loc);
  ------------------
  |  |  229|    169|#define CCAST(type, var) const_cast<type>(var)
  ------------------
 1605|    169|  }
 1606|       |
 1607|       |  // First, check if the flag is null or its type has changed. If so, someone
 1608|       |  // else woke it up.
 1609|    168|  if (!flag) { // Thread doesn't appear to be sleeping on anything
  ------------------
  |  Branch (1609:7): [True: 0, False: 168]
  ------------------
 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|    168|  } else if (flag->get_type() != th->th.th_sleep_loc_type) {
  ------------------
  |  Branch (1615:14): [True: 0, False: 168]
  ------------------
 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|    168|  } else { // if multiple threads are sleeping, flag should be internally
 1628|       |    // referring to a specific thread here
 1629|    168|    if (!flag->is_sleeping()) {
  ------------------
  |  Branch (1629:9): [True: 0, False: 168]
  ------------------
 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|    168|  }
 1637|    168|  KMP_DEBUG_ASSERT(flag);
 1638|    168|  flag->unset_sleeping();
 1639|    168|  TCW_PTR(th->th.th_sleep_loc, NULL);
  ------------------
  |  | 1157|    168|#define TCW_PTR(a, b) TCW_8((a), (b))
  |  |  ------------------
  |  |  |  | 1132|    168|#define TCW_8(a, b) (a) = (b)
  |  |  ------------------
  ------------------
 1640|    168|  th->th.th_sleep_loc_type = flag_unset;
 1641|       |
 1642|    168|  KF_TRACE(5, ("__kmp_resume_template: T#%d about to wakeup T#%d, reset "
 1643|    168|               "sleep bit for flag's loc(%p): %u\n",
 1644|    168|               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|    168|  status = pthread_cond_signal(&th->th.th_suspend_cv.c_cond);
 1655|    168|  KMP_CHECK_SYSFAIL("pthread_cond_signal", status);
  ------------------
  |  |  153|    168|  {                                                                            \
  |  |  154|    168|    if (error) {                                                               \
  |  |  ------------------
  |  |  |  Branch (154:9): [True: 0, False: 168]
  |  |  ------------------
  |  |  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|    168|  }
  ------------------
 1656|    168|  __kmp_unlock_suspend_mx(th);
 1657|    168|  KF_TRACE(30, ("__kmp_resume_template: T#%d exiting after signaling wake up"
 1658|    168|                " for T#%d\n",
 1659|    168|                gtid, target_gtid));
 1660|    168|}

