LLVMFuzzerTestOneInput:
   66|  1.40k|extern "C" int LLVMFuzzerTestOneInput(const uint8_t* Data, size_t Size) {
   67|  1.40k|  assert(Data);
  ------------------
  |  Branch (67:3): [True: 1.40k, False: 0]
  ------------------
   68|       |
   69|  1.40k|  try {
   70|  1.40k|    const Buffer b(Data, implicit_cast<Buffer::size_type>(Size));
   71|  1.40k|    const DataBuffer db(b, Endianness::little);
   72|  1.40k|    ByteStream bs(db);
   73|       |
   74|  1.40k|    RawImage mRaw(CreateRawImage(bs));
   75|       |
   76|  1.40k|    uint32_t numStrips = bs.getU32();
   77|  1.40k|    uint32_t numStripLineOffsets = bs.getU32();
   78|  1.40k|    uint32_t numStripWidths = bs.getU32();
   79|  1.40k|    uint32_t numStripHeights = bs.getU32();
   80|  1.40k|    uint32_t numDefineCodesSize = bs.getU32();
   81|       |
   82|  1.40k|    auto stripSizes = bs.getStream(numStrips, sizeof(uint32_t));
   83|  1.40k|    auto stripLineOffsetsInput =
   84|  1.40k|        bs.getStream(numStripLineOffsets, sizeof(uint32_t));
   85|  1.40k|    auto stripWidthsInput = bs.getStream(numStripWidths, sizeof(uint16_t));
   86|  1.40k|    auto stripHeightsInput = bs.getStream(numStripHeights, sizeof(uint16_t));
   87|  1.40k|    auto defineCodes = bs.getStream(numDefineCodesSize);
   88|  1.40k|    const auto initialPrediction = bs.getArray<uint16_t, 4>();
   89|  1.40k|    const auto imgDim = bs.getArray<int, 2>();
   90|       |
   91|       |    // The rest of the bs are the input strips.
   92|       |
   93|  1.40k|    getTrailingStrips(bs, stripSizes, nullptr);
   94|       |    // If we have not run out of tmp, we're good to proceed.
   95|  1.40k|    std::vector<Array1DRef<const uint8_t>> strips;
   96|  1.40k|    try {
   97|  1.40k|      bs = getTrailingStrips(bs, stripSizes, &strips);
   98|  1.40k|    } catch (...) {
   99|      0|      __builtin_unreachable();
  100|      0|    }
  101|    946|    bs = {}; // bs is no longer needed.
  102|       |
  103|    946|    if (mRaw->getDataType() != RawImageType::UINT16 ||
  ------------------
  |  Branch (103:9): [True: 6, False: 940]
  ------------------
  104|    940|        mRaw->getBpp() != sizeof(uint16_t)) {
  ------------------
  |  Branch (104:9): [True: 14, False: 926]
  ------------------
  105|     20|      ThrowRDE("Unexpected component count / data type");
  ------------------
  |  |   38|     20|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     20|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     20|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     20|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  106|     20|    }
  107|       |
  108|    926|    auto stripLineOffsets =
  109|    926|        stripLineOffsetsInput.getVector<uint32_t>(numStripLineOffsets);
  110|    926|    stripLineOffsets.reserve(1); // Array1DRef does not like nullptr's.
  111|    926|    auto stripWidths = stripWidthsInput.getVector<uint16_t>(numStripWidths);
  112|    926|    stripWidths.reserve(1); // Array1DRef does not like nullptr's.
  113|    926|    auto stripHeights = stripHeightsInput.getVector<uint16_t>(numStripHeights);
  114|    926|    stripHeights.reserve(1); // Array1DRef does not like nullptr's.
  115|       |
  116|    926|    PanasonicV8Decompressor::DecompressorParamsBuilder builder(
  117|    926|        {imgDim[0], imgDim[1]}, initialPrediction, getAsArray1DRef(strips),
  118|    926|        getAsArray1DRef(stripLineOffsets), getAsArray1DRef(stripWidths),
  119|    926|        getAsArray1DRef(stripHeights), defineCodes);
  120|       |
  121|    926|    PanasonicV8Decompressor v8(mRaw, builder.getDecompressorParams());
  122|    926|    mRaw->createData();
  123|    926|    v8.decompress();
  124|    926|    MSan::CheckMemIsInitialized(mRaw->getByteDataAsUncroppedArray2DRef());
  125|  1.28k|  } catch (const RawspeedException&) { // NOLINT(bugprone-empty-catch)
  126|       |    // Exceptions are good, crashes are bad.
  127|  1.28k|  }
  128|       |
  129|  1.40k|  return 0;
  130|  1.40k|}
PanasonicV8Decompressor.cpp:_ZN8rawspeed12_GLOBAL__N_117getTrailingStripsENS_10ByteStreamES1_PNSt3__16vectorINS_10Array1DRefIKhEENS2_9allocatorIS6_EEEE:
   48|  1.94k|                             std::vector<Array1DRef<const uint8_t>>* out) {
   49|  1.94k|  invariant(sizesBs.getRemainSize() % sizeof(uint32_t) == 0);
  ------------------
  |  |   27|  1.94k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (49:3): [True: 1.94k, False: 0]
  ------------------
   50|  1.94k|  uint32_t numStrips = sizesBs.getRemainSize() / sizeof(uint32_t);
   51|       |
   52|  1.94k|  if (out)
  ------------------
  |  Branch (52:7): [True: 946, False: 999]
  ------------------
   53|    946|    out->reserve(std::max(1U, numStrips));
   54|   992k|  for (uint32_t strip = 0; strip != numStrips; ++strip) {
  ------------------
  |  Branch (54:28): [True: 990k, False: 1.94k]
  ------------------
   55|   990k|    const uint32_t stripSize = sizesBs.getU32();
   56|   990k|    Buffer buf = bs.getBuffer(stripSize);
   57|   990k|    if (out)
  ------------------
  |  Branch (57:9): [True: 485k, False: 504k]
  ------------------
   58|   485k|      out->emplace_back(buf);
   59|   990k|  }
   60|  1.94k|  invariant(sizesBs.getRemainSize() == 0);
  ------------------
  |  |   27|  1.94k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (60:3): [True: 1.89k, False: 53]
  ------------------
   61|  1.89k|  return bs;
   62|  1.94k|}

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

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

_ZN8rawspeed10Array1DRefIKhEC2EPS1_i:
  104|  14.1M|    : data(data_), numElts(numElts_) {
  105|  14.1M|  establishClassInvariants();
  106|  14.1M|}
_ZNK8rawspeed10Array1DRefIKhE24establishClassInvariantsEv:
   97|   124M|Array1DRef<T>::establishClassInvariants() const noexcept {
   98|   124M|  invariant(data);
  ------------------
  |  |   27|   124M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (98:3): [True: 124M, False: 0]
  ------------------
   99|   124M|  invariant(numElts >= 0);
  ------------------
  |  |   27|   124M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (99:3): [True: 124M, False: 0]
  ------------------
  100|   124M|}
_ZNK8rawspeed10Array1DRefIKhE5beginEv:
  159|  8.77M|template <class T> inline T* Array1DRef<T>::begin() const {
  160|  8.77M|  establishClassInvariants();
  161|  8.77M|  return addressOf(/*eltIdx=*/0);
  162|  8.77M|}
_ZNK8rawspeed10Array1DRefIKhE9addressOfEi:
  133|  13.6M|Array1DRef<T>::addressOf(const int eltIdx) const {
  134|  13.6M|  establishClassInvariants();
  135|  13.6M|  invariant(eltIdx >= 0);
  ------------------
  |  |   27|  13.6M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (135:3): [True: 13.6M, False: 0]
  ------------------
  136|  13.6M|  invariant(eltIdx <= numElts);
  ------------------
  |  |   27|  13.6M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (136:3): [True: 13.6M, False: 0]
  ------------------
  137|  13.6M|#pragma GCC diagnostic push
  138|  13.6M|#pragma GCC diagnostic ignored "-Wpragmas"
  139|  13.6M|#pragma GCC diagnostic ignored "-Wunknown-warning-option"
  140|  13.6M|#pragma GCC diagnostic ignored "-Wunsafe-buffer-usage"
  141|  13.6M|  return data + eltIdx;
  142|  13.6M|#pragma GCC diagnostic pop
  143|  13.6M|}
_ZNK8rawspeed10Array1DRefIKhE4sizeEv:
  154|  63.5M|template <class T> inline int Array1DRef<T>::size() const {
  155|  63.5M|  establishClassInvariants();
  156|  63.5M|  return numElts;
  157|  63.5M|}
_ZNK8rawspeed10Array1DRefIKhE7getCropEii:
  110|  4.88M|Array1DRef<T>::getCrop(int offset, int size) const {
  111|  4.88M|  establishClassInvariants();
  112|  4.88M|  invariant(offset >= 0);
  ------------------
  |  |   27|  4.88M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (112:3): [True: 4.88M, False: 0]
  ------------------
  113|  4.88M|  invariant(size >= 0);
  ------------------
  |  |   27|  4.88M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (113:3): [True: 4.88M, False: 0]
  ------------------
  114|  4.88M|  invariant(offset <= numElts);
  ------------------
  |  |   27|  4.88M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (114:3): [True: 4.88M, False: 0]
  ------------------
  115|  4.88M|  invariant(size <= numElts);
  ------------------
  |  |   27|  4.88M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (115:3): [True: 4.88M, False: 0]
  ------------------
  116|  4.88M|  invariant(offset + size <= numElts);
  ------------------
  |  |   27|  4.88M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (116:3): [True: 4.88M, False: 0]
  ------------------
  117|  4.88M|  return {*this, offset, size};
  118|  4.88M|}
_ZN8rawspeed10Array1DRefIKNS0_IKhEEEC2EPS3_i:
  104|    926|    : data(data_), numElts(numElts_) {
  105|    926|  establishClassInvariants();
  106|    926|}
_ZNK8rawspeed10Array1DRefIKNS0_IKhEEE24establishClassInvariantsEv:
   97|  3.13k|Array1DRef<T>::establishClassInvariants() const noexcept {
   98|  3.13k|  invariant(data);
  ------------------
  |  |   27|  3.13k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (98:3): [True: 3.13k, False: 0]
  ------------------
   99|  3.13k|  invariant(numElts >= 0);
  ------------------
  |  |   27|  3.13k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (99:3): [True: 3.13k, False: 0]
  ------------------
  100|  3.13k|}
_ZN8rawspeed10Array1DRefIKjEC2EPS1_i:
  104|    926|    : data(data_), numElts(numElts_) {
  105|    926|  establishClassInvariants();
  106|    926|}
_ZNK8rawspeed10Array1DRefIKjE24establishClassInvariantsEv:
   97|  5.44k|Array1DRef<T>::establishClassInvariants() const noexcept {
   98|  5.44k|  invariant(data);
  ------------------
  |  |   27|  5.44k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (98:3): [True: 5.44k, False: 0]
  ------------------
   99|  5.44k|  invariant(numElts >= 0);
  ------------------
  |  |   27|  5.44k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (99:3): [True: 5.44k, False: 0]
  ------------------
  100|  5.44k|}
_ZN8rawspeed10Array1DRefIKtEC2EPS1_i:
  104|  1.85k|    : data(data_), numElts(numElts_) {
  105|  1.85k|  establishClassInvariants();
  106|  1.85k|}
_ZNK8rawspeed10Array1DRefIKtE24establishClassInvariantsEv:
   97|  6.94k|Array1DRef<T>::establishClassInvariants() const noexcept {
   98|  6.94k|  invariant(data);
  ------------------
  |  |   27|  6.94k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (98:3): [True: 6.94k, False: 0]
  ------------------
   99|  6.94k|  invariant(numElts >= 0);
  ------------------
  |  |   27|  6.94k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (99:3): [True: 6.94k, False: 0]
  ------------------
  100|  6.94k|}
_ZNK8rawspeed10Array1DRefIKNS0_IKhEEE4sizeEv:
  154|    666|template <class T> inline int Array1DRef<T>::size() const {
  155|    666|  establishClassInvariants();
  156|    666|  return numElts;
  157|    666|}
_ZNK8rawspeed10Array1DRefIKNS0_IKhEEE5beginEv:
  159|    235|template <class T> inline T* Array1DRef<T>::begin() const {
  160|    235|  establishClassInvariants();
  161|    235|  return addressOf(/*eltIdx=*/0);
  162|    235|}
_ZNK8rawspeed10Array1DRefIKNS0_IKhEEE9addressOfEi:
  133|    772|Array1DRef<T>::addressOf(const int eltIdx) const {
  134|    772|  establishClassInvariants();
  135|    772|  invariant(eltIdx >= 0);
  ------------------
  |  |   27|    772|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (135:3): [True: 772, False: 0]
  ------------------
  136|    772|  invariant(eltIdx <= numElts);
  ------------------
  |  |   27|    772|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (136:3): [True: 772, False: 0]
  ------------------
  137|    772|#pragma GCC diagnostic push
  138|    772|#pragma GCC diagnostic ignored "-Wpragmas"
  139|    772|#pragma GCC diagnostic ignored "-Wunknown-warning-option"
  140|    772|#pragma GCC diagnostic ignored "-Wunsafe-buffer-usage"
  141|    772|  return data + eltIdx;
  142|    772|#pragma GCC diagnostic pop
  143|    772|}
_ZNK8rawspeed10Array1DRefIKNS0_IKhEEE3endEv:
  163|    235|template <class T> inline T* Array1DRef<T>::end() const {
  164|    235|  establishClassInvariants();
  165|    235|  return addressOf(/*eltIdx=*/numElts);
  166|    235|}
_ZN8rawspeed10Array1DRefIKNS_12iRectangle2DEEC2EPS2_i:
  104|    712|    : data(data_), numElts(numElts_) {
  105|    712|  establishClassInvariants();
  106|    712|}
_ZNK8rawspeed10Array1DRefIKNS_12iRectangle2DEE24establishClassInvariantsEv:
   97|  3.01k|Array1DRef<T>::establishClassInvariants() const noexcept {
   98|  3.01k|  invariant(data);
  ------------------
  |  |   27|  3.01k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (98:3): [True: 3.01k, False: 0]
  ------------------
   99|  3.01k|  invariant(numElts >= 0);
  ------------------
  |  |   27|  3.01k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (99:3): [True: 3.01k, False: 0]
  ------------------
  100|  3.01k|}
_ZN8rawspeed10Array1DRefIKNS_23PanasonicV8Decompressor15DecoderLUTEntryEEC2EPS3_i:
  104|    234|    : data(data_), numElts(numElts_) {
  105|    234|  establishClassInvariants();
  106|    234|}
_ZNK8rawspeed10Array1DRefIKNS_23PanasonicV8Decompressor15DecoderLUTEntryEE24establishClassInvariantsEv:
   97|  2.75M|Array1DRef<T>::establishClassInvariants() const noexcept {
   98|  2.75M|  invariant(data);
  ------------------
  |  |   27|  2.75M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (98:3): [True: 2.75M, False: 0]
  ------------------
   99|  2.75M|  invariant(numElts >= 0);
  ------------------
  |  |   27|  2.75M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (99:3): [True: 2.75M, False: 0]
  ------------------
  100|  2.75M|}
_ZNK8rawspeed10Array1DRefISt4byteE24establishClassInvariantsEv:
   97|  3.49M|Array1DRef<T>::establishClassInvariants() const noexcept {
   98|  3.49M|  invariant(data);
  ------------------
  |  |   27|  3.49M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (98:3): [True: 3.49M, False: 0]
  ------------------
   99|  3.49M|  invariant(numElts >= 0);
  ------------------
  |  |   27|  3.49M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (99:3): [True: 3.49M, False: 0]
  ------------------
  100|  3.49M|}
_ZNK8rawspeed10Array1DRefISt4byteE4sizeEv:
  154|  1.18M|template <class T> inline int Array1DRef<T>::size() const {
  155|  1.18M|  establishClassInvariants();
  156|  1.18M|  return numElts;
  157|  1.18M|}
_ZNK8rawspeed10Array1DRefISt4byteE9addressOfEi:
  133|   823k|Array1DRef<T>::addressOf(const int eltIdx) const {
  134|   823k|  establishClassInvariants();
  135|   823k|  invariant(eltIdx >= 0);
  ------------------
  |  |   27|   823k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (135:3): [True: 823k, False: 0]
  ------------------
  136|   823k|  invariant(eltIdx <= numElts);
  ------------------
  |  |   27|   823k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (136:3): [True: 823k, False: 0]
  ------------------
  137|   823k|#pragma GCC diagnostic push
  138|   823k|#pragma GCC diagnostic ignored "-Wpragmas"
  139|   823k|#pragma GCC diagnostic ignored "-Wunknown-warning-option"
  140|   823k|#pragma GCC diagnostic ignored "-Wunsafe-buffer-usage"
  141|   823k|  return data + eltIdx;
  142|   823k|#pragma GCC diagnostic pop
  143|   823k|}
_ZN8rawspeed10Array1DRefISt4byteEC2EPS1_i:
  104|   172k|    : data(data_), numElts(numElts_) {
  105|   172k|  establishClassInvariants();
  106|   172k|}
_ZNK8rawspeed10Array1DRefISt4byteE7getCropEii:
  110|  99.0k|Array1DRef<T>::getCrop(int offset, int size) const {
  111|  99.0k|  establishClassInvariants();
  112|  99.0k|  invariant(offset >= 0);
  ------------------
  |  |   27|  99.0k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (112:3): [True: 99.0k, False: 0]
  ------------------
  113|  99.0k|  invariant(size >= 0);
  ------------------
  |  |   27|  99.0k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (113:3): [True: 99.0k, False: 0]
  ------------------
  114|  99.0k|  invariant(offset <= numElts);
  ------------------
  |  |   27|  99.0k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (114:3): [True: 99.0k, False: 0]
  ------------------
  115|  99.0k|  invariant(size <= numElts);
  ------------------
  |  |   27|  99.0k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (115:3): [True: 99.0k, False: 0]
  ------------------
  116|  99.0k|  invariant(offset + size <= numElts);
  ------------------
  |  |   27|  99.0k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (116:3): [True: 99.0k, False: 0]
  ------------------
  117|  99.0k|  return {*this, offset, size};
  118|  99.0k|}
_ZN8rawspeed10Array1DRefItEC2EPti:
  104|  4.15M|    : data(data_), numElts(numElts_) {
  105|  4.15M|  establishClassInvariants();
  106|  4.15M|}
_ZNK8rawspeed10Array1DRefItE24establishClassInvariantsEv:
   97|   145M|Array1DRef<T>::establishClassInvariants() const noexcept {
   98|   145M|  invariant(data);
  ------------------
  |  |   27|   145M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (98:3): [True: 145M, False: 0]
  ------------------
   99|   145M|  invariant(numElts >= 0);
  ------------------
  |  |   27|   145M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (99:3): [True: 145M, False: 0]
  ------------------
  100|   145M|}
_ZNK8rawspeed10Array1DRefItE4sizeEv:
  154|  79.2M|template <class T> inline int Array1DRef<T>::size() const {
  155|  79.2M|  establishClassInvariants();
  156|  79.2M|  return numElts;
  157|  79.2M|}
_ZN8rawspeed10Array1DRefISt4byteEC2ItQaaaantaasr3stdE10is_const_vITL0__Entsr3stdE10is_const_vIT_Entsr3stdE9is_same_vIu14__remove_constIS5_Eu14__remove_constIS4_EEsr3stdE9is_same_vIS6_S1_EEENS0_IS5_EE:
   78|    242|      : Array1DRef(reinterpret_cast<T*>(RHS.data), sizeof(T2) * RHS.numElts) {}
_ZNK8rawspeed10Array1DRefIKSt4byteE4sizeEv:
  154|  5.57M|template <class T> inline int Array1DRef<T>::size() const {
  155|  5.57M|  establishClassInvariants();
  156|  5.57M|  return numElts;
  157|  5.57M|}
_ZNK8rawspeed10Array1DRefIKSt4byteE24establishClassInvariantsEv:
   97|  10.7M|Array1DRef<T>::establishClassInvariants() const noexcept {
   98|  10.7M|  invariant(data);
  ------------------
  |  |   27|  10.7M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (98:3): [True: 10.7M, False: 0]
  ------------------
   99|  10.7M|  invariant(numElts >= 0);
  ------------------
  |  |   27|  10.7M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (99:3): [True: 10.7M, False: 0]
  ------------------
  100|  10.7M|}
_ZNK8rawspeed10Array1DRefIKSt4byteE5beginEv:
  159|  79.8k|template <class T> inline T* Array1DRef<T>::begin() const {
  160|  79.8k|  establishClassInvariants();
  161|  79.8k|  return addressOf(/*eltIdx=*/0);
  162|  79.8k|}
_ZNK8rawspeed10Array1DRefIKSt4byteE9addressOfEi:
  133|   159k|Array1DRef<T>::addressOf(const int eltIdx) const {
  134|   159k|  establishClassInvariants();
  135|   159k|  invariant(eltIdx >= 0);
  ------------------
  |  |   27|   159k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (135:3): [True: 159k, False: 0]
  ------------------
  136|   159k|  invariant(eltIdx <= numElts);
  ------------------
  |  |   27|   159k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (136:3): [True: 159k, False: 0]
  ------------------
  137|   159k|#pragma GCC diagnostic push
  138|   159k|#pragma GCC diagnostic ignored "-Wpragmas"
  139|   159k|#pragma GCC diagnostic ignored "-Wunknown-warning-option"
  140|   159k|#pragma GCC diagnostic ignored "-Wunsafe-buffer-usage"
  141|   159k|  return data + eltIdx;
  142|   159k|#pragma GCC diagnostic pop
  143|   159k|}
_ZNK8rawspeed10Array1DRefISt4byteE5beginEv:
  159|  80.1k|template <class T> inline T* Array1DRef<T>::begin() const {
  160|  80.1k|  establishClassInvariants();
  161|  80.1k|  return addressOf(/*eltIdx=*/0);
  162|  80.1k|}
_ZNK8rawspeed10Array1DRefIKSt4byteE7getCropEii:
  110|  79.8k|Array1DRef<T>::getCrop(int offset, int size) const {
  111|  79.8k|  establishClassInvariants();
  112|  79.8k|  invariant(offset >= 0);
  ------------------
  |  |   27|  79.8k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (112:3): [True: 79.8k, False: 0]
  ------------------
  113|  79.8k|  invariant(size >= 0);
  ------------------
  |  |   27|  79.8k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (113:3): [True: 79.8k, False: 0]
  ------------------
  114|  79.8k|  invariant(offset <= numElts);
  ------------------
  |  |   27|  79.8k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (114:3): [True: 79.8k, False: 0]
  ------------------
  115|  79.8k|  invariant(size <= numElts);
  ------------------
  |  |   27|  79.8k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (115:3): [True: 79.8k, False: 0]
  ------------------
  116|  79.8k|  invariant(offset + size <= numElts);
  ------------------
  |  |   27|  79.8k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (116:3): [True: 79.8k, False: 0]
  ------------------
  117|  79.8k|  return {*this, offset, size};
  118|  79.8k|}
_ZNK8rawspeed10Array1DRefISt4byteEclEi:
  147|   643k|Array1DRef<T>::operator()(const int eltIdx) const {
  148|   643k|  establishClassInvariants();
  149|   643k|  invariant(eltIdx >= 0);
  ------------------
  |  |   27|   643k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (149:3): [True: 643k, False: 0]
  ------------------
  150|   643k|  invariant(eltIdx < numElts);
  ------------------
  |  |   27|   643k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (150:3): [True: 643k, False: 0]
  ------------------
  151|   643k|  return *addressOf(eltIdx);
  152|   643k|}
_ZNK8rawspeed10Array1DRefItE9addressOfEi:
  133|  7.83M|Array1DRef<T>::addressOf(const int eltIdx) const {
  134|  7.83M|  establishClassInvariants();
  135|  7.83M|  invariant(eltIdx >= 0);
  ------------------
  |  |   27|  7.83M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (135:3): [True: 7.83M, False: 0]
  ------------------
  136|  7.83M|  invariant(eltIdx <= numElts);
  ------------------
  |  |   27|  7.83M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (136:3): [True: 7.83M, False: 0]
  ------------------
  137|  7.83M|#pragma GCC diagnostic push
  138|  7.83M|#pragma GCC diagnostic ignored "-Wpragmas"
  139|  7.83M|#pragma GCC diagnostic ignored "-Wunknown-warning-option"
  140|  7.83M|#pragma GCC diagnostic ignored "-Wunsafe-buffer-usage"
  141|  7.83M|  return data + eltIdx;
  142|  7.83M|#pragma GCC diagnostic pop
  143|  7.83M|}
_ZNK8rawspeed10Array1DRefItE7getCropEii:
  110|  4.15M|Array1DRef<T>::getCrop(int offset, int size) const {
  111|  4.15M|  establishClassInvariants();
  112|  4.15M|  invariant(offset >= 0);
  ------------------
  |  |   27|  4.15M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (112:3): [True: 4.15M, False: 0]
  ------------------
  113|  4.15M|  invariant(size >= 0);
  ------------------
  |  |   27|  4.15M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (113:3): [True: 4.15M, False: 0]
  ------------------
  114|  4.15M|  invariant(offset <= numElts);
  ------------------
  |  |   27|  4.15M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (114:3): [True: 4.15M, False: 0]
  ------------------
  115|  4.15M|  invariant(size <= numElts);
  ------------------
  |  |   27|  4.15M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (115:3): [True: 4.15M, False: 0]
  ------------------
  116|  4.15M|  invariant(offset + size <= numElts);
  ------------------
  |  |   27|  4.15M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (116:3): [True: 4.15M, False: 0]
  ------------------
  117|  4.15M|  return {*this, offset, size};
  118|  4.15M|}
_ZNK8rawspeed10Array1DRefItEclEi:
  147|  3.68M|Array1DRef<T>::operator()(const int eltIdx) const {
  148|  3.68M|  establishClassInvariants();
  149|  3.68M|  invariant(eltIdx >= 0);
  ------------------
  |  |   27|  3.68M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (149:3): [True: 3.68M, False: 0]
  ------------------
  150|  3.68M|  invariant(eltIdx < numElts);
  ------------------
  |  |   27|  3.68M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (150:3): [True: 3.68M, False: 0]
  ------------------
  151|  3.68M|  return *addressOf(eltIdx);
  152|  3.68M|}
_ZNK8rawspeed10Array1DRefIKjE4sizeEv:
  154|    598|template <class T> inline int Array1DRef<T>::size() const {
  155|    598|  establishClassInvariants();
  156|    598|  return numElts;
  157|    598|}
_ZNK8rawspeed10Array1DRefIKtE4sizeEv:
  154|  1.16k|template <class T> inline int Array1DRef<T>::size() const {
  155|  1.16k|  establishClassInvariants();
  156|  1.16k|  return numElts;
  157|  1.16k|}
_ZNK8rawspeed10Array1DRefIKtEclEi:
  147|  1.96k|Array1DRef<T>::operator()(const int eltIdx) const {
  148|  1.96k|  establishClassInvariants();
  149|  1.96k|  invariant(eltIdx >= 0);
  ------------------
  |  |   27|  1.96k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (149:3): [True: 1.96k, False: 0]
  ------------------
  150|  1.96k|  invariant(eltIdx < numElts);
  ------------------
  |  |   27|  1.96k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (150:3): [True: 1.96k, False: 0]
  ------------------
  151|  1.96k|  return *addressOf(eltIdx);
  152|  1.96k|}
_ZNK8rawspeed10Array1DRefIKtE9addressOfEi:
  133|  1.96k|Array1DRef<T>::addressOf(const int eltIdx) const {
  134|  1.96k|  establishClassInvariants();
  135|  1.96k|  invariant(eltIdx >= 0);
  ------------------
  |  |   27|  1.96k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (135:3): [True: 1.96k, False: 0]
  ------------------
  136|  1.96k|  invariant(eltIdx <= numElts);
  ------------------
  |  |   27|  1.96k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (136:3): [True: 1.96k, False: 0]
  ------------------
  137|  1.96k|#pragma GCC diagnostic push
  138|  1.96k|#pragma GCC diagnostic ignored "-Wpragmas"
  139|  1.96k|#pragma GCC diagnostic ignored "-Wunknown-warning-option"
  140|  1.96k|#pragma GCC diagnostic ignored "-Wunsafe-buffer-usage"
  141|  1.96k|  return data + eltIdx;
  142|  1.96k|#pragma GCC diagnostic pop
  143|  1.96k|}
_ZNK8rawspeed10Array1DRefIKjEclEi:
  147|  1.96k|Array1DRef<T>::operator()(const int eltIdx) const {
  148|  1.96k|  establishClassInvariants();
  149|  1.96k|  invariant(eltIdx >= 0);
  ------------------
  |  |   27|  1.96k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (149:3): [True: 1.96k, False: 0]
  ------------------
  150|  1.96k|  invariant(eltIdx < numElts);
  ------------------
  |  |   27|  1.96k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (150:3): [True: 1.96k, False: 0]
  ------------------
  151|  1.96k|  return *addressOf(eltIdx);
  152|  1.96k|}
_ZNK8rawspeed10Array1DRefIKjE9addressOfEi:
  133|  1.96k|Array1DRef<T>::addressOf(const int eltIdx) const {
  134|  1.96k|  establishClassInvariants();
  135|  1.96k|  invariant(eltIdx >= 0);
  ------------------
  |  |   27|  1.96k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (135:3): [True: 1.96k, False: 0]
  ------------------
  136|  1.96k|  invariant(eltIdx <= numElts);
  ------------------
  |  |   27|  1.96k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (136:3): [True: 1.96k, False: 0]
  ------------------
  137|  1.96k|#pragma GCC diagnostic push
  138|  1.96k|#pragma GCC diagnostic ignored "-Wpragmas"
  139|  1.96k|#pragma GCC diagnostic ignored "-Wunknown-warning-option"
  140|  1.96k|#pragma GCC diagnostic ignored "-Wunsafe-buffer-usage"
  141|  1.96k|  return data + eltIdx;
  142|  1.96k|#pragma GCC diagnostic pop
  143|  1.96k|}
_ZNK8rawspeed10Array1DRefIKNS_12iRectangle2DEEclEi:
  147|    924|Array1DRef<T>::operator()(const int eltIdx) const {
  148|    924|  establishClassInvariants();
  149|    924|  invariant(eltIdx >= 0);
  ------------------
  |  |   27|    924|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (149:3): [True: 924, False: 0]
  ------------------
  150|    924|  invariant(eltIdx < numElts);
  ------------------
  |  |   27|    924|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (150:3): [True: 924, False: 0]
  ------------------
  151|    924|  return *addressOf(eltIdx);
  152|    924|}
_ZNK8rawspeed10Array1DRefIKNS_12iRectangle2DEE9addressOfEi:
  133|    924|Array1DRef<T>::addressOf(const int eltIdx) const {
  134|    924|  establishClassInvariants();
  135|    924|  invariant(eltIdx >= 0);
  ------------------
  |  |   27|    924|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (135:3): [True: 924, False: 0]
  ------------------
  136|    924|  invariant(eltIdx <= numElts);
  ------------------
  |  |   27|    924|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (136:3): [True: 924, False: 0]
  ------------------
  137|    924|#pragma GCC diagnostic push
  138|    924|#pragma GCC diagnostic ignored "-Wpragmas"
  139|    924|#pragma GCC diagnostic ignored "-Wunknown-warning-option"
  140|    924|#pragma GCC diagnostic ignored "-Wunsafe-buffer-usage"
  141|    924|  return data + eltIdx;
  142|    924|#pragma GCC diagnostic pop
  143|    924|}
_ZNK8rawspeed10Array1DRefIKNS_12iRectangle2DEE4sizeEv:
  154|    453|template <class T> inline int Array1DRef<T>::size() const {
  155|    453|  establishClassInvariants();
  156|    453|  return numElts;
  157|    453|}
_ZNK8rawspeed10Array1DRefIKNS_23PanasonicV8Decompressor15DecoderLUTEntryEE4sizeEv:
  154|   918k|template <class T> inline int Array1DRef<T>::size() const {
  155|   918k|  establishClassInvariants();
  156|   918k|  return numElts;
  157|   918k|}
_ZNK8rawspeed10Array1DRefIKNS_23PanasonicV8Decompressor15DecoderLUTEntryEE5beginEv:
  159|    362|template <class T> inline T* Array1DRef<T>::begin() const {
  160|    362|  establishClassInvariants();
  161|    362|  return addressOf(/*eltIdx=*/0);
  162|    362|}
_ZNK8rawspeed10Array1DRefIKNS_23PanasonicV8Decompressor15DecoderLUTEntryEE9addressOfEi:
  133|   918k|Array1DRef<T>::addressOf(const int eltIdx) const {
  134|   918k|  establishClassInvariants();
  135|   918k|  invariant(eltIdx >= 0);
  ------------------
  |  |   27|   918k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (135:3): [True: 918k, False: 0]
  ------------------
  136|   918k|  invariant(eltIdx <= numElts);
  ------------------
  |  |   27|   918k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (136:3): [True: 918k, False: 0]
  ------------------
  137|   918k|#pragma GCC diagnostic push
  138|   918k|#pragma GCC diagnostic ignored "-Wpragmas"
  139|   918k|#pragma GCC diagnostic ignored "-Wunknown-warning-option"
  140|   918k|#pragma GCC diagnostic ignored "-Wunsafe-buffer-usage"
  141|   918k|  return data + eltIdx;
  142|   918k|#pragma GCC diagnostic pop
  143|   918k|}
_ZNK8rawspeed10Array1DRefIKNS_23PanasonicV8Decompressor15DecoderLUTEntryEE3endEv:
  163|    362|template <class T> inline T* Array1DRef<T>::end() const {
  164|    362|  establishClassInvariants();
  165|    362|  return addressOf(/*eltIdx=*/numElts);
  166|    362|}
_ZNK8rawspeed10Array1DRefIKNS0_IKhEEEclEi:
  147|    302|Array1DRef<T>::operator()(const int eltIdx) const {
  148|    302|  establishClassInvariants();
  149|    302|  invariant(eltIdx >= 0);
  ------------------
  |  |   27|    302|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (149:3): [True: 302, False: 0]
  ------------------
  150|    302|  invariant(eltIdx < numElts);
  ------------------
  |  |   27|    302|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (150:3): [True: 302, False: 0]
  ------------------
  151|    302|  return *addressOf(eltIdx);
  152|    302|}
_ZN8rawspeed10Array1DRefIKSt4byteEC2IKhQaaaantaasr3stdE10is_const_vITL0__Entsr3stdE10is_const_vIT_Entsr3stdE9is_same_vIu14__remove_constIS7_Eu14__remove_constIS6_EEsr3stdE9is_same_vIS8_S1_EEENS0_IS7_EE:
   78|    121|      : Array1DRef(reinterpret_cast<T*>(RHS.data), sizeof(T2) * RHS.numElts) {}
_ZN8rawspeed10Array1DRefIKSt4byteEC2EPS2_i:
  104|  80.0k|    : data(data_), numElts(numElts_) {
  105|  80.0k|  establishClassInvariants();
  106|  80.0k|}
_ZNK8rawspeed10Array1DRefISt4byteE3endEv:
  163|    210|template <class T> inline T* Array1DRef<T>::end() const {
  164|    210|  establishClassInvariants();
  165|    210|  return addressOf(/*eltIdx=*/numElts);
  166|    210|}
_ZNK8rawspeed10Array1DRefISt4byteE8getBlockEii:
  122|  79.8k|Array1DRef<T>::getBlock(int size, int index) const {
  123|  79.8k|  establishClassInvariants();
  124|  79.8k|  invariant(index >= 0);
  ------------------
  |  |   27|  79.8k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (124:3): [True: 79.8k, False: 0]
  ------------------
  125|  79.8k|  invariant(size >= 0);
  ------------------
  |  |   27|  79.8k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (125:3): [True: 79.8k, False: 0]
  ------------------
  126|  79.8k|  invariant(index <= numElts);
  ------------------
  |  |   27|  79.8k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (126:3): [True: 79.8k, False: 0]
  ------------------
  127|  79.8k|  invariant(size <= numElts);
  ------------------
  |  |   27|  79.8k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (127:3): [True: 79.8k, False: 0]
  ------------------
  128|  79.8k|  return getCrop(size * index, size);
  129|  79.8k|}
_ZNK8rawspeed10Array1DRefIKNS_23PanasonicV8Decompressor15DecoderLUTEntryEEclEi:
  147|   917k|Array1DRef<T>::operator()(const int eltIdx) const {
  148|   917k|  establishClassInvariants();
  149|   917k|  invariant(eltIdx >= 0);
  ------------------
  |  |   27|   917k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (149:3): [True: 917k, False: 0]
  ------------------
  150|   917k|  invariant(eltIdx < numElts);
  ------------------
  |  |   27|   917k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (150:3): [True: 917k, False: 0]
  ------------------
  151|   917k|  return *addressOf(eltIdx);
  152|   917k|}

_ZN8rawspeed15getAsArray1DRefINS_10Array1DRefIKhEEEENS1_IKT_EERKNSt3__16vectorIS4_NS7_9allocatorIS4_EEEE:
   30|    926|[[nodiscard]] Array1DRef<const T> getAsArray1DRef(const std::vector<T>& vec) {
   31|    926|  return {vec.data(), implicit_cast<int>(vec.size())};
   32|    926|}
_ZN8rawspeed15getAsArray1DRefIjEENS_10Array1DRefIKT_EERKNSt3__16vectorIS2_NS5_9allocatorIS2_EEEE:
   30|    926|[[nodiscard]] Array1DRef<const T> getAsArray1DRef(const std::vector<T>& vec) {
   31|    926|  return {vec.data(), implicit_cast<int>(vec.size())};
   32|    926|}
_ZN8rawspeed15getAsArray1DRefItEENS_10Array1DRefIKT_EERKNSt3__16vectorIS2_NS5_9allocatorIS2_EEEE:
   30|  1.85k|[[nodiscard]] Array1DRef<const T> getAsArray1DRef(const std::vector<T>& vec) {
   31|  1.85k|  return {vec.data(), implicit_cast<int>(vec.size())};
   32|  1.85k|}
_ZN8rawspeed15getAsArray1DRefINS_12iRectangle2DEEENS_10Array1DRefIKT_EERKNSt3__16vectorIS3_NS6_9allocatorIS3_EEEE:
   30|    712|[[nodiscard]] Array1DRef<const T> getAsArray1DRef(const std::vector<T>& vec) {
   31|    712|  return {vec.data(), implicit_cast<int>(vec.size())};
   32|    712|}
_ZN8rawspeed15getAsArray1DRefINS_23PanasonicV8Decompressor15DecoderLUTEntryEEENS_10Array1DRefIKT_EERKNSt3__16vectorIS4_NS7_9allocatorIS4_EEEE:
   30|    234|[[nodiscard]] Array1DRef<const T> getAsArray1DRef(const std::vector<T>& vec) {
   31|    234|  return {vec.data(), implicit_cast<int>(vec.size())};
   32|    234|}

_ZNK8rawspeed10Array2DRefISt4byteE24establishClassInvariantsEv:
  127|  95.8k|Array2DRef<T>::establishClassInvariants() const noexcept {
  128|  95.8k|  data.establishClassInvariants();
  129|  95.8k|  invariant(_width >= 0);
  ------------------
  |  |   27|  95.8k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (129:3): [True: 95.8k, False: 0]
  ------------------
  130|  95.8k|  invariant(_height >= 0);
  ------------------
  |  |   27|  95.8k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (130:3): [True: 95.8k, False: 0]
  ------------------
  131|  95.8k|  invariant(_pitch != 0);
  ------------------
  |  |   27|  95.8k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (131:3): [True: 95.8k, False: 0]
  ------------------
  132|  95.8k|  invariant(_pitch >= 0);
  ------------------
  |  |   27|  95.8k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (132:3): [True: 95.8k, False: 0]
  ------------------
  133|  95.8k|  invariant(_pitch >= _width);
  ------------------
  |  |   27|  95.8k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (133:3): [True: 95.8k, False: 0]
  ------------------
  134|  95.8k|  invariant((_width == 0) == (_height == 0));
  ------------------
  |  |   27|  95.8k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (134:3): [True: 95.8k, False: 0]
  ------------------
  135|  95.8k|  invariant(data.size() == _pitch * _height);
  ------------------
  |  |   27|  95.8k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (135:3): [True: 95.8k, False: 0]
  ------------------
  136|  95.8k|}
_ZNK8rawspeed10Array2DRefISt4byteE5widthEv:
  165|  38.2k|__attribute__((always_inline)) inline int Array2DRef<T>::width() const {
  166|  38.2k|  establishClassInvariants();
  167|  38.2k|  return _width;
  168|  38.2k|}
_ZNK8rawspeed10Array2DRefISt4byteE6heightEv:
  171|  31.9k|__attribute__((always_inline)) inline int Array2DRef<T>::height() const {
  172|  31.9k|  establishClassInvariants();
  173|  31.9k|  return _height;
  174|  31.9k|}
_ZNK8rawspeed10Array2DRefISt4byteEixEi:
  186|  12.6k|inline Array1DRef<T> Array2DRef<T>::operator[](const int row) const {
  187|  12.6k|  establishClassInvariants();
  188|  12.6k|  invariant(row >= 0);
  ------------------
  |  |   27|  12.6k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (188:3): [True: 12.6k, False: 0]
  ------------------
  189|  12.6k|  invariant(row < height());
  ------------------
  |  |   27|  12.6k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (189:3): [True: 12.6k, False: 0]
  ------------------
  190|  12.6k|  return data.getCrop(row * _pitch, width()).getAsArray1DRef();
  191|  12.6k|}
_ZN8rawspeed10Array2DRefItEC2EPtiii:
  148|   233k|    : Array2DRef({data_, pitch_ * height_}, width_, height_, pitch_) {
  149|   233k|  establishClassInvariants();
  150|   233k|}
_ZN8rawspeed10Array2DRefItEC2ENS_10Array1DRefItEEiii:
  141|   233k|    : data(data_), _pitch(pitch_), _width(width_), _height(height_) {
  142|   233k|  establishClassInvariants();
  143|   233k|}
_ZNK8rawspeed10Array2DRefItE24establishClassInvariantsEv:
  127|  30.1M|Array2DRef<T>::establishClassInvariants() const noexcept {
  128|  30.1M|  data.establishClassInvariants();
  129|  30.1M|  invariant(_width >= 0);
  ------------------
  |  |   27|  30.1M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (129:3): [True: 30.1M, False: 0]
  ------------------
  130|  30.1M|  invariant(_height >= 0);
  ------------------
  |  |   27|  30.1M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (130:3): [True: 30.1M, False: 0]
  ------------------
  131|  30.1M|  invariant(_pitch != 0);
  ------------------
  |  |   27|  30.1M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (131:3): [True: 30.1M, False: 0]
  ------------------
  132|  30.1M|  invariant(_pitch >= 0);
  ------------------
  |  |   27|  30.1M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (132:3): [True: 30.1M, False: 0]
  ------------------
  133|  30.1M|  invariant(_pitch >= _width);
  ------------------
  |  |   27|  30.1M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (133:3): [True: 30.1M, False: 0]
  ------------------
  134|  30.1M|  invariant((_width == 0) == (_height == 0));
  ------------------
  |  |   27|  30.1M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (134:3): [True: 30.1M, False: 0]
  ------------------
  135|  30.1M|  invariant(data.size() == _pitch * _height);
  ------------------
  |  |   27|  30.1M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (135:3): [True: 30.1M, False: 0]
  ------------------
  136|  30.1M|}
_ZN8rawspeed10Array2DRefISt4byteEC2ItQaaaantaasr3stdE10is_const_vITL0__Entsr3stdE10is_const_vIT_Entsr3stdE9is_same_vIu14__remove_constIS5_Eu14__remove_constIS4_EEsr3stdE9is_same_vIS6_S1_EEENS0_IS5_EE:
   92|    242|      : Array2DRef(RHS.data, sizeof(T2) * RHS._width, RHS._height,
   93|    242|                   sizeof(T2) * RHS._pitch) {}
_ZN8rawspeed10Array2DRefISt4byteEC2ENS_10Array1DRefIS1_EEiii:
  141|    242|    : data(data_), _pitch(pitch_), _width(width_), _height(height_) {
  142|    242|  establishClassInvariants();
  143|    242|}
_ZNK8rawspeed10Array2DRefItE5widthEv:
  165|  12.0M|__attribute__((always_inline)) inline int Array2DRef<T>::width() const {
  166|  12.0M|  establishClassInvariants();
  167|  12.0M|  return _width;
  168|  12.0M|}
_ZNK8rawspeed10Array2DRefItE6heightEv:
  171|  8.12M|__attribute__((always_inline)) inline int Array2DRef<T>::height() const {
  172|  8.12M|  establishClassInvariants();
  173|  8.12M|  return _height;
  174|  8.12M|}
_ZNK8rawspeed10Array2DRefISt4byteEclEii:
  195|  6.30k|Array2DRef<T>::operator()(const int row, const int col) const {
  196|  6.30k|  establishClassInvariants();
  197|  6.30k|  invariant(col >= 0);
  ------------------
  |  |   27|  6.30k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (197:3): [True: 6.30k, False: 0]
  ------------------
  198|  6.30k|  invariant(col < width());
  ------------------
  |  |   27|  6.30k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (198:3): [True: 6.30k, False: 0]
  ------------------
  199|  6.30k|  return (operator[](row))(col);
  200|  6.30k|}
_ZNK8rawspeed10Array2DRefItEixEi:
  186|  3.91M|inline Array1DRef<T> Array2DRef<T>::operator[](const int row) const {
  187|  3.91M|  establishClassInvariants();
  188|  3.91M|  invariant(row >= 0);
  ------------------
  |  |   27|  3.91M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (188:3): [True: 3.91M, False: 0]
  ------------------
  189|  3.91M|  invariant(row < height());
  ------------------
  |  |   27|  3.91M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (189:3): [True: 3.91M, False: 0]
  ------------------
  190|  3.91M|  return data.getCrop(row * _pitch, width()).getAsArray1DRef();
  191|  3.91M|}
_ZN8rawspeed10Array2DRefItEC2EPtii:
  154|    121|    : Array2DRef(data_, width_, height_, /*pitch=*/width_) {
  155|    121|  establishClassInvariants();
  156|    121|}
_ZNK8rawspeed10Array2DRefItE5pitchEv:
  159|   233k|__attribute__((always_inline)) inline int Array2DRef<T>::pitch() const {
  160|   233k|  establishClassInvariants();
  161|   233k|  return _pitch;
  162|   233k|}
_ZNK8rawspeed10Array2DRefItEclEii:
  195|  3.68M|Array2DRef<T>::operator()(const int row, const int col) const {
  196|  3.68M|  establishClassInvariants();
  197|  3.68M|  invariant(col >= 0);
  ------------------
  |  |   27|  3.68M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (197:3): [True: 3.68M, False: 0]
  ------------------
  198|  3.68M|  invariant(col < width());
  ------------------
  |  |   27|  3.68M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (198:3): [True: 3.68M, False: 0]
  ------------------
  199|  3.68M|  return (operator[](row))(col);
  200|  3.68M|}

_ZN8rawspeed8bitwidthIjEEjT_:
   43|  1.27k|constexpr unsigned RAWSPEED_READNONE bitwidth([[maybe_unused]] T unused = {}) {
   44|       |  return CHAR_BIT * sizeof(T);
   45|  1.27k|}
_ZN8rawspeed8bitwidthImEEjT_:
   43|  1.35M|constexpr unsigned RAWSPEED_READNONE bitwidth([[maybe_unused]] T unused = {}) {
   44|       |  return CHAR_BIT * sizeof(T);
   45|  1.35M|}
_ZN8rawspeed6isIntNIjQsr3stdE15is_arithmetic_vIT_EEEbS1_j:
   87|  1.27k|constexpr bool RAWSPEED_READNONE isIntN(T value, unsigned int nBits) {
   88|  1.27k|  invariant(nBits < bitwidth<T>() && "Check must not be tautological.");
  ------------------
  |  |   27|  1.27k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (88:3): [True: 1.27k, False: 0]
  |  Branch (88:3): [True: 1.27k, Folded]
  |  Branch (88:3): [True: 1.27k, False: 0]
  ------------------
   89|  1.27k|  using UnsignedT = std::make_unsigned_t<T>;
   90|  1.27k|  const auto highBits = static_cast<UnsignedT>(value) >> nBits;
   91|  1.27k|  return highBits == 0;
   92|  1.27k|}
_ZN8rawspeed15bitreverse_eachIhQsr3stdE7same_asIT_hEEENSt3__15arrayIS1_Lm4EEES4_:
  161|  79.6k|std::array<T, 4> bitreverse_each(std::array<T, 4> x) {
  162|       |#if !__has_builtin(__builtin_bitreverse32)
  163|       |  for (T& e : x)
  164|       |    e = bitreverse(e);
  165|       |#else
  166|  79.6k|  uint32_t tmp;
  167|  79.6k|  std::memcpy(&tmp, x.data(), sizeof(uint32_t));
  168|  79.6k|  tmp = bitreverse(tmp);
  169|  79.6k|  tmp = __builtin_bswap32(tmp);
  170|  79.6k|  std::memcpy(x.data(), &tmp, sizeof(uint32_t));
  171|  79.6k|#endif
  172|  79.6k|  return x;
  173|  79.6k|}
_ZN8rawspeed10bitreverseIjQsr3stdE7same_asIT_jEEES1_S1_:
  154|  79.6k|T bitreverse(const T v) {
  155|  79.6k|  return __builtin_bitreverse32(v);
  156|  79.6k|}
_ZN8rawspeed15extractHighBitsImQsr3stdE13is_unsigned_vIT_EEES1_S1_jj:
  121|  1.35M|    T value, unsigned nBits, unsigned effectiveBitwidth = bitwidth<T>()) {
  122|  1.35M|  invariant(effectiveBitwidth <= bitwidth<T>());
  ------------------
  |  |   27|  1.35M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (122:3): [True: 1.35M, False: 0]
  ------------------
  123|  1.35M|  invariant(nBits <= effectiveBitwidth);
  ------------------
  |  |   27|  1.35M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (123:3): [True: 1.35M, False: 0]
  ------------------
  124|  1.35M|  auto numLowBitsToSkip = effectiveBitwidth - nBits;
  125|  1.35M|  invariant(numLowBitsToSkip < bitwidth<T>());
  ------------------
  |  |   27|  1.35M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (125:3): [True: 1.35M, False: 0]
  ------------------
  126|  1.35M|  return value >> numLowBitsToSkip;
  127|  1.35M|}

_ZN8rawspeed13implicit_castIjmQaaaaoosr3stdE13is_integral_vIT0_Esr3stdE19is_floating_point_vIS1_Eoosr3stdE13is_integral_vIT_Esr3stdE19is_floating_point_vIS2_Entsr3stdE9is_same_vIS1_S2_EEES2_S1_:
   32|  1.35M|constexpr RAWSPEED_READNONE Ttgt implicit_cast(Tsrc value) {
   33|  1.35M|#pragma GCC diagnostic push
   34|  1.35M|#pragma GCC diagnostic ignored "-Wconversion"
   35|  1.35M|#pragma GCC diagnostic ignored "-Wdouble-promotion"
   36|  1.35M|  return value;
   37|  1.35M|#pragma GCC diagnostic pop
   38|  1.35M|}
_ZN8rawspeed13implicit_castIijQaaaaoosr3stdE13is_integral_vIT0_Esr3stdE19is_floating_point_vIS1_Eoosr3stdE13is_integral_vIT_Esr3stdE19is_floating_point_vIS2_Entsr3stdE9is_same_vIS1_S2_EEES2_S1_:
   32|  9.26M|constexpr RAWSPEED_READNONE Ttgt implicit_cast(Tsrc value) {
   33|  9.26M|#pragma GCC diagnostic push
   34|  9.26M|#pragma GCC diagnostic ignored "-Wconversion"
   35|  9.26M|#pragma GCC diagnostic ignored "-Wdouble-promotion"
   36|  9.26M|  return value;
   37|  9.26M|#pragma GCC diagnostic pop
   38|  9.26M|}
_ZN8rawspeed13implicit_castIimQaaaaoosr3stdE13is_integral_vIT0_Esr3stdE19is_floating_point_vIS1_Eoosr3stdE13is_integral_vIT_Esr3stdE19is_floating_point_vIS2_Entsr3stdE9is_same_vIS1_S2_EEES2_S1_:
   32|   164k|constexpr RAWSPEED_READNONE Ttgt implicit_cast(Tsrc value) {
   33|   164k|#pragma GCC diagnostic push
   34|   164k|#pragma GCC diagnostic ignored "-Wconversion"
   35|   164k|#pragma GCC diagnostic ignored "-Wdouble-promotion"
   36|   164k|  return value;
   37|   164k|#pragma GCC diagnostic pop
   38|   164k|}
_ZN8rawspeed13implicit_castIhtQaaaaoosr3stdE13is_integral_vIT0_Esr3stdE19is_floating_point_vIS1_Eoosr3stdE13is_integral_vIT_Esr3stdE19is_floating_point_vIS2_Entsr3stdE9is_same_vIS1_S2_EEES2_S1_:
   32|  1.26k|constexpr RAWSPEED_READNONE Ttgt implicit_cast(Tsrc value) {
   33|  1.26k|#pragma GCC diagnostic push
   34|  1.26k|#pragma GCC diagnostic ignored "-Wconversion"
   35|  1.26k|#pragma GCC diagnostic ignored "-Wdouble-promotion"
   36|  1.26k|  return value;
   37|  1.26k|#pragma GCC diagnostic pop
   38|  1.26k|}
_ZN8rawspeed13implicit_castIhjQaaaaoosr3stdE13is_integral_vIT0_Esr3stdE19is_floating_point_vIS1_Eoosr3stdE13is_integral_vIT_Esr3stdE19is_floating_point_vIS2_Entsr3stdE9is_same_vIS1_S2_EEES2_S1_:
   32|  1.26k|constexpr RAWSPEED_READNONE Ttgt implicit_cast(Tsrc value) {
   33|  1.26k|#pragma GCC diagnostic push
   34|  1.26k|#pragma GCC diagnostic ignored "-Wconversion"
   35|  1.26k|#pragma GCC diagnostic ignored "-Wdouble-promotion"
   36|  1.26k|  return value;
   37|  1.26k|#pragma GCC diagnostic pop
   38|  1.26k|}

_ZN8rawspeed17CroppedArray1DRefIKhEC2ENS_10Array1DRefIS1_EEii:
  107|  4.88M|    : base(base_), offset(offset_), numElts(numElts_) {
  108|  4.88M|  establishClassInvariants();
  109|  4.88M|}
_ZNK8rawspeed17CroppedArray1DRefIKhE24establishClassInvariantsEv:
   94|  19.5M|CroppedArray1DRef<T>::establishClassInvariants() const noexcept {
   95|  19.5M|  base.establishClassInvariants();
   96|  19.5M|  invariant(offset >= 0);
  ------------------
  |  |   27|  19.5M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (96:3): [True: 19.5M, False: 0]
  ------------------
   97|  19.5M|  invariant(numElts >= 0);
  ------------------
  |  |   27|  19.5M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (97:3): [True: 19.5M, False: 0]
  ------------------
   98|  19.5M|  invariant(offset <= base.size());
  ------------------
  |  |   27|  19.5M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (98:3): [True: 19.5M, False: 0]
  ------------------
   99|  19.5M|  invariant(numElts <= base.size());
  ------------------
  |  |   27|  19.5M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (99:3): [True: 19.5M, False: 0]
  ------------------
  100|  19.5M|  invariant(offset + numElts <= base.size());
  ------------------
  |  |   27|  19.5M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (100:3): [True: 19.5M, False: 0]
  ------------------
  101|  19.5M|}
_ZNK8rawspeed17CroppedArray1DRefIKhE15getAsArray1DRefEv:
   71|  4.88M|  [[nodiscard]] Array1DRef<T> getAsArray1DRef() const {
   72|  4.88M|    return {begin(), size()};
   73|  4.88M|  }
_ZNK8rawspeed17CroppedArray1DRefIKhE5beginEv:
  137|  4.88M|template <class T> inline T* CroppedArray1DRef<T>::begin() const {
  138|  4.88M|  establishClassInvariants();
  139|  4.88M|  return addressOf(/*eltIdx=*/0);
  140|  4.88M|}
_ZNK8rawspeed17CroppedArray1DRefIKhE9addressOfEi:
  152|  4.88M|inline T* CroppedArray1DRef<T>::addressOf(const int eltIdx) const {
  153|  4.88M|  establishClassInvariants();
  154|  4.88M|  invariant(eltIdx >= 0);
  ------------------
  |  |   27|  4.88M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (154:3): [True: 4.88M, False: 0]
  ------------------
  155|  4.88M|  invariant(eltIdx <= numElts);
  ------------------
  |  |   27|  4.88M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (155:3): [True: 4.88M, False: 0]
  ------------------
  156|  4.88M|  return base.addressOf(offset + eltIdx);
  157|  4.88M|}
_ZNK8rawspeed17CroppedArray1DRefIKhE4sizeEv:
  146|  4.88M|template <class T> inline int CroppedArray1DRef<T>::size() const {
  147|  4.88M|  establishClassInvariants();
  148|  4.88M|  return numElts;
  149|  4.88M|}
_ZNK8rawspeed17CroppedArray1DRefISt4byteE5beginEv:
  137|  99.0k|template <class T> inline T* CroppedArray1DRef<T>::begin() const {
  138|  99.0k|  establishClassInvariants();
  139|  99.0k|  return addressOf(/*eltIdx=*/0);
  140|  99.0k|}
_ZNK8rawspeed17CroppedArray1DRefISt4byteE24establishClassInvariantsEv:
   94|   309k|CroppedArray1DRef<T>::establishClassInvariants() const noexcept {
   95|   309k|  base.establishClassInvariants();
   96|   309k|  invariant(offset >= 0);
  ------------------
  |  |   27|   309k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (96:3): [True: 309k, False: 0]
  ------------------
   97|   309k|  invariant(numElts >= 0);
  ------------------
  |  |   27|   309k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (97:3): [True: 309k, False: 0]
  ------------------
   98|   309k|  invariant(offset <= base.size());
  ------------------
  |  |   27|   309k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (98:3): [True: 309k, False: 0]
  ------------------
   99|   309k|  invariant(numElts <= base.size());
  ------------------
  |  |   27|   309k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (99:3): [True: 309k, False: 0]
  ------------------
  100|   309k|  invariant(offset + numElts <= base.size());
  ------------------
  |  |   27|   309k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (100:3): [True: 309k, False: 0]
  ------------------
  101|   309k|}
_ZNK8rawspeed17CroppedArray1DRefISt4byteE9addressOfEi:
  152|  99.0k|inline T* CroppedArray1DRef<T>::addressOf(const int eltIdx) const {
  153|  99.0k|  establishClassInvariants();
  154|  99.0k|  invariant(eltIdx >= 0);
  ------------------
  |  |   27|  99.0k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (154:3): [True: 99.0k, False: 0]
  ------------------
  155|  99.0k|  invariant(eltIdx <= numElts);
  ------------------
  |  |   27|  99.0k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (155:3): [True: 99.0k, False: 0]
  ------------------
  156|  99.0k|  return base.addressOf(offset + eltIdx);
  157|  99.0k|}
_ZNK8rawspeed17CroppedArray1DRefISt4byteE4sizeEv:
  146|  12.8k|template <class T> inline int CroppedArray1DRef<T>::size() const {
  147|  12.8k|  establishClassInvariants();
  148|  12.8k|  return numElts;
  149|  12.8k|}
_ZNK8rawspeed17CroppedArray1DRefISt4byteE15getAsArray1DRefEv:
   71|  12.8k|  [[nodiscard]] Array1DRef<T> getAsArray1DRef() const {
   72|  12.8k|    return {begin(), size()};
   73|  12.8k|  }
_ZN8rawspeed17CroppedArray1DRefISt4byteEC2ENS_10Array1DRefIS1_EEii:
  107|  99.0k|    : base(base_), offset(offset_), numElts(numElts_) {
  108|  99.0k|  establishClassInvariants();
  109|  99.0k|}
_ZNK8rawspeed17CroppedArray1DRefIKSt4byteE24establishClassInvariantsEv:
   94|   319k|CroppedArray1DRef<T>::establishClassInvariants() const noexcept {
   95|   319k|  base.establishClassInvariants();
   96|   319k|  invariant(offset >= 0);
  ------------------
  |  |   27|   319k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (96:3): [True: 319k, False: 0]
  ------------------
   97|   319k|  invariant(numElts >= 0);
  ------------------
  |  |   27|   319k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (97:3): [True: 319k, False: 0]
  ------------------
   98|   319k|  invariant(offset <= base.size());
  ------------------
  |  |   27|   319k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (98:3): [True: 319k, False: 0]
  ------------------
   99|   319k|  invariant(numElts <= base.size());
  ------------------
  |  |   27|   319k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (99:3): [True: 319k, False: 0]
  ------------------
  100|   319k|  invariant(offset + numElts <= base.size());
  ------------------
  |  |   27|   319k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (100:3): [True: 319k, False: 0]
  ------------------
  101|   319k|}
_ZNK8rawspeed17CroppedArray1DRefIKSt4byteE15getAsArray1DRefEv:
   71|  79.8k|  [[nodiscard]] Array1DRef<T> getAsArray1DRef() const {
   72|  79.8k|    return {begin(), size()};
   73|  79.8k|  }
_ZNK8rawspeed17CroppedArray1DRefIKSt4byteE5beginEv:
  137|  79.8k|template <class T> inline T* CroppedArray1DRef<T>::begin() const {
  138|  79.8k|  establishClassInvariants();
  139|  79.8k|  return addressOf(/*eltIdx=*/0);
  140|  79.8k|}
_ZNK8rawspeed17CroppedArray1DRefIKSt4byteE9addressOfEi:
  152|  79.8k|inline T* CroppedArray1DRef<T>::addressOf(const int eltIdx) const {
  153|  79.8k|  establishClassInvariants();
  154|  79.8k|  invariant(eltIdx >= 0);
  ------------------
  |  |   27|  79.8k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (154:3): [True: 79.8k, False: 0]
  ------------------
  155|  79.8k|  invariant(eltIdx <= numElts);
  ------------------
  |  |   27|  79.8k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (155:3): [True: 79.8k, False: 0]
  ------------------
  156|  79.8k|  return base.addressOf(offset + eltIdx);
  157|  79.8k|}
_ZNK8rawspeed17CroppedArray1DRefIKSt4byteE4sizeEv:
  146|  79.8k|template <class T> inline int CroppedArray1DRef<T>::size() const {
  147|  79.8k|  establishClassInvariants();
  148|  79.8k|  return numElts;
  149|  79.8k|}
_ZNK8rawspeed17CroppedArray1DRefItE15getAsArray1DRefEv:
   71|  3.91M|  [[nodiscard]] Array1DRef<T> getAsArray1DRef() const {
   72|  3.91M|    return {begin(), size()};
   73|  3.91M|  }
_ZNK8rawspeed17CroppedArray1DRefItE5beginEv:
  137|  4.15M|template <class T> inline T* CroppedArray1DRef<T>::begin() const {
  138|  4.15M|  establishClassInvariants();
  139|  4.15M|  return addressOf(/*eltIdx=*/0);
  140|  4.15M|}
_ZNK8rawspeed17CroppedArray1DRefItE24establishClassInvariantsEv:
   94|  16.3M|CroppedArray1DRef<T>::establishClassInvariants() const noexcept {
   95|  16.3M|  base.establishClassInvariants();
   96|  16.3M|  invariant(offset >= 0);
  ------------------
  |  |   27|  16.3M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (96:3): [True: 16.3M, False: 0]
  ------------------
   97|  16.3M|  invariant(numElts >= 0);
  ------------------
  |  |   27|  16.3M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (97:3): [True: 16.3M, False: 0]
  ------------------
   98|  16.3M|  invariant(offset <= base.size());
  ------------------
  |  |   27|  16.3M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (98:3): [True: 16.3M, False: 0]
  ------------------
   99|  16.3M|  invariant(numElts <= base.size());
  ------------------
  |  |   27|  16.3M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (99:3): [True: 16.3M, False: 0]
  ------------------
  100|  16.3M|  invariant(offset + numElts <= base.size());
  ------------------
  |  |   27|  16.3M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (100:3): [True: 16.3M, False: 0]
  ------------------
  101|  16.3M|}
_ZNK8rawspeed17CroppedArray1DRefItE9addressOfEi:
  152|  4.15M|inline T* CroppedArray1DRef<T>::addressOf(const int eltIdx) const {
  153|  4.15M|  establishClassInvariants();
  154|  4.15M|  invariant(eltIdx >= 0);
  ------------------
  |  |   27|  4.15M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (154:3): [True: 4.15M, False: 0]
  ------------------
  155|  4.15M|  invariant(eltIdx <= numElts);
  ------------------
  |  |   27|  4.15M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (155:3): [True: 4.15M, False: 0]
  ------------------
  156|  4.15M|  return base.addressOf(offset + eltIdx);
  157|  4.15M|}
_ZNK8rawspeed17CroppedArray1DRefItE4sizeEv:
  146|  3.91M|template <class T> inline int CroppedArray1DRef<T>::size() const {
  147|  3.91M|  establishClassInvariants();
  148|  3.91M|  return numElts;
  149|  3.91M|}
_ZN8rawspeed17CroppedArray1DRefItEC2ENS_10Array1DRefItEEii:
  107|  4.15M|    : base(base_), offset(offset_), numElts(numElts_) {
  108|  4.15M|  establishClassInvariants();
  109|  4.15M|}
_ZN8rawspeed17CroppedArray1DRefIKSt4byteEC2ENS_10Array1DRefIS2_EEii:
  107|  79.8k|    : base(base_), offset(offset_), numElts(numElts_) {
  108|  79.8k|  establishClassInvariants();
  109|  79.8k|}

_ZNK8rawspeed17CroppedArray2DRefISt4byteEixEi:
  125|  6.30k|CroppedArray2DRef<T>::operator[](const int row) const {
  126|  6.30k|  establishClassInvariants();
  127|  6.30k|  invariant(row >= 0);
  ------------------
  |  |   27|  6.30k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (127:3): [True: 6.30k, False: 0]
  ------------------
  128|  6.30k|  invariant(row < croppedHeight);
  ------------------
  |  |   27|  6.30k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (128:3): [True: 6.30k, False: 0]
  ------------------
  129|  6.30k|  const Array1DRef<T> fullLine = base.operator[](offsetRows + row);
  130|  6.30k|  return fullLine.getCrop(offsetCols, croppedWidth);
  131|  6.30k|}
_ZNK8rawspeed17CroppedArray2DRefISt4byteE24establishClassInvariantsEv:
   98|  6.42k|CroppedArray2DRef<T>::establishClassInvariants() const noexcept {
   99|  6.42k|  base.establishClassInvariants();
  100|  6.42k|  invariant(offsetCols >= 0);
  ------------------
  |  |   27|  6.42k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (100:3): [True: 6.42k, False: 0]
  ------------------
  101|  6.42k|  invariant(offsetRows >= 0);
  ------------------
  |  |   27|  6.42k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (101:3): [True: 6.42k, False: 0]
  ------------------
  102|  6.42k|  invariant(croppedWidth >= 0);
  ------------------
  |  |   27|  6.42k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (102:3): [True: 6.42k, False: 0]
  ------------------
  103|  6.42k|  invariant(croppedHeight >= 0);
  ------------------
  |  |   27|  6.42k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (103:3): [True: 6.42k, False: 0]
  ------------------
  104|  6.42k|  invariant(offsetCols <= base.width());
  ------------------
  |  |   27|  6.42k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (104:3): [True: 6.42k, False: 0]
  ------------------
  105|  6.42k|  invariant(offsetRows <= base.height());
  ------------------
  |  |   27|  6.42k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (105:3): [True: 6.42k, False: 0]
  ------------------
  106|  6.42k|  invariant(croppedWidth <= base.width());
  ------------------
  |  |   27|  6.42k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (106:3): [True: 6.42k, False: 0]
  ------------------
  107|  6.42k|  invariant(croppedHeight <= base.height());
  ------------------
  |  |   27|  6.42k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (107:3): [True: 6.42k, False: 0]
  ------------------
  108|  6.42k|  invariant(offsetCols + croppedWidth <= base.width());
  ------------------
  |  |   27|  6.42k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (108:3): [True: 6.42k, False: 0]
  ------------------
  109|  6.42k|  invariant(offsetRows + croppedHeight <= base.height());
  ------------------
  |  |   27|  6.42k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (109:3): [True: 6.42k, False: 0]
  ------------------
  110|  6.42k|  invariant((croppedWidth == 0) == (croppedHeight == 0));
  ------------------
  |  |   27|  6.42k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (110:3): [True: 6.42k, False: 0]
  ------------------
  111|  6.42k|}
_ZN8rawspeed17CroppedArray2DRefISt4byteEC2ENS_10Array2DRefIS1_EE:
   64|    121|      : CroppedArray2DRef(RHS, /*offsetCols=*/0, /*offsetRows=*/0, RHS.width(),
   65|    121|                          RHS.height()) {}
_ZN8rawspeed17CroppedArray2DRefISt4byteEC2ENS_10Array2DRefIS1_EEiiii:
  118|    121|    : base(base_), offsetCols(offsetCols_), offsetRows(offsetRows_),
  119|    121|      croppedWidth(croppedWidth_), croppedHeight(croppedHeight_) {
  120|    121|  establishClassInvariants();
  121|    121|}
_ZNK8rawspeed17CroppedArray2DRefItE24establishClassInvariantsEv:
   98|   699k|CroppedArray2DRef<T>::establishClassInvariants() const noexcept {
   99|   699k|  base.establishClassInvariants();
  100|   699k|  invariant(offsetCols >= 0);
  ------------------
  |  |   27|   699k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (100:3): [True: 699k, False: 0]
  ------------------
  101|   699k|  invariant(offsetRows >= 0);
  ------------------
  |  |   27|   699k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (101:3): [True: 699k, False: 0]
  ------------------
  102|   699k|  invariant(croppedWidth >= 0);
  ------------------
  |  |   27|   699k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (102:3): [True: 699k, False: 0]
  ------------------
  103|   699k|  invariant(croppedHeight >= 0);
  ------------------
  |  |   27|   699k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (103:3): [True: 699k, False: 0]
  ------------------
  104|   699k|  invariant(offsetCols <= base.width());
  ------------------
  |  |   27|   699k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (104:3): [True: 699k, False: 0]
  ------------------
  105|   699k|  invariant(offsetRows <= base.height());
  ------------------
  |  |   27|   699k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (105:3): [True: 699k, False: 0]
  ------------------
  106|   699k|  invariant(croppedWidth <= base.width());
  ------------------
  |  |   27|   699k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (106:3): [True: 699k, False: 0]
  ------------------
  107|   699k|  invariant(croppedHeight <= base.height());
  ------------------
  |  |   27|   699k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (107:3): [True: 699k, False: 0]
  ------------------
  108|   699k|  invariant(offsetCols + croppedWidth <= base.width());
  ------------------
  |  |   27|   699k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (108:3): [True: 699k, False: 0]
  ------------------
  109|   699k|  invariant(offsetRows + croppedHeight <= base.height());
  ------------------
  |  |   27|   699k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (109:3): [True: 699k, False: 0]
  ------------------
  110|   699k|  invariant((croppedWidth == 0) == (croppedHeight == 0));
  ------------------
  |  |   27|   699k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (110:3): [True: 699k, False: 0]
  ------------------
  111|   699k|}
_ZN8rawspeed17CroppedArray2DRefItEC2ENS_10Array2DRefItEEiiii:
  118|   233k|    : base(base_), offsetCols(offsetCols_), offsetRows(offsetRows_),
  119|   233k|      croppedWidth(croppedWidth_), croppedHeight(croppedHeight_) {
  120|   233k|  establishClassInvariants();
  121|   233k|}
_ZNK8rawspeed17CroppedArray2DRefItEixEi:
  125|   233k|CroppedArray2DRef<T>::operator[](const int row) const {
  126|   233k|  establishClassInvariants();
  127|   233k|  invariant(row >= 0);
  ------------------
  |  |   27|   233k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (127:3): [True: 233k, False: 0]
  ------------------
  128|   233k|  invariant(row < croppedHeight);
  ------------------
  |  |   27|   233k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (128:3): [True: 233k, False: 0]
  ------------------
  129|   233k|  const Array1DRef<T> fullLine = base.operator[](offsetRows + row);
  130|   233k|  return fullLine.getCrop(offsetCols, croppedWidth);
  131|   233k|}
_ZNK8rawspeed17CroppedArray2DRefItE15getAsArray2DRefEv:
   79|   233k|  [[nodiscard]] Array2DRef<T> getAsArray2DRef() const {
   80|   233k|    establishClassInvariants();
   81|   233k|    return {operator[](0).begin(), croppedWidth, croppedHeight, base.pitch()};
   82|   233k|  }

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

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

_ZN8rawspeed8OptionalINS_10Array2DRefIiEEEC2Ev:
   35|  1.33k|  Optional() = default;
_ZN8rawspeed8OptionalIiEC2Ev:
   35|  1.69k|  Optional() = default;
_ZN8rawspeed8OptionalINSt3__15arrayIfLm4EEEEC2Ev:
   35|  1.33k|  Optional() = default;
_ZNK8rawspeed8OptionalIiE9has_valueEv:
   85|  29.9M|  [[nodiscard]] bool has_value() const RAWSPEED_READNONE {
   86|  29.9M|    return impl.has_value();
   87|  29.9M|  }
_ZNR8rawspeed8OptionalIiEdeEv:
   70|  14.9M|  T& operator*() & {
   71|  14.9M|    invariant(has_value());
  ------------------
  |  |   27|  14.9M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (71:5): [True: 14.9M, False: 0]
  ------------------
   72|  14.9M|    return impl.value();
   73|  14.9M|  }
_ZN8rawspeed8OptionalIiEaSIiQsr3stdE7same_asITL0__T_EEERS1_OS4_:
   46|  14.9M|  Optional<T>& operator=(U&& value) {
   47|  14.9M|    impl = std::forward<U>(value);
   48|  14.9M|    return *this;
   49|  14.9M|  }
_ZNKR8rawspeed8OptionalIiEdeEv:
   65|    362|  const T& operator*() const& {
   66|    362|    invariant(has_value());
  ------------------
  |  |   27|    362|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (66:5): [True: 362, False: 0]
  ------------------
   67|    362|    return impl.value();
   68|    362|  }

_ZN8rawspeed8iPoint2DC2Eii:
   41|  11.9k|  constexpr iPoint2D(value_type a, value_type b) : x(a), y(b) {}
_ZNK8rawspeed8iPoint2DplERKS0_:
   43|  3.96k|  constexpr iPoint2D operator+(const iPoint2D& rhs) const {
   44|  3.96k|    return {x + rhs.x, y + rhs.y};
   45|  3.96k|  }
_ZNK8rawspeed8iPoint2DeqERKS0_:
   59|  1.33k|  constexpr bool RAWSPEED_READONLY operator==(const iPoint2D& rhs) const {
   60|  1.33k|    return x == rhs.x && y == rhs.y;
  ------------------
  |  Branch (60:12): [True: 1.10k, False: 225]
  |  Branch (60:26): [True: 938, False: 171]
  ------------------
   61|  1.33k|  }
_ZNK8rawspeed8iPoint2DgtERKS0_:
   63|    684|  constexpr bool RAWSPEED_READONLY operator>(const iPoint2D& rhs) const {
   64|    684|    return x > rhs.x && y > rhs.y;
  ------------------
  |  Branch (64:12): [True: 642, False: 42]
  |  Branch (64:25): [True: 606, False: 36]
  ------------------
   65|    684|  }
_ZNK8rawspeed8iPoint2DgeERKS0_:
   70|  1.57k|  constexpr bool RAWSPEED_READONLY operator>=(const iPoint2D& rhs) const {
   71|  1.57k|    return x >= rhs.x && y >= rhs.y;
  ------------------
  |  Branch (71:12): [True: 1.57k, False: 0]
  |  Branch (71:26): [True: 1.57k, False: 0]
  ------------------
   72|  1.57k|  }
_ZNK8rawspeed8iPoint2DleERKS0_:
   73|  1.57k|  constexpr bool RAWSPEED_READONLY operator<=(const iPoint2D& rhs) const {
   74|  1.57k|    return x <= rhs.x && y <= rhs.y;
  ------------------
  |  Branch (74:12): [True: 1.55k, False: 17]
  |  Branch (74:26): [True: 1.53k, False: 16]
  ------------------
   75|  1.57k|  }
_ZNK8rawspeed8iPoint2D15hasPositiveAreaEv:
   77|    684|  [[nodiscard]] bool RAWSPEED_READONLY hasPositiveArea() const {
   78|    684|    return *this > iPoint2D(0, 0);
   79|    684|  }
_ZNK8rawspeed8iPoint2D4areaEv:
   81|    181|  [[nodiscard]] area_type RAWSPEED_READONLY area() const {
   82|    181|    using signed_area = std::make_signed_t<area_type>;
   83|       |
   84|    181|    area_type x_abs = std::abs(static_cast<signed_area>(x));
   85|    181|    area_type y_abs = std::abs(static_cast<signed_area>(y));
   86|       |
   87|    181|    return x_abs * y_abs;
   88|    181|  }
_ZN8rawspeed12iRectangle2DC2ERKNS_8iPoint2DES3_:
  111|  2.43k|      : pos(pos_), dim(dim_) {}
_ZNK8rawspeed12iRectangle2D9getBottomEv:
  118|    139|  [[nodiscard]] constexpr int getBottom() const { return pos.y + dim.y; }
_ZNK8rawspeed12iRectangle2D8getRightEv:
  120|     32|  [[nodiscard]] constexpr int getRight() const { return pos.x + dim.x; }
_ZNK8rawspeed12iRectangle2D8getWidthEv:
  121|    452|  [[nodiscard]] constexpr int getWidth() const { return dim.x; }
_ZNK8rawspeed12iRectangle2D9getHeightEv:
  122|      1|  [[nodiscard]] constexpr int getHeight() const { return dim.y; }
_ZNK8rawspeed12iRectangle2D10getTopLeftEv:
  123|  3.42k|  [[nodiscard]] constexpr iPoint2D getTopLeft() const { return pos; }
_ZNK8rawspeed12iRectangle2D14getBottomRightEv:
  124|  3.79k|  [[nodiscard]] constexpr iPoint2D getBottomRight() const { return pos + dim; }
_ZNK8rawspeed12iRectangle2D11getTopRightEv:
  125|    144|  [[nodiscard]] constexpr iPoint2D getTopRight() const {
  126|    144|    return pos + iPoint2D(dim.x, 0);
  127|    144|  }
_ZNK8rawspeed12iRectangle2D13getBottomLeftEv:
  128|     30|  [[nodiscard]] constexpr iPoint2D getBottomLeft() const {
  129|     30|    return pos + iPoint2D(0, dim.y);
  130|     30|  }
_ZNK8rawspeed12iRectangle2D15hasPositiveAreaEv:
  131|  1.53k|  [[nodiscard]] constexpr bool RAWSPEED_READONLY hasPositiveArea() const {
  132|  1.53k|    return (dim.x > 0) && (dim.y > 0);
  ------------------
  |  Branch (132:12): [True: 1.53k, False: 4]
  |  Branch (132:27): [True: 1.53k, False: 2]
  ------------------
  133|  1.53k|  }
_ZNK8rawspeed12iRectangle2D12isThisInsideERKS0_:
  146|  1.57k|  isThisInside(const iRectangle2D& superRect) const {
  147|  1.57k|    return getTopLeft() >= superRect.getTopLeft() &&
  ------------------
  |  Branch (147:12): [True: 1.57k, False: 0]
  ------------------
  148|  1.57k|           getBottomRight() <= superRect.getBottomRight();
  ------------------
  |  Branch (148:12): [True: 1.53k, False: 33]
  ------------------
  149|  1.57k|  }
_ZN8rawspeed8iPoint2DC2Ev:
   40|  5.33k|  constexpr iPoint2D() = default;

_ZN8rawspeed15TiledArray2DRefItEC2ENS_10Array2DRefItEEii:
  114|  1.97k|    : data(data_), tileWidth(tileWidth_), tileHeight(tileHeight_) {
  115|  1.97k|  establishClassInvariants();
  116|  1.97k|}
_ZNK8rawspeed15TiledArray2DRefItE24establishClassInvariantsEv:
  100|   936k|TiledArray2DRef<T>::establishClassInvariants() const noexcept {
  101|   936k|  data.establishClassInvariants();
  102|   936k|  invariant(tileWidth > 0);
  ------------------
  |  |   27|   936k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (102:3): [True: 936k, False: 0]
  ------------------
  103|   936k|  invariant(tileHeight > 0);
  ------------------
  |  |   27|   936k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (103:3): [True: 936k, False: 0]
  ------------------
  104|   936k|  invariant(tileWidth <= data.width());
  ------------------
  |  |   27|   936k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (104:3): [True: 936k, False: 0]
  ------------------
  105|   936k|  invariant(tileHeight <= data.height());
  ------------------
  |  |   27|   936k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (105:3): [True: 936k, False: 0]
  ------------------
  106|   936k|  invariant(data.width() % tileWidth == 0);
  ------------------
  |  |   27|   936k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (106:3): [True: 936k, False: 0]
  ------------------
  107|   936k|  invariant(data.height() % tileHeight == 0);
  ------------------
  |  |   27|   936k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (107:3): [True: 936k, False: 0]
  ------------------
  108|   936k|}
_ZNK8rawspeed15TiledArray2DRefItE7numColsEv:
  119|   464k|__attribute__((always_inline)) inline int TiledArray2DRef<T>::numCols() const {
  120|   464k|  establishClassInvariants();
  121|   464k|  return data.width() / tileWidth;
  122|   464k|}
_ZNK8rawspeed15TiledArray2DRefItE7numRowsEv:
  125|   236k|__attribute__((always_inline)) inline int TiledArray2DRef<T>::numRows() const {
  126|   236k|  establishClassInvariants();
  127|   236k|  return data.height() / tileHeight;
  128|   236k|}
_ZNK8rawspeed15TiledArray2DRefItEclEii:
  132|   233k|TiledArray2DRef<T>::operator()(const int row, const int col) const {
  133|   233k|  establishClassInvariants();
  134|   233k|  invariant(col >= 0);
  ------------------
  |  |   27|   233k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (134:3): [True: 233k, False: 0]
  ------------------
  135|   233k|  invariant(col < numCols());
  ------------------
  |  |   27|   233k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (135:3): [True: 233k, False: 0]
  ------------------
  136|   233k|  invariant(row >= 0);
  ------------------
  |  |   27|   233k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (136:3): [True: 233k, False: 0]
  ------------------
  137|   233k|  invariant(row < numRows());
  ------------------
  |  |   27|   233k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (137:3): [True: 233k, False: 0]
  ------------------
  138|   233k|  return CroppedArray2DRef(data,
  139|   233k|                           /*offsetCols=*/tileWidth * col,
  140|   233k|                           /*offsetRows=*/tileHeight * row,
  141|   233k|                           /*croppedWidth=*/tileWidth,
  142|   233k|                           /*croppedHeight=*/tileHeight);
  143|   233k|}

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

_ZNK8rawspeed18BitStreamCacheBase24establishClassInvariantsEv:
   54|  6.91M|BitStreamCacheBase::establishClassInvariants() const noexcept {
   55|  6.91M|  invariant(fillLevel >= 0);
  ------------------
  |  |   27|  6.91M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (55:3): [True: 6.91M, False: 0]
  ------------------
   56|  6.91M|  invariant(fillLevel <= Size);
  ------------------
  |  |   27|  6.91M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (56:3): [True: 6.91M, False: 0]
  ------------------
   57|  6.91M|}
_ZN8rawspeed28BitStreamCacheRightInLeftOut4pushEmi:
   93|  79.8k|  void push(uint64_t bits, int count) noexcept {
   94|  79.8k|    establishClassInvariants();
   95|  79.8k|    invariant(count >= 0);
  ------------------
  |  |   27|  79.8k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (95:5): [True: 79.8k, False: 0]
  ------------------
   96|       |    // NOTE: count may be zero!
   97|  79.8k|    invariant(count <= Size);
  ------------------
  |  |   27|  79.8k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (97:5): [True: 79.8k, False: 0]
  ------------------
   98|  79.8k|    invariant(count + fillLevel <= Size);
  ------------------
  |  |   27|  79.8k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (98:5): [True: 79.8k, False: 0]
  ------------------
   99|       |    // If the maximal size of the cache is BitStreamCacheBase::Size, and we
  100|       |    // have fillLevel [high] bits set, how many empty [low] bits do we have?
  101|  79.8k|    const int vacantBits = BitStreamCacheBase::Size - fillLevel;
  102|  79.8k|    invariant(vacantBits >= 0);
  ------------------
  |  |   27|  79.8k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (102:5): [True: 79.8k, False: 0]
  ------------------
  103|  79.8k|    invariant(vacantBits <= Size);
  ------------------
  |  |   27|  79.8k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (103:5): [True: 79.8k, False: 0]
  ------------------
  104|  79.8k|    invariant(vacantBits != 0);
  ------------------
  |  |   27|  79.8k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (104:5): [True: 79.8k, False: 0]
  ------------------
  105|  79.8k|    invariant(vacantBits >= count);
  ------------------
  |  |   27|  79.8k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (105:5): [True: 79.8k, False: 0]
  ------------------
  106|       |    // If we just directly 'or' these low bits into the cache right now,
  107|       |    // how many unfilled bits of a gap will there be in the middle of a cache?
  108|  79.8k|    const int emptyBitsGap = vacantBits - count;
  109|  79.8k|    invariant(emptyBitsGap >= 0);
  ------------------
  |  |   27|  79.8k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (109:5): [True: 79.8k, False: 0]
  ------------------
  110|  79.8k|    invariant(emptyBitsGap <= Size);
  ------------------
  |  |   27|  79.8k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (110:5): [True: 79.8k, False: 0]
  ------------------
  111|  79.8k|    if (count != 0) {
  ------------------
  |  Branch (111:9): [True: 79.8k, False: 0]
  ------------------
  112|  79.8k|      invariant(emptyBitsGap < Size);
  ------------------
  |  |   27|  79.8k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (112:7): [True: 79.8k, False: 0]
  ------------------
  113|       |      // So just shift the new bits so that there is no gap in the middle.
  114|  79.8k|      cache |= bits << emptyBitsGap;
  115|  79.8k|    }
  116|  79.8k|    fillLevel += count;
  117|  79.8k|  }
_ZNK8rawspeed28BitStreamCacheRightInLeftOut4peekEi:
  119|  1.35M|  [[nodiscard]] auto peek(int count) const noexcept {
  120|  1.35M|    establishClassInvariants();
  121|  1.35M|    invariant(count >= 0);
  ------------------
  |  |   27|  1.35M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (121:5): [True: 1.35M, False: 0]
  ------------------
  122|  1.35M|    invariant(count <= Size);
  ------------------
  |  |   27|  1.35M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (122:5): [True: 1.35M, False: 0]
  ------------------
  123|  1.35M|    invariant(count <= MaxGetBits);
  ------------------
  |  |   27|  1.35M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (123:5): [True: 1.35M, False: 0]
  ------------------
  124|  1.35M|    invariant(count != 0);
  ------------------
  |  |   27|  1.35M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (124:5): [True: 1.35M, False: 0]
  ------------------
  125|  1.35M|    invariant(count <= fillLevel);
  ------------------
  |  |   27|  1.35M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (125:5): [True: 1.35M, False: 0]
  ------------------
  126|  1.35M|    return implicit_cast<uint32_t>(
  127|  1.35M|        extractHighBits(cache, count,
  128|  1.35M|                        /*effectiveBitwidth=*/BitStreamCacheBase::Size));
  129|  1.35M|  }
_ZN8rawspeed28BitStreamCacheRightInLeftOut4skipEi:
  131|  1.35M|  void skip(int count) noexcept {
  132|  1.35M|    establishClassInvariants();
  133|  1.35M|    invariant(count >= 0);
  ------------------
  |  |   27|  1.35M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (133:5): [True: 1.35M, False: 0]
  ------------------
  134|       |    // `count` *could* be larger than `MaxGetBits`.
  135|       |    // `count` could be zero.
  136|  1.35M|    invariant(count <= Size);
  ------------------
  |  |   27|  1.35M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (136:5): [True: 1.35M, False: 0]
  ------------------
  137|  1.35M|    invariant(count <= fillLevel);
  ------------------
  |  |   27|  1.35M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (137:5): [True: 1.35M, False: 0]
  ------------------
  138|  1.35M|    fillLevel -= count;
  139|  1.35M|    cache <<= count;
  140|  1.35M|  }

_ZN8rawspeed11BitStreamerINS_17BitStreamerRevMSBENS_40BitStreamerReversedSequentialReplenisherIS1_EEEC2ENS_10Array1DRefIKSt4byteEE:
  192|    121|  explicit BitStreamer(Array1DRef<const std::byte> input) : replenisher(input) {
  193|    121|    establishClassInvariants();
  194|    121|  }
_ZN8rawspeed26BitStreamerReplenisherBaseINS_17BitStreamerRevMSBEEC2ENS_10Array1DRefIKSt4byteEE:
   57|    121|      : input(input_) {
   58|    121|    if (input.size() < BitStreamerTraits<Tag>::MaxProcessBytes)
  ------------------
  |  Branch (58:9): [True: 0, False: 121]
  ------------------
   59|    121|      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|    121|  }
_ZNK8rawspeed11BitStreamerINS_17BitStreamerRevMSBENS_40BitStreamerReversedSequentialReplenisherIS1_EEE24establishClassInvariantsEv:
  185|  4.13M|  void establishClassInvariants() const noexcept {
  186|  4.13M|    cache.establishClassInvariants();
  187|  4.13M|    replenisher.establishClassInvariants();
  188|  4.13M|  }
_ZNK8rawspeed26BitStreamerReplenisherBaseINS_17BitStreamerRevMSBEE24establishClassInvariantsEv:
   65|  4.45M|BitStreamerReplenisherBase<Tag>::establishClassInvariants() const noexcept {
   66|  4.45M|  input.establishClassInvariants();
   67|  4.45M|  invariant(input.size() >= BitStreamerTraits<Tag>::MaxProcessBytes);
  ------------------
  |  |   27|  4.45M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (67:3): [True: 4.45M, False: 0]
  ------------------
   68|  4.45M|  invariant(pos >= 0);
  ------------------
  |  |   27|  4.45M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (68:3): [True: 4.45M, False: 0]
  ------------------
   69|  4.45M|  invariant(pos % StreamTraits::MinLoadStepByteMultiple == 0);
  ------------------
  |  |   27|  4.45M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (69:3): [True: 4.45M, False: 0]
  ------------------
   70|       |  // `pos` *could* be out-of-bounds of `input`.
   71|  4.45M|}
_ZN8rawspeed11BitStreamerINS_17BitStreamerRevMSBENS_40BitStreamerReversedSequentialReplenisherIS1_EEE4fillEi:
  216|   918k|  void fill(int nbits = Cache::MaxGetBits) {
  217|   918k|    establishClassInvariants();
  218|   918k|    invariant(nbits >= 0);
  ------------------
  |  |   27|   918k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (218:5): [True: 918k, False: 0]
  ------------------
  219|   918k|    invariant(nbits != 0);
  ------------------
  |  |   27|   918k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (219:5): [True: 918k, False: 0]
  ------------------
  220|   918k|    invariant(nbits <= Cache::MaxGetBits);
  ------------------
  |  |   27|   918k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (220:5): [True: 918k, False: 0]
  ------------------
  221|       |
  222|   918k|    if (cache.fillLevel >= nbits)
  ------------------
  |  Branch (222:9): [True: 838k, False: 79.9k]
  ------------------
  223|   838k|      return;
  224|       |
  225|  79.9k|    const auto input = replenisher.getInput();
  226|  79.9k|    const auto numBytes = static_cast<Derived*>(this)->fillCache(input);
  227|  79.9k|    replenisher.markNumBytesAsConsumed(numBytes);
  228|       |    invariant(cache.fillLevel >= nbits);
  ------------------
  |  |   27|  79.9k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (228:5): [True: 79.8k, False: 64]
  ------------------
  229|  79.9k|  }
_ZNK8rawspeed39BitStreamerForwardSequentialReplenisherINS_17BitStreamerRevMSBEE6getPosEv:
   84|   160k|  [[nodiscard]] typename Base::size_type getPos() const {
   85|   160k|    Base::establishClassInvariants();
   86|   160k|    return Base::pos;
   87|   160k|  }
_ZN8rawspeed11BitStreamerINS_17BitStreamerRevMSBENS_40BitStreamerReversedSequentialReplenisherIS1_EEE9fillCacheENSt3__15arrayISt4byteLm4EEE:
  157|  79.8k|                inputStorage) {
  158|  79.8k|    static_assert(BitStreamCacheBase::MaxGetBits >= 32, "check implementation");
  159|  79.8k|    establishClassInvariants();
  160|  79.8k|    auto input = Array1DRef<std::byte>(inputStorage.data(),
  161|  79.8k|                                       implicit_cast<int>(inputStorage.size()));
  162|  79.8k|    invariant(input.size() == Traits::MaxProcessBytes);
  ------------------
  |  |   27|  79.8k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (162:5): [True: 79.8k, False: 0]
  ------------------
  163|       |
  164|  79.8k|    constexpr int StreamChunkBitwidth =
  165|  79.8k|        bitwidth<typename StreamTraits::ChunkType>();
  166|  79.8k|    static_assert(CHAR_BIT * Traits::MaxProcessBytes >= StreamChunkBitwidth);
  167|  79.8k|    static_assert(CHAR_BIT * Traits::MaxProcessBytes % StreamChunkBitwidth ==
  168|  79.8k|                  0);
  169|  79.8k|    constexpr int NumChunksNeeded =
  170|  79.8k|        (CHAR_BIT * Traits::MaxProcessBytes) / StreamChunkBitwidth;
  171|  79.8k|    static_assert(NumChunksNeeded >= 1);
  172|       |
  173|   159k|    for (int i = 0; i != NumChunksNeeded; ++i) {
  ------------------
  |  Branch (173:21): [True: 79.8k, False: 79.8k]
  ------------------
  174|  79.8k|      auto chunkInput =
  175|  79.8k|          input.getBlock(sizeof(typename StreamTraits::ChunkType), i);
  176|  79.8k|      auto chunk = getByteSwapped<typename StreamTraits::ChunkType>(
  177|  79.8k|          chunkInput.begin(),
  178|  79.8k|          StreamTraits::ChunkEndianness != getHostEndianness());
  179|  79.8k|      cache.push(chunk, StreamChunkBitwidth);
  180|  79.8k|    }
  181|  79.8k|    return Traits::MaxProcessBytes;
  182|  79.8k|  }
_ZN8rawspeed39BitStreamerForwardSequentialReplenisherINS_17BitStreamerRevMSBEE22markNumBytesAsConsumedEi:
   92|  79.8k|  void markNumBytesAsConsumed(typename Base::size_type numBytes) {
   93|  79.8k|    Base::establishClassInvariants();
   94|  79.8k|    invariant(numBytes >= 0);
  ------------------
  |  |   27|  79.8k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (94:5): [True: 79.8k, False: 0]
  ------------------
   95|  79.8k|    invariant(numBytes != 0);
  ------------------
  |  |   27|  79.8k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (95:5): [True: 79.8k, False: 0]
  ------------------
   96|  79.8k|    invariant(numBytes % StreamTraits::MinLoadStepByteMultiple == 0);
  ------------------
  |  |   27|  79.8k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (96:5): [True: 79.8k, False: 0]
  ------------------
   97|  79.8k|    Base::pos += numBytes;
   98|  79.8k|  }
_ZN8rawspeed11BitStreamerINS_17BitStreamerRevMSBENS_40BitStreamerReversedSequentialReplenisherIS1_EEE14peekBitsNoFillEi:
  253|  1.35M|  uint32_t RAWSPEED_READONLY peekBitsNoFill(int nbits) {
  254|  1.35M|    establishClassInvariants();
  255|  1.35M|    invariant(nbits >= 0);
  ------------------
  |  |   27|  1.35M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (255:5): [True: 1.35M, False: 0]
  ------------------
  256|  1.35M|    invariant(nbits != 0);
  ------------------
  |  |   27|  1.35M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (256:5): [True: 1.35M, False: 0]
  ------------------
  257|  1.35M|    invariant(nbits <= Cache::MaxGetBits);
  ------------------
  |  |   27|  1.35M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (257:5): [True: 1.35M, False: 0]
  ------------------
  258|  1.35M|    return cache.peek(nbits);
  259|  1.35M|  }
_ZN8rawspeed11BitStreamerINS_17BitStreamerRevMSBENS_40BitStreamerReversedSequentialReplenisherIS1_EEE14skipBitsNoFillEi:
  261|  1.35M|  void skipBitsNoFill(int nbits) {
  262|  1.35M|    establishClassInvariants();
  263|  1.35M|    invariant(nbits >= 0);
  ------------------
  |  |   27|  1.35M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (263:5): [True: 1.35M, False: 0]
  ------------------
  264|       |    // `nbits` could be zero.
  265|  1.35M|    invariant(nbits <= Cache::MaxGetBits);
  ------------------
  |  |   27|  1.35M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (265:5): [True: 1.35M, False: 0]
  ------------------
  266|  1.35M|    cache.skip(nbits);
  267|  1.35M|  }
_ZN8rawspeed11BitStreamerINS_17BitStreamerRevMSBENS_40BitStreamerReversedSequentialReplenisherIS1_EEE13getBitsNoFillEi:
  269|   433k|  uint32_t getBitsNoFill(int nbits) {
  270|   433k|    establishClassInvariants();
  271|   433k|    invariant(nbits >= 0);
  ------------------
  |  |   27|   433k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (271:5): [True: 433k, False: 0]
  ------------------
  272|   433k|    invariant(nbits != 0);
  ------------------
  |  |   27|   433k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (272:5): [True: 433k, False: 0]
  ------------------
  273|   433k|    invariant(nbits <= Cache::MaxGetBits);
  ------------------
  |  |   27|   433k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (273:5): [True: 433k, False: 0]
  ------------------
  274|   433k|    uint32_t ret = peekBitsNoFill(nbits);
  275|   433k|    skipBitsNoFill(nbits);
  276|   433k|    return ret;
  277|   433k|  }

_ZN8rawspeed25AbstractPrefixCodeDecoderINS_15BaselineCodeTagEE6extendEjj:
   70|   433k|  static int RAWSPEED_READNONE extend(uint32_t diff, uint32_t len) {
   71|   433k|    invariant(len > 0);
  ------------------
  |  |   27|   433k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (71:5): [True: 433k, False: 0]
  ------------------
   72|   433k|    auto ret = static_cast<int32_t>(diff);
   73|   433k|    if ((diff & (1 << (len - 1))) == 0)
  ------------------
  |  Branch (73:9): [True: 259k, False: 173k]
  ------------------
   74|   259k|      ret -= (1 << len) - 1;
   75|   433k|    return ret;
   76|   433k|  }

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

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

_ZN8rawspeed8ErrorLog8setErrorERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
   29|    101|void ErrorLog::setError(const std::string& err) {
   30|    101|  MutexLocker guard(&mutex);
   31|    101|  errors.push_back(err);
   32|    101|}

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

_ZN8rawspeed12RawImageData10createDataEv:
   68|    121|void RawImageData::createData() {
   69|    121|  static constexpr const auto alignment = 16;
   70|       |
   71|    121|  if (dim.x > 65535 || dim.y > 65535)
  ------------------
  |  Branch (71:7): [True: 0, False: 121]
  |  Branch (71:24): [True: 0, False: 121]
  ------------------
   72|    121|    ThrowRDE("Dimensions too large for allocation.");
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   73|    121|  if (dim.x <= 0 || dim.y <= 0)
  ------------------
  |  Branch (73:7): [True: 0, False: 121]
  |  Branch (73:21): [True: 0, False: 121]
  ------------------
   74|    121|    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|    121|  if (cpp <= 0 || bpp <= 0)
  ------------------
  |  Branch (75:7): [True: 0, False: 121]
  |  Branch (75:19): [True: 0, False: 121]
  ------------------
   76|    121|    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|    121|  if (isAllocated())
  ------------------
  |  Branch (77:7): [True: 0, False: 121]
  ------------------
   78|    121|    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|    121|  pitch =
   82|    121|      implicit_cast<int>(roundUp(static_cast<size_t>(dim.x) * bpp, alignment));
   83|    121|  assert(isAligned(pitch, alignment));
  ------------------
  |  Branch (83:3): [True: 121, 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|    121|  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|    121|  data.resize(static_cast<size_t>(pitch) * dim.y);
  100|       |
  101|    121|  uncropped_dim = dim;
  102|       |
  103|    121|#ifndef NDEBUG
  104|    121|  const Array2DRef<std::byte> img = getByteDataAsUncroppedArray2DRef();
  105|       |
  106|  6.42k|  for (int j = 0; j < dim.y; j++) {
  ------------------
  |  Branch (106:19): [True: 6.30k, False: 121]
  ------------------
  107|       |    // each line is indeed 16-byte aligned
  108|  6.30k|    assert(isAligned(&img(j, 0), alignment));
  ------------------
  |  Branch (108:5): [True: 6.30k, False: 0]
  ------------------
  109|  6.30k|  }
  110|    121|#endif
  111|       |
  112|    121|  poisonPadding();
  113|    121|}
_ZN8rawspeed12RawImageData13poisonPaddingEv:
  127|    121|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|    121|}
_ZN8rawspeed12RawImageData6setCppEj:
  153|  1.33k|void RawImageData::setCpp(uint32_t val) {
  154|  1.33k|  if (isAllocated())
  ------------------
  |  Branch (154:7): [True: 0, False: 1.33k]
  ------------------
  155|  1.33k|    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|  1.33k|  if (val > 4) {
  ------------------
  |  Branch (156:7): [True: 44, False: 1.29k]
  ------------------
  157|     44|    ThrowRDE(
  ------------------
  |  |   38|     44|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     44|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     44|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     44|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  158|     44|        "Only up to 4 components per pixel is support - attempted to set: %u",
  159|     44|        val);
  160|     44|  }
  161|       |
  162|  1.29k|  bpp /= cpp;
  163|  1.29k|  cpp = val;
  164|  1.29k|  bpp *= val;
  165|  1.29k|}

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

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

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

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

_ZN8rawspeed23PanasonicV8Decompressor25DecompressorParamsBuilder13getDecoderLUTENS_10ByteStreamE:
  241|    926|    ByteStream stream) {
  242|    926|  std::vector<PanasonicV8Decompressor::DecoderLUTEntry> mDecoderLUT;
  243|       |
  244|    926|  const auto numSymbols = stream.getU16();
  245|    926|  if (numSymbols < 1 || numSymbols > 17)
  ------------------
  |  Branch (245:7): [True: 167, False: 759]
  |  Branch (245:25): [True: 22, False: 737]
  ------------------
  246|    926|    ThrowRDE("Unexpected number of symbols: %u", numSymbols);
  ------------------
  |  |   38|     33|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     33|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     33|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     33|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  247|       |
  248|    893|  struct Entry {
  249|    893|    uint8_t bitcount;
  250|    893|    uint16_t symbol, mask;
  251|    893|    uint8_t codeValue;
  252|    893|  };
  253|    893|  std::vector<Entry> table;
  254|    893|  table.reserve(numSymbols);
  255|       |
  256|  2.17k|  for (unsigned symbolIndex = 0; symbolIndex != numSymbols; ++symbolIndex) {
  ------------------
  |  Branch (256:34): [True: 1.31k, False: 862]
  ------------------
  257|  1.31k|    const auto len = stream.getU16(); // Number of bits in symbol
  258|  1.31k|    if (len < 1 || len > 16)
  ------------------
  |  Branch (258:9): [True: 18, False: 1.29k]
  |  Branch (258:20): [True: 13, False: 1.28k]
  ------------------
  259|  1.31k|      ThrowRDE("Unexpected symbol length");
  ------------------
  |  |   38|     15|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     15|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     15|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     15|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  260|  1.30k|    const auto code = stream.getU16();
  261|  1.30k|    if (!isIntN<uint32_t>(code, len))
  ------------------
  |  Branch (261:9): [True: 15, False: 1.28k]
  ------------------
  262|  1.30k|      ThrowRDE("Bad symbol code");
  ------------------
  |  |   38|     15|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     15|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     15|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     15|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  263|  1.28k|    Entry entry;
  264|  1.28k|    entry.bitcount = implicit_cast<uint8_t>(len);
  265|  1.28k|    entry.symbol = uint16_t(code << (16U - entry.bitcount));
  266|  1.28k|    entry.codeValue = implicit_cast<uint8_t>(symbolIndex);
  267|  1.28k|    entry.mask = uint16_t(
  268|  1.28k|        0xffffU << (16U -
  269|  1.28k|                    entry.bitcount)); // mask of the bits overlapping symbol
  270|  1.28k|    if (entry.bitcount == PanasonicV8Decompressor::DecoderLUTEntry().bitcount &&
  ------------------
  |  Branch (270:9): [True: 54, False: 1.23k]
  |  Branch (270:9): [True: 1, False: 1.28k]
  ------------------
  271|     54|        entry.codeValue == PanasonicV8Decompressor::DecoderLUTEntry().diffCat)
  ------------------
  |  Branch (271:9): [True: 1, False: 53]
  ------------------
  272|  1.28k|      ThrowRDE("Sentinel symbol encountered");
  ------------------
  |  |   38|      1|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      1|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      1|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      1|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  273|  1.28k|    table.emplace_back(entry);
  274|  1.28k|  }
  275|    893|  assert(table.size() == numSymbols);
  ------------------
  |  Branch (275:3): [True: 684, False: 178]
  ------------------
  276|       |
  277|       |  // Cache of decoding results for all possible 16-bit values.
  278|    684|  mDecoderLUT.resize(1 + UINT16_MAX);
  279|       |
  280|       |  // Populates LUT by checking for a bitwise match between each value and the
  281|       |  // codes recorded in the table.
  282|  44.8M|  for (unsigned li = 0; li < mDecoderLUT.size(); ++li) {
  ------------------
  |  Branch (282:25): [True: 44.8M, False: 684]
  ------------------
  283|  44.8M|    PanasonicV8Decompressor::DecoderLUTEntry& lutVal = mDecoderLUT[li];
  284|  68.9M|    for (const auto& ti : table) {
  ------------------
  |  Branch (284:25): [True: 68.9M, False: 32.4M]
  ------------------
  285|  68.9M|      if ((uint16_t(li) & ti.mask) == ti.symbol) {
  ------------------
  |  Branch (285:11): [True: 12.4M, False: 56.5M]
  ------------------
  286|  12.4M|        lutVal.bitcount = ti.bitcount;
  287|  12.4M|        lutVal.diffCat = ti.codeValue;
  288|  12.4M|        break; // NOTE: not a prefix code!
  289|  12.4M|      }
  290|  68.9M|    }
  291|  44.8M|  }
  292|       |
  293|    684|  return mDecoderLUT;
  294|    862|}
_ZN8rawspeed23PanasonicV8Decompressor25DecompressorParamsBuilder11getOutRectsENS_8iPoint2DENS_10Array1DRefIKjEENS3_IKtEES7_:
  300|    684|    Array1DRef<const uint16_t> stripHeights) {
  301|    684|  if (!imgSize.hasPositiveArea())
  ------------------
  |  Branch (301:7): [True: 78, False: 606]
  ------------------
  302|    684|    ThrowRDE("Empty image requested");
  ------------------
  |  |   38|     78|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     78|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     78|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     78|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  303|    606|  if (imgSize.x % 2 != 0 || imgSize.y % 2 != 0)
  ------------------
  |  Branch (303:7): [True: 4, False: 602]
  |  Branch (303:29): [True: 4, False: 598]
  ------------------
  304|    606|    ThrowRDE("Image size is not multiple of 2");
  ------------------
  |  |   38|      8|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      8|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      8|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      8|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  305|    598|  const int totalStrips = stripLineOffsets.size();
  306|    598|  if (stripWidths.size() != totalStrips || stripHeights.size() != totalStrips)
  ------------------
  |  Branch (306:7): [True: 28, False: 570]
  |  Branch (306:44): [True: 31, False: 539]
  ------------------
  307|    598|    ThrowRDE("Inputs have mismatched length");
  ------------------
  |  |   38|     59|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     59|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     59|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     59|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  308|    539|  if (totalStrips <= 0)
  ------------------
  |  Branch (308:7): [True: 11, False: 528]
  ------------------
  309|    539|    ThrowRDE("No strips provided");
  ------------------
  |  |   38|     11|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     11|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     11|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     11|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  310|       |
  311|    528|  std::vector<iRectangle2D> mOutRects;
  312|       |
  313|  1.45k|  for (int stripIdx = 0; stripIdx < totalStrips; ++stripIdx) {
  ------------------
  |  Branch (313:26): [True: 980, False: 478]
  ------------------
  314|    980|    const uint32_t stripWidth = stripWidths(stripIdx);
  315|    980|    const uint32_t stripHeight = stripHeights(stripIdx);
  316|    980|    const uint32_t stripOutputX = stripLineOffsets(stripIdx) & 0xFFFF;
  317|    980|    const uint32_t stripOutputY = stripLineOffsets(stripIdx) >> 16;
  318|       |
  319|    980|    const auto rect = iRectangle2D(iPoint2D(stripOutputX, stripOutputY),
  320|    980|                                   iPoint2D(stripWidth, stripHeight));
  321|    980|    const auto imgDim = iRectangle2D({0, 0}, imgSize);
  322|       |
  323|    980|    if (!rect.isThisInside(imgDim))
  ------------------
  |  Branch (323:9): [True: 33, False: 947]
  ------------------
  324|    980|      ThrowRDE("Tile isn't fully within the output image");
  ------------------
  |  |   38|     33|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     33|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     33|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     33|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  325|    947|    if (!rect.hasPositiveArea())
  ------------------
  |  Branch (325:9): [True: 6, False: 941]
  ------------------
  326|    947|      ThrowRDE("The tile is empty");
  ------------------
  |  |   38|      6|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      6|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      6|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      6|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  327|       |
  328|    941|    if (rect.pos.x % 2 != 0 || rect.pos.y % 2 != 0)
  ------------------
  |  Branch (328:9): [True: 3, False: 938]
  |  Branch (328:32): [True: 3, False: 935]
  ------------------
  329|    941|      ThrowRDE("Tile position is not multiple of 2");
  ------------------
  |  |   38|      6|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      6|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      6|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      6|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  330|    935|    if (rect.dim.x % 2 != 0 || rect.dim.y % 2 != 0)
  ------------------
  |  Branch (330:9): [True: 1, False: 934]
  |  Branch (330:32): [True: 4, False: 930]
  ------------------
  331|    935|      ThrowRDE("Tile size is not multiple of 2");
  ------------------
  |  |   38|      5|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      5|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      5|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      5|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  332|       |
  333|    930|    mOutRects.emplace_back(rect);
  334|    930|  }
  335|       |
  336|    478|  isValidImageGrid(imgSize, getAsArray1DRef(mOutRects));
  337|    478|  return mOutRects;
  338|    528|}
PanasonicV8Decompressor.cpp:_ZN8rawspeed12_GLOBAL__N_116isValidImageGridENS_8iPoint2DENS_10Array1DRefIKNS_12iRectangle2DEEE:
  170|    478|void isValidImageGrid(iPoint2D imgSize, Array1DRef<const iRectangle2D> rects) {
  171|    478|  auto outPos = iPoint2D(0, 0);
  172|    478|  const auto imgDim = iRectangle2D(outPos, imgSize);
  173|       |
  174|    478|  iRectangle2D rect = rects(0);
  175|    478|  if (rect.pos != outPos)
  ------------------
  |  Branch (175:7): [True: 31, False: 447]
  ------------------
  176|    478|    ThrowRDE("First tile is out-of-order");
  ------------------
  |  |   38|     31|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     31|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     31|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     31|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  177|    447|  invariant(rect.isThisInside(imgDim));
  ------------------
  |  |   27|    447|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (177:3): [True: 447, False: 0]
  ------------------
  178|    447|  invariant(rect.hasPositiveArea());
  ------------------
  |  |   27|    447|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (178:3): [True: 447, False: 0]
  ------------------
  179|    447|  outPos.x += rect.getWidth();
  180|    453|  for (int tileIdx = 1; tileIdx != rects.size(); ++tileIdx) {
  ------------------
  |  Branch (180:25): [True: 144, False: 309]
  ------------------
  181|    144|    iRectangle2D nextRect = rects(tileIdx);
  182|    144|    invariant(nextRect.isThisInside(imgDim));
  ------------------
  |  |   27|    144|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (182:5): [True: 144, False: 0]
  ------------------
  183|    144|    invariant(nextRect.hasPositiveArea());
  ------------------
  |  |   27|    144|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (183:5): [True: 144, False: 0]
  ------------------
  184|    144|    switch (evaluateConsecutiveTiles(rect, nextRect)) {
  ------------------
  |  Branch (184:13): [True: 144, False: 0]
  ------------------
  185|      5|    case TileSequenceStatus::ContinuesRow:
  ------------------
  |  Branch (185:5): [True: 5, False: 139]
  ------------------
  186|      5|      outPos.x += nextRect.getWidth();
  187|      5|      rect = nextRect;
  188|      5|      continue;
  189|     32|    case TileSequenceStatus::BeginsNewRow:
  ------------------
  |  Branch (189:5): [True: 32, False: 112]
  ------------------
  190|     32|      if (outPos.x != imgDim.getRight())
  ------------------
  |  Branch (190:11): [True: 31, False: 1]
  ------------------
  191|     32|        ThrowRDE("Previous row has not been fully filled yet");
  ------------------
  |  |   38|     31|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     31|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     31|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     31|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  192|      1|      outPos.x = 0;
  193|      1|      outPos.y += nextRect.getHeight();
  194|      1|      rect = nextRect;
  195|      1|      continue;
  196|    107|    case TileSequenceStatus::Invalid:
  ------------------
  |  Branch (196:5): [True: 107, False: 37]
  ------------------
  197|    107|      ThrowRDE("Invalid tiling config");
  ------------------
  |  |   38|    107|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|    107|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|    107|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|    107|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  198|    144|    }
  199|    144|  }
  200|    309|  if (rect.getBottomRight() != imgDim.getBottomRight())
  ------------------
  |  Branch (200:7): [True: 66, False: 243]
  ------------------
  201|    309|    ThrowRDE("Tiles do not cover whole output image");
  ------------------
  |  |   38|     66|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     66|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     66|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     66|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  202|    309|}
PanasonicV8Decompressor.cpp:_ZN8rawspeed12_GLOBAL__N_124evaluateConsecutiveTilesENS_12iRectangle2DES1_:
  158|    144|evaluateConsecutiveTiles(const iRectangle2D rect, const iRectangle2D nextRect) {
  159|    144|  using enum TileSequenceStatus;
  160|       |  // Are these two are horizontally-adjacent rectangles of same height?
  161|    144|  if (rect.getTopRight() == nextRect.getTopLeft() &&
  ------------------
  |  Branch (161:7): [True: 30, False: 114]
  |  Branch (161:7): [True: 5, False: 139]
  ------------------
  162|     30|      rect.getBottomRight() == nextRect.getBottomLeft())
  ------------------
  |  Branch (162:7): [True: 5, False: 25]
  ------------------
  163|      5|    return ContinuesRow;
  164|       |  // Otherwise, the next rectangle should be the first row of next Row.
  165|    139|  if (nextRect.getTopLeft() == iPoint2D(0, rect.getBottom()))
  ------------------
  |  Branch (165:7): [True: 32, False: 107]
  ------------------
  166|     32|    return BeginsNewRow;
  167|    107|  return Invalid;
  168|    139|}
_ZN8rawspeed23PanasonicV8DecompressorC2ENS_8RawImageENS0_18DecompressorParamsE:
  344|    234|    : mRawOutput(std::move(outputImg)), mParams(std::move(mParams_)) {
  345|    234|  if (mRawOutput->getCpp() != 1 ||
  ------------------
  |  Branch (345:7): [True: 0, False: 234]
  ------------------
  346|    234|      mRawOutput->getDataType() != RawImageType::UINT16 ||
  ------------------
  |  Branch (346:7): [True: 0, False: 234]
  ------------------
  347|    234|      mRawOutput->getBpp() != sizeof(uint16_t)) {
  ------------------
  |  Branch (347:7): [True: 0, False: 234]
  ------------------
  348|      0|    ThrowRDE("Unexpected component count / data type");
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  349|      0|  }
  350|    234|  if (mRawOutput->dim != mParams.imgSize)
  ------------------
  |  Branch (350:7): [True: 53, False: 181]
  ------------------
  351|    234|    ThrowRDE("Unexpected image dimensions");
  ------------------
  |  |   38|     53|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     53|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     53|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     53|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  352|    181|  const auto maxBpp = maxBitsPerPixelNeeded(mParams.mDecoderLUT);
  353|    181|  if (maxBpp > 32) {
  ------------------
  |  Branch (353:7): [True: 0, False: 181]
  ------------------
  354|      0|    ThrowRDE("Single pixel decode may consume more than 32 bits");
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  355|      0|  }
  356|    181|  const auto minBpp = minBitsPerPixelNeeded(mParams.mDecoderLUT);
  357|    302|  for (int stripIdx = 0; stripIdx < mParams.mStrips.size(); ++stripIdx) {
  ------------------
  |  Branch (357:26): [True: 181, False: 121]
  ------------------
  358|    181|    const auto strip = mParams.mStrips(stripIdx);
  359|    181|    const auto maxPixelsInStrip = (uint64_t{CHAR_BIT} * strip.size()) / minBpp;
  360|    181|    const auto outRect = mParams.mOutRect(stripIdx);
  361|    181|    if (outRect.dim.area() > maxPixelsInStrip)
  ------------------
  |  Branch (361:9): [True: 60, False: 121]
  ------------------
  362|    181|      ThrowRDE("Input strip is unsufficient to produce requested tile");
  ------------------
  |  |   38|     60|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     60|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     60|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     60|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  363|    181|  }
  364|    181|}
PanasonicV8Decompressor.cpp:_ZN8rawspeed12_GLOBAL__N_121maxBitsPerPixelNeededENS_10Array1DRefIKNS_23PanasonicV8Decompressor15DecoderLUTEntryEEE:
  232|    181|    Array1DRef<const PanasonicV8Decompressor::DecoderLUTEntry> mDecoderLUT) {
  233|    181|  return bitsPerPixelNeeded(mDecoderLUT,
  234|    181|                            [](auto a, auto b) { return std::max(a, b); });
  235|    181|}
PanasonicV8Decompressor.cpp:_ZN8rawspeed12_GLOBAL__N_118bitsPerPixelNeededIZNS0_21maxBitsPerPixelNeededENS_10Array1DRefIKNS_23PanasonicV8Decompressor15DecoderLUTEntryEEEE3$_0EEiS6_T_:
  207|    181|    T cb) {
  208|    181|  invariant(mDecoderLUT.size() > 0);
  ------------------
  |  |   27|    181|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (208:3): [True: 181, False: 0]
  ------------------
  209|    181|  const auto r = std::accumulate(
  210|    181|      mDecoderLUT.begin(), mDecoderLUT.end(), Optional<int>(),
  211|    181|      [cb](auto init, const PanasonicV8Decompressor::DecoderLUTEntry& e) {
  212|    181|        if (e.isSentinel())
  213|    181|          return init;
  214|    181|        invariant(e.bitcount > 0);
  215|    181|        const auto total = e.bitcount + e.diffCat;
  216|    181|        invariant(total > 0);
  217|    181|        init = init.has_value() ? cb(*init, total) : total;
  218|    181|        return init;
  219|    181|      });
  220|    181|  const auto bit = *r;
  221|    181|  invariant(bit > 0);
  ------------------
  |  |   27|    181|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (221:3): [True: 181, False: 0]
  ------------------
  222|    181|  return bit;
  223|    181|}
PanasonicV8Decompressor.cpp:_ZZN8rawspeed12_GLOBAL__N_118bitsPerPixelNeededIZNS0_21maxBitsPerPixelNeededENS_10Array1DRefIKNS_23PanasonicV8Decompressor15DecoderLUTEntryEEEE3$_0EEiS6_T_ENKUlS8_RS5_E_clINS_8OptionalIiEEEEDaS8_S9_:
  211|  11.8M|      [cb](auto init, const PanasonicV8Decompressor::DecoderLUTEntry& e) {
  212|  11.8M|        if (e.isSentinel())
  ------------------
  |  Branch (212:13): [True: 4.37M, False: 7.48M]
  ------------------
  213|  4.37M|          return init;
  214|  7.48M|        invariant(e.bitcount > 0);
  ------------------
  |  |   27|  7.48M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (214:9): [True: 7.48M, False: 0]
  ------------------
  215|  7.48M|        const auto total = e.bitcount + e.diffCat;
  216|  7.48M|        invariant(total > 0);
  ------------------
  |  |   27|  7.48M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (216:9): [True: 7.48M, False: 0]
  ------------------
  217|  7.48M|        init = init.has_value() ? cb(*init, total) : total;
  ------------------
  |  Branch (217:16): [True: 7.48M, False: 181]
  ------------------
  218|  7.48M|        return init;
  219|  7.48M|      });
PanasonicV8Decompressor.cpp:_ZZN8rawspeed12_GLOBAL__N_121maxBitsPerPixelNeededENS_10Array1DRefIKNS_23PanasonicV8Decompressor15DecoderLUTEntryEEEENK3$_0clIiiEEDaT_T0_:
  234|  7.48M|                            [](auto a, auto b) { return std::max(a, b); });
PanasonicV8Decompressor.cpp:_ZN8rawspeed12_GLOBAL__N_121minBitsPerPixelNeededENS_10Array1DRefIKNS_23PanasonicV8Decompressor15DecoderLUTEntryEEE:
  226|    181|    Array1DRef<const PanasonicV8Decompressor::DecoderLUTEntry> mDecoderLUT) {
  227|    181|  return bitsPerPixelNeeded(mDecoderLUT,
  228|    181|                            [](auto a, auto b) { return std::min(a, b); });
  229|    181|}
PanasonicV8Decompressor.cpp:_ZN8rawspeed12_GLOBAL__N_118bitsPerPixelNeededIZNS0_21minBitsPerPixelNeededENS_10Array1DRefIKNS_23PanasonicV8Decompressor15DecoderLUTEntryEEEE3$_0EEiS6_T_:
  207|    181|    T cb) {
  208|    181|  invariant(mDecoderLUT.size() > 0);
  ------------------
  |  |   27|    181|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (208:3): [True: 181, False: 0]
  ------------------
  209|    181|  const auto r = std::accumulate(
  210|    181|      mDecoderLUT.begin(), mDecoderLUT.end(), Optional<int>(),
  211|    181|      [cb](auto init, const PanasonicV8Decompressor::DecoderLUTEntry& e) {
  212|    181|        if (e.isSentinel())
  213|    181|          return init;
  214|    181|        invariant(e.bitcount > 0);
  215|    181|        const auto total = e.bitcount + e.diffCat;
  216|    181|        invariant(total > 0);
  217|    181|        init = init.has_value() ? cb(*init, total) : total;
  218|    181|        return init;
  219|    181|      });
  220|    181|  const auto bit = *r;
  221|    181|  invariant(bit > 0);
  ------------------
  |  |   27|    181|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (221:3): [True: 181, False: 0]
  ------------------
  222|    181|  return bit;
  223|    181|}
PanasonicV8Decompressor.cpp:_ZZN8rawspeed12_GLOBAL__N_118bitsPerPixelNeededIZNS0_21minBitsPerPixelNeededENS_10Array1DRefIKNS_23PanasonicV8Decompressor15DecoderLUTEntryEEEE3$_0EEiS6_T_ENKUlS8_RS5_E_clINS_8OptionalIiEEEEDaS8_S9_:
  211|  11.8M|      [cb](auto init, const PanasonicV8Decompressor::DecoderLUTEntry& e) {
  212|  11.8M|        if (e.isSentinel())
  ------------------
  |  Branch (212:13): [True: 4.37M, False: 7.48M]
  ------------------
  213|  4.37M|          return init;
  214|  7.48M|        invariant(e.bitcount > 0);
  ------------------
  |  |   27|  7.48M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (214:9): [True: 7.48M, False: 0]
  ------------------
  215|  7.48M|        const auto total = e.bitcount + e.diffCat;
  216|  7.48M|        invariant(total > 0);
  ------------------
  |  |   27|  7.48M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (216:9): [True: 7.48M, False: 0]
  ------------------
  217|  7.48M|        init = init.has_value() ? cb(*init, total) : total;
  ------------------
  |  Branch (217:16): [True: 7.48M, False: 181]
  ------------------
  218|  7.48M|        return init;
  219|  7.48M|      });
PanasonicV8Decompressor.cpp:_ZZN8rawspeed12_GLOBAL__N_121minBitsPerPixelNeededENS_10Array1DRefIKNS_23PanasonicV8Decompressor15DecoderLUTEntryEEEENK3$_0clIiiEEDaT_T0_:
  228|  7.48M|                            [](auto a, auto b) { return std::min(a, b); });
_ZNK8rawspeed23PanasonicV8Decompressor10decompressEv:
  366|    121|void PanasonicV8Decompressor::decompress() const {
  367|    121|  const int numStrips = mParams.mStrips.size();
  368|    121|#ifdef HAVE_OPENMP
  369|    121|  unsigned threadCount =
  370|    121|      std::min(numStrips, rawspeed_get_number_of_processor_cores());
  371|    121|#pragma omp parallel for num_threads(threadCount)                              \
  372|    121|    schedule(static) default(none) firstprivate(numStrips)
  373|    121|#endif
  374|    121|  for (int stripIdx = 0; stripIdx < numStrips; ++stripIdx) {
  375|    121|    try {
  376|    121|      Array1DRef<const uint8_t> strip = mParams.mStrips(stripIdx);
  377|       |
  378|    121|      const auto outRect = mParams.mOutRect(stripIdx);
  379|       |
  380|    121|      const auto out = CroppedArray2DRef<uint16_t>(
  381|    121|                           mRawOutput->getU16DataAsUncroppedArray2DRef(),
  382|    121|                           /*offsetCols=*/outRect.pos.x,
  383|    121|                           /*offsetRows=*/outRect.pos.y,
  384|    121|                           /*croppedWidth=*/outRect.dim.x,
  385|    121|                           /*croppedHeight=*/outRect.dim.y)
  386|    121|                           .getAsArray2DRef();
  387|       |
  388|    121|      InternalDecoder decoder(mParams.mDecoderLUT, strip);
  389|       |
  390|    121|      decompressStrip(out, decoder);
  391|    121|    } catch (const RawspeedException& err) {
  392|       |      // Propagate the exception out of OpenMP magic.
  393|    121|      mRawOutput->setError(err.what());
  394|    121|    } catch (...) {
  395|       |      // We should not get any other exception type here.
  396|    121|      __builtin_unreachable();
  397|    121|    }
  398|    121|  }
  399|    121|}
PanasonicV8Decompressor.cpp:_ZNK8rawspeed23PanasonicV8Decompressor10decompressEv.omp_outlined_debug__:
  374|    242|  for (int stripIdx = 0; stripIdx < numStrips; ++stripIdx) {
  ------------------
  |  Branch (374:26): [True: 121, False: 121]
  ------------------
  375|    121|    try {
  376|    121|      Array1DRef<const uint8_t> strip = mParams.mStrips(stripIdx);
  377|       |
  378|    121|      const auto outRect = mParams.mOutRect(stripIdx);
  379|       |
  380|    121|      const auto out = CroppedArray2DRef<uint16_t>(
  381|    121|                           mRawOutput->getU16DataAsUncroppedArray2DRef(),
  382|    121|                           /*offsetCols=*/outRect.pos.x,
  383|    121|                           /*offsetRows=*/outRect.pos.y,
  384|    121|                           /*croppedWidth=*/outRect.dim.x,
  385|    121|                           /*croppedHeight=*/outRect.dim.y)
  386|    121|                           .getAsArray2DRef();
  387|       |
  388|    121|      InternalDecoder decoder(mParams.mDecoderLUT, strip);
  389|       |
  390|    121|      decompressStrip(out, decoder);
  391|    121|    } catch (const RawspeedException& err) {
  392|       |      // Propagate the exception out of OpenMP magic.
  393|    101|      mRawOutput->setError(err.what());
  394|    101|    } catch (...) {
  395|       |      // We should not get any other exception type here.
  396|      0|      __builtin_unreachable();
  397|      0|    }
  398|    121|  }
_ZN8rawspeed23PanasonicV8Decompressor15InternalDecoderC2ERKNS_10Array1DRefIKNS0_15DecoderLUTEntryEEENS2_IKhEE:
  148|    121|      : mLUT(LUT), mBitPump(bitStream) {}
_ZNK8rawspeed23PanasonicV8Decompressor15decompressStripENS_10Array2DRefItEENS0_15InternalDecoderE:
  402|    121|                                              InternalDecoder decoder) const {
  403|    121|  Bayer2x2 predictedStorage = mParams.initialPrediction;
  404|    121|  const auto pred = Array2DRef(predictedStorage.data(), 2, 2);
  405|       |
  406|    121|  invariant(out.height() % 2 == 0);
  ------------------
  |  |   27|    121|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (406:3): [True: 121, False: 0]
  ------------------
  407|    121|  invariant(out.width() % 2 == 0);
  ------------------
  |  |   27|    121|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (407:3): [True: 121, False: 0]
  ------------------
  408|       |
  409|    363|  for (int j = 0; j != 2; ++j)
  ------------------
  |  Branch (409:19): [True: 242, False: 121]
  ------------------
  410|    726|    for (int i = 0; i != 2; ++i)
  ------------------
  |  Branch (410:21): [True: 484, False: 242]
  ------------------
  411|    484|      pred(i, j) = pred(j, i);
  412|       |
  413|    121|  const auto rowGroups = TiledArray2DRef(out,
  414|    121|                                         /*tileWidth=*/out.width(),
  415|    121|                                         /*tileHeight_=*/2);
  416|       |
  417|    121|  invariant(rowGroups.numCols() == 1);
  ------------------
  |  |   27|    121|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (417:3): [True: 121, False: 0]
  ------------------
  418|  1.97k|  for (int rowGroup = 0; rowGroup != rowGroups.numRows(); ++rowGroup) {
  ------------------
  |  Branch (418:26): [True: 1.84k, False: 121]
  ------------------
  419|  1.84k|    const auto outRow = rowGroups(rowGroup, 0).getAsArray2DRef();
  420|       |
  421|  1.84k|    const auto outBlocks = TiledArray2DRef(outRow,
  422|  1.84k|                                           /*tileWidth=*/2,
  423|  1.84k|                                           /*tileHeight=*/2);
  424|       |
  425|       |    // Each decoded 'row' is actually two rows of pixels in the raw image
  426|       |    // because the image is encoded in rows of 2x2 CFA tiles. Likewise the
  427|       |    // effective width here is 2x the strip width.
  428|  1.84k|    invariant(outBlocks.numRows() == 1);
  ------------------
  |  |   27|  1.84k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (428:5): [True: 1.84k, False: 0]
  ------------------
  429|   231k|    for (int blockIdx = 0; blockIdx < outBlocks.numCols(); ++blockIdx) {
  ------------------
  |  Branch (429:28): [True: 229k, False: 1.84k]
  ------------------
  430|   229k|      const auto outBlock = outBlocks(0, blockIdx).getAsArray2DRef();
  431|       |
  432|   688k|      for (int j = 0; j != 2; ++j) {
  ------------------
  |  Branch (432:23): [True: 459k, False: 229k]
  ------------------
  433|  1.37M|        for (int i = 0; i != 2; ++i) {
  ------------------
  |  Branch (433:25): [True: 918k, False: 459k]
  ------------------
  434|   918k|          const int32_t diff = decoder.decodeNextDiffValue();
  435|   918k|          const int32_t decodedValue = pred(i, j) + diff;
  436|   918k|          pred(i, j) = uint16_t(std::clamp(
  437|   918k|              decodedValue, 0, int32_t(std::numeric_limits<uint16_t>::max())));
  438|   918k|          outBlock(i, j) = pred(i, j);
  439|   918k|        }
  440|   459k|      }
  441|   229k|    }
  442|       |
  443|       |    // At the end of the line, reset predicted value to the first tile of the
  444|       |    // prior line.
  445|  1.84k|    const auto tmp = outBlocks(0, 0).getAsArray2DRef();
  446|  5.34k|    for (int j = 0; j != 2; ++j)
  ------------------
  |  Branch (446:21): [True: 3.49k, False: 1.84k]
  ------------------
  447|  10.4k|      for (int i = 0; i != 2; ++i)
  ------------------
  |  Branch (447:23): [True: 6.99k, False: 3.49k]
  ------------------
  448|  6.99k|        pred(i, j) = tmp(i, j);
  449|  1.84k|  }
  450|    121|}
_ZN8rawspeed23PanasonicV8Decompressor15InternalDecoder19decodeNextDiffValueEv:
  452|   918k|int32_t inline PanasonicV8Decompressor::InternalDecoder::decodeNextDiffValue() {
  453|       |  // Retrieve the difference category, which indicates magnitude of the
  454|       |  // difference between the predicted and actual value.
  455|   918k|  mBitPump.fill(32);
  456|   918k|  const auto next16 = uint16_t(mBitPump.peekBitsNoFill(16));
  457|   918k|  invariant(mLUT.size() == 1 + UINT16_MAX);
  ------------------
  |  |   27|   918k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (457:3): [True: 917k, False: 64]
  ------------------
  458|   917k|  const auto& [codeLen, codeValue] = mLUT(next16);
  459|   917k|  if (codeValue == 0 && codeLen == 7)
  ------------------
  |  Branch (459:7): [True: 484k, False: 433k]
  |  Branch (459:25): [True: 37, False: 484k]
  ------------------
  460|   917k|    ThrowRDE("Decoding encountered an invalid value!");
  ------------------
  |  |   38|     37|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     37|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     37|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     37|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  461|       |  // Skip the bits that encoded the difference category
  462|   917k|  mBitPump.skipBitsNoFill(codeLen);
  463|   917k|  int diffLen = codeValue;
  464|       |
  465|   917k|  if (diffLen == 0)
  ------------------
  |  Branch (465:7): [True: 484k, False: 433k]
  ------------------
  466|   484k|    return 0;
  467|       |
  468|   433k|  const uint32_t diff = mBitPump.getBitsNoFill(diffLen);
  469|   433k|  return AbstractPrefixCodeDecoder<BaselineCodeTag>::extend(diff, diffLen);
  470|   917k|}
_ZN8rawspeed40BitStreamerReversedSequentialReplenisherINS_17BitStreamerRevMSBEE8getInputEv:
   75|  79.9k|  std::array<std::byte, BitStreamerTraits<Tag>::MaxProcessBytes> getInput() {
   76|  79.9k|    Base::establishClassInvariants();
   77|       |
   78|  79.9k|    std::array<std::byte, BitStreamerTraits<Tag>::MaxProcessBytes> tmpStorage;
   79|  79.9k|    auto tmp = Array1DRef<std::byte>(tmpStorage.data(),
   80|  79.9k|                                     implicit_cast<int>(tmpStorage.size()));
   81|       |
   82|  79.9k|    if (Base::getPos() + BitStreamerTraits<Tag>::MaxProcessBytes <=
  ------------------
  |  Branch (82:9): [True: 79.6k, False: 274]
  ------------------
   83|  79.9k|        Base::input.size()) [[likely]] {
   84|  79.6k|      auto currInput =
   85|  79.6k|          Base::input
   86|  79.6k|              .getCrop(Base::getPos(), BitStreamerTraits<Tag>::MaxProcessBytes)
   87|  79.6k|              .getAsArray1DRef();
   88|  79.6k|      invariant(currInput.size() == tmp.size());
  ------------------
  |  |   27|  79.6k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (88:7): [True: 79.6k, False: 0]
  ------------------
   89|  79.6k|      std::copy_n(currInput.begin(), BitStreamerTraits<Tag>::MaxProcessBytes,
   90|  79.6k|                  tmp.begin());
   91|       |
   92|  79.6k|      std::array<uint8_t, 4> ints;
   93|   398k|      for (int i = 0; i != 4; ++i)
  ------------------
  |  Branch (93:23): [True: 318k, False: 79.6k]
  ------------------
   94|   318k|        ints[i] = uint8_t(tmp(i));
   95|  79.6k|      ints = bitreverse_each(ints);
   96|   398k|      for (int i = 0; i != 4; ++i)
  ------------------
  |  Branch (96:23): [True: 318k, False: 79.6k]
  ------------------
   97|   318k|        tmp(i) = std::byte{ints[i]};
   98|       |
   99|  79.6k|      return tmpStorage;
  100|  79.6k|    }
  101|       |
  102|    274|    if (Base::getPos() >
  ------------------
  |  Branch (102:9): [True: 64, False: 210]
  ------------------
  103|    274|        Base::input.size() + 2 * BitStreamerTraits<Tag>::MaxProcessBytes)
  104|     64|        [[unlikely]]
  105|     64|      ThrowIOE("Buffer overflow read in BitStreamer");
  ------------------
  |  |   37|     64|#define ThrowIOE(...) ThrowExceptionHelper(rawspeed::IOException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     64|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     64|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     64|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  106|       |
  107|    210|    variableLengthLoadNaiveViaMemcpy(tmp, Base::input, Base::getPos());
  108|       |
  109|    210|    return tmpStorage;
  110|    274|  }

_ZN8rawspeed23PanasonicV8Decompressor25DecompressorParamsBuilderC2ENS_8iPoint2DENSt3__15arrayItLm4EEENS_10Array1DRefIKNS6_IKhEEEENS6_IKjEENS6_IKtEESE_NS_10ByteStreamE:
  115|    926|        : imgSize(imgSize_), mDecoderLUT(getDecoderLUT(defineCodes)),
  116|    926|          mStrips(mStrips_), initialPrediction(initialPrediction_),
  117|    926|          mOutRects(getOutRects(imgSize, stripLineOffsets, stripWidths,
  118|    926|                                stripHeights)) {
  119|    926|      if (mStrips.size() != implicit_cast<int>(mOutRects.size()))
  ------------------
  |  Branch (119:11): [True: 8, False: 918]
  ------------------
  120|    926|        ThrowRDE("Got different number of input strips vs output tiles");
  ------------------
  |  |   38|      8|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      8|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      8|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      8|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  121|    918|      for (const auto& strip : mStrips_) {
  ------------------
  |  Branch (121:30): [True: 235, False: 917]
  ------------------
  122|    235|        if (strip.size() == 0)
  ------------------
  |  Branch (122:13): [True: 1, False: 234]
  ------------------
  123|    235|          ThrowRDE("Got empty input strip");
  ------------------
  |  |   38|      1|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      1|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      1|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      1|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  124|    235|      }
  125|    918|    }
_ZNK8rawspeed23PanasonicV8Decompressor25DecompressorParamsBuilder21getDecompressorParamsEv:
  127|    234|    [[nodiscard]] DecompressorParams getDecompressorParams() const {
  128|    234|      return {imgSize, mStrips, getAsArray1DRef(mOutRects),
  129|    234|              getAsArray1DRef(mDecoderLUT), initialPrediction};
  130|    234|    }
_ZN8rawspeed23PanasonicV8Decompressor18DecompressorParamsC2ENS_8iPoint2DENS_10Array1DRefIKNS3_IKhEEEENS3_IKNS_12iRectangle2DEEENS3_IKNS0_15DecoderLUTEntryEEENSt3__15arrayItLm4EEE:
   88|    234|        : imgSize(imgSize_), mStrips(mStrips_), mOutRect(mOutRect_),
   89|    234|          mDecoderLUT(mDecoderLUT_), initialPrediction(initialPrediction_) {}
_ZNK8rawspeed23PanasonicV8Decompressor15DecoderLUTEntry10isSentinelEv:
   61|  23.7M|    [[nodiscard]] bool isSentinel() const {
   62|  23.7M|      constexpr auto sentinel = DecoderLUTEntry();
   63|  23.7M|      return bitcount == sentinel.bitcount && diffCat == sentinel.diffCat;
  ------------------
  |  Branch (63:14): [True: 8.77M, False: 14.9M]
  |  Branch (63:47): [True: 8.75M, False: 18.1k]
  ------------------
   64|  23.7M|    }

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

_ZN8rawspeed10ByteStreamC2ENS_10DataBufferE:
   50|  11.6k|  explicit ByteStream(DataBuffer buffer) : DataBuffer(buffer) {}
_ZN8rawspeed10ByteStream6getU32Ev:
  196|  1.00M|  uint32_t getU32() { return get<uint32_t>(); }
_ZN8rawspeed10ByteStream3getIjEET_v:
  159|  1.59M|  template <typename T> T get() {
  160|  1.59M|    auto ret = peek<T>();
  161|  1.59M|    pos += sizeof(T);
  162|  1.59M|    return ret;
  163|  1.59M|  }
_ZNK8rawspeed10ByteStream4peekIjEET_j:
  156|  1.59M|  template <typename T> [[nodiscard]] T peek(size_type i = 0) const {
  157|  1.59M|    return DataBuffer::get<T>(pos, i);
  158|  1.59M|  }
_ZN8rawspeed10ByteStream9getStreamEjj:
  124|  9.41k|  ByteStream getStream(size_type nmemb, size_type size_) {
  125|  9.41k|    if (size_ && nmemb > std::numeric_limits<size_type>::max() / size_)
  ------------------
  |  Branch (125:9): [True: 9.41k, False: 0]
  |  Branch (125:18): [True: 86, False: 9.32k]
  ------------------
  126|  9.41k|      ThrowIOE("Integer overflow when calculating stream length");
  ------------------
  |  |   37|     86|#define ThrowIOE(...) ThrowExceptionHelper(rawspeed::IOException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     86|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     86|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     86|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  127|  9.32k|    return getStream(nmemb * size_);
  128|  9.41k|  }
_ZN8rawspeed10ByteStream9getStreamEj:
  119|  10.3k|  ByteStream getStream(size_type size_) {
  120|  10.3k|    ByteStream ret = peekStream(size_);
  121|  10.3k|    pos += size_;
  122|  10.3k|    return ret;
  123|  10.3k|  }
_ZNK8rawspeed10ByteStream10peekStreamEj:
  111|  10.3k|  [[nodiscard]] ByteStream peekStream(size_type size_) const {
  112|  10.3k|    return getSubStream(pos, size_);
  113|  10.3k|  }
_ZNK8rawspeed10ByteStream12getSubStreamEjj:
   55|  10.3k|                                        size_type size_) const {
   56|  10.3k|    return ByteStream(DataBuffer(getSubView(offset, size_), getByteOrder()));
   57|  10.3k|  }
_ZN8rawspeed10ByteStream8getArrayItLi4EEENSt3__15arrayIT_XT0_EEEv:
  165|  1.02k|  template <typename T, int N> std::array<T, N> getArray() {
  166|  1.02k|    std::array<T, N> out;
  167|  1.02k|    auto bs = getStream(N, sizeof(T));
  168|  1.02k|    std::generate(out.begin(), out.end(), [&bs]() { return bs.get<T>(); });
  169|  1.02k|    invariant(bs.getRemainSize() == 0);
  ------------------
  |  |   27|  1.02k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (169:5): [True: 1.00k, False: 16]
  ------------------
  170|  1.00k|    return out;
  171|  1.02k|  }
_ZZN8rawspeed10ByteStream8getArrayItLi4EEENSt3__15arrayIT_XT0_EEEvENKUlvE_clEv:
  168|  4.01k|    std::generate(out.begin(), out.end(), [&bs]() { return bs.get<T>(); });
_ZN8rawspeed10ByteStream3getItEET_v:
  159|  2.28M|  template <typename T> T get() {
  160|  2.28M|    auto ret = peek<T>();
  161|  2.28M|    pos += sizeof(T);
  162|  2.28M|    return ret;
  163|  2.28M|  }
_ZNK8rawspeed10ByteStream4peekItEET_j:
  156|  2.28M|  template <typename T> [[nodiscard]] T peek(size_type i = 0) const {
  157|  2.28M|    return DataBuffer::get<T>(pos, i);
  158|  2.28M|  }
_ZNK8rawspeed10ByteStream13getRemainSizeEv:
   87|  10.5k|  [[nodiscard]] size_type RAWSPEED_READONLY getRemainSize() const {
   88|  10.5k|    invariant(getSize() >= pos);
  ------------------
  |  |   27|  10.5k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (88:5): [True: 10.5k, False: 0]
  ------------------
   89|  10.5k|    (void)check(0);
   90|  10.5k|    return getSize() - pos;
   91|  10.5k|  }
_ZNK8rawspeed10ByteStream5checkEj:
   63|  10.5k|  [[nodiscard]] size_type check(size_type bytes) const {
   64|  10.5k|    if (!isValid(pos, bytes))
  ------------------
  |  Branch (64:9): [True: 0, False: 10.5k]
  ------------------
   65|  10.5k|      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|  10.5k|    [[maybe_unused]] Buffer tmp = getSubView(pos, bytes);
   67|  10.5k|    assert(tmp.getSize() == bytes);
  ------------------
  |  Branch (67:5): [True: 10.5k, False: 0]
  ------------------
   68|  10.5k|    assert(!ASan::RegionIsPoisoned(tmp.begin(), tmp.getSize()));
  ------------------
  |  Branch (68:5): [True: 10.5k, False: 0]
  ------------------
   69|  10.5k|    return bytes;
   70|  10.5k|  }
_ZN8rawspeed10ByteStream8getArrayIiLi2EEENSt3__15arrayIT_XT0_EEEv:
  165|  1.00k|  template <typename T, int N> std::array<T, N> getArray() {
  166|  1.00k|    std::array<T, N> out;
  167|  1.00k|    auto bs = getStream(N, sizeof(T));
  168|  1.00k|    std::generate(out.begin(), out.end(), [&bs]() { return bs.get<T>(); });
  169|  1.00k|    invariant(bs.getRemainSize() == 0);
  ------------------
  |  |   27|  1.00k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (169:5): [True: 999, False: 5]
  ------------------
  170|    999|    return out;
  171|  1.00k|  }
_ZZN8rawspeed10ByteStream8getArrayIiLi2EEENSt3__15arrayIT_XT0_EEEvENKUlvE_clEv:
  168|  1.99k|    std::generate(out.begin(), out.end(), [&bs]() { return bs.get<T>(); });
_ZN8rawspeed10ByteStream3getIiEET_v:
  159|  1.99k|  template <typename T> T get() {
  160|  1.99k|    auto ret = peek<T>();
  161|  1.99k|    pos += sizeof(T);
  162|  1.99k|    return ret;
  163|  1.99k|  }
_ZNK8rawspeed10ByteStream4peekIiEET_j:
  156|  1.99k|  template <typename T> [[nodiscard]] T peek(size_type i = 0) const {
  157|  1.99k|    return DataBuffer::get<T>(pos, i);
  158|  1.99k|  }
_ZN8rawspeed10ByteStream9getBufferEj:
  103|   990k|  Buffer getBuffer(size_type size_) {
  104|   990k|    Buffer ret = peekBuffer(size_);
  105|   990k|    pos += size_;
  106|   990k|    return ret;
  107|   990k|  }
_ZNK8rawspeed10ByteStream10peekBufferEj:
  100|   990k|  [[nodiscard]] Buffer peekBuffer(size_type size_) const {
  101|   990k|    return getSubView(pos, size_);
  102|   990k|  }
_ZN8rawspeed10ByteStreamC2Ev:
   48|    946|  ByteStream() = default;
_ZN8rawspeed10ByteStream9getVectorIjEENSt3__16vectorIT_NS2_9allocatorIS4_EEEEi:
  173|    926|  template <typename T> std::vector<T> getVector(int nElt) {
  174|    926|    std::vector<T> out;
  175|    926|    auto bs = getStream(nElt, sizeof(T));
  176|    926|    out.reserve(nElt);
  177|    926|    std::generate_n(std::back_inserter(out), nElt,
  178|    926|                    [&bs]() { return bs.get<T>(); });
  179|    926|    invariant(bs.getRemainSize() == 0);
  ------------------
  |  |   27|    926|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (179:5): [True: 926, False: 0]
  ------------------
  180|    926|    return out;
  181|    926|  }
_ZZN8rawspeed10ByteStream9getVectorIjEENSt3__16vectorIT_NS2_9allocatorIS4_EEEEiENKUlvE_clEv:
  178|   592k|                    [&bs]() { return bs.get<T>(); });
_ZN8rawspeed10ByteStream9getVectorItEENSt3__16vectorIT_NS2_9allocatorIS4_EEEEi:
  173|  1.85k|  template <typename T> std::vector<T> getVector(int nElt) {
  174|  1.85k|    std::vector<T> out;
  175|  1.85k|    auto bs = getStream(nElt, sizeof(T));
  176|  1.85k|    out.reserve(nElt);
  177|  1.85k|    std::generate_n(std::back_inserter(out), nElt,
  178|  1.85k|                    [&bs]() { return bs.get<T>(); });
  179|  1.85k|    invariant(bs.getRemainSize() == 0);
  ------------------
  |  |   27|  1.85k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (179:5): [True: 1.85k, False: 0]
  ------------------
  180|  1.85k|    return out;
  181|  1.85k|  }
_ZZN8rawspeed10ByteStream9getVectorItEENSt3__16vectorIT_NS2_9allocatorIS4_EEEEiENKUlvE_clEv:
  178|  2.27M|                    [&bs]() { return bs.get<T>(); });
_ZN8rawspeed10ByteStream6getU16Ev:
  194|  3.52k|  uint16_t getU16() { return get<uint16_t>(); }

_ZN8rawspeed14getByteSwappedIjEET_PKvb:
  100|  1.67M|template <typename T> inline T getByteSwapped(const void* data, bool bswap) {
  101|  1.67M|  T ret;
  102|       |  // all interesting compilers optimize this memcpy into a single move
  103|       |  // this is the most effective way to load some bytes without running into
  104|       |  // alignment or aliasing issues
  105|  1.67M|  memcpy(&ret, data, sizeof(T));
  106|  1.67M|  return bswap ? getByteSwapped(ret) : ret;
  ------------------
  |  Branch (106:10): [True: 79.8k, False: 1.59M]
  ------------------
  107|  1.67M|}
_ZN8rawspeed14getByteSwappedEj:
   84|  79.8k|inline uint32_t getByteSwapped(uint32_t v) { return BSWAP32(v); }
  ------------------
  |  |   37|  79.8k|#define BSWAP32(A) __builtin_bswap32(A)
  ------------------
_ZN8rawspeed17getHostEndiannessEv:
   63|  3.95M|inline Endianness getHostEndianness() {
   64|  3.95M|#if defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
   65|  3.95M|  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|  3.95M|}
_ZN8rawspeed14getByteSwappedItEET_PKvb:
  100|  2.28M|template <typename T> inline T getByteSwapped(const void* data, bool bswap) {
  101|  2.28M|  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|  2.28M|  memcpy(&ret, data, sizeof(T));
  106|  2.28M|  return bswap ? getByteSwapped(ret) : ret;
  ------------------
  |  Branch (106:10): [True: 0, False: 2.28M]
  ------------------
  107|  2.28M|}
_ZN8rawspeed14getByteSwappedIiEET_PKvb:
  100|  1.99k|template <typename T> inline T getByteSwapped(const void* data, bool bswap) {
  101|  1.99k|  T ret;
  102|       |  // all interesting compilers optimize this memcpy into a single move
  103|       |  // this is the most effective way to load some bytes without running into
  104|       |  // alignment or aliasing issues
  105|  1.99k|  memcpy(&ret, data, sizeof(T));
  106|  1.99k|  return bswap ? getByteSwapped(ret) : ret;
  ------------------
  |  Branch (106:10): [True: 0, False: 1.99k]
  ------------------
  107|  1.99k|}

_ZN8rawspeed16ColorFilterArrayC2Ev:
   51|  1.33k|  ColorFilterArray() = default;

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

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

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

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

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

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

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

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

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

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

__cxa_get_globals:
   74|  2.76k|    __cxa_eh_globals *__cxa_get_globals() {
   75|       |        // Try to get the globals for this thread
   76|  2.76k|        __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|  2.76k|        if (NULL == retVal) {
  ------------------
  |  Branch (79:13): [True: 1, False: 2.76k]
  ------------------
   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|  2.76k|        return retVal;
   88|  2.76k|    }
__cxa_get_globals_fast:
   94|  4.14k|    __cxa_eh_globals *__cxa_get_globals_fast() {
   95|       |        // First time through, create the key.
   96|  4.14k|        if (0 != std::__libcpp_execute_once(&flag_, construct_))
  ------------------
  |  Branch (96:13): [True: 0, False: 4.14k]
  ------------------
   97|      0|            abort_message("execute once failure in __cxa_get_globals_fast()");
   98|  4.14k|        return static_cast<__cxa_eh_globals*>(std::__libcpp_tls_get(key_));
   99|  4.14k|    }
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|  1.38k|{
   28|  1.38k|    return __libcpp_atomic_load(&__cxa_unexpected_handler, _AO_Acquire);
   29|  1.38k|}
_ZSt13get_terminatev:
   48|  1.38k|{
   49|  1.38k|    return __libcpp_atomic_load(&__cxa_terminate_handler, _AO_Acquire);
   50|  1.38k|}

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

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

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

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

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

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

kmp_csupport.cpp:_ZL23__kmp_assert_valid_gtidi:
 3510|    363|static inline void __kmp_assert_valid_gtid(kmp_int32 gtid) {
 3511|    363|  if (UNLIKELY(gtid < 0 || gtid >= __kmp_threads_capacity))
  ------------------
  |  |  119|    726|#define UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (119:21): [True: 0, False: 363]
  |  |  |  Branch (119:41): [True: 0, False: 363]
  |  |  |  Branch (119:41): [True: 0, False: 363]
  |  |  ------------------
  ------------------
 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|    363|}
kmp_csupport.cpp:_ZL31__kmp_clear_x87_fpu_status_wordv:
 1365|    121|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|    121|  __asm__ __volatile__("fnclex");
 1384|    121|#endif // KMP_MIC
 1385|    121|}
kmp_csupport.cpp:_ZL31__kmp_load_x87_fpu_control_wordPKs:
 1358|    121|static inline void __kmp_load_x87_fpu_control_word(const kmp_int16 *p) {
 1359|    121|  __asm__ __volatile__("fldcw %0" : : "m"(*p));
 1360|    121|}
kmp_csupport.cpp:_ZL16__kmp_load_mxcsrPKj:
 1387|    121|static inline void __kmp_load_mxcsr(const kmp_uint32 *p) { _mm_setcsr(*p); }
_ZN11KMPAffinity4MaskD2Ev:
  724|     36|    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|      1|      : restored(false) {
  808|      1|    if (KMP_AFFINITY_CAPABLE()) {
  ------------------
  |  |  684|      1|#define KMP_AFFINITY_CAPABLE() (__kmp_affin_mask_size > 0)
  |  |  ------------------
  |  |  |  Branch (684:32): [True: 1, False: 0]
  |  |  ------------------
  ------------------
  809|      1|      KMP_CPU_ALLOC(mask);
  ------------------
  |  |  697|      1|#define KMP_CPU_ALLOC(ptr) (ptr = __kmp_affinity_dispatch->allocate_mask())
  ------------------
  810|      1|      KMP_ASSERT(mask != NULL);
  ------------------
  |  |   50|      1|  if (!(cond)) {                                                               \
  |  |  ------------------
  |  |  |  Branch (50:7): [True: 0, False: 1]
  |  |  ------------------
  |  |   51|      0|    __kmp_debug_assert("assertion failure", __FILE__, __LINE__);               \
  |  |   52|      0|  }
  ------------------
  811|      1|      __kmp_get_system_affinity(mask, /*abort_on_error=*/true);
  ------------------
  |  |  711|      1|  (mask)->get_system_affinity(abort_bool)
  ------------------
  812|      1|      if (new_mask)
  ------------------
  |  Branch (812:11): [True: 0, False: 1]
  ------------------
  813|      0|        __kmp_set_system_affinity(new_mask, /*abort_on_error=*/true);
  ------------------
  |  |  713|      0|  (mask)->set_system_affinity(abort_bool)
  ------------------
  814|      1|    }
  815|      1|  }
_ZN19kmp_affinity_raii_t7restoreEv:
  816|      1|  void restore() {
  817|      1|    if (!restored && KMP_AFFINITY_CAPABLE()) {
  ------------------
  |  |  684|      1|#define KMP_AFFINITY_CAPABLE() (__kmp_affin_mask_size > 0)
  |  |  ------------------
  |  |  |  Branch (684:32): [True: 1, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (817:9): [True: 1, False: 0]
  ------------------
  818|      1|      __kmp_set_system_affinity(mask, /*abort_on_error=*/true);
  ------------------
  |  |  713|      1|  (mask)->set_system_affinity(abort_bool)
  ------------------
  819|      1|      KMP_CPU_FREE(mask);
  ------------------
  |  |  698|      1|#define KMP_CPU_FREE(ptr) __kmp_affinity_dispatch->deallocate_mask(ptr)
  ------------------
  820|      1|    }
  821|      1|    restored = true;
  822|      1|  }
_ZN19kmp_affinity_raii_tD2Ev:
  823|      1|  ~kmp_affinity_raii_t() { restore(); }
_ZNK18kmp_affinity_ids_tixEm:
  875|     12|  int operator[](size_t idx) const { return ids[idx]; }
_ZN18kmp_affinity_ids_tixEm:
  876|    278|  int &operator[](size_t idx) { return ids[idx]; }
_ZN18kmp_affinity_ids_taSERKS_:
  877|      1|  kmp_affinity_ids_t &operator=(const kmp_affinity_ids_t &rhs) {
  878|     13|    for (int i = 0; i < KMP_HW_LAST; ++i)
  ------------------
  |  Branch (878:21): [True: 12, False: 1]
  ------------------
  879|     12|      ids[i] = rhs[i];
  880|      1|    return *this;
  881|      1|  }
_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|      1|static inline int __kmp_gtid_from_thread(const kmp_info_t *thr) {
 3496|      1|  KMP_DEBUG_ASSERT(thr);
 3497|      1|  return thr->th.th_info.ds.ds_gtid;
 3498|      1|}
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:_ZL9copy_icvsP20kmp_internal_controlS0_:
 2111|    124|                             kmp_internal_control_t *src) {
 2112|    124|  *dst = *src;
 2113|    124|}
kmp_runtime.cpp:_ZL27__kmp_assign_root_init_maskv:
 3785|    122|static inline void __kmp_assign_root_init_mask() {
 3786|    122|  int gtid = __kmp_entry_gtid();
  ------------------
  |  | 3467|    122|#define __kmp_entry_gtid() __kmp_get_global_thread_id_reg()
  ------------------
 3787|    122|  kmp_root_t *r = __kmp_threads[gtid]->th.th_root;
 3788|    122|  if (r->r.r_uber_thread == __kmp_threads[gtid] && !r->r.r_affinity_assigned) {
  ------------------
  |  Branch (3788:7): [True: 122, False: 0]
  |  Branch (3788:52): [True: 0, False: 122]
  ------------------
 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|    122|}
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|    122|static inline void __kmp_store_x87_fpu_control_word(kmp_int16 *p) {
 1363|    122|  __asm__ __volatile__("fstcw %0" : "=m"(*p));
 1364|    122|}
kmp_runtime.cpp:_ZL17__kmp_store_mxcsrPj:
 1388|    122|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; }
_ZN11kmp_convertIliLb0ELb0ELb1ELb1EE2toEl:
 4612|      2|  static TargetType to(SourceType src) {
 4613|      2|    KMP_ASSERT(src <= static_cast<SourceType>(
  ------------------
  |  |   50|      2|  if (!(cond)) {                                                               \
  |  |  ------------------
  |  |  |  Branch (50:7): [True: 0, False: 2]
  |  |  ------------------
  |  |   51|      0|    __kmp_debug_assert("assertion failure", __FILE__, __LINE__);               \
  |  |   52|      0|  }
  ------------------
 4614|      2|                          (std::numeric_limits<TargetType>::max)()));
 4615|      2|    KMP_ASSERT(src >= static_cast<SourceType>(
  ------------------
  |  |   50|      2|  if (!(cond)) {                                                               \
  |  |  ------------------
  |  |  |  Branch (50:7): [True: 0, False: 2]
  |  |  ------------------
  |  |   51|      0|    __kmp_debug_assert("assertion failure", __FILE__, __LINE__);               \
  |  |   52|      0|  }
  ------------------
 4616|      2|                          (std::numeric_limits<TargetType>::min)()));
 4617|      2|    return (TargetType)src;
 4618|      2|  }
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_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|  5.34k|static inline void __kmp_x86_pause(void) { _mm_pause(); }
kmp_lock.cpp:_ZL22__kmp_thread_from_gtidi:
 3500|    101|static inline kmp_info_t *__kmp_thread_from_gtid(int gtid) {
 3501|    101|  KMP_DEBUG_ASSERT(gtid >= 0);
 3502|    101|  return __kmp_threads[gtid];
 3503|    101|}
kmp_sched.cpp:_ZL23__kmp_assert_valid_gtidi:
 3510|    121|static inline void __kmp_assert_valid_gtid(kmp_int32 gtid) {
 3511|    121|  if (UNLIKELY(gtid < 0 || gtid >= __kmp_threads_capacity))
  ------------------
  |  |  119|    242|#define UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (119:21): [True: 0, False: 121]
  |  |  |  Branch (119:41): [True: 0, False: 121]
  |  |  |  Branch (119:41): [True: 0, False: 121]
  |  |  ------------------
  ------------------
 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|    121|}
kmp_sched.cpp:_ZL19__kmp_tid_from_gtidi:
 3485|    121|static inline int __kmp_tid_from_gtid(int gtid) {
 3486|    121|  KMP_DEBUG_ASSERT(gtid >= 0);
 3487|    121|  return __kmp_threads[gtid]->th.th_info.ds.ds_tid;
 3488|    121|}
z_Linux_util.cpp:_ZL13KMP_UBER_GTIDi:
 3478|      2|static inline bool KMP_UBER_GTID(int gtid) {
 3479|      2|  KMP_DEBUG_ASSERT(gtid >= KMP_GTID_MIN);
 3480|      2|  KMP_DEBUG_ASSERT(gtid < __kmp_threads_capacity);
 3481|      2|  return (gtid >= 0 && __kmp_root[gtid] && __kmp_threads[gtid] &&
  ------------------
  |  Branch (3481:11): [True: 2, False: 0]
  |  Branch (3481:24): [True: 2, False: 0]
  |  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|      2|}
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|    121|static inline void __kmp_assign_root_init_mask() {
 3786|    121|  int gtid = __kmp_entry_gtid();
  ------------------
  |  | 3467|    121|#define __kmp_entry_gtid() __kmp_get_global_thread_id_reg()
  ------------------
 3787|    121|  kmp_root_t *r = __kmp_threads[gtid]->th.th_root;
 3788|    121|  if (r->r.r_uber_thread == __kmp_threads[gtid] && !r->r.r_affinity_assigned) {
  ------------------
  |  Branch (3788:7): [True: 121, False: 0]
  |  Branch (3788:52): [True: 1, False: 120]
  ------------------
 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|    121|}
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|     36|void *KMPAffinity::Mask::operator new(size_t n) { return __kmp_allocate(n); }
  ------------------
  |  | 3617|     36|#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|     35|void KMPAffinity::Mask::operator delete(void *p) { __kmp_free(p); }
  ------------------
  |  | 3619|     35|#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|      1|void __kmp_affinity_set_init_mask(int gtid, int isa_root) {
 4692|       |
 4693|      1|  kmp_info_t *th = (kmp_info_t *)TCR_SYNC_PTR(__kmp_threads[gtid]);
  ------------------
  |  | 1158|      1|#define TCR_SYNC_PTR(a) ((void *)TCR_SYNC_8(a))
  |  |  ------------------
  |  |  |  | 1140|      1|#define TCR_SYNC_8(a) (a)
  |  |  ------------------
  ------------------
 4694|       |
 4695|       |  // Set the thread topology information to default of unknown
 4696|     13|  for (int id = 0; id < KMP_HW_LAST; ++id)
  ------------------
  |  Branch (4696:20): [True: 12, False: 1]
  ------------------
 4697|     12|    th->th.th_topology_ids[id] = kmp_hw_thread_t::UNKNOWN_ID;
 4698|      1|  th->th.th_topology_attrs = KMP_AFFINITY_ATTRS_UNKNOWN;
  ------------------
  |  |  891|      1|  { KMP_HW_CORE_TYPE_UNKNOWN, kmp_hw_attr_t::UNKNOWN_CORE_EFF, 0, 0 }
  ------------------
 4699|       |
 4700|      1|  if (!KMP_AFFINITY_CAPABLE()) {
  ------------------
  |  |  684|      1|#define KMP_AFFINITY_CAPABLE() (__kmp_affin_mask_size > 0)
  ------------------
  |  Branch (4700:7): [True: 0, False: 1]
  ------------------
 4701|      0|    return;
 4702|      0|  }
 4703|       |
 4704|      1|  if (th->th.th_affin_mask == NULL) {
  ------------------
  |  Branch (4704:7): [True: 1, False: 0]
  ------------------
 4705|      1|    KMP_CPU_ALLOC(th->th.th_affin_mask);
  ------------------
  |  |  697|      1|#define KMP_CPU_ALLOC(ptr) (ptr = __kmp_affinity_dispatch->allocate_mask())
  ------------------
 4706|      1|  } 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|      1|  kmp_affin_mask_t *mask;
 4716|      1|  int i;
 4717|      1|  const kmp_affinity_t *affinity;
 4718|      1|  const char *env_var;
 4719|      1|  bool is_hidden_helper = KMP_HIDDEN_HELPER_THREAD(gtid);
  ------------------
  |  | 4417|      1|  ((gtid) >= 1 && (gtid) <= __kmp_hidden_helper_threads_num)
  |  |  ------------------
  |  |  |  Branch (4417:4): [True: 0, False: 1]
  |  |  |  Branch (4417:19): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 4720|       |
 4721|      1|  if (is_hidden_helper)
  ------------------
  |  Branch (4721:7): [True: 0, False: 1]
  ------------------
 4722|      0|    affinity = &__kmp_hh_affinity;
 4723|      1|  else
 4724|      1|    affinity = &__kmp_affinity;
 4725|      1|  env_var = affinity->env_var;
 4726|       |
 4727|      1|  if (KMP_AFFINITY_NON_PROC_BIND || is_hidden_helper) {
  ------------------
  |  |  963|      2|  ((__kmp_nested_proc_bind.bind_types[0] == proc_bind_false ||                 \
  |  |  ------------------
  |  |  |  Branch (963:5): [True: 1, False: 0]
  |  |  ------------------
  |  |  964|      1|    __kmp_nested_proc_bind.bind_types[0] == proc_bind_intel) &&                \
  |  |  ------------------
  |  |  |  Branch (964:5): [True: 0, False: 0]
  |  |  ------------------
  |  |  965|      2|   (__kmp_affinity.num_masks > 0 || __kmp_affinity.type == affinity_balanced))
  |  |  ------------------
  |  |  |  Branch (965:5): [True: 1, False: 0]
  |  |  |  Branch (965:37): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (4727:37): [True: 0, False: 0]
  ------------------
 4728|      1|    if ((affinity->type == affinity_none) ||
  ------------------
  |  Branch (4728:9): [True: 1, False: 0]
  ------------------
 4729|      0|        (affinity->type == affinity_balanced) ||
  ------------------
  |  Branch (4729:9): [True: 0, False: 0]
  ------------------
 4730|      1|        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|      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|  }
  ------------------
 4737|      1|      i = 0;
 4738|      1|      mask = __kmp_affin_fullMask;
 4739|      1|    } else {
 4740|      0|      __kmp_select_mask_by_gtid(gtid, affinity, &i, &mask);
 4741|      0|    }
 4742|      1|  } 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|      1|  th->th.th_current_place = i;
 4758|      1|  if (isa_root && !is_hidden_helper) {
  ------------------
  |  Branch (4758:7): [True: 1, False: 0]
  |  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|      1|  } else if (KMP_AFFINITY_NON_PROC_BIND) {
  ------------------
  |  |  963|      0|  ((__kmp_nested_proc_bind.bind_types[0] == proc_bind_false ||                 \
  |  |  ------------------
  |  |  |  Branch (963:5): [True: 0, False: 0]
  |  |  ------------------
  |  |  964|      0|    __kmp_nested_proc_bind.bind_types[0] == proc_bind_intel) &&                \
  |  |  ------------------
  |  |  |  Branch (964:5): [True: 0, False: 0]
  |  |  ------------------
  |  |  965|      0|   (__kmp_affinity.num_masks > 0 || __kmp_affinity.type == affinity_balanced))
  |  |  ------------------
  |  |  |  Branch (965:5): [True: 0, 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|      0|    th->th.th_first_place = 0;
 4766|      0|    th->th.th_last_place = affinity->num_masks - 1;
 4767|      0|  }
 4768|       |  // Copy topology information associated with the place
 4769|      1|  if (i >= 0) {
  ------------------
  |  Branch (4769:7): [True: 1, False: 0]
  ------------------
 4770|      1|    th->th.th_topology_ids = __kmp_affinity.ids[i];
 4771|      1|    th->th.th_topology_attrs = __kmp_affinity.attrs[i];
 4772|      1|  }
 4773|       |
 4774|      1|  if (i == KMP_PLACE_ALL) {
  ------------------
  |  |  959|      1|#define KMP_PLACE_ALL (-1)
  ------------------
  |  Branch (4774:7): [True: 0, False: 1]
  ------------------
 4775|      0|    KA_TRACE(100, ("__kmp_affinity_set_init_mask: binding T#%d to all places\n",
 4776|      0|                   gtid));
 4777|      1|  } else {
 4778|      1|    KA_TRACE(100, ("__kmp_affinity_set_init_mask: binding T#%d to place %d\n",
 4779|      1|                   gtid, i));
 4780|      1|  }
 4781|       |
 4782|      1|  KMP_CPU_COPY(th->th.th_affin_mask, mask);
  ------------------
  |  |  693|      1|#define KMP_CPU_COPY(dest, src) (dest)->copy(src)
  ------------------
 4783|       |
 4784|       |  /* to avoid duplicate printing (will be correctly printed on barrier) */
 4785|      1|  if (affinity->flags.verbose &&
  ------------------
  |  Branch (4785:7): [True: 0, False: 1]
  ------------------
 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|      1|    __kmp_set_system_affinity(th->th.th_affin_mask, TRUE);
  ------------------
  |  |  713|      1|  (mask)->set_system_affinity(abort_bool)
  ------------------
 4805|      1|}
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|    427|    mask_size_type get_num_mask_types() const {
  298|    427|      return __kmp_affin_mask_size / sizeof(mask_t);
  299|    427|    }
_ZN17KMPNativeAffinity4MaskC2Ev:
  303|     37|    Mask() { mask = (mask_t *)__kmp_allocate(__kmp_affin_mask_size); }
  ------------------
  |  | 3617|     37|#define __kmp_allocate(size) ___kmp_allocate((size)KMP_SRC_LOC_CURR)
  ------------------
_ZN17KMPNativeAffinity4MaskD2Ev:
  304|     36|    ~Mask() {
  305|     36|      if (mask)
  ------------------
  |  Branch (305:11): [True: 36, False: 0]
  ------------------
  306|     36|        __kmp_free(mask);
  ------------------
  |  | 3619|     36|#define __kmp_free(ptr) ___kmp_free((ptr)KMP_SRC_LOC_CURR)
  ------------------
  307|     36|    }
_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|      3|    void copy(const KMPAffinity::Mask *src) override {
  323|      3|      const Mask *convert = static_cast<const Mask *>(src);
  324|      3|      mask_size_type e = get_num_mask_types();
  325|      6|      for (mask_size_type i = 0; i < e; ++i)
  ------------------
  |  Branch (325:34): [True: 3, False: 3]
  ------------------
  326|      3|        mask[i] = convert->mask[i];
  327|      3|    }
_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|      2|    int get_system_affinity(bool abort_on_error) override {
  363|      2|      KMP_ASSERT2(KMP_AFFINITY_CAPABLE(),
  ------------------
  |  |   53|      2|#define KMP_ASSERT2(cond, msg) KMP_ASSERT(cond)
  |  |  ------------------
  |  |  |  |   50|      2|  if (!(cond)) {                                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (50:7): [True: 0, False: 2]
  |  |  |  |  ------------------
  |  |  |  |   51|      0|    __kmp_debug_assert("assertion failure", __FILE__, __LINE__);               \
  |  |  |  |   52|      0|  }
  |  |  ------------------
  ------------------
  364|      2|                  "Illegal get affinity operation when not capable");
  365|      2|#if KMP_OS_LINUX
  366|      2|      long retval =
  367|      2|          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|      2|      if (retval >= 0) {
  ------------------
  |  Branch (373:11): [True: 2, False: 0]
  ------------------
  374|      2|        return 0;
  375|      2|      }
  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|      2|    }
_ZNK17KMPNativeAffinity4Mask19set_system_affinityEb:
  383|     35|    int set_system_affinity(bool abort_on_error) const override {
  384|     35|      KMP_ASSERT2(KMP_AFFINITY_CAPABLE(),
  ------------------
  |  |   53|     35|#define KMP_ASSERT2(cond, msg) KMP_ASSERT(cond)
  |  |  ------------------
  |  |  |  |   50|     35|  if (!(cond)) {                                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (50:7): [True: 0, False: 35]
  |  |  |  |  ------------------
  |  |  |  |   51|      0|    __kmp_debug_assert("assertion failure", __FILE__, __LINE__);               \
  |  |  |  |   52|      0|  }
  |  |  ------------------
  ------------------
  385|     35|                  "Illegal set affinity operation when not capable");
  386|     35|#if KMP_OS_LINUX
  387|     35|      long retval =
  388|     35|          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|     35|      if (retval >= 0) {
  ------------------
  |  Branch (394:11): [True: 35, False: 0]
  ------------------
  395|     35|        return 0;
  396|     35|      }
  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|     35|    }
_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|     36|  KMPAffinity::Mask *allocate_mask() override {
  410|     36|    KMPNativeAffinity::Mask *retval = new Mask();
  411|     36|    return retval;
  412|     36|  }
_ZN17KMPNativeAffinity15deallocate_maskEPN11KMPAffinity4MaskE:
  413|     35|  void deallocate_mask(KMPAffinity::Mask *m) override {
  414|     35|    KMPNativeAffinity::Mask *native_mask =
  415|     35|        static_cast<KMPNativeAffinity::Mask *>(m);
  416|     35|    delete native_mask;
  417|     35|  }
_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|      1|void __kmp_initialize_bget(kmp_info_t *th) {
  993|      1|  KMP_DEBUG_ASSERT(SizeQuant >= sizeof(void *) && (th != 0));
  994|       |
  995|      1|  set_thr_data(th);
  996|       |
  997|      1|  bectl(th, (bget_compact_t)0, (bget_acquire_t)malloc, (bget_release_t)free,
  998|      1|        (bufsize)__kmp_malloc_pool_incr);
  999|      1|}
__kmp_finalize_bget:
 1001|      1|void __kmp_finalize_bget(kmp_info_t *th) {
 1002|      1|  thr_data_t *thr;
 1003|      1|  bfhead_t *b;
 1004|       |
 1005|      1|  KMP_DEBUG_ASSERT(th != 0);
 1006|       |
 1007|      1|#if BufStats
 1008|      1|  thr = (thr_data_t *)th->th.th_local.bget_data;
 1009|      1|  KMP_DEBUG_ASSERT(thr != NULL);
 1010|      1|  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|      1|  if (thr->relfcn != 0 && b != 0 && thr->numpblk != 0 &&
  ------------------
  |  Branch (1017:7): [True: 1, False: 0]
  |  Branch (1017:27): [True: 0, False: 1]
  |  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|      1|#endif /* BufStats */
 1035|       |
 1036|       |  /* Deallocate bget_data */
 1037|      1|  if (th->th.th_local.bget_data != NULL) {
  ------------------
  |  Branch (1037:7): [True: 1, False: 0]
  ------------------
 1038|      1|    __kmp_free(th->th.th_local.bget_data);
  ------------------
  |  | 3619|      1|#define __kmp_free(ptr) ___kmp_free((ptr)KMP_SRC_LOC_CURR)
  ------------------
 1039|       |    th->th.th_local.bget_data = NULL;
 1040|      1|  }
 1041|      1|}
__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|    230|void *___kmp_allocate(size_t size KMP_SRC_LOC_DECL) {
 1998|    230|  void *ptr;
 1999|    230|  KE_TRACE(25, ("-> __kmp_allocate( %d ) called from %s:%d\n",
 2000|    230|                (int)size KMP_SRC_LOC_PARM));
 2001|    230|  ptr = ___kmp_allocate_align(size, __kmp_align_alloc KMP_SRC_LOC_PARM);
 2002|    230|  KE_TRACE(25, ("<- __kmp_allocate() returns %p\n", ptr));
 2003|    230|  return ptr;
 2004|    230|} // func ___kmp_allocate
___kmp_free:
 2023|    226|void ___kmp_free(void *ptr KMP_SRC_LOC_DECL) {
 2024|    226|  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|    226|  KE_TRACE(25,
 2030|    226|           ("-> __kmp_free( %p ) called from %s:%d\n", ptr KMP_SRC_LOC_PARM));
 2031|    226|  KMP_ASSERT(ptr != NULL);
  ------------------
  |  |   50|    226|  if (!(cond)) {                                                               \
  |  |  ------------------
  |  |  |  Branch (50:7): [True: 0, False: 226]
  |  |  ------------------
  |  |   51|      0|    __kmp_debug_assert("assertion failure", __FILE__, __LINE__);               \
  |  |   52|      0|  }
  ------------------
 2032|       |
 2033|    226|  descr = *(kmp_mem_descr_t *)((kmp_uintptr_t)ptr - sizeof(kmp_mem_descr_t));
 2034|       |
 2035|    226|  KE_TRACE(26, ("   __kmp_free:     "
 2036|    226|                "ptr_allocated=%p, size_allocated=%d, "
 2037|    226|                "ptr_aligned=%p, size_aligned=%d\n",
 2038|    226|                descr.ptr_allocated, (int)descr.size_allocated,
 2039|    226|                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|    226|#ifndef LEAK_MEMORY
 2054|    226|  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|    226|  free_src_loc(descr.ptr_allocated KMP_SRC_LOC_PARM);
  ------------------
  |  |  145|    226|#define free_src_loc(args) _free_src_loc(args)
  |  |  ------------------
  |  |  |  |  190|    226|#define _free_src_loc(ptr) free((ptr))
  |  |  ------------------
  ------------------
 2059|    226|#endif
 2060|    226|#endif
 2061|    226|  KMP_MB();
 2062|    226|  KE_TRACE(25, ("<- __kmp_free() returns\n"));
 2063|    226|} // func ___kmp_free
__kmp_initialize_fast_memory:
 2276|      1|void __kmp_initialize_fast_memory(kmp_info_t *this_thr) {
 2277|      1|  KE_TRACE(10, ("__kmp_initialize_fast_memory: Called from th %p\n", this_thr));
 2278|       |
 2279|      1|  memset(this_thr->th.th_free_lists, 0, NUM_LISTS * sizeof(kmp_free_list_t));
  ------------------
  |  | 2926|      1|#define NUM_LISTS 4
  ------------------
 2280|      1|}
__kmp_free_fast_memory:
 2284|      1|void __kmp_free_fast_memory(kmp_info_t *th) {
 2285|       |  // Suppose we use BGET underlying allocator, walk through its structures...
 2286|      1|  int bin;
 2287|      1|  thr_data_t *thr = get_thr_data(th);
 2288|      1|  void **lst = NULL;
 2289|       |
 2290|      1|  KE_TRACE(
 2291|      1|      5, ("__kmp_free_fast_memory: Called T#%d\n", __kmp_gtid_from_thread(th)));
 2292|       |
 2293|      1|  __kmp_bget_dequeue(th); // Release any queued buffers
 2294|       |
 2295|       |  // Dig through free lists and extract all allocated blocks
 2296|     21|  for (bin = 0; bin < MAX_BGET_BINS; ++bin) {
  ------------------
  |  |  124|     21|#define MAX_BGET_BINS (int)(sizeof(bget_bin_size) / sizeof(bufsize))
  ------------------
  |  Branch (2296:17): [True: 20, False: 1]
  ------------------
 2297|     20|    bfhead_t *b = thr->freelist[bin].ql.flink;
 2298|     20|    while (b != &thr->freelist[bin]) {
  ------------------
  |  Branch (2298:12): [True: 0, False: 20]
  ------------------
 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|     20|  }
 2307|      1|  while (lst != NULL) {
  ------------------
  |  Branch (2307:10): [True: 0, False: 1]
  ------------------
 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|      1|  KE_TRACE(
 2321|      1|      5, ("__kmp_free_fast_memory: Freed T#%d\n", __kmp_gtid_from_thread(th)));
 2322|      1|}
kmp_alloc.cpp:_ZL12set_thr_dataP8kmp_info:
  227|      1|static void set_thr_data(kmp_info_t *th) {
  228|      1|  int i;
  229|      1|  thr_data_t *data;
  230|       |
  231|      1|  data = (thr_data_t *)((!th->th.th_local.bget_data)
  ------------------
  |  Branch (231:25): [True: 1, False: 0]
  ------------------
  232|      1|                            ? __kmp_allocate(sizeof(*data))
  ------------------
  |  | 3617|      1|#define __kmp_allocate(size) ___kmp_allocate((size)KMP_SRC_LOC_CURR)
  ------------------
  233|      1|                            : th->th.th_local.bget_data);
  234|       |
  235|      1|  memset(data, '\0', sizeof(*data));
  236|       |
  237|     21|  for (i = 0; i < MAX_BGET_BINS; ++i) {
  ------------------
  |  |  124|     21|#define MAX_BGET_BINS (int)(sizeof(bget_bin_size) / sizeof(bufsize))
  ------------------
  |  Branch (237:15): [True: 20, False: 1]
  ------------------
  238|     20|    data->freelist[i].ql.flink = &data->freelist[i];
  239|     20|    data->freelist[i].ql.blink = &data->freelist[i];
  240|     20|  }
  241|       |
  242|      1|  th->th.th_local.bget_data = data;
  243|      1|  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|      1|}
kmp_alloc.cpp:_ZL5bectlP8kmp_infoPFimiEPFPvmEPFvS3_El:
  867|      1|                  bufsize pool_incr) {
  868|      1|  thr_data_t *thr = get_thr_data(th);
  869|       |
  870|      1|  thr->compfcn = compact;
  871|      1|  thr->acqfcn = acquire;
  872|      1|  thr->relfcn = release;
  873|      1|  thr->exp_incr = pool_incr;
  874|      1|}
kmp_alloc.cpp:_ZL12get_thr_dataP8kmp_info:
  253|      2|static thr_data_t *get_thr_data(kmp_info_t *th) {
  254|      2|  thr_data_t *data;
  255|       |
  256|      2|  data = (thr_data_t *)th->th.th_local.bget_data;
  257|       |
  258|      2|  KMP_DEBUG_ASSERT(data != 0);
  259|       |
  260|      2|  return data;
  261|      2|}
kmp_alloc.cpp:_ZL18__kmp_bget_dequeueP8kmp_info:
  264|      1|static void __kmp_bget_dequeue(kmp_info_t *th) {
  265|      1|  void *p = TCR_SYNC_PTR(th->th.th_local.bget_list);
  ------------------
  |  | 1158|      1|#define TCR_SYNC_PTR(a) ((void *)TCR_SYNC_8(a))
  |  |  ------------------
  |  |  |  | 1140|      1|#define TCR_SYNC_8(a) (a)
  |  |  ------------------
  ------------------
  266|       |
  267|      1|  if (p != 0) {
  ------------------
  |  Branch (267:7): [True: 0, False: 1]
  ------------------
  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|      1|}
kmp_alloc.cpp:_ZL21___kmp_allocate_alignmm:
 1913|    230|                                   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|    230|  kmp_mem_descr_t descr;
 1931|    230|  kmp_uintptr_t addr_allocated; // Address returned by malloc().
 1932|    230|  kmp_uintptr_t addr_aligned; // Aligned address to return to caller.
 1933|    230|  kmp_uintptr_t addr_descr; // Address of memory block descriptor.
 1934|       |
 1935|    230|  KE_TRACE(25, ("-> ___kmp_allocate_align( %d, %d ) called from %s:%d\n",
 1936|    230|                (int)size, (int)alignment KMP_SRC_LOC_PARM));
 1937|       |
 1938|    230|  KMP_DEBUG_ASSERT(alignment < 32 * 1024); // Alignment should not be too
 1939|    230|  KMP_DEBUG_ASSERT(sizeof(void *) <= sizeof(kmp_uintptr_t));
 1940|       |  // Make sure kmp_uintptr_t is enough to store addresses.
 1941|       |
 1942|    230|  descr.size_aligned = size;
 1943|    230|  descr.size_allocated =
 1944|    230|      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|    230|  descr.ptr_allocated = malloc_src_loc(descr.size_allocated KMP_SRC_LOC_PARM);
  ------------------
  |  |  144|    230|#define malloc_src_loc(args) _malloc_src_loc(args)
  |  |  ------------------
  |  |  |  |  189|    230|#define _malloc_src_loc(size) malloc((size))
  |  |  ------------------
  ------------------
 1950|    230|#endif
 1951|    230|  KE_TRACE(10, ("   malloc( %d ) returned %p\n", (int)descr.size_allocated,
 1952|    230|                descr.ptr_allocated));
 1953|    230|  if (descr.ptr_allocated == NULL) {
  ------------------
  |  Branch (1953:7): [True: 0, False: 230]
  ------------------
 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|    230|  addr_allocated = (kmp_uintptr_t)descr.ptr_allocated;
 1958|    230|  addr_aligned =
 1959|    230|      (addr_allocated + sizeof(kmp_mem_descr_t) + alignment) & ~(alignment - 1);
 1960|    230|  addr_descr = addr_aligned - sizeof(kmp_mem_descr_t);
 1961|       |
 1962|    230|  descr.ptr_aligned = (void *)addr_aligned;
 1963|       |
 1964|    230|  KE_TRACE(26, ("   ___kmp_allocate_align: "
 1965|    230|                "ptr_allocated=%p, size_allocated=%d, "
 1966|    230|                "ptr_aligned=%p, size_aligned=%d\n",
 1967|    230|                descr.ptr_allocated, (int)descr.size_allocated,
 1968|    230|                descr.ptr_aligned, (int)descr.size_aligned));
 1969|       |
 1970|    230|  KMP_DEBUG_ASSERT(addr_allocated <= addr_descr);
 1971|    230|  KMP_DEBUG_ASSERT(addr_descr + sizeof(kmp_mem_descr_t) == addr_aligned);
 1972|    230|  KMP_DEBUG_ASSERT(addr_aligned + descr.size_aligned <=
 1973|    230|                   addr_allocated + descr.size_allocated);
 1974|    230|  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|    230|  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|    230|  *((kmp_mem_descr_t *)addr_descr) = descr;
 1986|       |
 1987|    230|  KMP_MB();
 1988|       |
 1989|    230|  KE_TRACE(25, ("<- ___kmp_allocate_align() returns %p\n", descr.ptr_aligned));
 1990|    230|  return descr.ptr_aligned;
 1991|    230|} // 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|}

__kmpc_global_thread_num:
   99|    121|kmp_int32 __kmpc_global_thread_num(ident_t *loc) {
  100|    121|  kmp_int32 gtid = __kmp_entry_gtid();
  ------------------
  |  | 3467|    121|#define __kmp_entry_gtid() __kmp_get_global_thread_id_reg()
  ------------------
  101|       |
  102|    121|  KC_TRACE(10, ("__kmpc_global_thread_num: T#%d\n", gtid));
  103|       |
  104|    121|  return gtid;
  105|    121|}
__kmpc_push_num_threads:
  232|    121|                             kmp_int32 num_threads) {
  233|    121|  KA_TRACE(20, ("__kmpc_push_num_threads: enter T#%d num_threads=%d\n",
  234|    121|                global_tid, num_threads));
  235|    121|  __kmp_assert_valid_gtid(global_tid);
  236|    121|  __kmp_push_num_threads(loc, global_tid, num_threads);
  237|    121|}
__kmpc_fork_call:
  262|    121|void __kmpc_fork_call(ident_t *loc, kmp_int32 argc, kmpc_micro microtask, ...) {
  263|    121|  int gtid = __kmp_entry_gtid();
  ------------------
  |  | 3467|    121|#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|    121|  {
  284|    121|    va_list ap;
  285|    121|    va_start(ap, microtask);
  286|       |
  287|    121|#if OMPT_SUPPORT
  288|    121|    ompt_frame_t *ompt_frame;
  289|    121|    if (ompt_enabled.enabled) {
  ------------------
  |  Branch (289:9): [True: 0, False: 121]
  ------------------
  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|    121|    OMPT_STORE_RETURN_ADDRESS(gtid);
  ------------------
  |  |   92|    121|  OmptReturnAddressGuard ReturnAddressGuard{gtid, __builtin_return_address(0)};
  ------------------
  295|    121|#endif
  296|       |
  297|       |#if INCLUDE_SSC_MARKS
  298|       |    SSC_MARK_FORKING();
  299|       |#endif
  300|    121|    __kmp_fork_call(loc, gtid, fork_context_intel, argc,
  301|    121|                    VOLATILE_CAST(microtask_t) microtask, // "wrapped" task
  ------------------
  |  | 1180|    121|#define VOLATILE_CAST(x) (x)
  ------------------
  302|    121|                    VOLATILE_CAST(launch_t) __kmp_invoke_task_func,
  ------------------
  |  | 1180|    121|#define VOLATILE_CAST(x) (x)
  ------------------
  303|    121|                    kmp_va_addr_of(ap));
  ------------------
  |  |  220|    121|#define kmp_va_addr_of(ap) (&(ap))
  ------------------
  304|       |#if INCLUDE_SSC_MARKS
  305|       |    SSC_MARK_JOINING();
  306|       |#endif
  307|    121|    __kmp_join_call(loc, gtid
  308|    121|#if OMPT_SUPPORT
  309|    121|                    ,
  310|    121|                    fork_context_intel
  311|    121|#endif
  312|    121|    );
  313|       |
  314|    121|    va_end(ap);
  315|       |
  316|    121|#if OMPT_SUPPORT
  317|    121|    if (ompt_enabled.enabled) {
  ------------------
  |  Branch (317:9): [True: 0, False: 121]
  ------------------
  318|      0|      ompt_frame->enter_frame = ompt_data_none;
  ------------------
  |  | 1408|      0|#define ompt_data_none {0}
  ------------------
  319|      0|    }
  320|    121|#endif
  321|    121|  }
  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|    121|}
__kmpc_serialized_parallel:
  522|    121|void __kmpc_serialized_parallel(ident_t *loc, kmp_int32 global_tid) {
  523|       |  // The implementation is now in kmp_runtime.cpp so that it can share static
  524|       |  // functions with kmp_fork_call since the tasks to be done are similar in
  525|       |  // each case.
  526|    121|  __kmp_assert_valid_gtid(global_tid);
  527|    121|#if OMPT_SUPPORT
  528|    121|  OMPT_STORE_RETURN_ADDRESS(global_tid);
  ------------------
  |  |   92|    121|  OmptReturnAddressGuard ReturnAddressGuard{gtid, __builtin_return_address(0)};
  ------------------
  529|    121|#endif
  530|    121|  __kmp_serialized_parallel(loc, global_tid);
  531|    121|}
__kmpc_end_serialized_parallel:
  540|    121|void __kmpc_end_serialized_parallel(ident_t *loc, kmp_int32 global_tid) {
  541|    121|  kmp_internal_control_t *top;
  542|    121|  kmp_info_t *this_thr;
  543|    121|  kmp_team_t *serial_team;
  544|       |
  545|    121|  KC_TRACE(10,
  546|    121|           ("__kmpc_end_serialized_parallel: called by T#%d\n", global_tid));
  547|       |
  548|       |  /* skip all this code for autopar serialized loops since it results in
  549|       |     unacceptable overhead */
  550|    121|  if (loc != NULL && (loc->flags & KMP_IDENT_AUTOPAR))
  ------------------
  |  Branch (550:7): [True: 121, False: 0]
  |  Branch (550:22): [True: 0, False: 121]
  ------------------
  551|      0|    return;
  552|       |
  553|       |  // Not autopar code
  554|    121|  __kmp_assert_valid_gtid(global_tid);
  555|    121|  if (!TCR_4(__kmp_init_parallel))
  ------------------
  |  | 1127|    121|#define TCR_4(a) (a)
  ------------------
  |  Branch (555:7): [True: 0, False: 121]
  ------------------
  556|      0|    __kmp_parallel_initialize();
  557|       |
  558|    121|  __kmp_resume_if_soft_paused();
  559|       |
  560|    121|  this_thr = __kmp_threads[global_tid];
  561|    121|  serial_team = this_thr->th.th_serial_team;
  562|       |
  563|    121|  kmp_task_team_t *task_team = this_thr->th.th_task_team;
  564|       |  // we need to wait for the proxy tasks before finishing the thread
  565|    121|  if (task_team != NULL && (task_team->tt.tt_found_proxy_tasks ||
  ------------------
  |  Branch (565:7): [True: 0, False: 121]
  |  Branch (565:29): [True: 0, False: 0]
  ------------------
  566|      0|                            task_team->tt.tt_hidden_helper_task_encountered))
  ------------------
  |  Branch (566:29): [True: 0, False: 0]
  ------------------
  567|      0|    __kmp_task_team_wait(this_thr, serial_team USE_ITT_BUILD_ARG(NULL));
  568|       |
  569|    121|  KMP_MB();
  570|    121|  KMP_DEBUG_ASSERT(serial_team);
  571|    121|  KMP_ASSERT(serial_team->t.t_serialized);
  ------------------
  |  |   50|    121|  if (!(cond)) {                                                               \
  |  |  ------------------
  |  |  |  Branch (50:7): [True: 0, False: 121]
  |  |  ------------------
  |  |   51|      0|    __kmp_debug_assert("assertion failure", __FILE__, __LINE__);               \
  |  |   52|      0|  }
  ------------------
  572|    121|  KMP_DEBUG_ASSERT(this_thr->th.th_team == serial_team);
  573|    121|  KMP_DEBUG_ASSERT(serial_team != this_thr->th.th_root->r.r_root_team);
  574|    121|  KMP_DEBUG_ASSERT(serial_team->t.t_threads);
  575|    121|  KMP_DEBUG_ASSERT(serial_team->t.t_threads[0] == this_thr);
  576|       |
  577|    121|#if OMPT_SUPPORT
  578|    121|  if (ompt_enabled.enabled &&
  ------------------
  |  Branch (578:7): [True: 0, False: 121]
  ------------------
  579|      0|      this_thr->th.ompt_thread_info.state != ompt_state_overhead) {
  ------------------
  |  Branch (579:7): [True: 0, False: 0]
  ------------------
  580|      0|    OMPT_CUR_TASK_INFO(this_thr)->frame.exit_frame = ompt_data_none;
  ------------------
  |  |   68|      0|#define OMPT_CUR_TASK_INFO(thr) (&((thr)->th.th_current_task->ompt_task_info))
  ------------------
                  OMPT_CUR_TASK_INFO(this_thr)->frame.exit_frame = ompt_data_none;
  ------------------
  |  | 1408|      0|#define ompt_data_none {0}
  ------------------
  581|      0|    if (ompt_enabled.ompt_callback_implicit_task) {
  ------------------
  |  Branch (581:9): [True: 0, False: 0]
  ------------------
  582|      0|      ompt_callbacks.ompt_callback(ompt_callback_implicit_task)(
  ------------------
  |  |   27|      0|#define ompt_callback(e) e##_callback
  ------------------
  583|      0|          ompt_scope_end, NULL, OMPT_CUR_TASK_DATA(this_thr), 1,
  ------------------
  |  |   70|      0|  (&((thr)->th.th_current_task->ompt_task_info.task_data))
  ------------------
  584|      0|          OMPT_CUR_TASK_INFO(this_thr)->thread_num, ompt_task_implicit);
  ------------------
  |  |   68|      0|#define OMPT_CUR_TASK_INFO(thr) (&((thr)->th.th_current_task->ompt_task_info))
  ------------------
  585|      0|    }
  586|       |
  587|       |    // reset clear the task id only after unlinking the task
  588|      0|    ompt_data_t *parent_task_data;
  589|      0|    __ompt_get_task_info_internal(1, NULL, &parent_task_data, NULL, NULL, NULL);
  590|       |
  591|      0|    if (ompt_enabled.ompt_callback_parallel_end) {
  ------------------
  |  Branch (591:9): [True: 0, False: 0]
  ------------------
  592|      0|      ompt_callbacks.ompt_callback(ompt_callback_parallel_end)(
  ------------------
  |  |   27|      0|#define ompt_callback(e) e##_callback
  ------------------
  593|      0|          &(serial_team->t.ompt_team_info.parallel_data), parent_task_data,
  594|      0|          ompt_parallel_invoker_program | ompt_parallel_team,
  595|      0|          OMPT_LOAD_RETURN_ADDRESS(global_tid));
  ------------------
  |  |   93|      0|#define OMPT_LOAD_RETURN_ADDRESS(gtid) __ompt_load_return_address(gtid)
  ------------------
  596|      0|    }
  597|      0|    __ompt_lw_taskteam_unlink(this_thr);
  598|      0|    this_thr->th.ompt_thread_info.state = ompt_state_overhead;
  599|      0|  }
  600|    121|#endif
  601|       |
  602|       |  /* If necessary, pop the internal control stack values and replace the team
  603|       |   * values */
  604|    121|  top = serial_team->t.t_control_stack_top;
  605|    121|  if (top && top->serial_nesting_level == serial_team->t.t_serialized) {
  ------------------
  |  Branch (605:7): [True: 0, False: 121]
  |  Branch (605:14): [True: 0, False: 0]
  ------------------
  606|      0|    copy_icvs(&serial_team->t.t_threads[0]->th.th_current_task->td_icvs, top);
  607|      0|    serial_team->t.t_control_stack_top = top->next;
  608|      0|    __kmp_free(top);
  ------------------
  |  | 3619|      0|#define __kmp_free(ptr) ___kmp_free((ptr)KMP_SRC_LOC_CURR)
  ------------------
  609|      0|  }
  610|       |
  611|       |  /* pop dispatch buffers stack */
  612|    121|  KMP_DEBUG_ASSERT(serial_team->t.t_dispatch->th_disp_buffer);
  613|    121|  {
  614|    121|    dispatch_private_info_t *disp_buffer =
  615|    121|        serial_team->t.t_dispatch->th_disp_buffer;
  616|    121|    serial_team->t.t_dispatch->th_disp_buffer =
  617|    121|        serial_team->t.t_dispatch->th_disp_buffer->next;
  618|    121|    __kmp_free(disp_buffer);
  ------------------
  |  | 3619|    121|#define __kmp_free(ptr) ___kmp_free((ptr)KMP_SRC_LOC_CURR)
  ------------------
  619|    121|  }
  620|    121|  this_thr->th.th_def_allocator = serial_team->t.t_def_allocator; // restore
  621|       |
  622|    121|  --serial_team->t.t_serialized;
  623|    121|  if (serial_team->t.t_serialized == 0) {
  ------------------
  |  Branch (623:7): [True: 121, False: 0]
  ------------------
  624|       |
  625|       |    /* return to the parallel section */
  626|       |
  627|    121|#if KMP_ARCH_X86 || KMP_ARCH_X86_64
  628|    121|    if (__kmp_inherit_fp_control && serial_team->t.t_fp_control_saved) {
  ------------------
  |  Branch (628:9): [True: 121, False: 0]
  |  Branch (628:37): [True: 121, False: 0]
  ------------------
  629|    121|      __kmp_clear_x87_fpu_status_word();
  630|    121|      __kmp_load_x87_fpu_control_word(&serial_team->t.t_x87_fpu_control_word);
  631|    121|      __kmp_load_mxcsr(&serial_team->t.t_mxcsr);
  632|    121|    }
  633|    121|#endif /* KMP_ARCH_X86 || KMP_ARCH_X86_64 */
  634|       |
  635|    121|    __kmp_pop_current_task_from_thread(this_thr);
  636|    121|#if OMPD_SUPPORT
  637|    121|    if (ompd_state & OMPD_ENABLE_BP)
  ------------------
  |  |   35|    121|#define OMPD_ENABLE_BP 0x1
  ------------------
  |  Branch (637:9): [True: 0, False: 121]
  ------------------
  638|      0|      ompd_bp_parallel_end();
  639|    121|#endif
  640|       |
  641|    121|    this_thr->th.th_team = serial_team->t.t_parent;
  642|    121|    this_thr->th.th_info.ds.ds_tid = serial_team->t.t_master_tid;
  643|       |
  644|       |    /* restore values cached in the thread */
  645|    121|    this_thr->th.th_team_nproc = serial_team->t.t_parent->t.t_nproc; /*  JPH */
  646|    121|    this_thr->th.th_team_master =
  647|    121|        serial_team->t.t_parent->t.t_threads[0]; /* JPH */
  648|    121|    this_thr->th.th_team_serialized = this_thr->th.th_team->t.t_serialized;
  649|       |
  650|       |    /* TODO the below shouldn't need to be adjusted for serialized teams */
  651|    121|    this_thr->th.th_dispatch =
  652|    121|        &this_thr->th.th_team->t.t_dispatch[serial_team->t.t_master_tid];
  653|       |
  654|    121|    KMP_ASSERT(this_thr->th.th_current_task->td_flags.executing == 0);
  ------------------
  |  |   50|    121|  if (!(cond)) {                                                               \
  |  |  ------------------
  |  |  |  Branch (50:7): [True: 0, False: 121]
  |  |  ------------------
  |  |   51|      0|    __kmp_debug_assert("assertion failure", __FILE__, __LINE__);               \
  |  |   52|      0|  }
  ------------------
  655|    121|    this_thr->th.th_current_task->td_flags.executing = 1;
  656|       |
  657|    121|    if (__kmp_tasking_mode != tskm_immediate_exec) {
  ------------------
  |  Branch (657:9): [True: 121, False: 0]
  ------------------
  658|       |      // Copy the task team from the new child / old parent team to the thread.
  659|    121|      this_thr->th.th_task_team =
  660|    121|          this_thr->th.th_team->t.t_task_team[this_thr->th.th_task_state];
  661|    121|      KA_TRACE(20,
  662|    121|               ("__kmpc_end_serialized_parallel: T#%d restoring task_team %p / "
  663|    121|                "team %p\n",
  664|    121|                global_tid, this_thr->th.th_task_team, this_thr->th.th_team));
  665|    121|    }
  666|    121|#if KMP_AFFINITY_SUPPORTED
  667|    121|    if (this_thr->th.th_team->t.t_level == 0 && __kmp_affinity.flags.reset) {
  ------------------
  |  Branch (667:9): [True: 121, False: 0]
  |  Branch (667:49): [True: 0, False: 121]
  ------------------
  668|      0|      __kmp_reset_root_init_mask(global_tid);
  669|      0|    }
  670|    121|#endif
  671|    121|  } else {
  672|      0|    if (__kmp_tasking_mode != tskm_immediate_exec) {
  ------------------
  |  Branch (672:9): [True: 0, False: 0]
  ------------------
  673|      0|      KA_TRACE(20, ("__kmpc_end_serialized_parallel: T#%d decreasing nesting "
  674|      0|                    "depth of serial team %p to %d\n",
  675|      0|                    global_tid, serial_team, serial_team->t.t_serialized));
  676|      0|    }
  677|      0|  }
  678|       |
  679|    121|  serial_team->t.t_level--;
  680|    121|  if (__kmp_env_consistency_check)
  ------------------
  |  Branch (680:7): [True: 0, False: 121]
  ------------------
  681|      0|    __kmp_pop_parallel(global_tid, NULL);
  682|    121|#if OMPT_SUPPORT
  683|    121|  if (ompt_enabled.enabled)
  ------------------
  |  Branch (683:7): [True: 0, False: 121]
  ------------------
  684|      0|    this_thr->th.ompt_thread_info.state =
  685|      0|        ((this_thr->th.th_team_serialized) ? ompt_state_work_serial
  ------------------
  |  Branch (685:10): [True: 0, False: 0]
  ------------------
  686|      0|                                           : ompt_state_work_parallel);
  687|    121|#endif
  688|    121|}
__kmpc_for_static_fini:
 1910|    121|void __kmpc_for_static_fini(ident_t *loc, kmp_int32 global_tid) {
 1911|    121|  KMP_POP_PARTITIONED_TIMER();
  ------------------
  |  | 1015|    121|#define KMP_POP_PARTITIONED_TIMER() ((void)0)
  ------------------
 1912|    121|  KE_TRACE(10, ("__kmpc_for_static_fini called T#%d\n", global_tid));
 1913|       |
 1914|    121|#if OMPT_SUPPORT && OMPT_OPTIONAL
 1915|    121|  if (ompt_enabled.ompt_callback_work) {
  ------------------
  |  Branch (1915:7): [True: 0, False: 121]
  ------------------
 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|    121|#endif
 1938|    121|  if (__kmp_env_consistency_check)
  ------------------
  |  Branch (1938:7): [True: 0, False: 121]
  ------------------
 1939|      0|    __kmp_pop_workshare(global_tid, ct_pdo, loc);
 1940|    121|}
__kmpc_init_lock:
 2419|  2.66k|void __kmpc_init_lock(ident_t *loc, kmp_int32 gtid, void **user_lock) {
 2420|  2.66k|#if KMP_USE_DYNAMIC_LOCK
 2421|       |
 2422|  2.66k|  KMP_DEBUG_ASSERT(__kmp_init_serial);
 2423|  2.66k|  if (__kmp_env_consistency_check && user_lock == NULL) {
  ------------------
  |  Branch (2423:7): [True: 0, False: 2.66k]
  |  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|  2.66k|  __kmp_init_lock_with_hint(loc, user_lock, __kmp_user_lock_seq);
 2427|       |
 2428|  2.66k|#if OMPT_SUPPORT && OMPT_OPTIONAL
 2429|       |  // This is the case, if called from omp_init_lock_with_hint:
 2430|  2.66k|  void *codeptr = OMPT_LOAD_RETURN_ADDRESS(gtid);
  ------------------
  |  |   93|  2.66k|#define OMPT_LOAD_RETURN_ADDRESS(gtid) __ompt_load_return_address(gtid)
  ------------------
 2431|  2.66k|  if (!codeptr)
  ------------------
  |  Branch (2431:7): [True: 2.66k, False: 0]
  ------------------
 2432|  2.66k|    codeptr = OMPT_GET_RETURN_ADDRESS(0);
  ------------------
  |  |  108|  2.66k|#define OMPT_GET_RETURN_ADDRESS(level) __builtin_return_address(level)
  ------------------
 2433|  2.66k|  if (ompt_enabled.ompt_callback_lock_init) {
  ------------------
  |  Branch (2433:7): [True: 0, False: 2.66k]
  ------------------
 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|  2.66k|#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|  2.66k|} // __kmpc_init_lock
__kmpc_destroy_lock:
 2565|  2.66k|void __kmpc_destroy_lock(ident_t *loc, kmp_int32 gtid, void **user_lock) {
 2566|  2.66k|#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|  2.66k|#if OMPT_SUPPORT && OMPT_OPTIONAL
 2578|       |  // This is the case, if called from omp_init_lock_with_hint:
 2579|  2.66k|  void *codeptr = OMPT_LOAD_RETURN_ADDRESS(gtid);
  ------------------
  |  |   93|  2.66k|#define OMPT_LOAD_RETURN_ADDRESS(gtid) __ompt_load_return_address(gtid)
  ------------------
 2580|  2.66k|  if (!codeptr)
  ------------------
  |  Branch (2580:7): [True: 2.66k, False: 0]
  ------------------
 2581|  2.66k|    codeptr = OMPT_GET_RETURN_ADDRESS(0);
  ------------------
  |  |  108|  2.66k|#define OMPT_GET_RETURN_ADDRESS(level) __builtin_return_address(level)
  ------------------
 2582|  2.66k|  if (ompt_enabled.ompt_callback_lock_destroy) {
  ------------------
  |  Branch (2582:7): [True: 0, False: 2.66k]
  ------------------
 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|  2.66k|#endif
 2587|  2.66k|  KMP_D_LOCK_FUNC(user_lock, destroy)((kmp_dyna_lock_t *)user_lock);
  ------------------
  |  | 1149|  2.66k|#define KMP_D_LOCK_FUNC(l, op) __kmp_direct_##op[KMP_EXTRACT_D_TAG(l)]
  |  |  ------------------
  |  |  |  | 1141|  2.66k|  (*((kmp_dyna_lock_t *)(l)) & ((1 << KMP_LOCK_SHIFT) - 1) &                   \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1076|  2.66k|  8 // number of low bits to be used as tag for direct locks
  |  |  |  |  ------------------
  |  |  |  | 1142|  2.66k|   -(*((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|  2.66k|} // __kmpc_destroy_lock
__kmpc_set_lock:
 2712|    101|void __kmpc_set_lock(ident_t *loc, kmp_int32 gtid, void **user_lock) {
 2713|    101|  KMP_COUNT_BLOCK(OMP_set_lock);
  ------------------
  |  | 1001|    101|#define KMP_COUNT_BLOCK(n) ((void)0)
  ------------------
 2714|    101|#if KMP_USE_DYNAMIC_LOCK
 2715|    101|  int tag = KMP_EXTRACT_D_TAG(user_lock);
  ------------------
  |  | 1141|    101|  (*((kmp_dyna_lock_t *)(l)) & ((1 << KMP_LOCK_SHIFT) - 1) &                   \
  |  |  ------------------
  |  |  |  | 1076|    101|  8 // number of low bits to be used as tag for direct locks
  |  |  ------------------
  |  | 1142|    101|   -(*((kmp_dyna_lock_t *)(l)) & 1))
  ------------------
 2716|       |#if USE_ITT_BUILD
 2717|       |  __kmp_itt_lock_acquiring(
 2718|       |      (kmp_user_lock_p)
 2719|       |          user_lock); // itt function will get to the right lock object.
 2720|       |#endif
 2721|    101|#if OMPT_SUPPORT && OMPT_OPTIONAL
 2722|       |  // This is the case, if called from omp_init_lock_with_hint:
 2723|    101|  void *codeptr = OMPT_LOAD_RETURN_ADDRESS(gtid);
  ------------------
  |  |   93|    101|#define OMPT_LOAD_RETURN_ADDRESS(gtid) __ompt_load_return_address(gtid)
  ------------------
 2724|    101|  if (!codeptr)
  ------------------
  |  Branch (2724:7): [True: 101, False: 0]
  ------------------
 2725|    101|    codeptr = OMPT_GET_RETURN_ADDRESS(0);
  ------------------
  |  |  108|    101|#define OMPT_GET_RETURN_ADDRESS(level) __builtin_return_address(level)
  ------------------
 2726|    101|  if (ompt_enabled.ompt_callback_mutex_acquire) {
  ------------------
  |  Branch (2726:7): [True: 0, False: 101]
  ------------------
 2727|      0|    ompt_callbacks.ompt_callback(ompt_callback_mutex_acquire)(
  ------------------
  |  |   27|      0|#define ompt_callback(e) e##_callback
  ------------------
 2728|      0|        ompt_mutex_lock, omp_lock_hint_none,
 2729|      0|        __ompt_get_mutex_impl_type(user_lock),
 2730|      0|        (ompt_wait_id_t)(uintptr_t)user_lock, codeptr);
 2731|      0|  }
 2732|    101|#endif
 2733|    101|#if KMP_USE_INLINED_TAS
 2734|    101|  if (tag == locktag_tas && !__kmp_env_consistency_check) {
  ------------------
  |  Branch (2734:7): [True: 0, False: 101]
  |  Branch (2734:29): [True: 0, False: 0]
  ------------------
 2735|      0|    KMP_ACQUIRE_TAS_LOCK(user_lock, gtid);
  ------------------
  |  | 1080|      0|  {                                                                            \
  |  | 1081|      0|    kmp_tas_lock_t *l = (kmp_tas_lock_t *)lock;                                \
  |  | 1082|      0|    kmp_int32 tas_free = KMP_LOCK_FREE(tas);                                   \
  |  |  ------------------
  |  |  |  | 1165|      0|#define KMP_LOCK_FREE(type) (locktag_##type)
  |  |  ------------------
  |  | 1083|      0|    kmp_int32 tas_busy = KMP_LOCK_BUSY(gtid + 1, tas);                         \
  |  |  ------------------
  |  |  |  | 1168|      0|#define KMP_LOCK_BUSY(v, type) ((v) << KMP_LOCK_SHIFT | locktag_##type)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1076|      0|  8 // number of low bits to be used as tag for direct locks
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1084|      0|    if (KMP_ATOMIC_LD_RLX(&l->lk.poll) != tas_free ||                          \
  |  |  ------------------
  |  |  |  | 1250|      0|#define KMP_ATOMIC_LD_RLX(p) KMP_ATOMIC_LD(p, relaxed)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1245|      0|#define KMP_ATOMIC_LD(p, order) (p)->load(std::memory_order_##order)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (1084:9): [True: 0, False: 0]
  |  |  ------------------
  |  | 1085|      0|        !__kmp_atomic_compare_store_acq(&l->lk.poll, tas_free, tas_busy)) {    \
  |  |  ------------------
  |  |  |  Branch (1085:9): [True: 0, False: 0]
  |  |  ------------------
  |  | 1086|      0|      kmp_uint32 spins;                                                        \
  |  | 1087|      0|      KMP_FSYNC_PREPARE(l);                                                    \
  |  |  ------------------
  |  |  |  |  332|      0|#define KMP_FSYNC_PREPARE(obj) ((void)0)
  |  |  ------------------
  |  | 1088|      0|      KMP_INIT_YIELD(spins);                                                   \
  |  |  ------------------
  |  |  |  | 1514|      0|  { (count) = __kmp_yield_init; }
  |  |  ------------------
  |  | 1089|      0|      kmp_backoff_t backoff = __kmp_spin_backoff_params;                       \
  |  | 1090|      0|      do {                                                                     \
  |  | 1091|      0|        if (TCR_4(__kmp_nth) >                                                 \
  |  |  ------------------
  |  |  |  | 1127|      0|#define TCR_4(a) (a)
  |  |  ------------------
  |  |  |  Branch (1091:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 1092|      0|            (__kmp_avail_proc ? __kmp_avail_proc : __kmp_xproc)) {             \
  |  |  ------------------
  |  |  |  Branch (1092:14): [True: 0, False: 0]
  |  |  ------------------
  |  | 1093|      0|          KMP_YIELD(TRUE);                                                     \
  |  |  ------------------
  |  |  |  | 1529|      0|  {                                                                            \
  |  |  |  | 1530|      0|    KMP_CPU_PAUSE();                                                           \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1498|      0|#define KMP_CPU_PAUSE() __kmp_x86_pause()
  |  |  |  |  ------------------
  |  |  |  | 1531|      0|    if ((cond) && (KMP_TRY_YIELD))                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1523|      0|  ((__kmp_use_yield == 1) || (__kmp_use_yield == 2 && (KMP_OVERSUBSCRIBED)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 1520|      0|  (TCR_4(__kmp_nth) > (__kmp_avail_proc ? __kmp_avail_proc : __kmp_xproc))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 1127|      0|#define TCR_4(a) (a)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (1520:24): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1523:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (1523:31): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (1523:55): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1531:9): [True: 0, Folded]
  |  |  |  |  ------------------
  |  |  |  | 1532|      0|      __kmp_yield();                                                           \
  |  |  |  | 1533|      0|  }
  |  |  ------------------
  |  | 1094|      0|        } else {                                                               \
  |  | 1095|      0|          KMP_YIELD_SPIN(spins);                                               \
  |  |  ------------------
  |  |  |  | 1545|      0|  {                                                                            \
  |  |  |  | 1546|      0|    KMP_CPU_PAUSE();                                                           \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1498|      0|#define KMP_CPU_PAUSE() __kmp_x86_pause()
  |  |  |  |  ------------------
  |  |  |  | 1547|      0|    if (KMP_TRY_YIELD) {                                                       \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1523|      0|  ((__kmp_use_yield == 1) || (__kmp_use_yield == 2 && (KMP_OVERSUBSCRIBED)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 1520|      0|  (TCR_4(__kmp_nth) > (__kmp_avail_proc ? __kmp_avail_proc : __kmp_xproc))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 1127|      0|#define TCR_4(a) (a)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (1520:24): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1523:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (1523:31): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (1523:55): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1548|      0|      (count) -= 2;                                                            \
  |  |  |  | 1549|      0|      if (!(count)) {                                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1549:11): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1550|      0|        __kmp_yield();                                                         \
  |  |  |  | 1551|      0|        (count) = __kmp_yield_next;                                            \
  |  |  |  | 1552|      0|      }                                                                        \
  |  |  |  | 1553|      0|    }                                                                          \
  |  |  |  | 1554|      0|  }
  |  |  ------------------
  |  | 1096|      0|        }                                                                      \
  |  | 1097|      0|        __kmp_spin_backoff(&backoff);                                          \
  |  | 1098|      0|      } while (                                                                \
  |  | 1099|      0|          KMP_ATOMIC_LD_RLX(&l->lk.poll) != tas_free ||                        \
  |  |  ------------------
  |  |  |  | 1250|      0|#define KMP_ATOMIC_LD_RLX(p) KMP_ATOMIC_LD(p, relaxed)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1245|      0|#define KMP_ATOMIC_LD(p, order) (p)->load(std::memory_order_##order)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (1099:11): [True: 0, False: 0]
  |  |  ------------------
  |  | 1100|      0|          !__kmp_atomic_compare_store_acq(&l->lk.poll, tas_free, tas_busy));   \
  |  |  ------------------
  |  |  |  Branch (1100:11): [True: 0, False: 0]
  |  |  ------------------
  |  | 1101|      0|    }                                                                          \
  |  | 1102|      0|    KMP_FSYNC_ACQUIRED(l);                                                     \
  |  |  ------------------
  |  |  |  |  334|      0|#define KMP_FSYNC_ACQUIRED(obj) ((void)0)
  |  |  ------------------
  |  | 1103|      0|  }
  ------------------
 2736|      0|  } else
 2737|       |#elif KMP_USE_INLINED_FUTEX
 2738|       |  if (tag == locktag_futex && !__kmp_env_consistency_check) {
 2739|       |    KMP_ACQUIRE_FUTEX_LOCK(user_lock, gtid);
 2740|       |  } else
 2741|       |#endif
 2742|    101|  {
 2743|    101|    __kmp_direct_set[tag]((kmp_dyna_lock_t *)user_lock, gtid);
 2744|    101|  }
 2745|       |#if USE_ITT_BUILD
 2746|       |  __kmp_itt_lock_acquired((kmp_user_lock_p)user_lock);
 2747|       |#endif
 2748|    101|#if OMPT_SUPPORT && OMPT_OPTIONAL
 2749|    101|  if (ompt_enabled.ompt_callback_mutex_acquired) {
  ------------------
  |  Branch (2749:7): [True: 0, False: 101]
  ------------------
 2750|      0|    ompt_callbacks.ompt_callback(ompt_callback_mutex_acquired)(
  ------------------
  |  |   27|      0|#define ompt_callback(e) e##_callback
  ------------------
 2751|      0|        ompt_mutex_lock, (ompt_wait_id_t)(uintptr_t)user_lock, codeptr);
 2752|      0|  }
 2753|    101|#endif
 2754|       |
 2755|       |#else // KMP_USE_DYNAMIC_LOCK
 2756|       |
 2757|       |  kmp_user_lock_p lck;
 2758|       |
 2759|       |  if ((__kmp_user_lock_kind == lk_tas) &&
 2760|       |      (sizeof(lck->tas.lk.poll) <= OMP_LOCK_T_SIZE)) {
 2761|       |    lck = (kmp_user_lock_p)user_lock;
 2762|       |  }
 2763|       |#if KMP_USE_FUTEX
 2764|       |  else if ((__kmp_user_lock_kind == lk_futex) &&
 2765|       |           (sizeof(lck->futex.lk.poll) <= OMP_LOCK_T_SIZE)) {
 2766|       |    lck = (kmp_user_lock_p)user_lock;
 2767|       |  }
 2768|       |#endif
 2769|       |  else {
 2770|       |    lck = __kmp_lookup_user_lock(user_lock, "omp_set_lock");
 2771|       |  }
 2772|       |
 2773|       |#if USE_ITT_BUILD
 2774|       |  __kmp_itt_lock_acquiring(lck);
 2775|       |#endif /* USE_ITT_BUILD */
 2776|       |#if OMPT_SUPPORT && OMPT_OPTIONAL
 2777|       |  // This is the case, if called from omp_init_lock_with_hint:
 2778|       |  void *codeptr = OMPT_LOAD_RETURN_ADDRESS(gtid);
 2779|       |  if (!codeptr)
 2780|       |    codeptr = OMPT_GET_RETURN_ADDRESS(0);
 2781|       |  if (ompt_enabled.ompt_callback_mutex_acquire) {
 2782|       |    ompt_callbacks.ompt_callback(ompt_callback_mutex_acquire)(
 2783|       |        ompt_mutex_lock, omp_lock_hint_none, __ompt_get_mutex_impl_type(),
 2784|       |        (ompt_wait_id_t)(uintptr_t)lck, codeptr);
 2785|       |  }
 2786|       |#endif
 2787|       |
 2788|       |  ACQUIRE_LOCK(lck, gtid);
 2789|       |
 2790|       |#if USE_ITT_BUILD
 2791|       |  __kmp_itt_lock_acquired(lck);
 2792|       |#endif /* USE_ITT_BUILD */
 2793|       |
 2794|       |#if OMPT_SUPPORT && OMPT_OPTIONAL
 2795|       |  if (ompt_enabled.ompt_callback_mutex_acquired) {
 2796|       |    ompt_callbacks.ompt_callback(ompt_callback_mutex_acquired)(
 2797|       |        ompt_mutex_lock, (ompt_wait_id_t)(uintptr_t)lck, codeptr);
 2798|       |  }
 2799|       |#endif
 2800|       |
 2801|       |#endif // KMP_USE_DYNAMIC_LOCK
 2802|    101|}
__kmpc_unset_lock:
 2915|    101|void __kmpc_unset_lock(ident_t *loc, kmp_int32 gtid, void **user_lock) {
 2916|    101|#if KMP_USE_DYNAMIC_LOCK
 2917|       |
 2918|    101|  int tag = KMP_EXTRACT_D_TAG(user_lock);
  ------------------
  |  | 1141|    101|  (*((kmp_dyna_lock_t *)(l)) & ((1 << KMP_LOCK_SHIFT) - 1) &                   \
  |  |  ------------------
  |  |  |  | 1076|    101|  8 // number of low bits to be used as tag for direct locks
  |  |  ------------------
  |  | 1142|    101|   -(*((kmp_dyna_lock_t *)(l)) & 1))
  ------------------
 2919|       |#if USE_ITT_BUILD
 2920|       |  __kmp_itt_lock_releasing((kmp_user_lock_p)user_lock);
 2921|       |#endif
 2922|    101|#if KMP_USE_INLINED_TAS
 2923|    101|  if (tag == locktag_tas && !__kmp_env_consistency_check) {
  ------------------
  |  Branch (2923:7): [True: 0, False: 101]
  |  Branch (2923:29): [True: 0, False: 0]
  ------------------
 2924|      0|    KMP_RELEASE_TAS_LOCK(user_lock, gtid);
  ------------------
  |  | 1117|      0|  { KMP_ATOMIC_ST_REL(&((kmp_tas_lock_t *)lock)->lk.poll, KMP_LOCK_FREE(tas)); }
  |  |  ------------------
  |  |  |  | 1251|      0|#define KMP_ATOMIC_ST_REL(p, v) KMP_ATOMIC_OP(store, p, v, release)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1246|      0|#define KMP_ATOMIC_OP(op, p, v, order) (p)->op(v, std::memory_order_##order)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2925|      0|  } else
 2926|       |#elif KMP_USE_INLINED_FUTEX
 2927|       |  if (tag == locktag_futex && !__kmp_env_consistency_check) {
 2928|       |    KMP_RELEASE_FUTEX_LOCK(user_lock, gtid);
 2929|       |  } else
 2930|       |#endif
 2931|    101|  {
 2932|    101|    __kmp_direct_unset[tag]((kmp_dyna_lock_t *)user_lock, gtid);
 2933|    101|  }
 2934|       |
 2935|    101|#if OMPT_SUPPORT && OMPT_OPTIONAL
 2936|       |  // This is the case, if called from omp_init_lock_with_hint:
 2937|    101|  void *codeptr = OMPT_LOAD_RETURN_ADDRESS(gtid);
  ------------------
  |  |   93|    101|#define OMPT_LOAD_RETURN_ADDRESS(gtid) __ompt_load_return_address(gtid)
  ------------------
 2938|    101|  if (!codeptr)
  ------------------
  |  Branch (2938:7): [True: 101, False: 0]
  ------------------
 2939|    101|    codeptr = OMPT_GET_RETURN_ADDRESS(0);
  ------------------
  |  |  108|    101|#define OMPT_GET_RETURN_ADDRESS(level) __builtin_return_address(level)
  ------------------
 2940|    101|  if (ompt_enabled.ompt_callback_mutex_released) {
  ------------------
  |  Branch (2940:7): [True: 0, False: 101]
  ------------------
 2941|      0|    ompt_callbacks.ompt_callback(ompt_callback_mutex_released)(
  ------------------
  |  |   27|      0|#define ompt_callback(e) e##_callback
  ------------------
 2942|      0|        ompt_mutex_lock, (ompt_wait_id_t)(uintptr_t)user_lock, codeptr);
 2943|      0|  }
 2944|    101|#endif
 2945|       |
 2946|       |#else // KMP_USE_DYNAMIC_LOCK
 2947|       |
 2948|       |  kmp_user_lock_p lck;
 2949|       |
 2950|       |  /* Can't use serial interval since not block structured */
 2951|       |  /* release the lock */
 2952|       |
 2953|       |  if ((__kmp_user_lock_kind == lk_tas) &&
 2954|       |      (sizeof(lck->tas.lk.poll) <= OMP_LOCK_T_SIZE)) {
 2955|       |#if KMP_OS_LINUX &&                                                            \
 2956|       |    (KMP_ARCH_X86 || KMP_ARCH_X86_64 || KMP_ARCH_ARM || KMP_ARCH_AARCH64)
 2957|       |// "fast" path implemented to fix customer performance issue
 2958|       |#if USE_ITT_BUILD
 2959|       |    __kmp_itt_lock_releasing((kmp_user_lock_p)user_lock);
 2960|       |#endif /* USE_ITT_BUILD */
 2961|       |    TCW_4(((kmp_user_lock_p)user_lock)->tas.lk.poll, 0);
 2962|       |    KMP_MB();
 2963|       |
 2964|       |#if OMPT_SUPPORT && OMPT_OPTIONAL
 2965|       |    // This is the case, if called from omp_init_lock_with_hint:
 2966|       |    void *codeptr = OMPT_LOAD_RETURN_ADDRESS(gtid);
 2967|       |    if (!codeptr)
 2968|       |      codeptr = OMPT_GET_RETURN_ADDRESS(0);
 2969|       |    if (ompt_enabled.ompt_callback_mutex_released) {
 2970|       |      ompt_callbacks.ompt_callback(ompt_callback_mutex_released)(
 2971|       |          ompt_mutex_lock, (ompt_wait_id_t)(uintptr_t)lck, codeptr);
 2972|       |    }
 2973|       |#endif
 2974|       |
 2975|       |    return;
 2976|       |#else
 2977|       |    lck = (kmp_user_lock_p)user_lock;
 2978|       |#endif
 2979|       |  }
 2980|       |#if KMP_USE_FUTEX
 2981|       |  else if ((__kmp_user_lock_kind == lk_futex) &&
 2982|       |           (sizeof(lck->futex.lk.poll) <= OMP_LOCK_T_SIZE)) {
 2983|       |    lck = (kmp_user_lock_p)user_lock;
 2984|       |  }
 2985|       |#endif
 2986|       |  else {
 2987|       |    lck = __kmp_lookup_user_lock(user_lock, "omp_unset_lock");
 2988|       |  }
 2989|       |
 2990|       |#if USE_ITT_BUILD
 2991|       |  __kmp_itt_lock_releasing(lck);
 2992|       |#endif /* USE_ITT_BUILD */
 2993|       |
 2994|       |  RELEASE_LOCK(lck, gtid);
 2995|       |
 2996|       |#if OMPT_SUPPORT && OMPT_OPTIONAL
 2997|       |  // This is the case, if called from omp_init_lock_with_hint:
 2998|       |  void *codeptr = OMPT_LOAD_RETURN_ADDRESS(gtid);
 2999|       |  if (!codeptr)
 3000|       |    codeptr = OMPT_GET_RETURN_ADDRESS(0);
 3001|       |  if (ompt_enabled.ompt_callback_mutex_released) {
 3002|       |    ompt_callbacks.ompt_callback(ompt_callback_mutex_released)(
 3003|       |        ompt_mutex_lock, (ompt_wait_id_t)(uintptr_t)lck, codeptr);
 3004|       |  }
 3005|       |#endif
 3006|       |
 3007|       |#endif // KMP_USE_DYNAMIC_LOCK
 3008|    101|}
kmp_csupport.cpp:_ZL25__kmp_init_lock_with_hintP5identPPv18kmp_dyna_lockseq_t:
 2315|  2.66k|                                                    kmp_dyna_lockseq_t seq) {
 2316|  2.66k|  if (KMP_IS_D_LOCK(seq)) {
  ------------------
  |  | 1104|  2.66k|  ((seq) >= KMP_FIRST_D_LOCK && (seq) <= KMP_LAST_D_LOCK)
  |  |  ------------------
  |  |  |  | 1077|  5.33k|#define KMP_FIRST_D_LOCK lockseq_tas
  |  |  ------------------
  |  |                 ((seq) >= KMP_FIRST_D_LOCK && (seq) <= KMP_LAST_D_LOCK)
  |  |  ------------------
  |  |  |  | 1057|  2.66k|#define KMP_LAST_D_LOCK lockseq_rtm_spin
  |  |  ------------------
  |  |  |  Branch (1104:4): [True: 2.66k, False: 0]
  |  |  |  Branch (1104:33): [True: 0, False: 2.66k]
  |  |  ------------------
  ------------------
 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|  2.66k|  } else {
 2322|  2.66k|    KMP_INIT_I_LOCK(lock, seq);
  ------------------
  |  | 1162|  2.66k|  __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|  2.66k|  }
 2328|  2.66k|}

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

__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|  5.34k|int __kmp_acquire_ticket_lock(kmp_ticket_lock_t *lck, kmp_int32 gtid) {
  645|  5.34k|  int retval = __kmp_acquire_ticket_lock_timed_template(lck, gtid);
  646|  5.34k|  return retval;
  647|  5.34k|}
__kmp_release_ticket_lock:
  714|  5.34k|int __kmp_release_ticket_lock(kmp_ticket_lock_t *lck, kmp_int32 gtid) {
  715|  5.34k|  kmp_uint32 distance = std::atomic_load_explicit(&lck->lk.next_ticket,
  716|  5.34k|                                                  std::memory_order_relaxed) -
  717|  5.34k|                        std::atomic_load_explicit(&lck->lk.now_serving,
  718|  5.34k|                                                  std::memory_order_relaxed);
  719|       |
  720|  5.34k|  std::atomic_fetch_add_explicit(&lck->lk.now_serving, 1U,
  721|  5.34k|                                 std::memory_order_release);
  722|       |
  723|  5.34k|  KMP_YIELD(distance >
  ------------------
  |  | 1529|  5.34k|  {                                                                            \
  |  | 1530|  5.34k|    KMP_CPU_PAUSE();                                                           \
  |  |  ------------------
  |  |  |  | 1498|  5.34k|#define KMP_CPU_PAUSE() __kmp_x86_pause()
  |  |  ------------------
  |  | 1531|  10.6k|    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: 5.34k]
  |  |  |  Branch (1531:10): [True: 1.17k, False: 4.17k]
  |  |  ------------------
  |  | 1532|  5.34k|      __kmp_yield();                                                           \
  |  | 1533|  5.34k|  }
  ------------------
  724|  5.34k|            (kmp_uint32)(__kmp_avail_proc ? __kmp_avail_proc : __kmp_xproc));
  725|  5.34k|  return KMP_LOCK_RELEASED;
  ------------------
  |  |  156|  5.34k|#define KMP_LOCK_RELEASED 1
  ------------------
  726|  5.34k|}
__kmp_init_ticket_lock:
  753|      6|void __kmp_init_ticket_lock(kmp_ticket_lock_t *lck) {
  754|       |  lck->lk.location = NULL;
  755|      6|  lck->lk.self = lck;
  756|      6|  std::atomic_store_explicit(&lck->lk.next_ticket, 0U,
  757|      6|                             std::memory_order_relaxed);
  758|      6|  std::atomic_store_explicit(&lck->lk.now_serving, 0U,
  759|      6|                             std::memory_order_relaxed);
  760|      6|  std::atomic_store_explicit(
  761|      6|      &lck->lk.owner_id, 0,
  762|      6|      std::memory_order_relaxed); // no thread owns the lock.
  763|      6|  std::atomic_store_explicit(
  764|      6|      &lck->lk.depth_locked, -1,
  765|      6|      std::memory_order_relaxed); // -1 => not a nested lock.
  766|      6|  std::atomic_store_explicit(&lck->lk.initialized, true,
  767|      6|                             std::memory_order_release);
  768|      6|}
__kmp_acquire_queuing_lock:
 1277|    101|int __kmp_acquire_queuing_lock(kmp_queuing_lock_t *lck, kmp_int32 gtid) {
 1278|    101|  KMP_DEBUG_ASSERT(gtid >= 0);
 1279|       |
 1280|    101|  int retval = __kmp_acquire_queuing_lock_timed_template<false>(lck, gtid);
 1281|    101|  return retval;
 1282|    101|}
__kmp_release_queuing_lock:
 1353|    101|int __kmp_release_queuing_lock(kmp_queuing_lock_t *lck, kmp_int32 gtid) {
 1354|    101|  volatile kmp_int32 *head_id_p = &lck->lk.head_id;
 1355|    101|  volatile kmp_int32 *tail_id_p = &lck->lk.tail_id;
 1356|       |
 1357|    101|  KA_TRACE(1000,
 1358|    101|           ("__kmp_release_queuing_lock: lck:%p, T#%d entering\n", lck, gtid));
 1359|    101|  KMP_DEBUG_ASSERT(gtid >= 0);
 1360|       |#if KMP_DEBUG || DEBUG_QUEUING_LOCKS
 1361|       |  kmp_info_t *this_thr = __kmp_thread_from_gtid(gtid);
 1362|       |#endif
 1363|    101|  KMP_DEBUG_ASSERT(this_thr != NULL);
 1364|       |#ifdef DEBUG_QUEUING_LOCKS
 1365|       |  TRACE_LOCK(gtid + 1, "rel ent");
 1366|       |
 1367|       |  if (this_thr->th.th_spin_here)
 1368|       |    __kmp_dump_queuing_lock(this_thr, gtid, lck, *head_id_p, *tail_id_p);
 1369|       |  if (this_thr->th.th_next_waiting != 0)
 1370|       |    __kmp_dump_queuing_lock(this_thr, gtid, lck, *head_id_p, *tail_id_p);
 1371|       |#endif
 1372|    101|  KMP_DEBUG_ASSERT(!this_thr->th.th_spin_here);
 1373|    101|  KMP_DEBUG_ASSERT(this_thr->th.th_next_waiting == 0);
 1374|       |
 1375|    101|  KMP_FSYNC_RELEASING(lck);
  ------------------
  |  |  335|    101|#define KMP_FSYNC_RELEASING(obj) ((void)0)
  ------------------
 1376|       |
 1377|    101|  while (1) {
  ------------------
  |  Branch (1377:10): [True: 101, Folded]
  ------------------
 1378|    101|    kmp_int32 dequeued;
 1379|    101|    kmp_int32 head;
 1380|    101|    kmp_int32 tail;
 1381|       |
 1382|    101|    head = *head_id_p;
 1383|       |
 1384|       |#ifdef DEBUG_QUEUING_LOCKS
 1385|       |    tail = *tail_id_p;
 1386|       |    TRACE_LOCK_HT(gtid + 1, "rel read: ", head, tail);
 1387|       |    if (head == 0)
 1388|       |      __kmp_dump_queuing_lock(this_thr, gtid, lck, head, tail);
 1389|       |#endif
 1390|    101|    KMP_DEBUG_ASSERT(head !=
 1391|    101|                     0); /* holding the lock, head must be -1 or queue head */
 1392|       |
 1393|    101|    if (head == -1) { /* nobody on queue */
  ------------------
  |  Branch (1393:9): [True: 101, False: 0]
  ------------------
 1394|       |      /* try (-1,0)->(0,0) */
 1395|    101|      if (KMP_COMPARE_AND_STORE_REL32(head_id_p, -1, 0)) {
  ------------------
  |  |  810|    101|  __sync_bool_compare_and_swap((volatile kmp_uint32 *)(p), (kmp_uint32)(cv),   \
  |  |  ------------------
  |  |  |  Branch (810:3): [True: 101, False: 0]
  |  |  ------------------
  |  |  811|    101|                               (kmp_uint32)(sv))
  ------------------
 1396|    101|        KA_TRACE(
 1397|    101|            1000,
 1398|    101|            ("__kmp_release_queuing_lock: lck:%p, T#%d exiting: queue empty\n",
 1399|    101|             lck, gtid));
 1400|       |#ifdef DEBUG_QUEUING_LOCKS
 1401|       |        TRACE_LOCK_HT(gtid + 1, "rel exit: ", 0, 0);
 1402|       |#endif
 1403|       |
 1404|    101|#if OMPT_SUPPORT
 1405|       |/* nothing to do - no other thread is trying to shift blame */
 1406|    101|#endif
 1407|    101|        return KMP_LOCK_RELEASED;
  ------------------
  |  |  156|    101|#define KMP_LOCK_RELEASED 1
  ------------------
 1408|    101|      }
 1409|      0|      dequeued = FALSE;
  ------------------
  |  | 1279|      0|#define FALSE 0
  ------------------
 1410|      0|    } else {
 1411|      0|      KMP_MB();
 1412|      0|      tail = *tail_id_p;
 1413|      0|      if (head == tail) { /* only one thread on the queue */
  ------------------
  |  Branch (1413:11): [True: 0, False: 0]
  ------------------
 1414|       |#ifdef DEBUG_QUEUING_LOCKS
 1415|       |        if (head <= 0)
 1416|       |          __kmp_dump_queuing_lock(this_thr, gtid, lck, head, tail);
 1417|       |#endif
 1418|      0|        KMP_DEBUG_ASSERT(head > 0);
 1419|       |
 1420|       |        /* try (h,h)->(-1,0) */
 1421|      0|        dequeued = KMP_COMPARE_AND_STORE_REL64(
  ------------------
  |  |  853|      0|  __sync_bool_compare_and_swap((volatile kmp_uint64 *)(p), (kmp_uint64)(cv),   \
  |  |  854|      0|                               (kmp_uint64)(sv))
  ------------------
 1422|      0|            RCAST(volatile kmp_int64 *, tail_id_p), KMP_PACK_64(head, head),
 1423|      0|            KMP_PACK_64(-1, 0));
 1424|       |#ifdef DEBUG_QUEUING_LOCKS
 1425|       |        TRACE_LOCK(gtid + 1, "rel deq: (h,h)->(-1,0)");
 1426|       |#endif
 1427|       |
 1428|      0|      } else {
 1429|      0|        volatile kmp_int32 *waiting_id_p;
 1430|      0|        kmp_info_t *head_thr = __kmp_thread_from_gtid(head - 1);
 1431|      0|        KMP_DEBUG_ASSERT(head_thr != NULL);
 1432|      0|        waiting_id_p = &head_thr->th.th_next_waiting;
 1433|       |
 1434|       |/* Does this require synchronous reads? */
 1435|       |#ifdef DEBUG_QUEUING_LOCKS
 1436|       |        if (head <= 0 || tail <= 0)
 1437|       |          __kmp_dump_queuing_lock(this_thr, gtid, lck, head, tail);
 1438|       |#endif
 1439|      0|        KMP_DEBUG_ASSERT(head > 0 && tail > 0);
 1440|       |
 1441|       |        /* try (h,t)->(h',t) or (t,t) */
 1442|      0|        KMP_MB();
 1443|       |        /* make sure enqueuing thread has time to update next waiting thread
 1444|       |         * field */
 1445|      0|        *head_id_p =
 1446|      0|            KMP_WAIT((volatile kmp_uint32 *)waiting_id_p, 0, KMP_NEQ, NULL);
  ------------------
  |  | 1183|      0|#define KMP_WAIT __kmp_wait_4
  ------------------
                          KMP_WAIT((volatile kmp_uint32 *)waiting_id_p, 0, KMP_NEQ, NULL);
  ------------------
  |  | 1186|      0|#define KMP_NEQ __kmp_neq_4
  ------------------
 1447|       |#ifdef DEBUG_QUEUING_LOCKS
 1448|       |        TRACE_LOCK(gtid + 1, "rel deq: (h,t)->(h',t)");
 1449|       |#endif
 1450|      0|        dequeued = TRUE;
  ------------------
  |  | 1280|      0|#define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  | 1279|      0|#define FALSE 0
  |  |  ------------------
  ------------------
 1451|      0|      }
 1452|      0|    }
 1453|       |
 1454|      0|    if (dequeued) {
  ------------------
  |  Branch (1454:9): [True: 0, False: 0]
  ------------------
 1455|      0|      kmp_info_t *head_thr = __kmp_thread_from_gtid(head - 1);
 1456|      0|      KMP_DEBUG_ASSERT(head_thr != NULL);
 1457|       |
 1458|       |/* Does this require synchronous reads? */
 1459|       |#ifdef DEBUG_QUEUING_LOCKS
 1460|       |      if (head <= 0 || tail <= 0)
 1461|       |        __kmp_dump_queuing_lock(this_thr, gtid, lck, head, tail);
 1462|       |#endif
 1463|      0|      KMP_DEBUG_ASSERT(head > 0 && tail > 0);
 1464|       |
 1465|       |      /* For clean code only. Thread not released until next statement prevents
 1466|       |         race with acquire code. */
 1467|      0|      head_thr->th.th_next_waiting = 0;
 1468|       |#ifdef DEBUG_QUEUING_LOCKS
 1469|       |      TRACE_LOCK_T(gtid + 1, "rel nw=0 for t=", head);
 1470|       |#endif
 1471|       |
 1472|      0|      KMP_MB();
 1473|       |      /* reset spin value */
 1474|      0|      head_thr->th.th_spin_here = FALSE;
  ------------------
  |  | 1279|      0|#define FALSE 0
  ------------------
 1475|       |
 1476|      0|      KA_TRACE(1000, ("__kmp_release_queuing_lock: lck:%p, T#%d exiting: after "
 1477|      0|                      "dequeuing\n",
 1478|      0|                      lck, gtid));
 1479|       |#ifdef DEBUG_QUEUING_LOCKS
 1480|       |      TRACE_LOCK(gtid + 1, "rel exit 2");
 1481|       |#endif
 1482|      0|      return KMP_LOCK_RELEASED;
  ------------------
  |  |  156|      0|#define KMP_LOCK_RELEASED 1
  ------------------
 1483|      0|    }
 1484|       |    /* KMP_CPU_PAUSE(); don't want to make releasing thread hold up acquiring
 1485|       |       threads */
 1486|       |
 1487|       |#ifdef DEBUG_QUEUING_LOCKS
 1488|       |    TRACE_LOCK(gtid + 1, "rel retry");
 1489|       |#endif
 1490|       |
 1491|      0|  } /* while */
 1492|      0|  KMP_ASSERT2(0, "should not get here");
  ------------------
  |  |   53|      0|#define KMP_ASSERT2(cond, msg) KMP_ASSERT(cond)
  |  |  ------------------
  |  |  |  |   50|      0|  if (!(cond)) {                                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (50:7): [True: 0, Folded]
  |  |  |  |  ------------------
  |  |  |  |   51|      0|    __kmp_debug_assert("assertion failure", __FILE__, __LINE__);               \
  |  |  |  |   52|      0|  }
  |  |  ------------------
  ------------------
 1493|      0|  return KMP_LOCK_RELEASED;
  ------------------
  |  |  156|      0|#define KMP_LOCK_RELEASED 1
  ------------------
 1494|    101|}
__kmp_init_queuing_lock:
 1516|  2.68k|void __kmp_init_queuing_lock(kmp_queuing_lock_t *lck) {
 1517|  2.68k|  lck->lk.location = NULL;
 1518|  2.68k|  lck->lk.head_id = 0;
 1519|  2.68k|  lck->lk.tail_id = 0;
 1520|  2.68k|  lck->lk.next_ticket = 0;
 1521|  2.68k|  lck->lk.now_serving = 0;
 1522|  2.68k|  lck->lk.owner_id = 0; // no thread owns the lock.
 1523|  2.68k|  lck->lk.depth_locked = -1; // >= 0 for nestable locks, -1 for simple locks.
 1524|  2.68k|  lck->lk.initialized = lck;
 1525|       |
 1526|  2.68k|  KA_TRACE(1000, ("__kmp_init_queuing_lock: lock %p initialized\n", lck));
 1527|  2.68k|}
__kmp_destroy_queuing_lock:
 1529|  2.66k|void __kmp_destroy_queuing_lock(kmp_queuing_lock_t *lck) {
 1530|  2.66k|  lck->lk.initialized = NULL;
 1531|       |  lck->lk.location = NULL;
 1532|  2.66k|  lck->lk.head_id = 0;
 1533|  2.66k|  lck->lk.tail_id = 0;
 1534|  2.66k|  lck->lk.next_ticket = 0;
 1535|  2.66k|  lck->lk.now_serving = 0;
 1536|  2.66k|  lck->lk.owner_id = 0;
 1537|  2.66k|  lck->lk.depth_locked = -1;
 1538|  2.66k|}
__kmp_allocate_indirect_lock:
 3122|  2.66k|                                                  kmp_indirect_locktag_t tag) {
 3123|  2.66k|  kmp_indirect_lock_t *lck;
 3124|  2.66k|  kmp_lock_index_t idx, table_idx;
 3125|       |
 3126|  2.66k|  __kmp_acquire_lock(&__kmp_global_lock, gtid);
 3127|       |
 3128|  2.66k|  if (__kmp_indirect_lock_pool[tag] != NULL) {
  ------------------
  |  Branch (3128:7): [True: 2.66k, False: 2]
  ------------------
 3129|       |    // Reuse the allocated and destroyed lock object
 3130|  2.66k|    lck = __kmp_indirect_lock_pool[tag];
 3131|  2.66k|    if (OMP_LOCK_T_SIZE < sizeof(void *))
  ------------------
  |  |   54|  2.66k|#define OMP_LOCK_T_SIZE sizeof(int)
  ------------------
  |  Branch (3131:9): [True: 2.66k, Folded]
  ------------------
 3132|  2.66k|      idx = lck->lock->pool.index;
 3133|  2.66k|    __kmp_indirect_lock_pool[tag] = (kmp_indirect_lock_t *)lck->lock->pool.next;
 3134|  2.66k|    KA_TRACE(20, ("__kmp_allocate_indirect_lock: reusing an existing lock %p\n",
 3135|  2.66k|                  lck));
 3136|  2.66k|  } 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|  2.66k|  __kmp_release_lock(&__kmp_global_lock, gtid);
 3179|       |
 3180|  2.66k|  lck->type = tag;
 3181|       |
 3182|  2.66k|  if (OMP_LOCK_T_SIZE < sizeof(void *)) {
  ------------------
  |  |   54|  2.66k|#define OMP_LOCK_T_SIZE sizeof(int)
  ------------------
  |  Branch (3182:7): [True: 2.66k, Folded]
  ------------------
 3183|  2.66k|    *((kmp_lock_index_t *)user_lock) = idx
 3184|  2.66k|                                       << 1; // indirect lock word must be even
 3185|  2.66k|  } else {
 3186|      0|    *((kmp_indirect_lock_t **)user_lock) = lck;
 3187|      0|  }
 3188|       |
 3189|  2.66k|  return lck;
 3190|  2.66k|}
__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|  5.34k|                                         kmp_int32 gtid) {
  626|  5.34k|  kmp_uint32 my_ticket = std::atomic_fetch_add_explicit(
  627|  5.34k|      &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|  5.34k|  if (std::atomic_load_explicit(&lck->lk.now_serving,
  ------------------
  |  Branch (636:7): [True: 5.34k, False: 0]
  ------------------
  637|  5.34k|                                std::memory_order_acquire) == my_ticket) {
  638|  5.34k|    return KMP_LOCK_ACQUIRED_FIRST;
  ------------------
  |  |  158|  5.34k|#define KMP_LOCK_ACQUIRED_FIRST 1
  ------------------
  639|  5.34k|  }
  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|  5.34k|}
kmp_lock.cpp:_ZL23__kmp_init_queuing_lockP13kmp_user_lock:
 2953|  2.66k|  static void __kmp_##op##_##lk##_##lock(kmp_user_lock_p lock) {               \
 2954|  2.66k|    __kmp_##op##_##lk##_##lock(&lock->lk);                                     \
 2955|  2.66k|  }
kmp_lock.cpp:_ZL24__kmp_init_indirect_lockPj18kmp_dyna_lockseq_t:
 3220|  2.66k|                                     kmp_dyna_lockseq_t seq) {
 3221|  2.66k|#if KMP_USE_ADAPTIVE_LOCKS
 3222|  2.66k|  if (seq == lockseq_adaptive && !__kmp_cpuinfo.flags.rtm) {
  ------------------
  |  Branch (3222:7): [True: 0, False: 2.66k]
  |  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|  2.66k|#endif
 3227|  2.66k|#if KMP_USE_TSX
 3228|  2.66k|  if (seq == lockseq_rtm_queuing && !__kmp_cpuinfo.flags.rtm) {
  ------------------
  |  Branch (3228:7): [True: 0, False: 2.66k]
  |  Branch (3228:37): [True: 0, False: 0]
  ------------------
 3229|      0|    seq = lockseq_queuing;
 3230|      0|  }
 3231|  2.66k|#endif
 3232|  2.66k|  kmp_indirect_locktag_t tag = KMP_GET_I_TAG(seq);
  ------------------
  |  | 1107|  2.66k|#define KMP_GET_I_TAG(seq) (kmp_indirect_locktag_t)((seq)-KMP_FIRST_I_LOCK)
  |  |  ------------------
  |  |  |  | 1078|  2.66k|#define KMP_FIRST_I_LOCK lockseq_ticket
  |  |  ------------------
  ------------------
 3233|  2.66k|  kmp_indirect_lock_t *l =
 3234|  2.66k|      __kmp_allocate_indirect_lock((void **)lock, __kmp_entry_gtid(), tag);
  ------------------
  |  | 3467|  2.66k|#define __kmp_entry_gtid() __kmp_get_global_thread_id_reg()
  ------------------
 3235|  2.66k|  KMP_I_LOCK_FUNC(l, init)(l->lock);
  ------------------
  |  | 1154|  2.66k|  __kmp_indirect_##op[((kmp_indirect_lock_t *)(l))->type]
  ------------------
 3236|  2.66k|  KA_TRACE(
 3237|  2.66k|      20, ("__kmp_init_indirect_lock: initialized indirect lock with type#%d\n",
 3238|  2.66k|           seq));
 3239|  2.66k|}
kmp_lock.cpp:_ZL26__kmp_lookup_indirect_lockPPvPKc:
 3194|  2.66k|__kmp_lookup_indirect_lock(void **user_lock, const char *func) {
 3195|  2.66k|  if (__kmp_env_consistency_check) {
  ------------------
  |  Branch (3195:7): [True: 0, False: 2.66k]
  ------------------
 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|  2.66k|  } else {
 3211|  2.66k|    if (OMP_LOCK_T_SIZE < sizeof(void *)) {
  ------------------
  |  |   54|  2.66k|#define OMP_LOCK_T_SIZE sizeof(int)
  ------------------
  |  Branch (3211:9): [True: 2.66k, Folded]
  ------------------
 3212|  2.66k|      return __kmp_get_i_lock(KMP_EXTRACT_I_INDEX(user_lock));
  ------------------
  |  | 1145|  2.66k|#define KMP_EXTRACT_I_INDEX(l) (*(kmp_lock_index_t *)(l) >> 1)
  ------------------
 3213|  2.66k|    } else {
 3214|      0|      return *((kmp_indirect_lock_t **)user_lock);
 3215|      0|    }
 3216|  2.66k|  }
 3217|  2.66k|}
kmp_lock.cpp:_ZL27__kmp_destroy_indirect_lockPj:
 3241|  2.66k|static void __kmp_destroy_indirect_lock(kmp_dyna_lock_t *lock) {
 3242|  2.66k|  kmp_uint32 gtid = __kmp_entry_gtid();
  ------------------
  |  | 3467|  2.66k|#define __kmp_entry_gtid() __kmp_get_global_thread_id_reg()
  ------------------
 3243|  2.66k|  kmp_indirect_lock_t *l =
 3244|  2.66k|      __kmp_lookup_indirect_lock((void **)lock, "omp_destroy_lock");
 3245|  2.66k|  KMP_I_LOCK_FUNC(l, destroy)(l->lock);
  ------------------
  |  | 1154|  2.66k|  __kmp_indirect_##op[((kmp_indirect_lock_t *)(l))->type]
  ------------------
 3246|  2.66k|  kmp_indirect_locktag_t tag = l->type;
 3247|       |
 3248|  2.66k|  __kmp_acquire_lock(&__kmp_global_lock, gtid);
 3249|       |
 3250|       |  // Use the base lock's space to keep the pool chain.
 3251|  2.66k|  l->lock->pool.next = (kmp_user_lock_p)__kmp_indirect_lock_pool[tag];
 3252|  2.66k|  if (OMP_LOCK_T_SIZE < sizeof(void *)) {
  ------------------
  |  |   54|  2.66k|#define OMP_LOCK_T_SIZE sizeof(int)
  ------------------
  |  Branch (3252:7): [True: 2.66k, Folded]
  ------------------
 3253|  2.66k|    l->lock->pool.index = KMP_EXTRACT_I_INDEX(lock);
  ------------------
  |  | 1145|  2.66k|#define KMP_EXTRACT_I_INDEX(l) (*(kmp_lock_index_t *)(l) >> 1)
  ------------------
 3254|  2.66k|  }
 3255|  2.66k|  __kmp_indirect_lock_pool[tag] = l;
 3256|       |
 3257|  2.66k|  __kmp_release_lock(&__kmp_global_lock, gtid);
 3258|  2.66k|}
kmp_lock.cpp:_ZL23__kmp_set_indirect_lockPji:
 3260|    101|static int __kmp_set_indirect_lock(kmp_dyna_lock_t *lock, kmp_int32 gtid) {
 3261|    101|  kmp_indirect_lock_t *l = KMP_LOOKUP_I_LOCK(lock);
  ------------------
  |  | 1264|    101|  ((OMP_LOCK_T_SIZE < sizeof(void *))                                          \
  |  |  ------------------
  |  |  |  |   54|    101|#define OMP_LOCK_T_SIZE sizeof(int)
  |  |  ------------------
  |  |  |  Branch (1264:4): [True: 101, Folded]
  |  |  ------------------
  |  | 1265|    101|       ? __kmp_get_i_lock(KMP_EXTRACT_I_INDEX(l))                              \
  |  |  ------------------
  |  |  |  | 1145|    101|#define KMP_EXTRACT_I_INDEX(l) (*(kmp_lock_index_t *)(l) >> 1)
  |  |  ------------------
  |  | 1266|    101|       : *((kmp_indirect_lock_t **)(l)))
  ------------------
 3262|    101|  return KMP_I_LOCK_FUNC(l, set)(l->lock, gtid);
  ------------------
  |  | 1154|    101|  __kmp_indirect_##op[((kmp_indirect_lock_t *)(l))->type]
  ------------------
 3263|    101|}
kmp_lock.cpp:_ZL25__kmp_unset_indirect_lockPji:
 3265|    101|static int __kmp_unset_indirect_lock(kmp_dyna_lock_t *lock, kmp_int32 gtid) {
 3266|    101|  kmp_indirect_lock_t *l = KMP_LOOKUP_I_LOCK(lock);
  ------------------
  |  | 1264|    101|  ((OMP_LOCK_T_SIZE < sizeof(void *))                                          \
  |  |  ------------------
  |  |  |  |   54|    101|#define OMP_LOCK_T_SIZE sizeof(int)
  |  |  ------------------
  |  |  |  Branch (1264:4): [True: 101, Folded]
  |  |  ------------------
  |  | 1265|    101|       ? __kmp_get_i_lock(KMP_EXTRACT_I_INDEX(l))                              \
  |  |  ------------------
  |  |  |  | 1145|    101|#define KMP_EXTRACT_I_INDEX(l) (*(kmp_lock_index_t *)(l) >> 1)
  |  |  ------------------
  |  | 1266|    101|       : *((kmp_indirect_lock_t **)(l)))
  ------------------
 3267|    101|  return KMP_I_LOCK_FUNC(l, unset)(l->lock, gtid);
  ------------------
  |  | 1154|    101|  __kmp_indirect_##op[((kmp_indirect_lock_t *)(l))->type]
  ------------------
 3268|    101|}
kmp_lock.cpp:_ZL26__kmp_acquire_queuing_lockP13kmp_user_locki:
 2958|    101|                                        kmp_int32 gtid) {                      \
 2959|    101|    return __kmp_##op##_##lk##_##lock(&lock->lk, gtid);                        \
 2960|    101|  }
kmp_lock.cpp:_ZL26__kmp_release_queuing_lockP13kmp_user_locki:
 2958|    101|                                        kmp_int32 gtid) {                      \
 2959|    101|    return __kmp_##op##_##lk##_##lock(&lock->lk, gtid);                        \
 2960|    101|  }
kmp_lock.cpp:_ZL26__kmp_destroy_queuing_lockP13kmp_user_lock:
 2953|  2.66k|  static void __kmp_##op##_##lk##_##lock(kmp_user_lock_p lock) {               \
 2954|  2.66k|    __kmp_##op##_##lk##_##lock(&lock->lk);                                     \
 2955|  2.66k|  }
kmp_lock.cpp:_ZL41__kmp_acquire_queuing_lock_timed_templateILb0EEiP16kmp_queuing_locki:
 1085|    101|                                          kmp_int32 gtid) {
 1086|    101|  kmp_info_t *this_thr = __kmp_thread_from_gtid(gtid);
 1087|    101|  volatile kmp_int32 *head_id_p = &lck->lk.head_id;
 1088|    101|  volatile kmp_int32 *tail_id_p = &lck->lk.tail_id;
 1089|    101|  volatile kmp_uint32 *spin_here_p;
 1090|       |
 1091|    101|#if OMPT_SUPPORT
 1092|    101|  ompt_state_t prev_state = ompt_state_undefined;
 1093|    101|#endif
 1094|       |
 1095|    101|  KA_TRACE(1000,
 1096|    101|           ("__kmp_acquire_queuing_lock: lck:%p, T#%d entering\n", lck, gtid));
 1097|       |
 1098|    101|  KMP_FSYNC_PREPARE(lck);
  ------------------
  |  |  332|    101|#define KMP_FSYNC_PREPARE(obj) ((void)0)
  ------------------
 1099|    101|  KMP_DEBUG_ASSERT(this_thr != NULL);
 1100|    101|  spin_here_p = &this_thr->th.th_spin_here;
 1101|       |
 1102|       |#ifdef DEBUG_QUEUING_LOCKS
 1103|       |  TRACE_LOCK(gtid + 1, "acq ent");
 1104|       |  if (*spin_here_p)
 1105|       |    __kmp_dump_queuing_lock(this_thr, gtid, lck, *head_id_p, *tail_id_p);
 1106|       |  if (this_thr->th.th_next_waiting != 0)
 1107|       |    __kmp_dump_queuing_lock(this_thr, gtid, lck, *head_id_p, *tail_id_p);
 1108|       |#endif
 1109|    101|  KMP_DEBUG_ASSERT(!*spin_here_p);
 1110|    101|  KMP_DEBUG_ASSERT(this_thr->th.th_next_waiting == 0);
 1111|       |
 1112|       |  /* The following st.rel to spin_here_p needs to precede the cmpxchg.acq to
 1113|       |     head_id_p that may follow, not just in execution order, but also in
 1114|       |     visibility order. This way, when a releasing thread observes the changes to
 1115|       |     the queue by this thread, it can rightly assume that spin_here_p has
 1116|       |     already been set to TRUE, so that when it sets spin_here_p to FALSE, it is
 1117|       |     not premature.  If the releasing thread sets spin_here_p to FALSE before
 1118|       |     this thread sets it to TRUE, this thread will hang. */
 1119|    101|  *spin_here_p = TRUE; /* before enqueuing to prevent race */
  ------------------
  |  | 1280|    101|#define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  | 1279|    101|#define FALSE 0
  |  |  ------------------
  ------------------
 1120|       |
 1121|    101|  while (1) {
  ------------------
  |  Branch (1121:10): [True: 101, Folded]
  ------------------
 1122|    101|    kmp_int32 enqueued;
 1123|    101|    kmp_int32 head;
 1124|    101|    kmp_int32 tail;
 1125|       |
 1126|    101|    head = *head_id_p;
 1127|       |
 1128|    101|    switch (head) {
 1129|       |
 1130|      0|    case -1: {
  ------------------
  |  Branch (1130:5): [True: 0, False: 101]
  ------------------
 1131|       |#ifdef DEBUG_QUEUING_LOCKS
 1132|       |      tail = *tail_id_p;
 1133|       |      TRACE_LOCK_HT(gtid + 1, "acq read: ", head, tail);
 1134|       |#endif
 1135|      0|      tail = 0; /* to make sure next link asynchronously read is not set
 1136|       |                accidentally; this assignment prevents us from entering the
 1137|       |                if ( t > 0 ) condition in the enqueued case below, which is not
 1138|       |                necessary for this state transition */
 1139|       |
 1140|       |      /* try (-1,0)->(tid,tid) */
 1141|      0|      enqueued = KMP_COMPARE_AND_STORE_ACQ64((volatile kmp_int64 *)tail_id_p,
  ------------------
  |  |  850|      0|  __sync_bool_compare_and_swap((volatile kmp_uint64 *)(p), (kmp_uint64)(cv),   \
  |  |  851|      0|                               (kmp_uint64)(sv))
  ------------------
 1142|      0|                                             KMP_PACK_64(-1, 0),
 1143|      0|                                             KMP_PACK_64(gtid + 1, gtid + 1));
 1144|       |#ifdef DEBUG_QUEUING_LOCKS
 1145|       |      if (enqueued)
 1146|       |        TRACE_LOCK(gtid + 1, "acq enq: (-1,0)->(tid,tid)");
 1147|       |#endif
 1148|      0|    } break;
 1149|       |
 1150|      0|    default: {
  ------------------
  |  Branch (1150:5): [True: 0, False: 101]
  ------------------
 1151|      0|      tail = *tail_id_p;
 1152|      0|      KMP_DEBUG_ASSERT(tail != gtid + 1);
 1153|       |
 1154|       |#ifdef DEBUG_QUEUING_LOCKS
 1155|       |      TRACE_LOCK_HT(gtid + 1, "acq read: ", head, tail);
 1156|       |#endif
 1157|       |
 1158|      0|      if (tail == 0) {
  ------------------
  |  Branch (1158:11): [True: 0, False: 0]
  ------------------
 1159|      0|        enqueued = FALSE;
  ------------------
  |  | 1279|      0|#define FALSE 0
  ------------------
 1160|      0|      } else {
 1161|       |        /* try (h,t) or (h,h)->(h,tid) */
 1162|      0|        enqueued = KMP_COMPARE_AND_STORE_ACQ32(tail_id_p, tail, gtid + 1);
  ------------------
  |  |  807|      0|  __sync_bool_compare_and_swap((volatile kmp_uint32 *)(p), (kmp_uint32)(cv),   \
  |  |  808|      0|                               (kmp_uint32)(sv))
  ------------------
 1163|       |
 1164|       |#ifdef DEBUG_QUEUING_LOCKS
 1165|       |        if (enqueued)
 1166|       |          TRACE_LOCK(gtid + 1, "acq enq: (h,t)->(h,tid)");
 1167|       |#endif
 1168|      0|      }
 1169|      0|    } break;
 1170|       |
 1171|    101|    case 0: /* empty queue */
  ------------------
  |  Branch (1171:5): [True: 101, False: 0]
  ------------------
 1172|    101|    {
 1173|    101|      kmp_int32 grabbed_lock;
 1174|       |
 1175|       |#ifdef DEBUG_QUEUING_LOCKS
 1176|       |      tail = *tail_id_p;
 1177|       |      TRACE_LOCK_HT(gtid + 1, "acq read: ", head, tail);
 1178|       |#endif
 1179|       |      /* try (0,0)->(-1,0) */
 1180|       |
 1181|       |      /* only legal transition out of head = 0 is head = -1 with no change to
 1182|       |       * tail */
 1183|    101|      grabbed_lock = KMP_COMPARE_AND_STORE_ACQ32(head_id_p, 0, -1);
  ------------------
  |  |  807|    101|  __sync_bool_compare_and_swap((volatile kmp_uint32 *)(p), (kmp_uint32)(cv),   \
  |  |  808|    101|                               (kmp_uint32)(sv))
  ------------------
 1184|       |
 1185|    101|      if (grabbed_lock) {
  ------------------
  |  Branch (1185:11): [True: 101, False: 0]
  ------------------
 1186|       |
 1187|    101|        *spin_here_p = FALSE;
  ------------------
  |  | 1279|    101|#define FALSE 0
  ------------------
 1188|       |
 1189|    101|        KA_TRACE(
 1190|    101|            1000,
 1191|    101|            ("__kmp_acquire_queuing_lock: lck:%p, T#%d exiting: no queuing\n",
 1192|    101|             lck, gtid));
 1193|       |#ifdef DEBUG_QUEUING_LOCKS
 1194|       |        TRACE_LOCK_HT(gtid + 1, "acq exit: ", head, 0);
 1195|       |#endif
 1196|       |
 1197|    101|#if OMPT_SUPPORT
 1198|    101|        if (ompt_enabled.enabled && prev_state != ompt_state_undefined) {
  ------------------
  |  Branch (1198:13): [True: 0, False: 101]
  |  Branch (1198:37): [True: 0, False: 0]
  ------------------
 1199|       |          /* change the state before clearing wait_id */
 1200|      0|          this_thr->th.ompt_thread_info.state = prev_state;
 1201|      0|          this_thr->th.ompt_thread_info.wait_id = 0;
 1202|      0|        }
 1203|    101|#endif
 1204|       |
 1205|    101|        KMP_FSYNC_ACQUIRED(lck);
  ------------------
  |  |  334|    101|#define KMP_FSYNC_ACQUIRED(obj) ((void)0)
  ------------------
 1206|    101|        return KMP_LOCK_ACQUIRED_FIRST; /* lock holder cannot be on queue */
  ------------------
  |  |  158|    101|#define KMP_LOCK_ACQUIRED_FIRST 1
  ------------------
 1207|    101|      }
 1208|      0|      enqueued = FALSE;
  ------------------
  |  | 1279|      0|#define FALSE 0
  ------------------
 1209|      0|    } break;
 1210|    101|    }
 1211|       |
 1212|      0|#if OMPT_SUPPORT
 1213|      0|    if (ompt_enabled.enabled && prev_state == ompt_state_undefined) {
  ------------------
  |  Branch (1213:9): [True: 0, False: 0]
  |  Branch (1213:33): [True: 0, False: 0]
  ------------------
 1214|       |      /* this thread will spin; set wait_id before entering wait state */
 1215|      0|      prev_state = this_thr->th.ompt_thread_info.state;
 1216|      0|      this_thr->th.ompt_thread_info.wait_id = (uint64_t)lck;
 1217|      0|      this_thr->th.ompt_thread_info.state = ompt_state_wait_lock;
 1218|      0|    }
 1219|      0|#endif
 1220|       |
 1221|      0|    if (enqueued) {
  ------------------
  |  Branch (1221:9): [True: 0, False: 0]
  ------------------
 1222|      0|      if (tail > 0) {
  ------------------
  |  Branch (1222:11): [True: 0, False: 0]
  ------------------
 1223|      0|        kmp_info_t *tail_thr = __kmp_thread_from_gtid(tail - 1);
 1224|      0|        KMP_ASSERT(tail_thr != NULL);
  ------------------
  |  |   50|      0|  if (!(cond)) {                                                               \
  |  |  ------------------
  |  |  |  Branch (50:7): [True: 0, False: 0]
  |  |  ------------------
  |  |   51|      0|    __kmp_debug_assert("assertion failure", __FILE__, __LINE__);               \
  |  |   52|      0|  }
  ------------------
 1225|      0|        tail_thr->th.th_next_waiting = gtid + 1;
 1226|       |        /* corresponding wait for this write in release code */
 1227|      0|      }
 1228|      0|      KA_TRACE(1000,
 1229|      0|               ("__kmp_acquire_queuing_lock: lck:%p, T#%d waiting for lock\n",
 1230|      0|                lck, gtid));
 1231|       |
 1232|      0|      KMP_MB();
 1233|       |      // ToDo: Use __kmp_wait_sleep or similar when blocktime != inf
 1234|      0|      KMP_WAIT(spin_here_p, FALSE, KMP_EQ, lck);
  ------------------
  |  | 1183|      0|#define KMP_WAIT __kmp_wait_4
  ------------------
                    KMP_WAIT(spin_here_p, FALSE, KMP_EQ, lck);
  ------------------
  |  | 1279|      0|#define FALSE 0
  ------------------
                    KMP_WAIT(spin_here_p, FALSE, KMP_EQ, lck);
  ------------------
  |  | 1185|      0|#define KMP_EQ __kmp_eq_4
  ------------------
 1235|       |      // Synchronize writes to both runtime thread structures
 1236|       |      // and writes in user code.
 1237|      0|      KMP_MB();
 1238|       |
 1239|       |#ifdef DEBUG_QUEUING_LOCKS
 1240|       |      TRACE_LOCK(gtid + 1, "acq spin");
 1241|       |
 1242|       |      if (this_thr->th.th_next_waiting != 0)
 1243|       |        __kmp_dump_queuing_lock(this_thr, gtid, lck, *head_id_p, *tail_id_p);
 1244|       |#endif
 1245|      0|      KMP_DEBUG_ASSERT(this_thr->th.th_next_waiting == 0);
 1246|      0|      KA_TRACE(1000, ("__kmp_acquire_queuing_lock: lck:%p, T#%d exiting: after "
 1247|      0|                      "waiting on queue\n",
 1248|      0|                      lck, gtid));
 1249|       |
 1250|       |#ifdef DEBUG_QUEUING_LOCKS
 1251|       |      TRACE_LOCK(gtid + 1, "acq exit 2");
 1252|       |#endif
 1253|       |
 1254|      0|#if OMPT_SUPPORT
 1255|       |      /* change the state before clearing wait_id */
 1256|      0|      this_thr->th.ompt_thread_info.state = prev_state;
 1257|      0|      this_thr->th.ompt_thread_info.wait_id = 0;
 1258|      0|#endif
 1259|       |
 1260|       |      /* got lock, we were dequeued by the thread that released lock */
 1261|      0|      return KMP_LOCK_ACQUIRED_FIRST;
  ------------------
  |  |  158|      0|#define KMP_LOCK_ACQUIRED_FIRST 1
  ------------------
 1262|      0|    }
 1263|       |
 1264|       |    /* Yield if number of threads > number of logical processors */
 1265|       |    /* ToDo: Not sure why this should only be in oversubscription case,
 1266|       |       maybe should be traditional YIELD_INIT/YIELD_WHEN loop */
 1267|      0|    KMP_YIELD_OVERSUB();
  ------------------
  |  | 1536|      0|  {                                                                            \
  |  | 1537|      0|    KMP_CPU_PAUSE();                                                           \
  |  |  ------------------
  |  |  |  | 1498|      0|#define KMP_CPU_PAUSE() __kmp_x86_pause()
  |  |  ------------------
  |  | 1538|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1539|      0|      __kmp_yield();                                                           \
  |  | 1540|      0|  }
  ------------------
 1268|       |
 1269|       |#ifdef DEBUG_QUEUING_LOCKS
 1270|       |    TRACE_LOCK(gtid + 1, "acq retry");
 1271|       |#endif
 1272|      0|  }
 1273|      0|  KMP_ASSERT2(0, "should not get here");
  ------------------
  |  |   53|      0|#define KMP_ASSERT2(cond, msg) KMP_ASSERT(cond)
  |  |  ------------------
  |  |  |  |   50|      0|  if (!(cond)) {                                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (50:7): [True: 0, Folded]
  |  |  |  |  ------------------
  |  |  |  |   51|      0|    __kmp_debug_assert("assertion failure", __FILE__, __LINE__);               \
  |  |  |  |   52|      0|  }
  |  |  ------------------
  ------------------
 1274|      0|  return KMP_LOCK_ACQUIRED_FIRST;
  ------------------
  |  |  158|      0|#define KMP_LOCK_ACQUIRED_FIRST 1
  ------------------
 1275|    101|}

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

__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|  11.4k|int __kmp_get_global_thread_id_reg() {
  228|  11.4k|  int gtid;
  229|       |
  230|  11.4k|  if (!__kmp_init_serial) {
  ------------------
  |  Branch (230:7): [True: 1, False: 11.4k]
  ------------------
  231|      1|    gtid = KMP_GTID_DNE;
  ------------------
  |  | 1000|      1|#define KMP_GTID_DNE (-2) /* Does not exist */
  ------------------
  232|      1|  } else
  233|  11.4k|#ifdef KMP_TDATA_GTID
  234|  11.4k|      if (TCR_4(__kmp_gtid_mode) >= 3) {
  ------------------
  |  | 1127|  11.4k|#define TCR_4(a) (a)
  ------------------
  |  Branch (234:11): [True: 11.4k, False: 0]
  ------------------
  235|  11.4k|    KA_TRACE(1000, ("*** __kmp_get_global_thread_id_reg: using TDATA\n"));
  236|  11.4k|    gtid = __kmp_gtid;
  237|  11.4k|  } 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|  11.4k|  if (gtid == KMP_GTID_DNE) {
  ------------------
  |  | 1000|  11.4k|#define KMP_GTID_DNE (-2) /* Does not exist */
  ------------------
  |  Branch (249:7): [True: 1, False: 11.4k]
  ------------------
  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|  11.4k|  KMP_DEBUG_ASSERT(gtid >= 0);
  265|       |
  266|  11.4k|  return gtid;
  267|  11.4k|}
__kmp_check_stack_overlap:
  270|      1|void __kmp_check_stack_overlap(kmp_info_t *th) {
  271|      1|  int f;
  272|      1|  char *stack_beg = NULL;
  273|      1|  char *stack_end = NULL;
  274|      1|  int gtid;
  275|       |
  276|      1|  KA_TRACE(10, ("__kmp_check_stack_overlap: called\n"));
  277|      1|  if (__kmp_storage_map) {
  ------------------
  |  Branch (277:7): [True: 0, False: 1]
  ------------------
  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|      1|  gtid = __kmp_gtid_from_thread(th);
  299|      1|  if (__kmp_env_checks == TRUE && !KMP_UBER_GTID(gtid)) {
  ------------------
  |  | 1280|      2|#define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  | 1279|      1|#define FALSE 0
  |  |  ------------------
  ------------------
  |  Branch (299:7): [True: 0, False: 1]
  |  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|      1|  KA_TRACE(10, ("__kmp_check_stack_overlap: returning\n"));
  332|      1|}
__kmp_serialized_parallel:
 1113|    121|void __kmp_serialized_parallel(ident_t *loc, kmp_int32 global_tid) {
 1114|    121|  kmp_info_t *this_thr;
 1115|    121|  kmp_team_t *serial_team;
 1116|       |
 1117|    121|  KC_TRACE(10, ("__kmpc_serialized_parallel: called by T#%d\n", global_tid));
 1118|       |
 1119|       |  /* Skip all this code for autopar serialized loops since it results in
 1120|       |     unacceptable overhead */
 1121|    121|  if (loc != NULL && (loc->flags & KMP_IDENT_AUTOPAR))
  ------------------
  |  Branch (1121:7): [True: 121, False: 0]
  |  Branch (1121:22): [True: 0, False: 121]
  ------------------
 1122|      0|    return;
 1123|       |
 1124|    121|  if (!TCR_4(__kmp_init_parallel))
  ------------------
  |  | 1127|    121|#define TCR_4(a) (a)
  ------------------
  |  Branch (1124:7): [True: 0, False: 121]
  ------------------
 1125|      0|    __kmp_parallel_initialize();
 1126|    121|  __kmp_resume_if_soft_paused();
 1127|       |
 1128|    121|  this_thr = __kmp_threads[global_tid];
 1129|    121|  serial_team = this_thr->th.th_serial_team;
 1130|       |
 1131|       |  /* utilize the serialized team held by this thread */
 1132|    121|  KMP_DEBUG_ASSERT(serial_team);
 1133|    121|  KMP_MB();
 1134|       |
 1135|    121|  if (__kmp_tasking_mode != tskm_immediate_exec) {
  ------------------
  |  Branch (1135:7): [True: 121, False: 0]
  ------------------
 1136|    121|    KMP_DEBUG_ASSERT(
 1137|    121|        this_thr->th.th_task_team ==
 1138|    121|        this_thr->th.th_team->t.t_task_team[this_thr->th.th_task_state]);
 1139|    121|    KMP_DEBUG_ASSERT(serial_team->t.t_task_team[this_thr->th.th_task_state] ==
 1140|    121|                     NULL);
 1141|    121|    KA_TRACE(20, ("__kmpc_serialized_parallel: T#%d pushing task_team %p / "
 1142|    121|                  "team %p, new task_team = NULL\n",
 1143|    121|                  global_tid, this_thr->th.th_task_team, this_thr->th.th_team));
 1144|    121|    this_thr->th.th_task_team = NULL;
 1145|    121|  }
 1146|       |
 1147|    121|  kmp_proc_bind_t proc_bind = this_thr->th.th_set_proc_bind;
 1148|    121|  if (this_thr->th.th_current_task->td_icvs.proc_bind == proc_bind_false) {
  ------------------
  |  Branch (1148:7): [True: 121, False: 0]
  ------------------
 1149|    121|    proc_bind = proc_bind_false;
 1150|    121|  } else if (proc_bind == proc_bind_default) {
  ------------------
  |  Branch (1150:14): [True: 0, False: 0]
  ------------------
 1151|       |    // No proc_bind clause was specified, so use the current value
 1152|       |    // of proc-bind-var for this parallel region.
 1153|      0|    proc_bind = this_thr->th.th_current_task->td_icvs.proc_bind;
 1154|      0|  }
 1155|       |  // Reset for next parallel region
 1156|    121|  this_thr->th.th_set_proc_bind = proc_bind_default;
 1157|       |
 1158|       |  // Reset num_threads for next parallel region
 1159|    121|  this_thr->th.th_set_nproc = 0;
 1160|       |
 1161|    121|#if OMPT_SUPPORT
 1162|    121|  ompt_data_t ompt_parallel_data = ompt_data_none;
  ------------------
  |  | 1408|    121|#define ompt_data_none {0}
  ------------------
 1163|    121|  void *codeptr = OMPT_LOAD_RETURN_ADDRESS(global_tid);
  ------------------
  |  |   93|    121|#define OMPT_LOAD_RETURN_ADDRESS(gtid) __ompt_load_return_address(gtid)
  ------------------
 1164|    121|  if (ompt_enabled.enabled &&
  ------------------
  |  Branch (1164:7): [True: 0, False: 121]
  ------------------
 1165|      0|      this_thr->th.ompt_thread_info.state != ompt_state_overhead) {
  ------------------
  |  Branch (1165:7): [True: 0, False: 0]
  ------------------
 1166|       |
 1167|      0|    ompt_task_info_t *parent_task_info;
 1168|      0|    parent_task_info = OMPT_CUR_TASK_INFO(this_thr);
  ------------------
  |  |   68|      0|#define OMPT_CUR_TASK_INFO(thr) (&((thr)->th.th_current_task->ompt_task_info))
  ------------------
 1169|       |
 1170|      0|    parent_task_info->frame.enter_frame.ptr = OMPT_GET_FRAME_ADDRESS(0);
  ------------------
  |  |  109|      0|#define OMPT_GET_FRAME_ADDRESS(level) __builtin_frame_address(level)
  ------------------
 1171|      0|    if (ompt_enabled.ompt_callback_parallel_begin) {
  ------------------
  |  Branch (1171:9): [True: 0, False: 0]
  ------------------
 1172|      0|      int team_size = 1;
 1173|       |
 1174|      0|      ompt_callbacks.ompt_callback(ompt_callback_parallel_begin)(
  ------------------
  |  |   27|      0|#define ompt_callback(e) e##_callback
  ------------------
 1175|      0|          &(parent_task_info->task_data), &(parent_task_info->frame),
 1176|      0|          &ompt_parallel_data, team_size,
 1177|      0|          ompt_parallel_invoker_program | ompt_parallel_team, codeptr);
 1178|      0|    }
 1179|      0|  }
 1180|    121|#endif // OMPT_SUPPORT
 1181|       |
 1182|    121|  if (this_thr->th.th_team != serial_team) {
  ------------------
  |  Branch (1182:7): [True: 121, False: 0]
  ------------------
 1183|       |    // Nested level will be an index in the nested nthreads array
 1184|    121|    int level = this_thr->th.th_team->t.t_level;
 1185|       |
 1186|    121|    if (serial_team->t.t_serialized) {
  ------------------
  |  Branch (1186:9): [True: 0, False: 121]
  ------------------
 1187|       |      /* this serial team was already used
 1188|       |         TODO increase performance by making this locks more specific */
 1189|      0|      kmp_team_t *new_team;
 1190|       |
 1191|      0|      __kmp_acquire_bootstrap_lock(&__kmp_forkjoin_lock);
 1192|       |
 1193|      0|      new_team =
 1194|      0|          __kmp_allocate_team(this_thr->th.th_root, 1, 1,
 1195|      0|#if OMPT_SUPPORT
 1196|      0|                              ompt_parallel_data,
 1197|      0|#endif
 1198|      0|                              proc_bind, &this_thr->th.th_current_task->td_icvs,
 1199|      0|                              0 USE_NESTED_HOT_ARG(NULL));
  ------------------
  |  |  165|      0|#define USE_NESTED_HOT_ARG(x) , x
  ------------------
 1200|      0|      __kmp_release_bootstrap_lock(&__kmp_forkjoin_lock);
 1201|      0|      KMP_ASSERT(new_team);
  ------------------
  |  |   50|      0|  if (!(cond)) {                                                               \
  |  |  ------------------
  |  |  |  Branch (50:7): [True: 0, False: 0]
  |  |  ------------------
  |  |   51|      0|    __kmp_debug_assert("assertion failure", __FILE__, __LINE__);               \
  |  |   52|      0|  }
  ------------------
 1202|       |
 1203|       |      /* setup new serialized team and install it */
 1204|      0|      new_team->t.t_threads[0] = this_thr;
 1205|      0|      new_team->t.t_parent = this_thr->th.th_team;
 1206|      0|      serial_team = new_team;
 1207|      0|      this_thr->th.th_serial_team = serial_team;
 1208|       |
 1209|      0|      KF_TRACE(
 1210|      0|          10,
 1211|      0|          ("__kmpc_serialized_parallel: T#%d allocated new serial team %p\n",
 1212|      0|           global_tid, serial_team));
 1213|       |
 1214|       |      /* TODO the above breaks the requirement that if we run out of resources,
 1215|       |         then we can still guarantee that serialized teams are ok, since we may
 1216|       |         need to allocate a new one */
 1217|    121|    } else {
 1218|    121|      KF_TRACE(
 1219|    121|          10,
 1220|    121|          ("__kmpc_serialized_parallel: T#%d reusing cached serial team %p\n",
 1221|    121|           global_tid, serial_team));
 1222|    121|    }
 1223|       |
 1224|       |    /* we have to initialize this serial team */
 1225|    121|    KMP_DEBUG_ASSERT(serial_team->t.t_threads);
 1226|    121|    KMP_DEBUG_ASSERT(serial_team->t.t_threads[0] == this_thr);
 1227|    121|    KMP_DEBUG_ASSERT(this_thr->th.th_team != serial_team);
 1228|    121|    serial_team->t.t_ident = loc;
 1229|    121|    serial_team->t.t_serialized = 1;
 1230|    121|    serial_team->t.t_nproc = 1;
 1231|    121|    serial_team->t.t_parent = this_thr->th.th_team;
 1232|    121|    serial_team->t.t_sched.sched = this_thr->th.th_team->t.t_sched.sched;
 1233|    121|    this_thr->th.th_team = serial_team;
 1234|    121|    serial_team->t.t_master_tid = this_thr->th.th_info.ds.ds_tid;
 1235|       |
 1236|    121|    KF_TRACE(10, ("__kmpc_serialized_parallel: T#%d curtask=%p\n", global_tid,
 1237|    121|                  this_thr->th.th_current_task));
 1238|    121|    KMP_ASSERT(this_thr->th.th_current_task->td_flags.executing == 1);
  ------------------
  |  |   50|    121|  if (!(cond)) {                                                               \
  |  |  ------------------
  |  |  |  Branch (50:7): [True: 0, False: 121]
  |  |  ------------------
  |  |   51|      0|    __kmp_debug_assert("assertion failure", __FILE__, __LINE__);               \
  |  |   52|      0|  }
  ------------------
 1239|    121|    this_thr->th.th_current_task->td_flags.executing = 0;
 1240|       |
 1241|    121|    __kmp_push_current_task_to_thread(this_thr, serial_team, 0);
 1242|       |
 1243|       |    /* TODO: GEH: do ICVs work for nested serialized teams? Don't we need an
 1244|       |       implicit task for each serialized task represented by
 1245|       |       team->t.t_serialized? */
 1246|    121|    copy_icvs(&this_thr->th.th_current_task->td_icvs,
 1247|    121|              &this_thr->th.th_current_task->td_parent->td_icvs);
 1248|       |
 1249|       |    // Thread value exists in the nested nthreads array for the next nested
 1250|       |    // level
 1251|    121|    if (__kmp_nested_nth.used && (level + 1 < __kmp_nested_nth.used)) {
  ------------------
  |  Branch (1251:9): [True: 0, False: 121]
  |  Branch (1251:34): [True: 0, False: 0]
  ------------------
 1252|      0|      this_thr->th.th_current_task->td_icvs.nproc =
 1253|      0|          __kmp_nested_nth.nth[level + 1];
 1254|      0|    }
 1255|       |
 1256|    121|    if (__kmp_nested_proc_bind.used &&
  ------------------
  |  Branch (1256:9): [True: 121, False: 0]
  ------------------
 1257|    121|        (level + 1 < __kmp_nested_proc_bind.used)) {
  ------------------
  |  Branch (1257:9): [True: 0, False: 121]
  ------------------
 1258|      0|      this_thr->th.th_current_task->td_icvs.proc_bind =
 1259|      0|          __kmp_nested_proc_bind.bind_types[level + 1];
 1260|      0|    }
 1261|       |
 1262|       |#if USE_DEBUGGER
 1263|       |    serial_team->t.t_pkfn = (microtask_t)(~0); // For the debugger.
 1264|       |#endif
 1265|    121|    this_thr->th.th_info.ds.ds_tid = 0;
 1266|       |
 1267|       |    /* set thread cache values */
 1268|    121|    this_thr->th.th_team_nproc = 1;
 1269|    121|    this_thr->th.th_team_master = this_thr;
 1270|    121|    this_thr->th.th_team_serialized = 1;
 1271|       |
 1272|    121|    serial_team->t.t_level = serial_team->t.t_parent->t.t_level + 1;
 1273|    121|    serial_team->t.t_active_level = serial_team->t.t_parent->t.t_active_level;
 1274|    121|    serial_team->t.t_def_allocator = this_thr->th.th_def_allocator; // save
 1275|       |
 1276|    121|    propagateFPControl(serial_team);
 1277|       |
 1278|       |    /* check if we need to allocate dispatch buffers stack */
 1279|    121|    KMP_DEBUG_ASSERT(serial_team->t.t_dispatch);
 1280|    121|    if (!serial_team->t.t_dispatch->th_disp_buffer) {
  ------------------
  |  Branch (1280:9): [True: 121, False: 0]
  ------------------
 1281|    121|      serial_team->t.t_dispatch->th_disp_buffer =
 1282|    121|          (dispatch_private_info_t *)__kmp_allocate(
  ------------------
  |  | 3617|    121|#define __kmp_allocate(size) ___kmp_allocate((size)KMP_SRC_LOC_CURR)
  ------------------
 1283|    121|              sizeof(dispatch_private_info_t));
 1284|    121|    }
 1285|    121|    this_thr->th.th_dispatch = serial_team->t.t_dispatch;
 1286|       |
 1287|    121|    KMP_MB();
 1288|       |
 1289|    121|  } else {
 1290|       |    /* this serialized team is already being used,
 1291|       |     * that's fine, just add another nested level */
 1292|      0|    KMP_DEBUG_ASSERT(this_thr->th.th_team == serial_team);
 1293|      0|    KMP_DEBUG_ASSERT(serial_team->t.t_threads);
 1294|      0|    KMP_DEBUG_ASSERT(serial_team->t.t_threads[0] == this_thr);
 1295|      0|    ++serial_team->t.t_serialized;
 1296|      0|    this_thr->th.th_team_serialized = serial_team->t.t_serialized;
 1297|       |
 1298|       |    // Nested level will be an index in the nested nthreads array
 1299|      0|    int level = this_thr->th.th_team->t.t_level;
 1300|       |    // Thread value exists in the nested nthreads array for the next nested
 1301|       |    // level
 1302|      0|    if (__kmp_nested_nth.used && (level + 1 < __kmp_nested_nth.used)) {
  ------------------
  |  Branch (1302:9): [True: 0, False: 0]
  |  Branch (1302:34): [True: 0, False: 0]
  ------------------
 1303|      0|      this_thr->th.th_current_task->td_icvs.nproc =
 1304|      0|          __kmp_nested_nth.nth[level + 1];
 1305|      0|    }
 1306|      0|    serial_team->t.t_level++;
 1307|      0|    KF_TRACE(10, ("__kmpc_serialized_parallel: T#%d increasing nesting level "
 1308|      0|                  "of serial team %p to %d\n",
 1309|      0|                  global_tid, serial_team, serial_team->t.t_level));
 1310|       |
 1311|       |    /* allocate/push dispatch buffers stack */
 1312|      0|    KMP_DEBUG_ASSERT(serial_team->t.t_dispatch);
 1313|      0|    {
 1314|      0|      dispatch_private_info_t *disp_buffer =
 1315|      0|          (dispatch_private_info_t *)__kmp_allocate(
  ------------------
  |  | 3617|      0|#define __kmp_allocate(size) ___kmp_allocate((size)KMP_SRC_LOC_CURR)
  ------------------
 1316|      0|              sizeof(dispatch_private_info_t));
 1317|      0|      disp_buffer->next = serial_team->t.t_dispatch->th_disp_buffer;
 1318|      0|      serial_team->t.t_dispatch->th_disp_buffer = disp_buffer;
 1319|      0|    }
 1320|      0|    this_thr->th.th_dispatch = serial_team->t.t_dispatch;
 1321|       |
 1322|      0|    KMP_MB();
 1323|      0|  }
 1324|    121|  KMP_CHECK_UPDATE(serial_team->t.t_cancel_request, cancel_noreq);
  ------------------
  |  | 2280|    121|  if ((a) != (b))                                                              \
  |  |  ------------------
  |  |  |  Branch (2280:7): [True: 0, False: 121]
  |  |  ------------------
  |  | 2281|    121|  (a) = (b)
  ------------------
 1325|       |
 1326|       |  // Perform the display affinity functionality for
 1327|       |  // serialized parallel regions
 1328|    121|  if (__kmp_display_affinity) {
  ------------------
  |  Branch (1328:7): [True: 0, False: 121]
  ------------------
 1329|      0|    if (this_thr->th.th_prev_level != serial_team->t.t_level ||
  ------------------
  |  Branch (1329:9): [True: 0, False: 0]
  ------------------
 1330|      0|        this_thr->th.th_prev_num_threads != 1) {
  ------------------
  |  Branch (1330:9): [True: 0, False: 0]
  ------------------
 1331|       |      // NULL means use the affinity-format-var ICV
 1332|      0|      __kmp_aux_display_affinity(global_tid, NULL);
 1333|      0|      this_thr->th.th_prev_level = serial_team->t.t_level;
 1334|      0|      this_thr->th.th_prev_num_threads = 1;
 1335|      0|    }
 1336|      0|  }
 1337|       |
 1338|    121|  if (__kmp_env_consistency_check)
  ------------------
  |  Branch (1338:7): [True: 0, False: 121]
  ------------------
 1339|      0|    __kmp_push_parallel(global_tid, NULL);
 1340|    121|#if OMPT_SUPPORT
 1341|    121|  serial_team->t.ompt_team_info.master_return_address = codeptr;
 1342|    121|  if (ompt_enabled.enabled &&
  ------------------
  |  Branch (1342:7): [True: 0, False: 121]
  ------------------
 1343|      0|      this_thr->th.ompt_thread_info.state != ompt_state_overhead) {
  ------------------
  |  Branch (1343:7): [True: 0, False: 0]
  ------------------
 1344|      0|    OMPT_CUR_TASK_INFO(this_thr)->frame.exit_frame.ptr =
  ------------------
  |  |   68|      0|#define OMPT_CUR_TASK_INFO(thr) (&((thr)->th.th_current_task->ompt_task_info))
  ------------------
 1345|      0|        OMPT_GET_FRAME_ADDRESS(0);
  ------------------
  |  |  109|      0|#define OMPT_GET_FRAME_ADDRESS(level) __builtin_frame_address(level)
  ------------------
 1346|       |
 1347|      0|    ompt_lw_taskteam_t lw_taskteam;
 1348|      0|    __ompt_lw_taskteam_init(&lw_taskteam, this_thr, global_tid,
 1349|      0|                            &ompt_parallel_data, codeptr);
 1350|       |
 1351|      0|    __ompt_lw_taskteam_link(&lw_taskteam, this_thr, 1);
 1352|       |    // don't use lw_taskteam after linking. content was swaped
 1353|       |
 1354|       |    /* OMPT implicit task begin */
 1355|      0|    if (ompt_enabled.ompt_callback_implicit_task) {
  ------------------
  |  Branch (1355:9): [True: 0, False: 0]
  ------------------
 1356|      0|      ompt_callbacks.ompt_callback(ompt_callback_implicit_task)(
  ------------------
  |  |   27|      0|#define ompt_callback(e) e##_callback
  ------------------
 1357|      0|          ompt_scope_begin, OMPT_CUR_TEAM_DATA(this_thr),
  ------------------
  |  |   73|      0|  (&((thr)->th.th_team->t.ompt_team_info.parallel_data))
  ------------------
 1358|      0|          OMPT_CUR_TASK_DATA(this_thr), 1, __kmp_tid_from_gtid(global_tid),
  ------------------
  |  |   70|      0|  (&((thr)->th.th_current_task->ompt_task_info.task_data))
  ------------------
 1359|      0|          ompt_task_implicit); // TODO: Can this be ompt_task_initial?
 1360|      0|      OMPT_CUR_TASK_INFO(this_thr)->thread_num =
  ------------------
  |  |   68|      0|#define OMPT_CUR_TASK_INFO(thr) (&((thr)->th.th_current_task->ompt_task_info))
  ------------------
 1361|      0|          __kmp_tid_from_gtid(global_tid);
 1362|      0|    }
 1363|       |
 1364|       |    /* OMPT state */
 1365|      0|    this_thr->th.ompt_thread_info.state = ompt_state_work_parallel;
 1366|      0|    OMPT_CUR_TASK_INFO(this_thr)->frame.exit_frame.ptr =
  ------------------
  |  |   68|      0|#define OMPT_CUR_TASK_INFO(thr) (&((thr)->th.th_current_task->ompt_task_info))
  ------------------
 1367|      0|        OMPT_GET_FRAME_ADDRESS(0);
  ------------------
  |  |  109|      0|#define OMPT_GET_FRAME_ADDRESS(level) __builtin_frame_address(level)
  ------------------
 1368|      0|  }
 1369|    121|#endif
 1370|    121|}
__kmp_fork_call:
 1863|    121|                    kmp_va_list ap) {
 1864|    121|  void **argv;
 1865|    121|  int i;
 1866|    121|  int master_tid;
 1867|    121|  int master_this_cons;
 1868|    121|  kmp_team_t *team;
 1869|    121|  kmp_team_t *parent_team;
 1870|    121|  kmp_info_t *master_th;
 1871|    121|  kmp_root_t *root;
 1872|    121|  int nthreads;
 1873|    121|  int master_active;
 1874|    121|  int master_set_numthreads;
 1875|    121|  int level;
 1876|    121|  int active_level;
 1877|    121|  int teams_level;
 1878|    121|#if KMP_NESTED_HOT_TEAMS
 1879|    121|  kmp_hot_team_ptr_t **p_hot_teams;
 1880|    121|#endif
 1881|    121|  { // KMP_TIME_BLOCK
 1882|    121|    KMP_TIME_DEVELOPER_PARTITIONED_BLOCK(KMP_fork_call);
  ------------------
  |  | 1008|    121|#define KMP_TIME_DEVELOPER_PARTITIONED_BLOCK(n) ((void)0)
  ------------------
 1883|    121|    KMP_COUNT_VALUE(OMP_PARALLEL_args, argc);
  ------------------
  |  | 1000|    121|#define KMP_COUNT_VALUE(n, v) ((void)0)
  ------------------
 1884|       |
 1885|    121|    KA_TRACE(20, ("__kmp_fork_call: enter T#%d\n", gtid));
 1886|    121|    if (__kmp_stkpadding > 0 && __kmp_root[gtid] != NULL) {
  ------------------
  |  Branch (1886:9): [True: 0, False: 121]
  |  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|    121|    KMP_DEBUG_ASSERT(
 1897|    121|        __kmp_init_serial); // AC: potentially unsafe, not in sync with shutdown
 1898|    121|    if (!TCR_4(__kmp_init_parallel))
  ------------------
  |  | 1127|    121|#define TCR_4(a) (a)
  ------------------
  |  Branch (1898:9): [True: 1, False: 120]
  ------------------
 1899|      1|      __kmp_parallel_initialize();
 1900|    121|    __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|    121|    master_th = __kmp_threads[gtid];
 1906|       |
 1907|    121|    parent_team = master_th->th.th_team;
 1908|    121|    master_tid = master_th->th.th_info.ds.ds_tid;
 1909|    121|    master_this_cons = master_th->th.th_local.this_construct;
 1910|    121|    root = master_th->th.th_root;
 1911|    121|    master_active = root->r.r_active;
 1912|    121|    master_set_numthreads = master_th->th.th_set_nproc;
 1913|       |
 1914|    121|#if OMPT_SUPPORT
 1915|    121|    ompt_data_t ompt_parallel_data = ompt_data_none;
  ------------------
  |  | 1408|    121|#define ompt_data_none {0}
  ------------------
 1916|    121|    ompt_data_t *parent_task_data;
 1917|    121|    ompt_frame_t *ompt_frame;
 1918|    121|    void *return_address = NULL;
 1919|       |
 1920|    121|    if (ompt_enabled.enabled) {
  ------------------
  |  Branch (1920:9): [True: 0, False: 121]
  ------------------
 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|    121|#endif
 1926|       |
 1927|       |    // Assign affinity to root thread if it hasn't happened yet
 1928|    121|    __kmp_assign_root_init_mask();
 1929|       |
 1930|       |    // Nested level will be an index in the nested nthreads array
 1931|    121|    level = parent_team->t.t_level;
 1932|       |    // used to launch non-serial teams even if nested is not allowed
 1933|    121|    active_level = parent_team->t.t_active_level;
 1934|       |    // needed to check nesting inside the teams
 1935|    121|    teams_level = master_th->th.th_teams_level;
 1936|    121|#if KMP_NESTED_HOT_TEAMS
 1937|    121|    p_hot_teams = &master_th->th.th_hot_teams;
 1938|    121|    if (*p_hot_teams == NULL && __kmp_hot_teams_max_level > 0) {
  ------------------
  |  Branch (1938:9): [True: 1, False: 120]
  |  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|    121|#endif
 1946|       |
 1947|    121|#if OMPT_SUPPORT
 1948|    121|    if (ompt_enabled.enabled) {
  ------------------
  |  Branch (1948:9): [True: 0, False: 121]
  ------------------
 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|    121|#endif
 1964|       |
 1965|    121|    master_th->th.th_ident = loc;
 1966|       |
 1967|       |    // Parallel closely nested in teams construct:
 1968|    121|    if (__kmp_is_fork_in_teams(master_th, microtask, level, teams_level, ap)) {
  ------------------
  |  Branch (1968:9): [True: 0, False: 121]
  ------------------
 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|    121|    int enter_teams =
 1991|    121|        __kmp_is_entering_teams(active_level, level, teams_level, ap);
 1992|    121|    if ((!enter_teams &&
  ------------------
  |  Branch (1992:10): [True: 121, False: 0]
  ------------------
 1993|    121|         (parent_team->t.t_active_level >=
  ------------------
  |  Branch (1993:10): [True: 0, False: 121]
  ------------------
 1994|    121|          master_th->th.th_current_task->td_icvs.max_active_levels)) ||
 1995|    121|        (__kmp_library == library_serial)) {
  ------------------
  |  Branch (1995:9): [True: 0, False: 121]
  ------------------
 1996|      0|      KC_TRACE(10, ("__kmp_fork_call: T#%d serializing team\n", gtid));
 1997|      0|      nthreads = 1;
 1998|    121|    } else {
 1999|    121|      nthreads = master_set_numthreads
  ------------------
  |  Branch (1999:18): [True: 121, False: 0]
  ------------------
 2000|    121|                     ? master_set_numthreads
 2001|       |                     // TODO: get nproc directly from current task
 2002|    121|                     : get__nproc_2(parent_team, master_tid);
  ------------------
  |  | 2298|    121|  ((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|    121|      if (nthreads > 1) {
  ------------------
  |  Branch (2005:11): [True: 0, False: 121]
  ------------------
 2006|       |        /* determine how many new threads we can use */
 2007|      0|        __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|      0|        nthreads = __kmp_reserve_threads(root, parent_team, master_tid,
 2013|      0|                                         nthreads, enter_teams);
 2014|      0|        if (nthreads == 1) {
  ------------------
  |  Branch (2014:13): [True: 0, False: 0]
  ------------------
 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|      0|      }
 2021|    121|    }
 2022|    121|    KMP_DEBUG_ASSERT(nthreads > 0);
 2023|       |
 2024|       |    // If we temporarily changed the set number of threads then restore it now
 2025|    121|    master_th->th.th_set_nproc = 0;
 2026|       |
 2027|    121|    if (nthreads == 1) {
  ------------------
  |  Branch (2027:9): [True: 121, False: 0]
  ------------------
 2028|    121|      return __kmp_serial_fork_call(loc, gtid, call_context, argc, microtask,
 2029|    121|                                    invoker, master_th, parent_team,
 2030|    121|#if OMPT_SUPPORT
 2031|    121|                                    &ompt_parallel_data, &return_address,
 2032|    121|                                    &parent_task_data,
 2033|    121|#endif
 2034|    121|                                    ap);
 2035|    121|    } // 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|      0|    KF_TRACE(10, ("__kmp_fork_call: parent_team_aclevel=%d, master_th=%p, "
 2040|      0|                  "curtask=%p, curtask_max_aclevel=%d\n",
 2041|      0|                  parent_team->t.t_active_level, master_th,
 2042|      0|                  master_th->th.th_current_task,
 2043|      0|                  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|      0|    master_th->th.th_current_task->td_flags.executing = 0;
 2048|       |
 2049|      0|    if (!master_th->th.th_teams_microtask || level > teams_level) {
  ------------------
  |  Branch (2049:9): [True: 0, False: 0]
  |  Branch (2049:46): [True: 0, False: 0]
  ------------------
 2050|       |      /* Increment our nested depth level */
 2051|      0|      KMP_ATOMIC_INC(&root->r.r_in_parallel);
  ------------------
  |  | 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)
  |  |  ------------------
  ------------------
 2052|      0|    }
 2053|       |
 2054|       |    // See if we need to make a copy of the ICVs.
 2055|      0|    int nthreads_icv = master_th->th.th_current_task->td_icvs.nproc;
 2056|      0|    if ((level + 1 < __kmp_nested_nth.used) &&
  ------------------
  |  Branch (2056:9): [True: 0, False: 0]
  ------------------
 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|      0|    } else {
 2060|      0|      nthreads_icv = 0; // don't update
 2061|      0|    }
 2062|       |
 2063|       |    // Figure out the proc_bind_policy for the new team.
 2064|      0|    kmp_proc_bind_t proc_bind = master_th->th.th_set_proc_bind;
 2065|       |    // proc_bind_default means don't update
 2066|      0|    kmp_proc_bind_t proc_bind_icv = proc_bind_default;
 2067|      0|    if (master_th->th.th_current_task->td_icvs.proc_bind == proc_bind_false) {
  ------------------
  |  Branch (2067:9): [True: 0, False: 0]
  ------------------
 2068|      0|      proc_bind = proc_bind_false;
 2069|      0|    } 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|      0|    master_th->th.th_set_proc_bind = proc_bind_default;
 2097|       |
 2098|      0|    if ((nthreads_icv > 0) || (proc_bind_icv != proc_bind_default)) {
  ------------------
  |  Branch (2098:9): [True: 0, False: 0]
  |  Branch (2098:31): [True: 0, False: 0]
  ------------------
 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|      0|    } else {
 2120|       |      /* allocate a new parallel team */
 2121|      0|      KF_TRACE(10, ("__kmp_fork_call: before __kmp_allocate_team\n"));
 2122|      0|      team = __kmp_allocate_team(root, nthreads, nthreads,
 2123|      0|#if OMPT_SUPPORT
 2124|      0|                                 ompt_parallel_data,
 2125|      0|#endif
 2126|      0|                                 proc_bind,
 2127|      0|                                 &master_th->th.th_current_task->td_icvs,
 2128|      0|                                 argc USE_NESTED_HOT_ARG(master_th));
  ------------------
  |  |  165|      0|#define USE_NESTED_HOT_ARG(x) , x
  ------------------
 2129|      0|      if (__kmp_barrier_release_pattern[bs_forkjoin_barrier] == bp_dist_bar)
  ------------------
  |  Branch (2129:11): [True: 0, False: 0]
  ------------------
 2130|      0|        copy_icvs((kmp_internal_control_t *)team->t.b->team_icvs,
 2131|      0|                  &master_th->th.th_current_task->td_icvs);
 2132|      0|    }
 2133|      0|    KF_TRACE(
 2134|      0|        10, ("__kmp_fork_call: after __kmp_allocate_team - team = %p\n", team));
 2135|       |
 2136|       |    /* setup the new team */
 2137|      0|    KMP_CHECK_UPDATE(team->t.t_master_tid, master_tid);
  ------------------
  |  | 2280|      0|  if ((a) != (b))                                                              \
  |  |  ------------------
  |  |  |  Branch (2280:7): [True: 0, False: 0]
  |  |  ------------------
  |  | 2281|      0|  (a) = (b)
  ------------------
 2138|      0|    KMP_CHECK_UPDATE(team->t.t_master_this_cons, master_this_cons);
  ------------------
  |  | 2280|      0|  if ((a) != (b))                                                              \
  |  |  ------------------
  |  |  |  Branch (2280:7): [True: 0, False: 0]
  |  |  ------------------
  |  | 2281|      0|  (a) = (b)
  ------------------
 2139|      0|    KMP_CHECK_UPDATE(team->t.t_ident, loc);
  ------------------
  |  | 2280|      0|  if ((a) != (b))                                                              \
  |  |  ------------------
  |  |  |  Branch (2280:7): [True: 0, False: 0]
  |  |  ------------------
  |  | 2281|      0|  (a) = (b)
  ------------------
 2140|      0|    KMP_CHECK_UPDATE(team->t.t_parent, parent_team);
  ------------------
  |  | 2280|      0|  if ((a) != (b))                                                              \
  |  |  ------------------
  |  |  |  Branch (2280:7): [True: 0, False: 0]
  |  |  ------------------
  |  | 2281|      0|  (a) = (b)
  ------------------
 2141|      0|    KMP_CHECK_UPDATE_SYNC(team->t.t_pkfn, microtask);
  ------------------
  |  | 2283|      0|  if ((a) != (b))                                                              \
  |  |  ------------------
  |  |  |  Branch (2283:7): [True: 0, False: 0]
  |  |  ------------------
  |  | 2284|      0|  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)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2142|      0|#if OMPT_SUPPORT
 2143|      0|    KMP_CHECK_UPDATE_SYNC(team->t.ompt_team_info.master_return_address,
  ------------------
  |  | 2283|      0|  if ((a) != (b))                                                              \
  |  |  ------------------
  |  |  |  Branch (2283:7): [True: 0, False: 0]
  |  |  ------------------
  |  | 2284|      0|  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|      0|                          return_address);
 2145|      0|#endif
 2146|      0|    KMP_CHECK_UPDATE(team->t.t_invoke, invoker); // TODO move to root, maybe
  ------------------
  |  | 2280|      0|  if ((a) != (b))                                                              \
  |  |  ------------------
  |  |  |  Branch (2280:7): [True: 0, False: 0]
  |  |  ------------------
  |  | 2281|      0|  (a) = (b)
  ------------------
 2147|       |    // TODO: parent_team->t.t_level == INT_MAX ???
 2148|      0|    if (!master_th->th.th_teams_microtask || level > teams_level) {
  ------------------
  |  Branch (2148:9): [True: 0, False: 0]
  |  Branch (2148:46): [True: 0, False: 0]
  ------------------
 2149|      0|      int new_level = parent_team->t.t_level + 1;
 2150|      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)
  ------------------
 2151|      0|      new_level = parent_team->t.t_active_level + 1;
 2152|      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)
  ------------------
 2153|      0|    } 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|      0|    kmp_r_sched_t new_sched = get__sched_2(parent_team, master_tid);
  ------------------
  |  | 2300|      0|  ((xteam)->t.t_threads[(xtid)]->th.th_current_task->td_icvs.sched)
  ------------------
 2161|       |    // set primary thread's schedule as new run-time schedule
 2162|      0|    KMP_CHECK_UPDATE(team->t.t_sched.sched, new_sched.sched);
  ------------------
  |  | 2280|      0|  if ((a) != (b))                                                              \
  |  |  ------------------
  |  |  |  Branch (2280:7): [True: 0, False: 0]
  |  |  ------------------
  |  | 2281|      0|  (a) = (b)
  ------------------
 2163|       |
 2164|      0|    KMP_CHECK_UPDATE(team->t.t_cancel_request, cancel_noreq);
  ------------------
  |  | 2280|      0|  if ((a) != (b))                                                              \
  |  |  ------------------
  |  |  |  Branch (2280:7): [True: 0, False: 0]
  |  |  ------------------
  |  | 2281|      0|  (a) = (b)
  ------------------
 2165|      0|    KMP_CHECK_UPDATE(team->t.t_def_allocator, master_th->th.th_def_allocator);
  ------------------
  |  | 2280|      0|  if ((a) != (b))                                                              \
  |  |  ------------------
  |  |  |  Branch (2280:7): [True: 0, False: 0]
  |  |  ------------------
  |  | 2281|      0|  (a) = (b)
  ------------------
 2166|       |
 2167|       |    // Update the floating point rounding in the team if required.
 2168|      0|    propagateFPControl(team);
 2169|      0|#if OMPD_SUPPORT
 2170|      0|    if (ompd_state & OMPD_ENABLE_BP)
  ------------------
  |  |   35|      0|#define OMPD_ENABLE_BP 0x1
  ------------------
  |  Branch (2170:9): [True: 0, False: 0]
  ------------------
 2171|      0|      ompd_bp_parallel_begin();
 2172|      0|#endif
 2173|       |
 2174|      0|    if (__kmp_tasking_mode != tskm_immediate_exec) {
  ------------------
  |  Branch (2174:9): [True: 0, 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|      0|      KMP_DEBUG_ASSERT(master_th->th.th_task_team ==
 2178|      0|                       parent_team->t.t_task_team[master_th->th.th_task_state]);
 2179|      0|      KA_TRACE(20, ("__kmp_fork_call: Primary T#%d pushing task_team %p / team "
 2180|      0|                    "%p, new task_team %p / team %p\n",
 2181|      0|                    __kmp_gtid_from_thread(master_th),
 2182|      0|                    master_th->th.th_task_team, parent_team,
 2183|      0|                    team->t.t_task_team[master_th->th.th_task_state], team));
 2184|       |
 2185|      0|      if (active_level || master_th->th.th_task_team) {
  ------------------
  |  Branch (2185:11): [True: 0, False: 0]
  |  Branch (2185:27): [True: 0, False: 0]
  ------------------
 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|      0|    }
 2231|       |
 2232|      0|    KA_TRACE(
 2233|      0|        20,
 2234|      0|        ("__kmp_fork_call: T#%d(%d:%d)->(%d:0) created a team of %d threads\n",
 2235|      0|         gtid, parent_team->t.t_id, team->t.t_master_tid, team->t.t_id,
 2236|      0|         team->t.t_nproc));
 2237|      0|    KMP_DEBUG_ASSERT(team != root->r.r_hot_team ||
 2238|      0|                     (team->t.t_master_tid == 0 &&
 2239|      0|                      (team->t.t_parent == root->r.r_root_team ||
 2240|      0|                       team->t.t_parent->t.t_serialized)));
 2241|      0|    KMP_MB();
 2242|       |
 2243|       |    /* now, setup the arguments */
 2244|      0|    argv = (void **)team->t.t_argv;
 2245|      0|    if (ap) {
  ------------------
  |  Branch (2245:9): [True: 0, False: 0]
  ------------------
 2246|      0|      for (i = argc - 1; i >= 0; --i) {
  ------------------
  |  Branch (2246:26): [True: 0, False: 0]
  ------------------
 2247|      0|        void *new_argv = va_arg(kmp_va_deref(ap), void *);
 2248|      0|        KMP_CHECK_UPDATE(*argv, new_argv);
  ------------------
  |  | 2280|      0|  if ((a) != (b))                                                              \
  |  |  ------------------
  |  |  |  Branch (2280:7): [True: 0, False: 0]
  |  |  ------------------
  |  | 2281|      0|  (a) = (b)
  ------------------
 2249|      0|        argv++;
 2250|      0|      }
 2251|      0|    } 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|      0|    KMP_CHECK_UPDATE(team->t.t_master_active, master_active);
  ------------------
  |  | 2280|      0|  if ((a) != (b))                                                              \
  |  |  ------------------
  |  |  |  Branch (2280:7): [True: 0, False: 0]
  |  |  ------------------
  |  | 2281|      0|  (a) = (b)
  ------------------
 2260|      0|    if (!root->r.r_active) // Only do assignment if it prevents cache ping-pong
  ------------------
  |  Branch (2260:9): [True: 0, False: 0]
  ------------------
 2261|      0|      root->r.r_active = TRUE;
  ------------------
  |  | 1280|      0|#define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  | 1279|      0|#define FALSE 0
  |  |  ------------------
  ------------------
 2262|       |
 2263|      0|    __kmp_fork_team_threads(root, team, master_th, gtid, !ap);
 2264|      0|    __kmp_setup_icv_copy(team, nthreads,
 2265|      0|                         &master_th->th.th_current_task->td_icvs, loc);
 2266|       |
 2267|      0|#if OMPT_SUPPORT
 2268|      0|    master_th->th.ompt_thread_info.state = ompt_state_work_parallel;
 2269|      0|#endif
 2270|       |
 2271|      0|    __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|      0|    KMP_DEBUG_ASSERT(team == __kmp_threads[gtid]->th.th_team);
 2300|      0|    KMP_MB();
 2301|      0|    KF_TRACE(10,
 2302|      0|             ("__kmp_internal_fork : root=%p, team=%p, master_th=%p, gtid=%d\n",
 2303|      0|              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|      0|    if (ap) {
  ------------------
  |  Branch (2324:9): [True: 0, False: 0]
  ------------------
 2325|      0|      __kmp_internal_fork(loc, gtid, team);
 2326|      0|      KF_TRACE(10, ("__kmp_internal_fork : after : root=%p, team=%p, "
 2327|      0|                    "master_th=%p, gtid=%d\n",
 2328|      0|                    root, team, master_th, gtid));
 2329|      0|    }
 2330|       |
 2331|      0|    if (call_context == fork_context_gnu) {
  ------------------
  |  Branch (2331:9): [True: 0, False: 0]
  ------------------
 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|      0|    KA_TRACE(20, ("__kmp_fork_call: T#%d(%d:0) invoke microtask = %p\n", gtid,
 2338|      0|                  team->t.t_id, team->t.t_pkfn));
 2339|      0|  } // 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|      0|  if (!team->t.t_invoke(gtid)) {
  ------------------
  |  Branch (2349:7): [True: 0, False: 0]
  ------------------
 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|      0|  KA_TRACE(20, ("__kmp_fork_call: T#%d(%d:0) done microtask = %p\n", gtid,
 2361|      0|                team->t.t_id, team->t.t_pkfn));
 2362|      0|  KMP_MB(); /* Flush all pending memory write invalidates.  */
 2363|       |
 2364|      0|  KA_TRACE(20, ("__kmp_fork_call: parallel exit T#%d\n", gtid));
 2365|      0|#if OMPT_SUPPORT
 2366|      0|  if (ompt_enabled.enabled) {
  ------------------
  |  Branch (2366:7): [True: 0, False: 0]
  ------------------
 2367|      0|    master_th->th.ompt_thread_info.state = ompt_state_overhead;
 2368|      0|  }
 2369|      0|#endif
 2370|       |
 2371|      0|  return TRUE;
  ------------------
  |  | 1280|      0|#define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  | 1279|      0|#define FALSE 0
  |  |  ------------------
  ------------------
 2372|      0|}
__kmp_join_call:
 2403|    121|                     int exit_teams) {
 2404|    121|  KMP_TIME_DEVELOPER_PARTITIONED_BLOCK(KMP_join_call);
  ------------------
  |  | 1008|    121|#define KMP_TIME_DEVELOPER_PARTITIONED_BLOCK(n) ((void)0)
  ------------------
 2405|    121|  kmp_team_t *team;
 2406|    121|  kmp_team_t *parent_team;
 2407|    121|  kmp_info_t *master_th;
 2408|    121|  kmp_root_t *root;
 2409|    121|  int master_active;
 2410|       |
 2411|    121|  KA_TRACE(20, ("__kmp_join_call: enter T#%d\n", gtid));
 2412|       |
 2413|       |  /* setup current data */
 2414|    121|  master_th = __kmp_threads[gtid];
 2415|    121|  root = master_th->th.th_root;
 2416|    121|  team = master_th->th.th_team;
 2417|    121|  parent_team = team->t.t_parent;
 2418|       |
 2419|    121|  master_th->th.th_ident = loc;
 2420|       |
 2421|    121|#if OMPT_SUPPORT
 2422|    121|  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|    121|  if (ompt_enabled.enabled &&
  ------------------
  |  Branch (2426:7): [True: 0, False: 121]
  ------------------
 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|    121|#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|    121|  if (team->t.t_serialized) {
  ------------------
  |  Branch (2444:7): [True: 121, False: 0]
  ------------------
 2445|    121|    if (master_th->th.th_teams_microtask) {
  ------------------
  |  Branch (2445:9): [True: 0, False: 121]
  ------------------
 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|    121|    __kmpc_end_serialized_parallel(loc, gtid);
 2461|       |
 2462|    121|#if OMPT_SUPPORT
 2463|    121|    if (ompt_enabled.enabled) {
  ------------------
  |  Branch (2463:9): [True: 0, False: 121]
  ------------------
 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|    121|#endif
 2470|       |
 2471|    121|    return;
 2472|    121|  }
 2473|       |
 2474|      0|  master_active = team->t.t_master_active;
 2475|       |
 2476|      0|  if (!exit_teams) {
  ------------------
  |  Branch (2476:7): [True: 0, False: 0]
  ------------------
 2477|       |    // AC: No barrier for internal teams at exit from teams construct.
 2478|       |    //     But there is barrier for external team (league).
 2479|      0|    __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|      0|  } 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|      0|  KMP_MB();
 2504|       |
 2505|      0|#if OMPT_SUPPORT
 2506|      0|  ompt_data_t *parallel_data = &(team->t.ompt_team_info.parallel_data);
 2507|      0|  void *codeptr = team->t.ompt_team_info.master_return_address;
 2508|      0|#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|      0|#if KMP_AFFINITY_SUPPORTED
 2530|      0|  if (!exit_teams) {
  ------------------
  |  Branch (2530:7): [True: 0, False: 0]
  ------------------
 2531|       |    // Restore master thread's partition.
 2532|      0|    master_th->th.th_first_place = team->t.t_first_place;
 2533|      0|    master_th->th.th_last_place = team->t.t_last_place;
 2534|      0|  }
 2535|      0|#endif // KMP_AFFINITY_SUPPORTED
 2536|       |
 2537|      0|  if (master_th->th.th_teams_microtask && !exit_teams &&
  ------------------
  |  Branch (2537:7): [True: 0, False: 0]
  |  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|      0|  master_th->th.th_info.ds.ds_tid = team->t.t_master_tid;
 2607|      0|  master_th->th.th_local.this_construct = team->t.t_master_this_cons;
 2608|       |
 2609|      0|  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|      0|  __kmp_acquire_bootstrap_lock(&__kmp_forkjoin_lock);
 2615|       |
 2616|      0|  if (!master_th->th.th_teams_microtask ||
  ------------------
  |  Branch (2616:7): [True: 0, False: 0]
  ------------------
 2617|      0|      team->t.t_level > master_th->th.th_teams_level) {
  ------------------
  |  Branch (2617:7): [True: 0, False: 0]
  ------------------
 2618|       |    /* Decrement our nested depth level */
 2619|      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)
  |  |  ------------------
  ------------------
 2620|      0|  }
 2621|      0|  KMP_DEBUG_ASSERT(root->r.r_in_parallel >= 0);
 2622|       |
 2623|      0|#if OMPT_SUPPORT
 2624|      0|  if (ompt_enabled.enabled) {
  ------------------
  |  Branch (2624:7): [True: 0, False: 0]
  ------------------
 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|      0|#endif
 2639|       |
 2640|      0|  KF_TRACE(10, ("__kmp_join_call1: T#%d, this_thread=%p team=%p\n", 0,
 2641|      0|                master_th, team));
 2642|      0|  __kmp_pop_current_task_from_thread(master_th);
 2643|       |
 2644|      0|  master_th->th.th_def_allocator = team->t.t_def_allocator;
 2645|       |
 2646|      0|#if OMPD_SUPPORT
 2647|      0|  if (ompd_state & OMPD_ENABLE_BP)
  ------------------
  |  |   35|      0|#define OMPD_ENABLE_BP 0x1
  ------------------
  |  Branch (2647:7): [True: 0, False: 0]
  ------------------
 2648|      0|    ompd_bp_parallel_end();
 2649|      0|#endif
 2650|      0|  updateHWFPControl(team);
 2651|       |
 2652|      0|  if (root->r.r_active != master_active)
  ------------------
  |  Branch (2652:7): [True: 0, False: 0]
  ------------------
 2653|      0|    root->r.r_active = master_active;
 2654|       |
 2655|      0|  __kmp_free_team(root, team USE_NESTED_HOT_ARG(
  ------------------
  |  |  165|      0|#define USE_NESTED_HOT_ARG(x) , x
  ------------------
 2656|      0|                            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|      0|  master_th->th.th_team = parent_team;
 2664|      0|  master_th->th.th_team_nproc = parent_team->t.t_nproc;
 2665|      0|  master_th->th.th_team_master = parent_team->t.t_threads[0];
 2666|      0|  master_th->th.th_team_serialized = parent_team->t.t_serialized;
 2667|       |
 2668|       |  /* restore serialized team, if need be */
 2669|      0|  if (parent_team->t.t_serialized &&
  ------------------
  |  Branch (2669:7): [True: 0, False: 0]
  ------------------
 2670|      0|      parent_team != master_th->th.th_serial_team &&
  ------------------
  |  Branch (2670:7): [True: 0, False: 0]
  ------------------
 2671|      0|      parent_team != root->r.r_root_team) {
  ------------------
  |  Branch (2671:7): [True: 0, False: 0]
  ------------------
 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|      0|  if (__kmp_tasking_mode != tskm_immediate_exec) {
  ------------------
  |  Branch (2677:7): [True: 0, False: 0]
  ------------------
 2678|      0|    if (master_th->th.th_task_state_top >
  ------------------
  |  Branch (2678:9): [True: 0, False: 0]
  ------------------
 2679|      0|        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|      0|    } else if (team != root->r.r_hot_team) {
  ------------------
  |  Branch (2689:16): [True: 0, False: 0]
  ------------------
 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|      0|    master_th->th.th_task_team =
 2698|      0|        parent_team->t.t_task_team[master_th->th.th_task_state];
 2699|      0|    KA_TRACE(20,
 2700|      0|             ("__kmp_join_call: Primary T#%d restoring task_team %p, team %p\n",
 2701|      0|              __kmp_gtid_from_thread(master_th), master_th->th.th_task_team,
 2702|      0|              parent_team));
 2703|      0|  }
 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|      0|  master_th->th.th_current_task->td_flags.executing = 1;
 2709|       |
 2710|      0|  __kmp_release_bootstrap_lock(&__kmp_forkjoin_lock);
 2711|       |
 2712|      0|#if KMP_AFFINITY_SUPPORTED
 2713|      0|  if (master_th->th.th_team->t.t_level == 0 && __kmp_affinity.flags.reset) {
  ------------------
  |  Branch (2713:7): [True: 0, False: 0]
  |  Branch (2713:48): [True: 0, False: 0]
  ------------------
 2714|      0|    __kmp_reset_root_init_mask(gtid);
 2715|      0|  }
 2716|      0|#endif
 2717|      0|#if OMPT_SUPPORT
 2718|      0|  int flags =
 2719|      0|      OMPT_INVOKER(fork_context) |
  ------------------
  |  |   24|      0|  ((x == fork_context_gnu) ? ompt_parallel_invoker_program                     \
  |  |  ------------------
  |  |  |  Branch (24:4): [True: 0, False: 0]
  |  |  ------------------
  |  |   25|      0|                           : ompt_parallel_invoker_runtime)
  ------------------
 2720|      0|      ((team_microtask == (void *)__kmp_teams_master) ? ompt_parallel_league
  ------------------
  |  Branch (2720:8): [True: 0, False: 0]
  ------------------
 2721|      0|                                                      : ompt_parallel_team);
 2722|      0|  if (ompt_enabled.enabled) {
  ------------------
  |  Branch (2722:7): [True: 0, False: 0]
  ------------------
 2723|      0|    __kmp_join_ompt(gtid, master_th, parent_team, parallel_data, flags,
 2724|      0|                    codeptr);
 2725|      0|  }
 2726|      0|#endif
 2727|       |
 2728|      0|  KMP_MB();
 2729|      0|  KA_TRACE(20, ("__kmp_join_call: exit T#%d\n", gtid));
 2730|      0|}
__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|      1|void __kmp_init_random(kmp_info_t *thread) {
 3635|      1|  unsigned seed = thread->th.th_info.ds.ds_tid;
 3636|       |
 3637|      1|  thread->th.th_a =
 3638|      1|      __kmp_primes[seed % (sizeof(__kmp_primes) / sizeof(__kmp_primes[0]))];
 3639|      1|  thread->th.th_x = (seed + 1) * thread->th.th_a + 1;
 3640|      1|  KA_TRACE(30,
 3641|      1|           ("__kmp_init_random: THREAD: %u; A: %u\n", seed, thread->th.th_a));
 3642|      1|}
__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_team:
 5130|      3|                    int argc USE_NESTED_HOT_ARG(kmp_info_t *master)) {
 5131|      3|  KMP_TIME_DEVELOPER_PARTITIONED_BLOCK(KMP_allocate_team);
  ------------------
  |  | 1008|      3|#define KMP_TIME_DEVELOPER_PARTITIONED_BLOCK(n) ((void)0)
  ------------------
 5132|      3|  int f;
 5133|      3|  kmp_team_t *team;
 5134|      3|  int use_hot_team = !root->r.r_active;
 5135|      3|  int level = 0;
 5136|      3|  int do_place_partition = 1;
 5137|       |
 5138|      3|  KA_TRACE(20, ("__kmp_allocate_team: called\n"));
 5139|      3|  KMP_DEBUG_ASSERT(new_nproc >= 1 && argc >= 0);
 5140|      3|  KMP_DEBUG_ASSERT(max_nproc >= new_nproc);
 5141|      3|  KMP_MB();
 5142|       |
 5143|      3|#if KMP_NESTED_HOT_TEAMS
 5144|      3|  kmp_hot_team_ptr_t *hot_teams;
 5145|      3|  if (master) {
  ------------------
  |  Branch (5145:7): [True: 0, False: 3]
  ------------------
 5146|      0|    team = master->th.th_team;
 5147|      0|    level = team->t.t_active_level;
 5148|      0|    if (master->th.th_teams_microtask) { // in teams construct?
  ------------------
  |  Branch (5148:9): [True: 0, False: 0]
  ------------------
 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|      0|    hot_teams = master->th.th_hot_teams;
 5166|      0|    if (level < __kmp_hot_teams_max_level && hot_teams &&
  ------------------
  |  Branch (5166:9): [True: 0, False: 0]
  |  Branch (5166:46): [True: 0, False: 0]
  ------------------
 5167|      0|        hot_teams[level].hot_team) {
  ------------------
  |  Branch (5167:9): [True: 0, False: 0]
  ------------------
 5168|       |      // hot team has already been allocated for given level
 5169|      0|      use_hot_team = 1;
 5170|      0|    } else {
 5171|      0|      use_hot_team = 0;
 5172|      0|    }
 5173|      3|  } else {
 5174|       |    // check we won't access uninitialized hot_teams, just in case
 5175|      3|    KMP_DEBUG_ASSERT(new_nproc == 1);
 5176|      3|  }
 5177|      3|#endif
 5178|       |  // Optimization to use a "hot" team
 5179|      3|  if (use_hot_team && new_nproc > 1) {
  ------------------
  |  Branch (5179:7): [True: 3, False: 0]
  |  Branch (5179:23): [True: 0, False: 3]
  ------------------
 5180|      0|    KMP_DEBUG_ASSERT(new_nproc <= max_nproc);
 5181|      0|#if KMP_NESTED_HOT_TEAMS
 5182|      0|    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|      0|    if (team->t.t_nproc != new_nproc &&
  ------------------
  |  Branch (5194:9): [True: 0, False: 0]
  ------------------
 5195|      0|        __kmp_barrier_release_pattern[bs_forkjoin_barrier] == bp_dist_bar) {
  ------------------
  |  Branch (5195:9): [True: 0, False: 0]
  ------------------
 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|      0|    if (do_place_partition == 0)
  ------------------
  |  Branch (5203:9): [True: 0, False: 0]
  ------------------
 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|      0|    if (team->t.t_nproc == new_nproc) { // Check changes in number of threads
  ------------------
  |  Branch (5208:9): [True: 0, False: 0]
  ------------------
 5209|      0|      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|      0|      if (team->t.t_size_changed == -1) {
  ------------------
  |  Branch (5212:11): [True: 0, False: 0]
  ------------------
 5213|      0|        team->t.t_size_changed = 1;
 5214|      0|      } else {
 5215|      0|        KMP_CHECK_UPDATE(team->t.t_size_changed, 0);
  ------------------
  |  | 2280|      0|  if ((a) != (b))                                                              \
  |  |  ------------------
  |  |  |  Branch (2280:7): [True: 0, False: 0]
  |  |  ------------------
  |  | 2281|      0|  (a) = (b)
  ------------------
 5216|      0|      }
 5217|       |
 5218|       |      // TODO???: team->t.t_max_active_levels = new_max_active_levels;
 5219|      0|      kmp_r_sched_t new_sched = new_icvs->sched;
 5220|       |      // set primary thread's schedule as new run-time schedule
 5221|      0|      KMP_CHECK_UPDATE(team->t.t_sched.sched, new_sched.sched);
  ------------------
  |  | 2280|      0|  if ((a) != (b))                                                              \
  |  |  ------------------
  |  |  |  Branch (2280:7): [True: 0, False: 0]
  |  |  ------------------
  |  | 2281|      0|  (a) = (b)
  ------------------
 5222|       |
 5223|      0|      __kmp_reinitialize_team(team, new_icvs,
 5224|      0|                              root->r.r_uber_thread->th.th_ident);
 5225|       |
 5226|      0|      KF_TRACE(10, ("__kmp_allocate_team2: T#%d, this_thread=%p team=%p\n", 0,
 5227|      0|                    team->t.t_threads[0], team));
 5228|      0|      __kmp_push_current_task_to_thread(team->t.t_threads[0], team, 0);
 5229|       |
 5230|      0|#if KMP_AFFINITY_SUPPORTED
 5231|      0|      if ((team->t.t_size_changed == 0) &&
  ------------------
  |  Branch (5231:11): [True: 0, False: 0]
  ------------------
 5232|      0|          (team->t.t_proc_bind == new_proc_bind)) {
  ------------------
  |  Branch (5232:11): [True: 0, False: 0]
  ------------------
 5233|      0|        if (new_proc_bind == proc_bind_spread) {
  ------------------
  |  Branch (5233:13): [True: 0, False: 0]
  ------------------
 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|      0|        KA_TRACE(200, ("__kmp_allocate_team: reusing hot team #%d bindings: "
 5240|      0|                       "proc_bind = %d, partition = [%d,%d]\n",
 5241|      0|                       team->t.t_id, new_proc_bind, team->t.t_first_place,
 5242|      0|                       team->t.t_last_place));
 5243|      0|      } 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|      0|    } else if (team->t.t_nproc > new_nproc) {
  ------------------
  |  Branch (5252:16): [True: 0, False: 0]
  ------------------
 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|      0|    } else { // team->t.t_nproc < new_nproc
 5331|       |
 5332|      0|      KA_TRACE(20,
 5333|      0|               ("__kmp_allocate_team: increasing hot team thread count to %d\n",
 5334|      0|                new_nproc));
 5335|      0|      int old_nproc = team->t.t_nproc; // save old value and use to update only
 5336|      0|      team->t.t_size_changed = 1;
 5337|       |
 5338|      0|#if KMP_NESTED_HOT_TEAMS
 5339|      0|      int avail_threads = hot_teams[level].hot_team_nth;
 5340|      0|      if (new_nproc < avail_threads)
  ------------------
  |  Branch (5340:11): [True: 0, False: 0]
  ------------------
 5341|      0|        avail_threads = new_nproc;
 5342|      0|      kmp_info_t **other_threads = team->t.t_threads;
 5343|      0|      for (f = team->t.t_nproc; f < avail_threads; ++f) {
  ------------------
  |  Branch (5343:33): [True: 0, False: 0]
  ------------------
 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|      0|      if (hot_teams[level].hot_team_nth >= new_nproc) {
  ------------------
  |  Branch (5356:11): [True: 0, False: 0]
  ------------------
 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|      0|      } else {
 5362|       |        // We may have some threads in reserve, but not enough;
 5363|       |        // get reserved threads involved if any.
 5364|      0|        team->t.t_nproc = hot_teams[level].hot_team_nth;
 5365|      0|        hot_teams[level].hot_team_nth = new_nproc; // adjust hot team max size
 5366|      0|#endif // KMP_NESTED_HOT_TEAMS
 5367|      0|        if (team->t.t_max_nproc < new_nproc) {
  ------------------
  |  Branch (5367:13): [True: 0, False: 0]
  ------------------
 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|      0|#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|      0|        kmp_affinity_raii_t new_temp_affinity{__kmp_affin_fullMask};
 5380|      0|#endif
 5381|       |
 5382|       |        /* allocate new threads for the hot team */
 5383|      0|        for (f = team->t.t_nproc; f < new_nproc; f++) {
  ------------------
  |  Branch (5383:35): [True: 0, False: 0]
  ------------------
 5384|      0|          kmp_info_t *new_worker = __kmp_allocate_thread(root, team, f);
 5385|      0|          KMP_DEBUG_ASSERT(new_worker);
 5386|      0|          team->t.t_threads[f] = new_worker;
 5387|       |
 5388|      0|          KA_TRACE(20,
 5389|      0|                   ("__kmp_allocate_team: team %d init T#%d arrived: "
 5390|      0|                    "join=%llu, plain=%llu\n",
 5391|      0|                    team->t.t_id, __kmp_gtid_from_tid(f, team), team->t.t_id, f,
 5392|      0|                    team->t.t_bar[bs_forkjoin_barrier].b_arrived,
 5393|      0|                    team->t.t_bar[bs_plain_barrier].b_arrived));
 5394|       |
 5395|      0|          { // Initialize barrier data for new threads.
 5396|      0|            int b;
 5397|      0|            kmp_balign_t *balign = new_worker->th.th_bar;
 5398|      0|            for (b = 0; b < bs_last_barrier; ++b) {
  ------------------
  |  Branch (5398:25): [True: 0, False: 0]
  ------------------
 5399|      0|              balign[b].bb.b_arrived = team->t.t_bar[b].b_arrived;
 5400|      0|              KMP_DEBUG_ASSERT(balign[b].bb.wait_flag !=
 5401|      0|                               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|      0|            }
 5406|      0|          }
 5407|      0|        }
 5408|       |
 5409|      0|#if (KMP_OS_LINUX || KMP_OS_FREEBSD) && KMP_AFFINITY_SUPPORTED
 5410|       |        /* Restore initial primary thread's affinity mask */
 5411|      0|        new_temp_affinity.restore();
 5412|      0|#endif
 5413|      0|#if KMP_NESTED_HOT_TEAMS
 5414|      0|      } // end of check of t_nproc vs. new_nproc vs. hot_team_nth
 5415|      0|#endif // KMP_NESTED_HOT_TEAMS
 5416|      0|      if (__kmp_barrier_release_pattern[bs_forkjoin_barrier] == bp_dist_bar) {
  ------------------
  |  Branch (5416:11): [True: 0, False: 0]
  ------------------
 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|      0|      __kmp_initialize_team(team, new_nproc, new_icvs,
 5424|      0|                            root->r.r_uber_thread->th.th_ident);
 5425|       |
 5426|       |      /* reinitialize the threads */
 5427|      0|      KMP_DEBUG_ASSERT(team->t.t_nproc == new_nproc);
 5428|      0|      for (f = 0; f < team->t.t_nproc; ++f)
  ------------------
  |  Branch (5428:19): [True: 0, False: 0]
  ------------------
 5429|      0|        __kmp_initialize_info(team->t.t_threads[f], team, f,
 5430|      0|                              __kmp_gtid_from_tid(f, team));
 5431|       |
 5432|       |      // set th_task_state for new threads in hot team with older thread's state
 5433|      0|      kmp_uint8 old_state = team->t.t_threads[old_nproc - 1]->th.th_task_state;
 5434|      0|      for (f = old_nproc; f < team->t.t_nproc; ++f)
  ------------------
  |  Branch (5434:27): [True: 0, False: 0]
  ------------------
 5435|      0|        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|      0|      if (do_place_partition) {
  ------------------
  |  Branch (5445:11): [True: 0, False: 0]
  ------------------
 5446|      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)
  ------------------
 5447|      0|#if KMP_AFFINITY_SUPPORTED
 5448|      0|        __kmp_partition_places(team);
 5449|      0|#endif
 5450|      0|      }
 5451|      0|    } // Check changes in number of threads
 5452|       |
 5453|      0|    kmp_info_t *master = team->t.t_threads[0];
 5454|      0|    if (master->th.th_teams_microtask) {
  ------------------
  |  Branch (5454:9): [True: 0, False: 0]
  ------------------
 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|      0|#if KMP_NESTED_HOT_TEAMS
 5464|      0|    if (level) {
  ------------------
  |  Branch (5464:9): [True: 0, False: 0]
  ------------------
 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|      0|#endif // KMP_NESTED_HOT_TEAMS
 5481|       |
 5482|       |    /* reallocate space for arguments if necessary */
 5483|      0|    __kmp_alloc_argv_entries(argc, team, TRUE);
  ------------------
  |  | 1280|      0|#define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  | 1279|      0|#define FALSE 0
  |  |  ------------------
  ------------------
 5484|      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)
  ------------------
 5485|       |    // The hot team re-uses the previous task team,
 5486|       |    // if untouched during the previous release->gather phase.
 5487|       |
 5488|      0|    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|      0|#if OMPT_SUPPORT
 5499|      0|    __ompt_team_assign_id(team, ompt_parallel_data);
 5500|      0|#endif
 5501|       |
 5502|      0|    KMP_MB();
 5503|       |
 5504|      0|    return team;
 5505|      0|  }
 5506|       |
 5507|       |  /* next, let's try to take one from the team pool */
 5508|      3|  KMP_MB();
 5509|      3|  for (team = CCAST(kmp_team_t *, __kmp_team_pool); (team);) {
  ------------------
  |  |  229|      3|#define CCAST(type, var) const_cast<type>(var)
  ------------------
  |  Branch (5509:53): [True: 0, False: 3]
  ------------------
 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|      3|  KMP_MB();
 5574|      3|  team = (kmp_team_t *)__kmp_allocate(sizeof(kmp_team_t));
  ------------------
  |  | 3617|      3|#define __kmp_allocate(size) ___kmp_allocate((size)KMP_SRC_LOC_CURR)
  ------------------
 5575|       |
 5576|       |  /* and set it up */
 5577|      3|  team->t.t_max_nproc = max_nproc;
 5578|      3|  if (max_nproc > 1 &&
  ------------------
  |  Branch (5578:7): [True: 1, False: 2]
  ------------------
 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|      3|  __kmp_allocate_team_arrays(team, max_nproc);
 5587|       |
 5588|      3|  KA_TRACE(20, ("__kmp_allocate_team: making a new team\n"));
 5589|      3|  __kmp_initialize_team(team, new_nproc, new_icvs, NULL);
 5590|       |
 5591|      3|  KA_TRACE(20, ("__kmp_allocate_team: setting task_team[0] %p and task_team[1] "
 5592|      3|                "%p to NULL\n",
 5593|      3|                &team->t.t_task_team[0], &team->t.t_task_team[1]));
 5594|      3|  team->t.t_task_team[0] = NULL; // to be removed, as __kmp_allocate zeroes
 5595|       |  // memory, no need to duplicate
 5596|      3|  team->t.t_task_team[1] = NULL; // to be removed, as __kmp_allocate zeroes
 5597|       |  // memory, no need to duplicate
 5598|       |
 5599|      3|  if (__kmp_storage_map) {
  ------------------
  |  Branch (5599:7): [True: 0, False: 3]
  ------------------
 5600|      0|    __kmp_print_team_storage_map("team", team, team->t.t_id, new_nproc);
 5601|      0|  }
 5602|       |
 5603|       |  /* allocate space for arguments */
 5604|      3|  __kmp_alloc_argv_entries(argc, team, FALSE);
  ------------------
  |  | 1279|      3|#define FALSE 0
  ------------------
 5605|      3|  team->t.t_argc = argc;
 5606|       |
 5607|      3|  KA_TRACE(20,
 5608|      3|           ("__kmp_allocate_team: team %d init arrived: join=%u, plain=%u\n",
 5609|      3|            team->t.t_id, KMP_INIT_BARRIER_STATE, KMP_INIT_BARRIER_STATE));
 5610|      3|  { // Initialize barrier data.
 5611|      3|    int b;
 5612|     12|    for (b = 0; b < bs_last_barrier; ++b) {
  ------------------
  |  Branch (5612:17): [True: 9, False: 3]
  ------------------
 5613|      9|      team->t.t_bar[b].b_arrived = KMP_INIT_BARRIER_STATE;
  ------------------
  |  | 2018|      9|#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|      9|    }
 5619|      3|  }
 5620|       |
 5621|      3|  team->t.t_proc_bind = new_proc_bind;
 5622|       |
 5623|      3|#if OMPT_SUPPORT
 5624|      3|  __ompt_team_assign_id(team, ompt_parallel_data);
 5625|      3|  team->t.ompt_serialized_team_info = NULL;
 5626|      3|#endif
 5627|       |
 5628|      3|  KMP_MB();
 5629|       |
 5630|      3|  KA_TRACE(20, ("__kmp_allocate_team: done creating a new team %d.\n",
 5631|      3|                team->t.t_id));
 5632|       |
 5633|      3|  return team;
 5634|      3|}
__kmp_free_team:
 5642|      2|                     kmp_team_t *team USE_NESTED_HOT_ARG(kmp_info_t *master)) {
 5643|      2|  int f;
 5644|      2|  KA_TRACE(20, ("__kmp_free_team: T#%d freeing team %d\n", __kmp_get_gtid(),
 5645|      2|                team->t.t_id));
 5646|       |
 5647|       |  /* verify state */
 5648|      2|  KMP_DEBUG_ASSERT(root);
 5649|      2|  KMP_DEBUG_ASSERT(team);
 5650|      2|  KMP_DEBUG_ASSERT(team->t.t_nproc <= team->t.t_max_nproc);
 5651|      2|  KMP_DEBUG_ASSERT(team->t.t_threads);
 5652|       |
 5653|      2|  int use_hot_team = team == root->r.r_hot_team;
 5654|      2|#if KMP_NESTED_HOT_TEAMS
 5655|      2|  int level;
 5656|      2|  if (master) {
  ------------------
  |  Branch (5656:7): [True: 0, False: 2]
  ------------------
 5657|      0|    level = team->t.t_active_level - 1;
 5658|      0|    if (master->th.th_teams_microtask) { // in teams construct?
  ------------------
  |  Branch (5658:9): [True: 0, False: 0]
  ------------------
 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|      0|    if (level < __kmp_hot_teams_max_level) {
  ------------------
  |  Branch (5672:9): [True: 0, False: 0]
  ------------------
 5673|      0|      KMP_DEBUG_ASSERT(team == hot_teams[level].hot_team);
 5674|      0|      use_hot_team = 1;
 5675|      0|    }
 5676|      0|  }
 5677|      2|#endif // KMP_NESTED_HOT_TEAMS
 5678|       |
 5679|       |  /* team is done working */
 5680|      2|  TCW_SYNC_PTR(team->t.t_pkfn,
  ------------------
  |  | 1159|      2|#define TCW_SYNC_PTR(a, b) TCW_SYNC_8((a), (b))
  |  |  ------------------
  |  |  |  | 1141|      2|#define TCW_SYNC_8(a, b) (a) = (b)
  |  |  ------------------
  ------------------
 5681|      2|               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|      2|  if (!use_hot_team) {
  ------------------
  |  Branch (5688:7): [True: 2, False: 0]
  ------------------
 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|      2|      for (f = 1; f < team->t.t_nproc; ++f) {
  ------------------
  |  Branch (5691:19): [True: 0, False: 2]
  ------------------
 5692|      0|        KMP_DEBUG_ASSERT(team->t.t_threads[f]);
 5693|      0|        kmp_info_t *th = team->t.t_threads[f];
 5694|      0|        volatile kmp_uint32 *state = &th->th.th_reap_state;
 5695|      0|        while (*state != KMP_SAFE_TO_REAP) {
  ------------------
  |  | 2047|      0|#define KMP_SAFE_TO_REAP 1 // Thread th_reap_state: safe to reap (not tasking)
  ------------------
  |  Branch (5695:16): [True: 0, False: 0]
  ------------------
 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|      0|      }
 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: 0, False: 4]
  ------------------
 5717|      0|          for (f = 0; f < team->t.t_nproc; ++f) { // threads unref task teams
  ------------------
  |  Branch (5717:23): [True: 0, False: 0]
  ------------------
 5718|      0|            KMP_DEBUG_ASSERT(team->t.t_threads[f]);
 5719|      0|            team->t.t_threads[f]->th.th_task_team = NULL;
 5720|      0|          }
 5721|      0|          KA_TRACE(
 5722|      0|              20,
 5723|      0|              ("__kmp_free_team: T#%d deactivating task_team %p on team %d\n",
 5724|      0|               __kmp_get_gtid(), task_team, team->t.t_id));
 5725|      0|#if KMP_NESTED_HOT_TEAMS
 5726|      0|          __kmp_free_task_team(master, task_team);
 5727|      0|#endif
 5728|      0|          team->t.t_task_team[tt_idx] = NULL;
 5729|      0|        }
 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|      2|    for (f = 1; f < team->t.t_nproc; ++f) {
  ------------------
  |  Branch (5739:17): [True: 0, False: 2]
  ------------------
 5740|      0|      KMP_DEBUG_ASSERT(team->t.t_threads[f]);
 5741|      0|      if (__kmp_barrier_gather_pattern[bs_forkjoin_barrier] == bp_dist_bar) {
  ------------------
  |  Branch (5741:11): [True: 0, False: 0]
  ------------------
 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|      0|      __kmp_free_thread(team->t.t_threads[f]);
 5746|      0|    }
 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|      2|    for (f = 1; f < team->t.t_nproc; ++f) {
  ------------------
  |  Branch (5769:17): [True: 0, False: 2]
  ------------------
 5770|      0|      team->t.t_threads[f] = NULL;
 5771|      0|    }
 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|      2|  } else { // Check if team was created for primary threads in teams construct
 5783|       |    // See if first worker is a CG root
 5784|      0|    KMP_DEBUG_ASSERT(team->t.t_threads[1] &&
 5785|      0|                     team->t.t_threads[1]->th.th_cg_roots);
 5786|      0|    if (team->t.t_threads[1]->th.th_cg_roots->cg_root == team->t.t_threads[1]) {
  ------------------
  |  Branch (5786:9): [True: 0, False: 0]
  ------------------
 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|      0|  }
 5809|       |
 5810|      2|  KMP_MB();
 5811|      2|}
__kmp_reap_team:
 5814|      3|kmp_team_t *__kmp_reap_team(kmp_team_t *team) {
 5815|      3|  kmp_team_t *next_pool = team->t.t_next_pool;
 5816|       |
 5817|      3|  KMP_DEBUG_ASSERT(team);
 5818|      3|  KMP_DEBUG_ASSERT(team->t.t_dispatch);
 5819|      3|  KMP_DEBUG_ASSERT(team->t.t_disp_buffer);
 5820|      3|  KMP_DEBUG_ASSERT(team->t.t_threads);
 5821|      3|  KMP_DEBUG_ASSERT(team->t.t_argv);
 5822|       |
 5823|       |  /* TODO clean the threads that are a part of this? */
 5824|       |
 5825|       |  /* free stuff */
 5826|      3|  __kmp_free_team_arrays(team);
 5827|      3|  if (team->t.t_argv != &team->t.t_inline_argv[0])
  ------------------
  |  Branch (5827:7): [True: 0, False: 3]
  ------------------
 5828|      0|    __kmp_free((void *)team->t.t_argv);
  ------------------
  |  | 3619|      0|#define __kmp_free(ptr) ___kmp_free((ptr)KMP_SRC_LOC_CURR)
  ------------------
 5829|      3|  __kmp_free(team);
  ------------------
  |  | 3619|      3|#define __kmp_free(ptr) ___kmp_free((ptr)KMP_SRC_LOC_CURR)
  ------------------
 5830|       |
 5831|      3|  KMP_MB();
 5832|      3|  return next_pool;
 5833|      3|}
__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
_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_push_num_threads:
 7772|    121|void __kmp_push_num_threads(ident_t *id, int gtid, int num_threads) {
 7773|    121|  kmp_info_t *thr = __kmp_threads[gtid];
 7774|       |
 7775|    121|  if (num_threads > 0)
  ------------------
  |  Branch (7775:7): [True: 121, False: 0]
  ------------------
 7776|    121|    thr->th.th_set_nproc = num_threads;
 7777|    121|}
__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|    363|void __kmp_resume_if_soft_paused() {
 8961|    363|  if (__kmp_pause_status == kmp_soft_paused) {
  ------------------
  |  Branch (8961:7): [True: 0, False: 363]
  ------------------
 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|    363|}
_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|    121|inline static void propagateFPControl(kmp_team_t *team) {
 1051|    121|  if (__kmp_inherit_fp_control) {
  ------------------
  |  Branch (1051:7): [True: 121, False: 0]
  ------------------
 1052|    121|    kmp_int16 x87_fpu_control_word;
 1053|    121|    kmp_uint32 mxcsr;
 1054|       |
 1055|       |    // Get primary thread's values of FPU control flags (both X87 and vector)
 1056|    121|    __kmp_store_x87_fpu_control_word(&x87_fpu_control_word);
 1057|    121|    __kmp_store_mxcsr(&mxcsr);
 1058|    121|    mxcsr &= KMP_X86_MXCSR_MASK;
  ------------------
  |  | 1403|    121|#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|    121|    KMP_CHECK_UPDATE(team->t.t_x87_fpu_control_word, x87_fpu_control_word);
  ------------------
  |  | 2280|    121|  if ((a) != (b))                                                              \
  |  |  ------------------
  |  |  |  Branch (2280:7): [True: 1, False: 120]
  |  |  ------------------
  |  | 2281|    121|  (a) = (b)
  ------------------
 1070|    121|    KMP_CHECK_UPDATE(team->t.t_mxcsr, mxcsr);
  ------------------
  |  | 2280|    121|  if ((a) != (b))                                                              \
  |  |  ------------------
  |  |  |  Branch (2280:7): [True: 1, False: 120]
  |  |  ------------------
  |  | 2281|    121|  (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|    121|    KMP_CHECK_UPDATE(team->t.t_fp_control_saved, TRUE);
  ------------------
  |  | 2280|    121|  if ((a) != (b))                                                              \
  |  |  ------------------
  |  |  |  Branch (2280:7): [True: 1, False: 120]
  |  |  ------------------
  |  | 2281|    121|  (a) = (b)
  ------------------
 1074|    121|  } 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|    121|}
kmp_runtime.cpp:_ZL22__kmp_is_fork_in_teamsP8kmp_infoPFvPiS1_zEiiPA1_13__va_list_tag:
 1375|    121|                                          int teams_level, kmp_va_list ap) {
 1376|    121|  return (master_th->th.th_teams_microtask && ap &&
  ------------------
  |  Branch (1376:11): [True: 0, False: 121]
  |  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|    121|}
kmp_runtime.cpp:_ZL23__kmp_is_entering_teamsiiiPA1_13__va_list_tag:
 1383|    121|                                           int teams_level, kmp_va_list ap) {
 1384|    121|  return ((ap == NULL && active_level == 0) ||
  ------------------
  |  Branch (1384:12): [True: 0, False: 121]
  |  Branch (1384:26): [True: 0, False: 0]
  ------------------
 1385|    121|          (ap && teams_level > 0 && teams_level == level));
  ------------------
  |  Branch (1385:12): [True: 121, False: 0]
  |  Branch (1385:18): [True: 0, False: 121]
  |  Branch (1385:37): [True: 0, False: 0]
  ------------------
 1386|    121|}
kmp_runtime.cpp:_ZL22__kmp_serial_fork_callP5identi14fork_context_eiPFvPiS2_zEPFiiEP8kmp_infoP8kmp_teamP11ompt_data_tPPvPSC_PA1_13__va_list_tag:
 1636|    121|                       kmp_va_list ap) {
 1637|    121|  kmp_team_t *team;
 1638|    121|  int i;
 1639|    121|  void **argv;
 1640|       |
 1641|       |/* josh todo: hypothetical question: what do we do for OS X*? */
 1642|    121|#if KMP_OS_LINUX &&                                                            \
 1643|    121|    (KMP_ARCH_X86 || KMP_ARCH_X86_64 || KMP_ARCH_ARM || KMP_ARCH_AARCH64)
 1644|    121|  void *args[argc];
 1645|       |#else
 1646|       |  void **args = (void **)KMP_ALLOCA(argc * sizeof(void *));
 1647|       |#endif /* KMP_OS_LINUX && ( KMP_ARCH_X86 || KMP_ARCH_X86_64 || KMP_ARCH_ARM || \
 1648|       |          KMP_ARCH_AARCH64) */
 1649|       |
 1650|    121|  KA_TRACE(
 1651|    121|      20, ("__kmp_serial_fork_call: T#%d serializing parallel region\n", gtid));
 1652|       |
 1653|    121|  __kmpc_serialized_parallel(loc, gtid);
 1654|       |
 1655|    121|#if OMPD_SUPPORT
 1656|    121|  master_th->th.th_serial_team->t.t_pkfn = microtask;
 1657|    121|#endif
 1658|       |
 1659|    121|  if (call_context == fork_context_intel) {
  ------------------
  |  Branch (1659:7): [True: 121, False: 0]
  ------------------
 1660|       |    /* TODO this sucks, use the compiler itself to pass args! :) */
 1661|    121|    master_th->th.th_serial_team->t.t_ident = loc;
 1662|    121|    if (!ap) {
  ------------------
  |  Branch (1662:9): [True: 0, False: 121]
  ------------------
 1663|       |      // revert change made in __kmpc_serialized_parallel()
 1664|      0|      master_th->th.th_serial_team->t.t_level--;
 1665|       |// Get args from parent team for teams construct
 1666|       |
 1667|      0|#if OMPT_SUPPORT
 1668|      0|      void *dummy;
 1669|      0|      void **exit_frame_p;
 1670|      0|      ompt_task_info_t *task_info;
 1671|      0|      ompt_lw_taskteam_t lw_taskteam;
 1672|       |
 1673|      0|      if (ompt_enabled.enabled) {
  ------------------
  |  Branch (1673:11): [True: 0, False: 0]
  ------------------
 1674|      0|        __ompt_lw_taskteam_init(&lw_taskteam, master_th, gtid,
 1675|      0|                                ompt_parallel_data, *return_address);
 1676|       |
 1677|      0|        __ompt_lw_taskteam_link(&lw_taskteam, master_th, 0);
 1678|       |        // don't use lw_taskteam after linking. content was swaped
 1679|      0|        task_info = OMPT_CUR_TASK_INFO(master_th);
  ------------------
  |  |   68|      0|#define OMPT_CUR_TASK_INFO(thr) (&((thr)->th.th_current_task->ompt_task_info))
  ------------------
 1680|      0|        exit_frame_p = &(task_info->frame.exit_frame.ptr);
 1681|      0|        if (ompt_enabled.ompt_callback_implicit_task) {
  ------------------
  |  Branch (1681:13): [True: 0, False: 0]
  ------------------
 1682|      0|          OMPT_CUR_TASK_INFO(master_th)->thread_num = __kmp_tid_from_gtid(gtid);
  ------------------
  |  |   68|      0|#define OMPT_CUR_TASK_INFO(thr) (&((thr)->th.th_current_task->ompt_task_info))
  ------------------
 1683|      0|          ompt_callbacks.ompt_callback(ompt_callback_implicit_task)(
  ------------------
  |  |   27|      0|#define ompt_callback(e) e##_callback
  ------------------
 1684|      0|              ompt_scope_begin, OMPT_CUR_TEAM_DATA(master_th),
  ------------------
  |  |   73|      0|  (&((thr)->th.th_team->t.ompt_team_info.parallel_data))
  ------------------
 1685|      0|              &(task_info->task_data), 1,
 1686|      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))
  ------------------
 1687|      0|        }
 1688|       |
 1689|       |        /* OMPT state */
 1690|      0|        master_th->th.ompt_thread_info.state = ompt_state_work_parallel;
 1691|      0|      } else {
 1692|      0|        exit_frame_p = &dummy;
 1693|      0|      }
 1694|      0|#endif
 1695|       |
 1696|      0|      {
 1697|      0|        KMP_TIME_PARTITIONED_BLOCK(OMP_parallel);
  ------------------
  |  | 1013|      0|#define KMP_TIME_PARTITIONED_BLOCK(name) ((void)0)
  ------------------
 1698|      0|        KMP_SET_THREAD_STATE_BLOCK(IMPLICIT_TASK);
  ------------------
  |  | 1018|      0|#define KMP_SET_THREAD_STATE_BLOCK(state_name) ((void)0)
  ------------------
 1699|      0|        __kmp_invoke_microtask(microtask, gtid, 0, argc, parent_team->t.t_argv
 1700|      0|#if OMPT_SUPPORT
 1701|      0|                               ,
 1702|      0|                               exit_frame_p
 1703|      0|#endif
 1704|      0|                               );
 1705|      0|      }
 1706|       |
 1707|      0|#if OMPT_SUPPORT
 1708|      0|      if (ompt_enabled.enabled) {
  ------------------
  |  Branch (1708:11): [True: 0, False: 0]
  ------------------
 1709|      0|        *exit_frame_p = NULL;
 1710|      0|        if (ompt_enabled.ompt_callback_implicit_task) {
  ------------------
  |  Branch (1710:13): [True: 0, False: 0]
  ------------------
 1711|      0|          ompt_callbacks.ompt_callback(ompt_callback_implicit_task)(
  ------------------
  |  |   27|      0|#define ompt_callback(e) e##_callback
  ------------------
 1712|      0|              ompt_scope_end, NULL, &(task_info->task_data), 1,
 1713|      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))
  ------------------
 1714|      0|        }
 1715|      0|        *ompt_parallel_data = *OMPT_CUR_TEAM_DATA(master_th);
  ------------------
  |  |   73|      0|  (&((thr)->th.th_team->t.ompt_team_info.parallel_data))
  ------------------
 1716|      0|        __ompt_lw_taskteam_unlink(master_th);
 1717|      0|        if (ompt_enabled.ompt_callback_parallel_end) {
  ------------------
  |  Branch (1717:13): [True: 0, False: 0]
  ------------------
 1718|      0|          ompt_callbacks.ompt_callback(ompt_callback_parallel_end)(
  ------------------
  |  |   27|      0|#define ompt_callback(e) e##_callback
  ------------------
 1719|      0|              ompt_parallel_data, *parent_task_data,
 1720|      0|              OMPT_INVOKER(call_context) | ompt_parallel_team, *return_address);
  ------------------
  |  |   24|      0|  ((x == fork_context_gnu) ? ompt_parallel_invoker_program                     \
  |  |  ------------------
  |  |  |  Branch (24:4): [True: 0, False: 0]
  |  |  ------------------
  |  |   25|      0|                           : ompt_parallel_invoker_runtime)
  ------------------
 1721|      0|        }
 1722|      0|        master_th->th.ompt_thread_info.state = ompt_state_overhead;
 1723|      0|      }
 1724|      0|#endif
 1725|    121|    } else if (microtask == (microtask_t)__kmp_teams_master) {
  ------------------
  |  Branch (1725:16): [True: 0, False: 121]
  ------------------
 1726|      0|      KMP_DEBUG_ASSERT(master_th->th.th_team == master_th->th.th_serial_team);
 1727|      0|      team = master_th->th.th_team;
 1728|       |      // team->t.t_pkfn = microtask;
 1729|      0|      team->t.t_invoke = invoker;
 1730|      0|      __kmp_alloc_argv_entries(argc, team, TRUE);
  ------------------
  |  | 1280|      0|#define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  | 1279|      0|#define FALSE 0
  |  |  ------------------
  ------------------
 1731|      0|      team->t.t_argc = argc;
 1732|      0|      argv = (void **)team->t.t_argv;
 1733|      0|      if (ap) {
  ------------------
  |  Branch (1733:11): [True: 0, False: 0]
  ------------------
 1734|      0|        for (i = argc - 1; i >= 0; --i)
  ------------------
  |  Branch (1734:28): [True: 0, False: 0]
  ------------------
 1735|      0|          *argv++ = va_arg(kmp_va_deref(ap), void *);
 1736|      0|      } else {
 1737|      0|        for (i = 0; i < argc; ++i)
  ------------------
  |  Branch (1737:21): [True: 0, False: 0]
  ------------------
 1738|       |          // Get args from parent team for teams construct
 1739|      0|          argv[i] = parent_team->t.t_argv[i];
 1740|      0|      }
 1741|       |      // AC: revert change made in __kmpc_serialized_parallel()
 1742|       |      //     because initial code in teams should have level=0
 1743|      0|      team->t.t_level--;
 1744|       |      // AC: call special invoker for outer "parallel" of teams construct
 1745|      0|      invoker(gtid);
 1746|      0|#if OMPT_SUPPORT
 1747|      0|      if (ompt_enabled.enabled) {
  ------------------
  |  Branch (1747:11): [True: 0, False: 0]
  ------------------
 1748|      0|        ompt_task_info_t *task_info = OMPT_CUR_TASK_INFO(master_th);
  ------------------
  |  |   68|      0|#define OMPT_CUR_TASK_INFO(thr) (&((thr)->th.th_current_task->ompt_task_info))
  ------------------
 1749|      0|        if (ompt_enabled.ompt_callback_implicit_task) {
  ------------------
  |  Branch (1749:13): [True: 0, False: 0]
  ------------------
 1750|      0|          ompt_callbacks.ompt_callback(ompt_callback_implicit_task)(
  ------------------
  |  |   27|      0|#define ompt_callback(e) e##_callback
  ------------------
 1751|      0|              ompt_scope_end, NULL, &(task_info->task_data), 0,
 1752|      0|              OMPT_CUR_TASK_INFO(master_th)->thread_num, ompt_task_initial);
  ------------------
  |  |   68|      0|#define OMPT_CUR_TASK_INFO(thr) (&((thr)->th.th_current_task->ompt_task_info))
  ------------------
 1753|      0|        }
 1754|      0|        if (ompt_enabled.ompt_callback_parallel_end) {
  ------------------
  |  Branch (1754:13): [True: 0, False: 0]
  ------------------
 1755|      0|          ompt_callbacks.ompt_callback(ompt_callback_parallel_end)(
  ------------------
  |  |   27|      0|#define ompt_callback(e) e##_callback
  ------------------
 1756|      0|              ompt_parallel_data, *parent_task_data,
 1757|      0|              OMPT_INVOKER(call_context) | ompt_parallel_league,
  ------------------
  |  |   24|      0|  ((x == fork_context_gnu) ? ompt_parallel_invoker_program                     \
  |  |  ------------------
  |  |  |  Branch (24:4): [True: 0, False: 0]
  |  |  ------------------
  |  |   25|      0|                           : ompt_parallel_invoker_runtime)
  ------------------
 1758|      0|              *return_address);
 1759|      0|        }
 1760|      0|        master_th->th.ompt_thread_info.state = ompt_state_overhead;
 1761|      0|      }
 1762|      0|#endif
 1763|    121|    } else {
 1764|    121|      argv = args;
 1765|    363|      for (i = argc - 1; i >= 0; --i)
  ------------------
  |  Branch (1765:26): [True: 242, False: 121]
  ------------------
 1766|    242|        *argv++ = va_arg(kmp_va_deref(ap), void *);
 1767|    121|      KMP_MB();
 1768|       |
 1769|    121|#if OMPT_SUPPORT
 1770|    121|      void *dummy;
 1771|    121|      void **exit_frame_p;
 1772|    121|      ompt_task_info_t *task_info;
 1773|    121|      ompt_lw_taskteam_t lw_taskteam;
 1774|    121|      ompt_data_t *implicit_task_data;
 1775|       |
 1776|    121|      if (ompt_enabled.enabled) {
  ------------------
  |  Branch (1776:11): [True: 0, False: 121]
  ------------------
 1777|      0|        __ompt_lw_taskteam_init(&lw_taskteam, master_th, gtid,
 1778|      0|                                ompt_parallel_data, *return_address);
 1779|      0|        __ompt_lw_taskteam_link(&lw_taskteam, master_th, 0);
 1780|       |        // don't use lw_taskteam after linking. content was swaped
 1781|      0|        task_info = OMPT_CUR_TASK_INFO(master_th);
  ------------------
  |  |   68|      0|#define OMPT_CUR_TASK_INFO(thr) (&((thr)->th.th_current_task->ompt_task_info))
  ------------------
 1782|      0|        exit_frame_p = &(task_info->frame.exit_frame.ptr);
 1783|       |
 1784|       |        /* OMPT implicit task begin */
 1785|      0|        implicit_task_data = OMPT_CUR_TASK_DATA(master_th);
  ------------------
  |  |   70|      0|  (&((thr)->th.th_current_task->ompt_task_info.task_data))
  ------------------
 1786|      0|        if (ompt_enabled.ompt_callback_implicit_task) {
  ------------------
  |  Branch (1786:13): [True: 0, False: 0]
  ------------------
 1787|      0|          ompt_callbacks.ompt_callback(ompt_callback_implicit_task)(
  ------------------
  |  |   27|      0|#define ompt_callback(e) e##_callback
  ------------------
 1788|      0|              ompt_scope_begin, OMPT_CUR_TEAM_DATA(master_th),
  ------------------
  |  |   73|      0|  (&((thr)->th.th_team->t.ompt_team_info.parallel_data))
  ------------------
 1789|      0|              implicit_task_data, 1, __kmp_tid_from_gtid(gtid),
 1790|      0|              ompt_task_implicit);
 1791|      0|          OMPT_CUR_TASK_INFO(master_th)->thread_num = __kmp_tid_from_gtid(gtid);
  ------------------
  |  |   68|      0|#define OMPT_CUR_TASK_INFO(thr) (&((thr)->th.th_current_task->ompt_task_info))
  ------------------
 1792|      0|        }
 1793|       |
 1794|       |        /* OMPT state */
 1795|      0|        master_th->th.ompt_thread_info.state = ompt_state_work_parallel;
 1796|    121|      } else {
 1797|    121|        exit_frame_p = &dummy;
 1798|    121|      }
 1799|    121|#endif
 1800|       |
 1801|    121|      {
 1802|    121|        KMP_TIME_PARTITIONED_BLOCK(OMP_parallel);
  ------------------
  |  | 1013|    121|#define KMP_TIME_PARTITIONED_BLOCK(name) ((void)0)
  ------------------
 1803|    121|        KMP_SET_THREAD_STATE_BLOCK(IMPLICIT_TASK);
  ------------------
  |  | 1018|    121|#define KMP_SET_THREAD_STATE_BLOCK(state_name) ((void)0)
  ------------------
 1804|    121|        __kmp_invoke_microtask(microtask, gtid, 0, argc, args
 1805|    121|#if OMPT_SUPPORT
 1806|    121|                               ,
 1807|    121|                               exit_frame_p
 1808|    121|#endif
 1809|    121|                               );
 1810|    121|      }
 1811|       |
 1812|    121|#if OMPT_SUPPORT
 1813|    121|      if (ompt_enabled.enabled) {
  ------------------
  |  Branch (1813:11): [True: 0, False: 121]
  ------------------
 1814|      0|        *exit_frame_p = NULL;
 1815|      0|        if (ompt_enabled.ompt_callback_implicit_task) {
  ------------------
  |  Branch (1815:13): [True: 0, False: 0]
  ------------------
 1816|      0|          ompt_callbacks.ompt_callback(ompt_callback_implicit_task)(
  ------------------
  |  |   27|      0|#define ompt_callback(e) e##_callback
  ------------------
 1817|      0|              ompt_scope_end, NULL, &(task_info->task_data), 1,
 1818|      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))
  ------------------
 1819|      0|        }
 1820|       |
 1821|      0|        *ompt_parallel_data = *OMPT_CUR_TEAM_DATA(master_th);
  ------------------
  |  |   73|      0|  (&((thr)->th.th_team->t.ompt_team_info.parallel_data))
  ------------------
 1822|      0|        __ompt_lw_taskteam_unlink(master_th);
 1823|      0|        if (ompt_enabled.ompt_callback_parallel_end) {
  ------------------
  |  Branch (1823:13): [True: 0, False: 0]
  ------------------
 1824|      0|          ompt_callbacks.ompt_callback(ompt_callback_parallel_end)(
  ------------------
  |  |   27|      0|#define ompt_callback(e) e##_callback
  ------------------
 1825|      0|              ompt_parallel_data, *parent_task_data,
 1826|      0|              OMPT_INVOKER(call_context) | ompt_parallel_team, *return_address);
  ------------------
  |  |   24|      0|  ((x == fork_context_gnu) ? ompt_parallel_invoker_program                     \
  |  |  ------------------
  |  |  |  Branch (24:4): [True: 0, False: 0]
  |  |  ------------------
  |  |   25|      0|                           : ompt_parallel_invoker_runtime)
  ------------------
 1827|      0|        }
 1828|      0|        master_th->th.ompt_thread_info.state = ompt_state_overhead;
 1829|      0|      }
 1830|    121|#endif
 1831|    121|    }
 1832|    121|  } else if (call_context == fork_context_gnu) {
  ------------------
  |  Branch (1832:14): [True: 0, False: 0]
  ------------------
 1833|      0|#if OMPT_SUPPORT
 1834|      0|    if (ompt_enabled.enabled) {
  ------------------
  |  Branch (1834:9): [True: 0, False: 0]
  ------------------
 1835|      0|      ompt_lw_taskteam_t lwt;
 1836|      0|      __ompt_lw_taskteam_init(&lwt, master_th, gtid, ompt_parallel_data,
 1837|      0|                              *return_address);
 1838|       |
 1839|      0|      lwt.ompt_task_info.frame.exit_frame = ompt_data_none;
  ------------------
  |  | 1408|      0|#define ompt_data_none {0}
  ------------------
 1840|      0|      __ompt_lw_taskteam_link(&lwt, master_th, 1);
 1841|      0|    }
 1842|       |// don't use lw_taskteam after linking. content was swaped
 1843|      0|#endif
 1844|       |
 1845|       |    // we were called from GNU native code
 1846|      0|    KA_TRACE(20, ("__kmp_serial_fork_call: T#%d serial exit\n", gtid));
 1847|      0|    return FALSE;
  ------------------
  |  | 1279|      0|#define FALSE 0
  ------------------
 1848|      0|  } else {
 1849|      0|    KMP_ASSERT2(call_context < fork_context_last,
  ------------------
  |  |   53|      0|#define KMP_ASSERT2(cond, msg) KMP_ASSERT(cond)
  |  |  ------------------
  |  |  |  |   50|      0|  if (!(cond)) {                                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (50:7): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   51|      0|    __kmp_debug_assert("assertion failure", __FILE__, __LINE__);               \
  |  |  |  |   52|      0|  }
  |  |  ------------------
  ------------------
 1850|      0|                "__kmp_serial_fork_call: unknown fork_context parameter");
 1851|      0|  }
 1852|       |
 1853|    121|  KA_TRACE(20, ("__kmp_serial_fork_call: T#%d serial exit\n", gtid));
 1854|    121|  KMP_MB();
 1855|    121|  return FALSE;
  ------------------
  |  | 1279|    121|#define FALSE 0
  ------------------
 1856|    121|}
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|      2|    for (i = 0; i < hot_team->t.t_nproc; ++i) {
  ------------------
  |  Branch (4083:17): [True: 1, False: 1]
  ------------------
 4084|      1|      kmp_info_t *th = hot_team->t.t_threads[i];
 4085|      1|      if (__kmp_hot_teams_max_level > 1) {
  ------------------
  |  Branch (4085:11): [True: 0, False: 1]
  ------------------
 4086|      0|        n += __kmp_free_hot_teams(root, th, 1, __kmp_hot_teams_max_level);
 4087|      0|      }
 4088|      1|      if (th->th.th_hot_teams) {
  ------------------
  |  Branch (4088:11): [True: 1, False: 0]
  ------------------
 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|      1|    }
 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|      1|static void __kmp_reap_thread(kmp_info_t *thread, int is_root) {
 6161|       |  // It is assumed __kmp_forkjoin_lock is acquired.
 6162|       |
 6163|      1|  int gtid;
 6164|       |
 6165|      1|  KMP_DEBUG_ASSERT(thread != NULL);
 6166|       |
 6167|      1|  gtid = thread->th.th_info.ds.ds_gtid;
 6168|       |
 6169|      1|  if (!is_root) {
  ------------------
  |  Branch (6169:7): [True: 0, False: 1]
  ------------------
 6170|      0|    if (__kmp_dflt_blocktime != KMP_MAX_BLOCKTIME) {
  ------------------
  |  | 1184|      0|  (INT_MAX) /* Must be this for "infinite" setting the work */
  ------------------
  |  Branch (6170:9): [True: 0, False: 0]
  ------------------
 6171|       |      /* Assume the threads are at the fork barrier here */
 6172|      0|      KA_TRACE(
 6173|      0|          20, ("__kmp_reap_thread: releasing T#%d from fork barrier for reap\n",
 6174|      0|               gtid));
 6175|      0|      if (__kmp_barrier_gather_pattern[bs_forkjoin_barrier] == bp_dist_bar) {
  ------------------
  |  Branch (6175:11): [True: 0, False: 0]
  ------------------
 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|      0|      } else {
 6181|       |        /* Need release fence here to prevent seg faults for tree forkjoin
 6182|       |           barrier (GEH) */
 6183|      0|        kmp_flag_64<> flag(&thread->th.th_bar[bs_forkjoin_barrier].bb.b_go,
 6184|      0|                           thread);
 6185|      0|        __kmp_release_64(&flag);
 6186|      0|      }
 6187|      0|    }
 6188|       |
 6189|       |    // Terminate OS thread.
 6190|      0|    __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|      0|    if (thread->th.th_active_in_pool) {
  ------------------
  |  Branch (6202:9): [True: 0, False: 0]
  ------------------
 6203|      0|      thread->th.th_active_in_pool = FALSE;
  ------------------
  |  | 1279|      0|#define FALSE 0
  ------------------
 6204|      0|      KMP_ATOMIC_DEC(&__kmp_thread_pool_active_nth);
  ------------------
  |  | 1260|      0|#define KMP_ATOMIC_DEC(p) KMP_ATOMIC_OP(fetch_sub, p, 1, acq_rel)
  |  |  ------------------
  |  |  |  | 1246|      0|#define KMP_ATOMIC_OP(op, p, v, order) (p)->op(v, std::memory_order_##order)
  |  |  ------------------
  ------------------
 6205|      0|      KMP_DEBUG_ASSERT(__kmp_thread_pool_active_nth >= 0);
 6206|      0|    }
 6207|      0|  }
 6208|       |
 6209|      1|  __kmp_free_implicit_task(thread);
 6210|       |
 6211|       |// Free the fast memory for tasking
 6212|      1|#if USE_FAST_MEMORY
 6213|      1|  __kmp_free_fast_memory(thread);
 6214|      1|#endif /* USE_FAST_MEMORY */
 6215|       |
 6216|      1|  __kmp_suspend_uninitialize_thread(thread);
 6217|       |
 6218|      1|  KMP_DEBUG_ASSERT(__kmp_threads[gtid] == thread);
 6219|      1|  TCW_SYNC_PTR(__kmp_threads[gtid], NULL);
  ------------------
  |  | 1159|      1|#define TCW_SYNC_PTR(a, b) TCW_SYNC_8((a), (b))
  |  |  ------------------
  |  |  |  | 1141|      1|#define TCW_SYNC_8(a, b) (a) = (b)
  |  |  ------------------
  ------------------
 6220|       |
 6221|      1|  --__kmp_all_nth;
 6222|       |  // __kmp_nth was decremented when thread is added to the pool.
 6223|       |
 6224|      1|#ifdef KMP_ADJUST_BLOCKTIME
 6225|       |  /* Adjust blocktime back to user setting or default if necessary */
 6226|       |  /* Middle initialization might never have occurred                */
 6227|      1|  if (!__kmp_env_blocktime && (__kmp_avail_proc > 0)) {
  ------------------
  |  Branch (6227:7): [True: 1, False: 0]
  |  Branch (6227:31): [True: 1, False: 0]
  ------------------
 6228|      1|    KMP_DEBUG_ASSERT(__kmp_avail_proc > 0);
 6229|      1|    if (__kmp_nth <= __kmp_avail_proc) {
  ------------------
  |  Branch (6229:9): [True: 1, False: 0]
  ------------------
 6230|      1|      __kmp_zero_bt = FALSE;
  ------------------
  |  | 1279|      1|#define FALSE 0
  ------------------
 6231|      1|    }
 6232|      1|  }
 6233|      1|#endif /* KMP_ADJUST_BLOCKTIME */
 6234|       |
 6235|       |  /* free the memory being used */
 6236|      1|  if (__kmp_env_consistency_check) {
  ------------------
  |  Branch (6236:7): [True: 0, False: 1]
  ------------------
 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|      1|  if (thread->th.th_pri_common != NULL) {
  ------------------
  |  Branch (6243:7): [True: 1, False: 0]
  ------------------
 6244|      1|    __kmp_free(thread->th.th_pri_common);
  ------------------
  |  | 3619|      1|#define __kmp_free(ptr) ___kmp_free((ptr)KMP_SRC_LOC_CURR)
  ------------------
 6245|      1|    thread->th.th_pri_common = NULL;
 6246|      1|  }
 6247|       |
 6248|      1|  if (thread->th.th_task_state_memo_stack != NULL) {
  ------------------
  |  Branch (6248:7): [True: 1, False: 0]
  ------------------
 6249|      1|    __kmp_free(thread->th.th_task_state_memo_stack);
  ------------------
  |  | 3619|      1|#define __kmp_free(ptr) ___kmp_free((ptr)KMP_SRC_LOC_CURR)
  ------------------
 6250|      1|    thread->th.th_task_state_memo_stack = NULL;
 6251|      1|  }
 6252|       |
 6253|      1|#if KMP_USE_BGET
 6254|      1|  if (thread->th.th_local.bget_data != NULL) {
  ------------------
  |  Branch (6254:7): [True: 1, False: 0]
  ------------------
 6255|      1|    __kmp_finalize_bget(thread);
 6256|      1|  }
 6257|      1|#endif
 6258|       |
 6259|      1|#if KMP_AFFINITY_SUPPORTED
 6260|      1|  if (thread->th.th_affin_mask != NULL) {
  ------------------
  |  Branch (6260:7): [True: 1, False: 0]
  ------------------
 6261|      1|    KMP_CPU_FREE(thread->th.th_affin_mask);
  ------------------
  |  |  698|      1|#define KMP_CPU_FREE(ptr) __kmp_affinity_dispatch->deallocate_mask(ptr)
  ------------------
 6262|      1|    thread->th.th_affin_mask = NULL;
 6263|      1|  }
 6264|      1|#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|      1|  __kmp_reap_team(thread->th.th_serial_team);
 6274|      1|  thread->th.th_serial_team = NULL;
 6275|      1|  __kmp_free(thread);
  ------------------
  |  | 3619|      1|#define __kmp_free(ptr) ___kmp_free((ptr)KMP_SRC_LOC_CURR)
  ------------------
 6276|       |
 6277|      1|  KMP_MB();
 6278|       |
 6279|      1|} // __kmp_reap_thread
kmp_runtime.cpp:_ZL21__kmp_initialize_infoP8kmp_infoP8kmp_teamii:
 4247|      1|                                  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|      1|  KMP_DEBUG_ASSERT(this_thr != NULL);
 4252|      1|  KMP_DEBUG_ASSERT(this_thr->th.th_serial_team);
 4253|      1|  KMP_DEBUG_ASSERT(team);
 4254|      1|  KMP_DEBUG_ASSERT(team->t.t_threads);
 4255|      1|  KMP_DEBUG_ASSERT(team->t.t_dispatch);
 4256|      1|  kmp_info_t *master = team->t.t_threads[0];
 4257|      1|  KMP_DEBUG_ASSERT(master);
 4258|      1|  KMP_DEBUG_ASSERT(master->th.th_root);
 4259|       |
 4260|      1|  KMP_MB();
 4261|       |
 4262|      1|  TCW_SYNC_PTR(this_thr->th.th_team, team);
  ------------------
  |  | 1159|      1|#define TCW_SYNC_PTR(a, b) TCW_SYNC_8((a), (b))
  |  |  ------------------
  |  |  |  | 1141|      1|#define TCW_SYNC_8(a, b) (a) = (b)
  |  |  ------------------
  ------------------
 4263|       |
 4264|      1|  this_thr->th.th_info.ds.ds_tid = tid;
 4265|      1|  this_thr->th.th_set_nproc = 0;
 4266|      1|  if (__kmp_tasking_mode != tskm_immediate_exec)
  ------------------
  |  Branch (4266:7): [True: 1, 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|      1|    this_thr->th.th_reap_state = KMP_NOT_SAFE_TO_REAP;
  ------------------
  |  | 2046|      1|  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|      1|  this_thr->th.th_set_proc_bind = proc_bind_default;
 4273|      1|#if KMP_AFFINITY_SUPPORTED
 4274|      1|  this_thr->th.th_new_place = this_thr->th.th_current_place;
 4275|      1|#endif
 4276|      1|  this_thr->th.th_root = master->th.th_root;
 4277|       |
 4278|       |  /* setup the thread's cache of the team structure */
 4279|      1|  this_thr->th.th_team_nproc = team->t.t_nproc;
 4280|      1|  this_thr->th.th_team_master = master;
 4281|      1|  this_thr->th.th_team_serialized = team->t.t_serialized;
 4282|       |
 4283|      1|  KMP_DEBUG_ASSERT(team->t.t_implicit_task_taskdata);
 4284|       |
 4285|      1|  KF_TRACE(10, ("__kmp_initialize_info1: T#%d:%d this_thread=%p curtask=%p\n",
 4286|      1|                tid, gtid, this_thr, this_thr->th.th_current_task));
 4287|       |
 4288|      1|  __kmp_init_implicit_task(this_thr->th.th_team_master->th.th_ident, this_thr,
 4289|      1|                           team, tid, TRUE);
  ------------------
  |  | 1280|      1|#define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  | 1279|      1|#define FALSE 0
  |  |  ------------------
  ------------------
 4290|       |
 4291|      1|  KF_TRACE(10, ("__kmp_initialize_info2: T#%d:%d this_thread=%p curtask=%p\n",
 4292|      1|                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|      1|  this_thr->th.th_dispatch = &team->t.t_dispatch[tid];
 4298|       |
 4299|      1|  this_thr->th.th_local.this_construct = 0;
 4300|       |
 4301|      1|  if (!this_thr->th.th_pri_common) {
  ------------------
  |  Branch (4301:7): [True: 1, False: 0]
  ------------------
 4302|      1|    this_thr->th.th_pri_common =
 4303|      1|        (struct common_table *)__kmp_allocate(sizeof(struct common_table));
  ------------------
  |  | 3617|      1|#define __kmp_allocate(size) ___kmp_allocate((size)KMP_SRC_LOC_CURR)
  ------------------
 4304|      1|    if (__kmp_storage_map) {
  ------------------
  |  Branch (4304:9): [True: 0, False: 1]
  ------------------
 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|      1|    this_thr->th.th_pri_head = NULL;
 4310|      1|  }
 4311|       |
 4312|      1|  if (this_thr != master && // Primary thread's CG root is initialized elsewhere
  ------------------
  |  Branch (4312:7): [True: 0, False: 1]
  ------------------
 4313|      0|      this_thr->th.th_cg_roots != master->th.th_cg_roots) { // CG root not set
  ------------------
  |  Branch (4313:7): [True: 0, False: 0]
  ------------------
 4314|       |    // Make new thread's CG root same as primary thread's
 4315|      0|    KMP_DEBUG_ASSERT(master->th.th_cg_roots);
 4316|      0|    kmp_cg_root_t *tmp = this_thr->th.th_cg_roots;
 4317|      0|    if (tmp) {
  ------------------
  |  Branch (4317:9): [True: 0, False: 0]
  ------------------
 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|      0|    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|      0|    this_thr->th.th_cg_roots->cg_nthreads++;
 4330|      0|    KA_TRACE(100, ("__kmp_initialize_info: Thread %p increment cg_nthreads on"
 4331|      0|                   " node %p of thread %p to %d\n",
 4332|      0|                   this_thr, this_thr->th.th_cg_roots,
 4333|      0|                   this_thr->th.th_cg_roots->cg_root,
 4334|      0|                   this_thr->th.th_cg_roots->cg_nthreads));
 4335|      0|    this_thr->th.th_current_task->td_icvs.thread_limit =
 4336|      0|        this_thr->th.th_cg_roots->cg_thread_limit;
 4337|      0|  }
 4338|       |
 4339|       |  /* Initialize dynamic dispatch */
 4340|      1|  {
 4341|      1|    volatile kmp_disp_t *dispatch = this_thr->th.th_dispatch;
 4342|       |    // Use team max_nproc since this will never change for the team.
 4343|      1|    size_t disp_size =
 4344|      1|        sizeof(dispatch_private_info_t) *
 4345|      1|        (team->t.t_max_nproc == 1 ? 1 : __kmp_dispatch_num_buffers);
  ------------------
  |  Branch (4345:10): [True: 1, False: 0]
  ------------------
 4346|      1|    KD_TRACE(10, ("__kmp_initialize_info: T#%d max_nproc: %d\n", gtid,
 4347|      1|                  team->t.t_max_nproc));
 4348|      1|    KMP_ASSERT(dispatch);
  ------------------
  |  |   50|      1|  if (!(cond)) {                                                               \
  |  |  ------------------
  |  |  |  Branch (50:7): [True: 0, False: 1]
  |  |  ------------------
  |  |   51|      0|    __kmp_debug_assert("assertion failure", __FILE__, __LINE__);               \
  |  |   52|      0|  }
  ------------------
 4349|      1|    KMP_DEBUG_ASSERT(team->t.t_dispatch);
 4350|      1|    KMP_DEBUG_ASSERT(dispatch == &team->t.t_dispatch[tid]);
 4351|       |
 4352|      1|    dispatch->th_disp_index = 0;
 4353|      1|    dispatch->th_doacross_buf_idx = 0;
 4354|      1|    if (!dispatch->th_disp_buffer) {
  ------------------
  |  Branch (4354:9): [True: 1, False: 0]
  ------------------
 4355|      1|      dispatch->th_disp_buffer =
 4356|      1|          (dispatch_private_info_t *)__kmp_allocate(disp_size);
  ------------------
  |  | 3617|      1|#define __kmp_allocate(size) ___kmp_allocate((size)KMP_SRC_LOC_CURR)
  ------------------
 4357|       |
 4358|      1|      if (__kmp_storage_map) {
  ------------------
  |  Branch (4358:11): [True: 0, False: 1]
  ------------------
 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|      1|    } else {
 4370|      0|      memset(&dispatch->th_disp_buffer[0], '\0', disp_size);
 4371|      0|    }
 4372|       |
 4373|      1|    dispatch->th_dispatch_pr_current = 0;
 4374|      1|    dispatch->th_dispatch_sh_current = 0;
 4375|       |
 4376|      1|    dispatch->th_deo_fcn = 0; /* ORDERED     */
 4377|      1|    dispatch->th_dxo_fcn = 0; /* END ORDERED */
 4378|      1|  }
 4379|       |
 4380|      1|  this_thr->th.th_next_pool = NULL;
 4381|       |
 4382|      1|  if (!this_thr->th.th_task_state_memo_stack) {
  ------------------
  |  Branch (4382:7): [True: 1, False: 0]
  ------------------
 4383|      1|    size_t i;
 4384|      1|    this_thr->th.th_task_state_memo_stack =
 4385|      1|        (kmp_uint8 *)__kmp_allocate(4 * sizeof(kmp_uint8));
  ------------------
  |  | 3617|      1|#define __kmp_allocate(size) ___kmp_allocate((size)KMP_SRC_LOC_CURR)
  ------------------
 4386|      1|    this_thr->th.th_task_state_top = 0;
 4387|      1|    this_thr->th.th_task_state_stack_sz = 4;
 4388|      5|    for (i = 0; i < this_thr->th.th_task_state_stack_sz;
  ------------------
  |  Branch (4388:17): [True: 4, False: 1]
  ------------------
 4389|      4|         ++i) // zero init the stack
 4390|      4|      this_thr->th.th_task_state_memo_stack[i] = 0;
 4391|      1|  }
 4392|       |
 4393|      1|  KMP_DEBUG_ASSERT(!this_thr->th.th_spin_here);
 4394|      1|  KMP_DEBUG_ASSERT(this_thr->th.th_next_waiting == 0);
 4395|       |
 4396|      1|  KMP_MB();
 4397|      1|}
kmp_runtime.cpp:_ZL23__kmp_reinitialize_teamP8kmp_teamP20kmp_internal_controlP5ident:
 4694|      3|                                    ident_t *loc) {
 4695|      3|  KF_TRACE(10, ("__kmp_reinitialize_team: enter this_thread=%p team=%p\n",
 4696|      3|                team->t.t_threads[0], team));
 4697|      3|  KMP_DEBUG_ASSERT(team && new_icvs);
 4698|      3|  KMP_DEBUG_ASSERT((!TCR_4(__kmp_init_parallel)) || new_icvs->nproc);
 4699|      3|  KMP_CHECK_UPDATE(team->t.t_ident, loc);
  ------------------
  |  | 2280|      3|  if ((a) != (b))                                                              \
  |  |  ------------------
  |  |  |  Branch (2280:7): [True: 0, False: 3]
  |  |  ------------------
  |  | 2281|      3|  (a) = (b)
  ------------------
 4700|       |
 4701|      3|  KMP_CHECK_UPDATE(team->t.t_id, KMP_GEN_TEAM_ID());
  ------------------
  |  | 2280|      3|  if ((a) != (b))                                                              \
  |  |  ------------------
  |  |  |  Branch (2280:7): [True: 3, False: 0]
  |  |  ------------------
  |  | 2281|      3|  (a) = (b)
  ------------------
 4702|       |  // Copy ICVs to the primary thread's implicit taskdata
 4703|      3|  __kmp_init_implicit_task(loc, team->t.t_threads[0], team, 0, FALSE);
  ------------------
  |  | 1279|      3|#define FALSE 0
  ------------------
 4704|      3|  copy_icvs(&team->t.t_implicit_task_taskdata[0].td_icvs, new_icvs);
 4705|       |
 4706|      3|  KF_TRACE(10, ("__kmp_reinitialize_team: exit this_thread=%p team=%p\n",
 4707|      3|                team->t.t_threads[0], team));
 4708|      3|}
kmp_runtime.cpp:_ZL21__kmp_initialize_teamP8kmp_teamiP20kmp_internal_controlP5ident:
 4715|      3|                                  ident_t *loc) {
 4716|      3|  KF_TRACE(10, ("__kmp_initialize_team: enter: team=%p\n", team));
 4717|       |
 4718|       |  /* verify */
 4719|      3|  KMP_DEBUG_ASSERT(team);
 4720|      3|  KMP_DEBUG_ASSERT(new_nproc <= team->t.t_max_nproc);
 4721|      3|  KMP_DEBUG_ASSERT(team->t.t_threads);
 4722|      3|  KMP_MB();
 4723|       |
 4724|      3|  team->t.t_master_tid = 0; /* not needed */
 4725|       |  /* team->t.t_master_bar;        not needed */
 4726|      3|  team->t.t_serialized = new_nproc > 1 ? 0 : 1;
  ------------------
  |  Branch (4726:26): [True: 0, False: 3]
  ------------------
 4727|      3|  team->t.t_nproc = new_nproc;
 4728|       |
 4729|       |  /* team->t.t_parent     = NULL; TODO not needed & would mess up hot team */
 4730|      3|  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|      3|  TCW_SYNC_PTR(team->t.t_pkfn, NULL); /* not needed */
  ------------------
  |  | 1159|      3|#define TCW_SYNC_PTR(a, b) TCW_SYNC_8((a), (b))
  |  |  ------------------
  |  |  |  | 1141|      3|#define TCW_SYNC_8(a, b) (a) = (b)
  |  |  ------------------
  ------------------
 4735|      3|  team->t.t_invoke = NULL; /* not needed */
 4736|       |
 4737|       |  // TODO???: team->t.t_max_active_levels       = new_max_active_levels;
 4738|      3|  team->t.t_sched.sched = new_icvs->sched.sched;
 4739|       |
 4740|      3|#if KMP_ARCH_X86 || KMP_ARCH_X86_64
 4741|      3|  team->t.t_fp_control_saved = FALSE; /* not needed */
  ------------------
  |  | 1279|      3|#define FALSE 0
  ------------------
 4742|      3|  team->t.t_x87_fpu_control_word = 0; /* not needed */
 4743|      3|  team->t.t_mxcsr = 0; /* not needed */
 4744|      3|#endif /* KMP_ARCH_X86 || KMP_ARCH_X86_64 */
 4745|       |
 4746|      3|  team->t.t_construct = 0;
 4747|       |
 4748|      3|  team->t.t_ordered.dt.t_value = 0;
 4749|      3|  team->t.t_master_active = FALSE;
  ------------------
  |  | 1279|      3|#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|      3|  team->t.t_control_stack_top = NULL;
 4759|       |
 4760|      3|  __kmp_reinitialize_team(team, new_icvs, loc);
 4761|       |
 4762|      3|  KMP_MB();
 4763|      3|  KF_TRACE(10, ("__kmp_initialize_team: exit: team=%p\n", team));
 4764|      3|}
kmp_runtime.cpp:_ZL24__kmp_alloc_argv_entriesiP8kmp_teami:
 3170|      3|static void __kmp_alloc_argv_entries(int argc, kmp_team_t *team, int realloc) {
 3171|       |
 3172|      3|  KMP_DEBUG_ASSERT(team);
 3173|      3|  if (!realloc || argc > team->t.t_max_argc) {
  ------------------
  |  Branch (3173:7): [True: 3, False: 0]
  |  Branch (3173:19): [True: 0, False: 0]
  ------------------
 3174|       |
 3175|      3|    KA_TRACE(100, ("__kmp_alloc_argv_entries: team %d: needed entries=%d, "
 3176|      3|                   "current entries=%d\n",
 3177|      3|                   team->t.t_id, argc, (realloc) ? team->t.t_max_argc : 0));
 3178|       |    /* if previously allocated heap space for args, free them */
 3179|      3|    if (realloc && team->t.t_argv != &team->t.t_inline_argv[0])
  ------------------
  |  Branch (3179:9): [True: 0, False: 3]
  |  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|      3|    if (argc <= KMP_INLINE_ARGV_ENTRIES) {
  ------------------
  |  | 2998|      3|#define KMP_INLINE_ARGV_ENTRIES (int)(KMP_INLINE_ARGV_BYTES / KMP_PTR_SKIP)
  |  |  ------------------
  |  |  |  | 2990|      3|  (4 * CACHE_LINE -                                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|      3|# define CACHE_LINE 64
  |  |  |  |  ------------------
  |  |  |  | 2991|      3|   ((3 * KMP_PTR_SKIP + 2 * sizeof(int) + 2 * sizeof(kmp_int8) +               \
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|      3|#define KMP_PTR_SKIP (sizeof(void *))
  |  |  |  |  ------------------
  |  |  |  | 2992|      3|     sizeof(kmp_int16) + sizeof(kmp_uint32)) %                                 \
  |  |  |  | 2993|      3|    CACHE_LINE))
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|      3|# define CACHE_LINE 64
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define KMP_INLINE_ARGV_ENTRIES (int)(KMP_INLINE_ARGV_BYTES / KMP_PTR_SKIP)
  |  |  ------------------
  |  |  |  |   30|      3|#define KMP_PTR_SKIP (sizeof(void *))
  |  |  ------------------
  ------------------
  |  Branch (3182:9): [True: 3, False: 0]
  ------------------
 3183|       |      /* use unused space in the cache line for arguments */
 3184|      3|      team->t.t_max_argc = KMP_INLINE_ARGV_ENTRIES;
  ------------------
  |  | 2998|      3|#define KMP_INLINE_ARGV_ENTRIES (int)(KMP_INLINE_ARGV_BYTES / KMP_PTR_SKIP)
  |  |  ------------------
  |  |  |  | 2990|      3|  (4 * CACHE_LINE -                                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|      3|# define CACHE_LINE 64
  |  |  |  |  ------------------
  |  |  |  | 2991|      3|   ((3 * KMP_PTR_SKIP + 2 * sizeof(int) + 2 * sizeof(kmp_int8) +               \
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|      3|#define KMP_PTR_SKIP (sizeof(void *))
  |  |  |  |  ------------------
  |  |  |  | 2992|      3|     sizeof(kmp_int16) + sizeof(kmp_uint32)) %                                 \
  |  |  |  | 2993|      3|    CACHE_LINE))
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|      3|# define CACHE_LINE 64
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define KMP_INLINE_ARGV_ENTRIES (int)(KMP_INLINE_ARGV_BYTES / KMP_PTR_SKIP)
  |  |  ------------------
  |  |  |  |   30|      3|#define KMP_PTR_SKIP (sizeof(void *))
  |  |  ------------------
  ------------------
 3185|      3|      KA_TRACE(100, ("__kmp_alloc_argv_entries: team %d: inline allocate %d "
 3186|      3|                     "argv entries\n",
 3187|      3|                     team->t.t_id, team->t.t_max_argc));
 3188|      3|      team->t.t_argv = &team->t.t_inline_argv[0];
 3189|      3|      if (__kmp_storage_map) {
  ------------------
  |  Branch (3189:11): [True: 0, False: 3]
  ------------------
 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|      3|    } 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|      3|  }
 3214|      3|}
kmp_runtime.cpp:_ZL26__kmp_allocate_team_arraysP8kmp_teami:
 3216|      3|static void __kmp_allocate_team_arrays(kmp_team_t *team, int max_nth) {
 3217|      3|  int i;
 3218|      3|  int num_disp_buff = max_nth > 1 ? __kmp_dispatch_num_buffers : 2;
  ------------------
  |  Branch (3218:23): [True: 1, False: 2]
  ------------------
 3219|      3|  team->t.t_threads =
 3220|      3|      (kmp_info_t **)__kmp_allocate(sizeof(kmp_info_t *) * max_nth);
  ------------------
  |  | 3617|      3|#define __kmp_allocate(size) ___kmp_allocate((size)KMP_SRC_LOC_CURR)
  ------------------
 3221|      3|  team->t.t_disp_buffer = (dispatch_shared_info_t *)__kmp_allocate(
  ------------------
  |  | 3617|      3|#define __kmp_allocate(size) ___kmp_allocate((size)KMP_SRC_LOC_CURR)
  ------------------
 3222|      3|      sizeof(dispatch_shared_info_t) * num_disp_buff);
 3223|      3|  team->t.t_dispatch =
 3224|      3|      (kmp_disp_t *)__kmp_allocate(sizeof(kmp_disp_t) * max_nth);
  ------------------
  |  | 3617|      3|#define __kmp_allocate(size) ___kmp_allocate((size)KMP_SRC_LOC_CURR)
  ------------------
 3225|      3|  team->t.t_implicit_task_taskdata =
 3226|      3|      (kmp_taskdata_t *)__kmp_allocate(sizeof(kmp_taskdata_t) * max_nth);
  ------------------
  |  | 3617|      3|#define __kmp_allocate(size) ___kmp_allocate((size)KMP_SRC_LOC_CURR)
  ------------------
 3227|      3|  team->t.t_max_nproc = max_nth;
 3228|       |
 3229|       |  /* setup dispatch buffers */
 3230|     14|  for (i = 0; i < num_disp_buff; ++i) {
  ------------------
  |  Branch (3230:15): [True: 11, False: 3]
  ------------------
 3231|     11|    team->t.t_disp_buffer[i].buffer_index = i;
 3232|     11|    team->t.t_disp_buffer[i].doacross_buf_idx = i;
 3233|     11|  }
 3234|      3|}
kmp_runtime.cpp:_ZL22__kmp_free_team_arraysP8kmp_team:
 3236|      3|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|      3|  int i;
 3239|     69|  for (i = 0; i < team->t.t_max_nproc; ++i) {
  ------------------
  |  Branch (3239:15): [True: 66, False: 3]
  ------------------
 3240|     66|    if (team->t.t_dispatch[i].th_disp_buffer != NULL) {
  ------------------
  |  Branch (3240:9): [True: 1, False: 65]
  ------------------
 3241|      1|      __kmp_free(team->t.t_dispatch[i].th_disp_buffer);
  ------------------
  |  | 3619|      1|#define __kmp_free(ptr) ___kmp_free((ptr)KMP_SRC_LOC_CURR)
  ------------------
 3242|      1|      team->t.t_dispatch[i].th_disp_buffer = NULL;
 3243|      1|    }
 3244|     66|  }
 3245|       |#if KMP_USE_HIER_SCHED
 3246|       |  __kmp_dispatch_free_hierarchies(team);
 3247|       |#endif
 3248|      3|  __kmp_free(team->t.t_threads);
  ------------------
  |  | 3619|      3|#define __kmp_free(ptr) ___kmp_free((ptr)KMP_SRC_LOC_CURR)
  ------------------
 3249|      3|  __kmp_free(team->t.t_disp_buffer);
  ------------------
  |  | 3619|      3|#define __kmp_free(ptr) ___kmp_free((ptr)KMP_SRC_LOC_CURR)
  ------------------
 3250|      3|  __kmp_free(team->t.t_dispatch);
  ------------------
  |  | 3619|      3|#define __kmp_free(ptr) ___kmp_free((ptr)KMP_SRC_LOC_CURR)
  ------------------
 3251|      3|  __kmp_free(team->t.t_implicit_task_taskdata);
  ------------------
  |  | 3619|      3|#define __kmp_free(ptr) ___kmp_free((ptr)KMP_SRC_LOC_CURR)
  ------------------
 3252|      3|  team->t.t_threads = NULL;
 3253|      3|  team->t.t_disp_buffer = NULL;
 3254|       |  team->t.t_dispatch = NULL;
 3255|      3|  team->t.t_implicit_task_taskdata = 0;
 3256|      3|}
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|      1|    while (__kmp_thread_pool != NULL) { // Loop thru all the thread in the pool.
  ------------------
  |  Branch (6365:12): [True: 0, False: 1]
  ------------------
 6366|       |      // Get the next thread from the pool.
 6367|      0|      kmp_info_t *thread = CCAST(kmp_info_t *, __kmp_thread_pool);
  ------------------
  |  |  229|      0|#define CCAST(type, var) const_cast<type>(var)
  ------------------
 6368|      0|      __kmp_thread_pool = thread->th.th_next_pool;
 6369|       |      // Reap it.
 6370|      0|      KMP_DEBUG_ASSERT(thread->th.th_reap_state == KMP_SAFE_TO_REAP);
 6371|      0|      thread->th.th_next_pool = NULL;
 6372|      0|      thread->th.th_in_pool = FALSE;
  ------------------
  |  | 1279|      0|#define FALSE 0
  ------------------
 6373|      0|      __kmp_reap_thread(thread, 0);
 6374|      0|    }
 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|    121|                              kmp_int32 incr, kmp_int32 chunk) {
  876|    121|  __kmp_for_static_init<kmp_int32>(loc, gtid, schedtype, plastiter, plower,
  877|    121|                                   pupper, pstride, incr, chunk
  878|    121|#if OMPT_SUPPORT && OMPT_OPTIONAL
  879|    121|                                   ,
  880|    121|                                   OMPT_GET_RETURN_ADDRESS(0)
  ------------------
  |  |  108|    121|#define OMPT_GET_RETURN_ADDRESS(level) __builtin_return_address(level)
  ------------------
  881|    121|#endif
  882|    121|  );
  883|    121|}
kmp_sched.cpp:_ZL21__kmp_for_static_initIiEvP5identiiPiPT_S4_PN8traits_tIS3_E8signed_tES7_S7_Pv:
   83|    121|) {
   84|    121|  KMP_COUNT_BLOCK(OMP_LOOP_STATIC);
  ------------------
  |  | 1001|    121|#define KMP_COUNT_BLOCK(n) ((void)0)
  ------------------
   85|    121|  KMP_PUSH_PARTITIONED_TIMER(OMP_loop_static);
  ------------------
  |  | 1014|    121|#define KMP_PUSH_PARTITIONED_TIMER(name) ((void)0)
  ------------------
   86|    121|  KMP_PUSH_PARTITIONED_TIMER(OMP_loop_static_scheduling);
  ------------------
  |  | 1014|    121|#define KMP_PUSH_PARTITIONED_TIMER(name) ((void)0)
  ------------------
   87|       |
   88|       |  // Clear monotonic/nonmonotonic bits (ignore it)
   89|    121|  schedtype = SCHEDULE_WITHOUT_MODIFIERS(schedtype);
  ------------------
  |  |  451|    121|  (enum sched_type)(                                                           \
  |  |  452|    121|      (s) & ~(kmp_sch_modifier_nonmonotonic | kmp_sch_modifier_monotonic))
  ------------------
   90|       |
   91|    121|  typedef typename traits_t<T>::unsigned_t UT;
   92|    121|  typedef typename traits_t<T>::signed_t ST;
   93|       |  /*  this all has to be changed back to TID and such.. */
   94|    121|  kmp_int32 gtid = global_tid;
   95|    121|  kmp_uint32 tid;
   96|    121|  kmp_uint32 nth;
   97|    121|  UT trip_count;
   98|    121|  kmp_team_t *team;
   99|    121|  __kmp_assert_valid_gtid(gtid);
  100|    121|  kmp_info_t *th = __kmp_threads[gtid];
  101|       |
  102|    121|#if OMPT_SUPPORT && OMPT_OPTIONAL
  103|    121|  ompt_team_info_t *team_info = NULL;
  104|    121|  ompt_task_info_t *task_info = NULL;
  105|    121|  ompt_work_t ompt_work_type = ompt_work_loop;
  106|       |
  107|    121|  static kmp_int8 warn = 0;
  108|       |
  109|    121|  if (ompt_enabled.ompt_callback_work || ompt_enabled.ompt_callback_dispatch) {
  ------------------
  |  Branch (109:7): [True: 0, False: 121]
  |  Branch (109:42): [True: 0, False: 121]
  ------------------
  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|    121|#endif
  131|       |
  132|    121|  KMP_DEBUG_ASSERT(plastiter && plower && pupper && pstride);
  133|    121|  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|    121|  if (__kmp_env_consistency_check) {
  ------------------
  |  Branch (149:7): [True: 0, False: 121]
  ------------------
  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|    121|  if (incr > 0 ? (*pupper < *plower) : (*plower < *pupper)) {
  ------------------
  |  Branch (157:7): [True: 121, False: 0]
  |  Branch (157:7): [True: 0, False: 121]
  ------------------
  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|    121|  if (schedtype > kmp_ord_upper) {
  ------------------
  |  Branch (198:7): [True: 0, False: 121]
  ------------------
  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|    121|  } else {
  210|    121|    tid = __kmp_tid_from_gtid(global_tid);
  211|    121|    team = th->th.th_team;
  212|    121|  }
  213|       |
  214|       |  /* determine if "for" loop is an active worksharing construct */
  215|    121|  if (team->t.t_serialized) {
  ------------------
  |  Branch (215:7): [True: 121, False: 0]
  ------------------
  216|       |    /* serialized parallel, each thread executes whole iteration space */
  217|    121|    if (plastiter != NULL)
  ------------------
  |  Branch (217:9): [True: 121, False: 0]
  ------------------
  218|    121|      *plastiter = TRUE;
  ------------------
  |  | 1280|    121|#define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  | 1279|    121|#define FALSE 0
  |  |  ------------------
  ------------------
  219|       |    /* leave pupper and plower set to entire iteration space */
  220|    121|    *pstride =
  221|    121|        (incr > 0) ? (*pupper - *plower + 1) : (-(*plower - *pupper + 1));
  ------------------
  |  Branch (221:9): [True: 121, 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|    121|    KE_TRACE(10, ("__kmpc_for_static_init: T#%d return\n", global_tid));
  236|       |
  237|    121|#if OMPT_SUPPORT && OMPT_OPTIONAL
  238|    121|    if (ompt_enabled.ompt_callback_work) {
  ------------------
  |  Branch (238:9): [True: 0, False: 121]
  ------------------
  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|    121|#endif
  244|    121|    KMP_STATS_LOOP_END(OMP_loop_static_iterations);
  245|    121|    return;
  246|    121|  }
  247|      0|  nth = team->t.t_nproc;
  248|      0|  if (nth == 1) {
  ------------------
  |  Branch (248:7): [True: 0, False: 0]
  ------------------
  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|      0|  if (incr == 1) {
  ------------------
  |  Branch (279:7): [True: 0, False: 0]
  ------------------
  280|      0|    trip_count = *pupper - *plower + 1;
  281|      0|  } else if (incr == -1) {
  ------------------
  |  Branch (281:14): [True: 0, False: 0]
  ------------------
  282|      0|    trip_count = *plower - *pupper + 1;
  283|      0|  } else if (incr > 0) {
  ------------------
  |  Branch (283:14): [True: 0, False: 0]
  ------------------
  284|       |    // upper-lower can exceed the limit of signed type
  285|      0|    trip_count = (UT)(*pupper - *plower) / incr + 1;
  286|      0|  } else {
  287|      0|    trip_count = (UT)(*plower - *pupper) / (-incr) + 1;
  288|      0|  }
  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|      0|  if (__kmp_env_consistency_check) {
  ------------------
  |  Branch (296:7): [True: 0, False: 0]
  ------------------
  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|      0|  switch (schedtype) {
  306|      0|  case kmp_sch_static: {
  ------------------
  |  Branch (306:3): [True: 0, False: 0]
  ------------------
  307|      0|    if (trip_count < nth) {
  ------------------
  |  Branch (307:9): [True: 0, False: 0]
  ------------------
  308|      0|      KMP_DEBUG_ASSERT(
  309|      0|          __kmp_static == kmp_sch_static_greedy ||
  310|      0|          __kmp_static ==
  311|      0|              kmp_sch_static_balanced); // Unknown static scheduling type.
  312|      0|      if (tid < trip_count) {
  ------------------
  |  Branch (312:11): [True: 0, False: 0]
  ------------------
  313|      0|        *pupper = *plower = *plower + tid * incr;
  314|      0|      } else {
  315|       |        // set bounds so non-active threads execute no iterations
  316|      0|        *plower = *pupper + (incr > 0 ? 1 : -1);
  ------------------
  |  Branch (316:30): [True: 0, False: 0]
  ------------------
  317|      0|      }
  318|      0|      if (plastiter != NULL)
  ------------------
  |  Branch (318:11): [True: 0, False: 0]
  ------------------
  319|      0|        *plastiter = (tid == trip_count - 1);
  320|      0|    } else {
  321|      0|      if (__kmp_static == kmp_sch_static_balanced) {
  ------------------
  |  Branch (321:11): [True: 0, False: 0]
  ------------------
  322|      0|        UT small_chunk = trip_count / nth;
  323|      0|        UT extras = trip_count % nth;
  324|      0|        *plower += incr * (tid * small_chunk + (tid < extras ? tid : extras));
  ------------------
  |  Branch (324:49): [True: 0, False: 0]
  ------------------
  325|      0|        *pupper = *plower + small_chunk * incr - (tid < extras ? 0 : incr);
  ------------------
  |  Branch (325:51): [True: 0, False: 0]
  ------------------
  326|      0|        if (plastiter != NULL)
  ------------------
  |  Branch (326:13): [True: 0, False: 0]
  ------------------
  327|      0|          *plastiter = (tid == nth - 1);
  328|      0|      } else {
  329|      0|        T big_chunk_inc_count =
  330|      0|            (trip_count / nth + ((trip_count % nth) ? 1 : 0)) * incr;
  ------------------
  |  Branch (330:34): [True: 0, False: 0]
  ------------------
  331|      0|        T old_upper = *pupper;
  332|       |
  333|      0|        KMP_DEBUG_ASSERT(__kmp_static == kmp_sch_static_greedy);
  334|       |        // Unknown static scheduling type.
  335|       |
  336|      0|        *plower += tid * big_chunk_inc_count;
  337|      0|        *pupper = *plower + big_chunk_inc_count - incr;
  338|      0|        if (incr > 0) {
  ------------------
  |  Branch (338:13): [True: 0, False: 0]
  ------------------
  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|      0|        } else {
  346|      0|          if (*pupper > *plower)
  ------------------
  |  Branch (346:15): [True: 0, False: 0]
  ------------------
  347|      0|            *pupper = traits_t<T>::min_value;
  348|      0|          if (plastiter != NULL)
  ------------------
  |  Branch (348:15): [True: 0, False: 0]
  ------------------
  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|      0|          if (*pupper < old_upper)
  ------------------
  |  Branch (350:15): [True: 0, False: 0]
  ------------------
  351|      0|            *pupper = old_upper; // tracker C73258
  352|      0|        }
  353|      0|      }
  354|      0|    }
  355|      0|    *pstride = trip_count;
  356|      0|    break;
  357|      0|  }
  358|      0|  case kmp_sch_static_chunked: {
  ------------------
  |  Branch (358:3): [True: 0, False: 0]
  ------------------
  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: 0]
  ------------------
  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: 0]
  ------------------
  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|      0|  }
  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|      0|  KE_TRACE(10, ("__kmpc_for_static_init: T#%d return\n", global_tid));
  439|       |
  440|      0|#if OMPT_SUPPORT && OMPT_OPTIONAL
  441|      0|  if (ompt_enabled.ompt_callback_work) {
  ------------------
  |  Branch (441:7): [True: 0, False: 0]
  ------------------
  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|      0|  if (ompt_enabled.ompt_callback_dispatch) {
  ------------------
  |  Branch (446:7): [True: 0, False: 0]
  ------------------
  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|      0|#endif
  465|       |
  466|      0|  KMP_STATS_LOOP_END(OMP_loop_static_iterations);
  467|      0|  return;
  468|      0|}

__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|    121|void __kmp_pop_current_task_from_thread(kmp_info_t *this_thr) {
  613|    121|  KF_TRACE(10, ("__kmp_pop_current_task_from_thread(enter): T#%d "
  614|    121|                "this_thread=%p, curtask=%p, "
  615|    121|                "curtask_parent=%p\n",
  616|    121|                0, this_thr, this_thr->th.th_current_task,
  617|    121|                this_thr->th.th_current_task->td_parent));
  618|       |
  619|    121|  this_thr->th.th_current_task = this_thr->th.th_current_task->td_parent;
  620|       |
  621|    121|  KF_TRACE(10, ("__kmp_pop_current_task_from_thread(exit): T#%d "
  622|    121|                "this_thread=%p, curtask=%p, "
  623|    121|                "curtask_parent=%p\n",
  624|    121|                0, this_thr, this_thr->th.th_current_task,
  625|    121|                this_thr->th.th_current_task->td_parent));
  626|    121|}
__kmp_push_current_task_to_thread:
  635|    122|                                       int tid) {
  636|       |  // current task of the thread is a parent of the new just created implicit
  637|       |  // tasks of new team
  638|    122|  KF_TRACE(10, ("__kmp_push_current_task_to_thread(enter): T#%d this_thread=%p "
  639|    122|                "curtask=%p "
  640|    122|                "parent_task=%p\n",
  641|    122|                tid, this_thr, this_thr->th.th_current_task,
  642|    122|                team->t.t_implicit_task_taskdata[tid].td_parent));
  643|       |
  644|    122|  KMP_DEBUG_ASSERT(this_thr != NULL);
  645|       |
  646|    122|  if (tid == 0) {
  ------------------
  |  Branch (646:7): [True: 122, False: 0]
  ------------------
  647|    122|    if (this_thr->th.th_current_task != &team->t.t_implicit_task_taskdata[0]) {
  ------------------
  |  Branch (647:9): [True: 122, False: 0]
  ------------------
  648|    122|      team->t.t_implicit_task_taskdata[0].td_parent =
  649|    122|          this_thr->th.th_current_task;
  650|    122|      this_thr->th.th_current_task = &team->t.t_implicit_task_taskdata[0];
  651|    122|    }
  652|    122|  } else {
  653|      0|    team->t.t_implicit_task_taskdata[tid].td_parent =
  654|      0|        team->t.t_implicit_task_taskdata[0].td_parent;
  655|      0|    this_thr->th.th_current_task = &team->t.t_implicit_task_taskdata[tid];
  656|      0|  }
  657|       |
  658|    122|  KF_TRACE(10, ("__kmp_push_current_task_to_thread(exit): T#%d this_thread=%p "
  659|    122|                "curtask=%p "
  660|    122|                "parent_task=%p\n",
  661|    122|                tid, this_thr, this_thr->th.th_current_task,
  662|    122|                team->t.t_implicit_task_taskdata[tid].td_parent));
  663|    122|}
__kmp_init_implicit_task:
 1320|      4|                              kmp_team_t *team, int tid, int set_curr_task) {
 1321|      4|  kmp_taskdata_t *task = &team->t.t_implicit_task_taskdata[tid];
 1322|       |
 1323|      4|  KF_TRACE(
 1324|      4|      10,
 1325|      4|      ("__kmp_init_implicit_task(enter): T#:%d team=%p task=%p, reinit=%s\n",
 1326|      4|       tid, team, task, set_curr_task ? "TRUE" : "FALSE"));
 1327|       |
 1328|      4|  task->td_task_id = KMP_GEN_TASK_ID();
  ------------------
  |  | 3546|      4|#define KMP_GEN_TASK_ID() _KMP_GEN_ID(__kmp_task_counter)
  |  |  ------------------
  |  |  |  | 3543|      4|#define _KMP_GEN_ID(counter) (~0)
  |  |  ------------------
  ------------------
 1329|      4|  task->td_team = team;
 1330|       |  //    task->td_parent   = NULL;  // fix for CQ230101 (broken parent task info
 1331|       |  //    in debugger)
 1332|      4|  task->td_ident = loc_ref;
 1333|      4|  task->td_taskwait_ident = NULL;
 1334|      4|  task->td_taskwait_counter = 0;
 1335|      4|  task->td_taskwait_thread = 0;
 1336|       |
 1337|      4|  task->td_flags.tiedness = TASK_TIED;
  ------------------
  |  |   45|      4|#define TASK_TIED 1
  ------------------
 1338|      4|  task->td_flags.tasktype = TASK_IMPLICIT;
  ------------------
  |  |   48|      4|#define TASK_IMPLICIT 0
  ------------------
 1339|      4|  task->td_flags.proxy = TASK_FULL;
  ------------------
  |  |   50|      4|#define TASK_FULL 0
  ------------------
 1340|       |
 1341|       |  // All implicit tasks are executed immediately, not deferred
 1342|      4|  task->td_flags.task_serial = 1;
 1343|      4|  task->td_flags.tasking_ser = (__kmp_tasking_mode == tskm_immediate_exec);
 1344|      4|  task->td_flags.team_serial = (team->t.t_serialized) ? 1 : 0;
  ------------------
  |  Branch (1344:32): [True: 4, False: 0]
  ------------------
 1345|       |
 1346|      4|  task->td_flags.started = 1;
 1347|      4|  task->td_flags.executing = 1;
 1348|      4|  task->td_flags.complete = 0;
 1349|      4|  task->td_flags.freed = 0;
 1350|       |#if OMPX_TASKGRAPH
 1351|       |  task->td_flags.onced = 0;
 1352|       |#endif
 1353|       |
 1354|      4|  task->td_depnode = NULL;
 1355|      4|  task->td_last_tied = task;
 1356|      4|  task->td_allow_completion_event.type = KMP_EVENT_UNINITIALIZED;
 1357|       |
 1358|      4|  if (set_curr_task) { // only do this init first time thread is created
  ------------------
  |  Branch (1358:7): [True: 1, False: 3]
  ------------------
 1359|      1|    KMP_ATOMIC_ST_REL(&task->td_incomplete_child_tasks, 0);
  ------------------
  |  | 1251|      1|#define KMP_ATOMIC_ST_REL(p, v) KMP_ATOMIC_OP(store, p, v, release)
  |  |  ------------------
  |  |  |  | 1246|      1|#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|      1|    KMP_ATOMIC_ST_REL(&task->td_allocated_child_tasks, 0);
  ------------------
  |  | 1251|      1|#define KMP_ATOMIC_ST_REL(p, v) KMP_ATOMIC_OP(store, p, v, release)
  |  |  ------------------
  |  |  |  | 1246|      1|#define KMP_ATOMIC_OP(op, p, v, order) (p)->op(v, std::memory_order_##order)
  |  |  ------------------
  ------------------
 1362|      1|    task->td_taskgroup = NULL; // An implicit task does not have taskgroup
 1363|      1|    task->td_dephash = NULL;
 1364|      1|    __kmp_push_current_task_to_thread(this_thr, team, tid);
 1365|      3|  } else {
 1366|      3|    KMP_DEBUG_ASSERT(task->td_incomplete_child_tasks == 0);
 1367|      3|    KMP_DEBUG_ASSERT(task->td_allocated_child_tasks == 0);
 1368|      3|  }
 1369|       |
 1370|      4|#if OMPT_SUPPORT
 1371|      4|  if (UNLIKELY(ompt_enabled.enabled))
  ------------------
  |  |  119|      4|#define UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (119:21): [True: 0, False: 4]
  |  |  ------------------
  ------------------
 1372|      0|    __ompt_task_init(task, tid);
 1373|      4|#endif
 1374|       |
 1375|      4|  KF_TRACE(10, ("__kmp_init_implicit_task(exit): T#:%d team=%p task=%p\n", tid,
 1376|      4|                team, task));
 1377|      4|}
__kmp_free_implicit_task:
 1413|      1|void __kmp_free_implicit_task(kmp_info_t *thread) {
 1414|      1|  kmp_taskdata_t *task = thread->th.th_current_task;
 1415|      1|  if (task && task->td_dephash) {
  ------------------
  |  Branch (1415:7): [True: 1, False: 0]
  |  Branch (1415:15): [True: 0, False: 1]
  ------------------
 1416|      0|    __kmp_dephash_free(thread, task->td_dephash);
 1417|       |    task->td_dephash = NULL;
 1418|      0|  }
 1419|      1|}
__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: 0, False: 1]
  ------------------
 4018|       |    // Free all task_teams on the free list
 4019|      0|    __kmp_acquire_bootstrap_lock(&__kmp_task_team_lock);
 4020|      0|    while ((task_team = __kmp_free_task_teams) != NULL) {
  ------------------
  |  Branch (4020:12): [True: 0, False: 0]
  ------------------
 4021|      0|      __kmp_free_task_teams = task_team->tt.tt_next;
 4022|      0|      task_team->tt.tt_next = NULL;
 4023|       |
 4024|       |      // Free threads_data if necessary
 4025|      0|      if (task_team->tt.tt_threads_data != NULL) {
  ------------------
  |  Branch (4025:11): [True: 0, False: 0]
  ------------------
 4026|      0|        __kmp_free_task_threads_data(task_team);
 4027|      0|      }
 4028|      0|      if (task_team->tt.tt_task_pri_list != NULL) {
  ------------------
  |  Branch (4028:11): [True: 0, False: 0]
  ------------------
 4029|      0|        __kmp_free_task_pri_list(task_team);
 4030|      0|      }
 4031|      0|      __kmp_free(task_team);
  ------------------
  |  | 3619|      0|#define __kmp_free(ptr) ___kmp_free((ptr)KMP_SRC_LOC_CURR)
  ------------------
 4032|      0|    }
 4033|      0|    __kmp_release_bootstrap_lock(&__kmp_task_team_lock);
 4034|      0|  }
 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|      1|    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: 0, False: 1]
  ------------------
 4056|      1|         thread = thread->th.th_next_pool) {
 4057|       |#if KMP_OS_WINDOWS
 4058|       |      DWORD exit_val;
 4059|       |#endif
 4060|      0|      if (TCR_PTR(thread->th.th_task_team) == NULL) {
  ------------------
  |  | 1156|      0|#define TCR_PTR(a) ((void *)TCR_8(a))
  |  |  ------------------
  |  |  |  | 1131|      0|#define TCR_8(a) (a)
  |  |  ------------------
  ------------------
  |  Branch (4060:11): [True: 0, False: 0]
  ------------------
 4061|      0|        KA_TRACE(10, ("__kmp_wait_to_unref_task_team: T#%d task_team == NULL\n",
 4062|      0|                      __kmp_gtid_from_thread(thread)));
 4063|      0|        continue;
 4064|      0|      }
 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_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_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

_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|      3|void __ompt_team_assign_id(kmp_team_t *team, ompt_data_t ompt_pid) {
  502|      3|  team->t.ompt_team_info.parallel_data = ompt_pid;
  503|      3|}

_ZN22OmptReturnAddressGuardC2EiPv:
  139|  5.78k|  OmptReturnAddressGuard(int Gtid, void *ReturnAddress) : Gtid(Gtid) {
  140|  5.78k|    if (ompt_enabled.enabled && Gtid >= 0 && __kmp_threads[Gtid] &&
  ------------------
  |  Branch (140:9): [True: 0, False: 5.78k]
  |  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|  5.78k|  }
_ZN22OmptReturnAddressGuardD2Ev:
  146|  5.78k|  ~OmptReturnAddressGuard() {
  147|  5.78k|    if (SetAddress)
  ------------------
  |  Branch (147:9): [True: 0, False: 5.78k]
  ------------------
  148|      0|      __kmp_threads[Gtid]->th.ompt_thread_info.return_address = NULL;
  149|  5.78k|  }
_Z26__ompt_load_return_addressi:
   79|  5.65k|inline void *__ompt_load_return_address(int gtid) {
   80|  5.65k|  kmp_info_t *thr = __kmp_threads[gtid];
   81|  5.65k|  void *return_address = thr->th.ompt_thread_info.return_address;
   82|       |  thr->th.ompt_thread_info.return_address = NULL;
   83|  5.65k|  return return_address;
   84|  5.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|      1|void __kmp_create_worker(int gtid, kmp_info_t *th, size_t stack_size) {
  711|      1|  pthread_t handle;
  712|      1|  pthread_attr_t thread_attr;
  713|      1|  int status;
  714|       |
  715|      1|  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|      1|  if (KMP_UBER_GTID(gtid)) {
  ------------------
  |  Branch (736:7): [True: 1, False: 0]
  ------------------
  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|      0|  KA_TRACE(10, ("__kmp_create_worker: try to create thread (%d)\n", gtid));
  745|       |
  746|      0|  KMP_MB(); /* Flush all pending memory write invalidates.  */
  747|       |
  748|      0|#ifdef KMP_THREAD_ATTR
  749|      0|  status = pthread_attr_init(&thread_attr);
  750|      0|  if (status != 0) {
  ------------------
  |  Branch (750:7): [True: 0, False: 0]
  ------------------
  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|      0|  status = pthread_attr_setdetachstate(&thread_attr, PTHREAD_CREATE_JOINABLE);
  754|      0|  if (status != 0) {
  ------------------
  |  Branch (754:7): [True: 0, False: 0]
  ------------------
  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|      0|  stack_size += gtid * __kmp_stkoffset * 2;
  766|       |
  767|      0|  KA_TRACE(10, ("__kmp_create_worker: T#%d, default stacksize = %lu bytes, "
  768|      0|                "__kmp_stksize = %lu bytes, final stacksize = %lu bytes\n",
  769|      0|                gtid, KMP_DEFAULT_STKSIZE, __kmp_stksize, stack_size));
  770|       |
  771|      0|#ifdef _POSIX_THREAD_ATTR_STACKSIZE
  772|      0|  status = pthread_attr_setstacksize(&thread_attr, stack_size);
  773|      0|#ifdef KMP_BACKUP_STKSIZE
  774|      0|  if (status != 0) {
  ------------------
  |  Branch (774:7): [True: 0, False: 0]
  ------------------
  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|      0|#endif /* KMP_BACKUP_STKSIZE */
  786|      0|  if (status != 0) {
  ------------------
  |  Branch (786:7): [True: 0, False: 0]
  ------------------
  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|      0|#endif /* _POSIX_THREAD_ATTR_STACKSIZE */
  791|       |
  792|      0|#endif /* KMP_THREAD_ATTR */
  793|       |
  794|      0|  status =
  795|      0|      pthread_create(&handle, &thread_attr, __kmp_launch_worker, (void *)th);
  796|      0|  if (status != 0 || !handle) { // ??? Why do we check handle??
  ------------------
  |  Branch (796:7): [True: 0, False: 0]
  |  Branch (796:22): [True: 0, False: 0]
  ------------------
  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|      0|  th->th.th_info.ds.ds_thread = handle;
  815|       |
  816|      0|#ifdef KMP_THREAD_ATTR
  817|      0|  status = pthread_attr_destroy(&thread_attr);
  818|      0|  if (status) {
  ------------------
  |  Branch (818:7): [True: 0, False: 0]
  ------------------
  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|      0|#endif /* KMP_THREAD_ATTR */
  827|       |
  828|      0|  KMP_MB(); /* Flush all pending memory write invalidates.  */
  829|       |
  830|      0|  KA_TRACE(10, ("__kmp_create_worker: done creating thread (%d)\n", gtid));
  831|       |
  832|      0|} // __kmp_create_worker
__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_uninitialize_thread:
 1360|      1|void __kmp_suspend_uninitialize_thread(kmp_info_t *th) {
 1361|      1|  if (KMP_ATOMIC_LD_ACQ(&th->th.th_suspend_init_count) > __kmp_fork_count) {
  ------------------
  |  | 1249|      1|#define KMP_ATOMIC_LD_ACQ(p) KMP_ATOMIC_LD(p, acquire)
  |  |  ------------------
  |  |  |  | 1245|      1|#define KMP_ATOMIC_LD(p, order) (p)->load(std::memory_order_##order)
  |  |  ------------------
  ------------------
  |  Branch (1361:7): [True: 0, False: 1]
  ------------------
 1362|       |    /* this means we have initialize the suspension pthread objects for this
 1363|       |       thread in this instance of the process */
 1364|      0|    int status;
 1365|       |
 1366|      0|    status = pthread_cond_destroy(&th->th.th_suspend_cv.c_cond);
 1367|      0|    if (status != 0 && status != EBUSY) {
  ------------------
  |  Branch (1367:9): [True: 0, False: 0]
  |  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|      0|    status = pthread_mutex_destroy(&th->th.th_suspend_mx.m_mutex);
 1371|      0|    if (status != 0 && status != EBUSY) {
  ------------------
  |  Branch (1371:9): [True: 0, False: 0]
  |  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|      0|    --th->th.th_suspend_init_count;
 1375|      0|    KMP_DEBUG_ASSERT(KMP_ATOMIC_LD_RLX(&th->th.th_suspend_init_count) ==
 1376|      0|                     __kmp_fork_count);
 1377|      0|  }
 1378|      1|}
__kmp_yield:
 1714|      1|void __kmp_yield() { sched_yield(); }
__kmp_gtid_set_specific:
 1716|      1|void __kmp_gtid_set_specific(int gtid) {
 1717|      1|  if (__kmp_init_gtid) {
  ------------------
  |  Branch (1717:7): [True: 1, False: 0]
  ------------------
 1718|      1|    int status;
 1719|      1|    status = pthread_setspecific(__kmp_gtid_threadprivate_key,
 1720|      1|                                 (void *)(intptr_t)(gtid + 1));
 1721|      1|    KMP_CHECK_SYSFAIL("pthread_setspecific", 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|  }
  ------------------
 1722|      1|  } else {
 1723|      0|    KA_TRACE(50, ("__kmp_gtid_set_specific: runtime shutdown, returning\n"));
 1724|      0|  }
 1725|      1|}
__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.65k|  while ((now = __kmp_hardware_timestamp()) < goal)
  ------------------
  |  Branch (2007:10): [True: 3.65k, False: 1]
  ------------------
 2008|  3.65k|    ;
 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|      1|static kmp_int32 __kmp_set_stack_info(int gtid, kmp_info_t *th) {
  409|      1|  int stack_data;
  410|      1|#if KMP_OS_LINUX || KMP_OS_DRAGONFLY || KMP_OS_FREEBSD || KMP_OS_NETBSD ||     \
  411|      1|    KMP_OS_HURD
  412|      1|  pthread_attr_t attr;
  413|      1|  int status;
  414|      1|  size_t size = 0;
  415|      1|  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|      1|  if (!KMP_UBER_GTID(gtid)) {
  ------------------
  |  Branch (420:7): [True: 0, False: 1]
  ------------------
  421|       |
  422|       |    /* Fetch the real thread attributes */
  423|      0|    status = pthread_attr_init(&attr);
  424|      0|    KMP_CHECK_SYSFAIL("pthread_attr_init", status);
  ------------------
  |  |  153|      0|  {                                                                            \
  |  |  154|      0|    if (error) {                                                               \
  |  |  ------------------
  |  |  |  Branch (154:9): [True: 0, False: 0]
  |  |  ------------------
  |  |  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|      0|  }
  ------------------
  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|      0|    status = pthread_getattr_np(pthread_self(), &attr);
  430|      0|    KMP_CHECK_SYSFAIL("pthread_getattr_np", status);
  ------------------
  |  |  153|      0|  {                                                                            \
  |  |  154|      0|    if (error) {                                                               \
  |  |  ------------------
  |  |  |  Branch (154:9): [True: 0, False: 0]
  |  |  ------------------
  |  |  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|      0|  }
  ------------------
  431|      0|#endif
  432|      0|    status = pthread_attr_getstack(&attr, &addr, &size);
  433|      0|    KMP_CHECK_SYSFAIL("pthread_attr_getstack", status);
  ------------------
  |  |  153|      0|  {                                                                            \
  |  |  154|      0|    if (error) {                                                               \
  |  |  ------------------
  |  |  |  Branch (154:9): [True: 0, False: 0]
  |  |  ------------------
  |  |  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|      0|  }
  ------------------
  434|      0|    KA_TRACE(60,
  435|      0|             ("__kmp_set_stack_info: T#%d pthread_attr_getstack returned size:"
  436|      0|              " %lu, low addr: %p\n",
  437|      0|              gtid, size, addr));
  438|      0|    status = pthread_attr_destroy(&attr);
  439|      0|    KMP_CHECK_SYSFAIL("pthread_attr_destroy", status);
  ------------------
  |  |  153|      0|  {                                                                            \
  |  |  154|      0|    if (error) {                                                               \
  |  |  ------------------
  |  |  |  Branch (154:9): [True: 0, False: 0]
  |  |  ------------------
  |  |  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|      0|  }
  ------------------
  440|      0|  }
  441|       |
  442|      1|  if (size != 0 && addr != 0) { // was stack parameter determination successful?
  ------------------
  |  Branch (442:7): [True: 0, False: 1]
  |  Branch (442:20): [True: 0, False: 0]
  ------------------
  443|       |    /* Store the correct base and size */
  444|      0|    TCW_PTR(th->th.th_info.ds.ds_stackbase, (((char *)addr) + size));
  ------------------
  |  | 1157|      0|#define TCW_PTR(a, b) TCW_8((a), (b))
  |  |  ------------------
  |  |  |  | 1132|      0|#define TCW_8(a, b) (a) = (b)
  |  |  ------------------
  ------------------
  445|      0|    TCW_PTR(th->th.th_info.ds.ds_stacksize, size);
  ------------------
  |  | 1157|      0|#define TCW_PTR(a, b) TCW_8((a), (b))
  |  |  ------------------
  |  |  |  | 1132|      0|#define TCW_8(a, b) (a) = (b)
  |  |  ------------------
  ------------------
  446|      0|    TCW_4(th->th.th_info.ds.ds_stackgrow, FALSE);
  ------------------
  |  | 1128|      0|#define TCW_4(a, b) (a) = (b)
  ------------------
  447|      0|    return TRUE;
  ------------------
  |  | 1280|      0|#define TRUE (!FALSE)
  |  |  ------------------
  |  |  |  | 1279|      0|#define FALSE 0
  |  |  ------------------
  ------------------
  448|      0|  }
  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|      1|}
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

