Dual.cpp:_ZL23createPrefixCodeDecoderIN8rawspeed20PrefixCodeLUTDecoderINS0_15BaselineCodeTagENS0_23PrefixCodeLookupDecoderIS2_EEEEET_RNS0_10ByteStreamE:
  147|  2.01k|static T createPrefixCodeDecoder(rawspeed::ByteStream& bs) {
  148|  2.01k|  using CodeTag = typename T::Tag;
  149|       |
  150|  2.01k|  rawspeed::Optional<T> ht;
  151|  2.01k|  if (bool huffmanCode = bs.getByte() != 0; huffmanCode)
  ------------------
  |  Branch (151:45): [True: 2.01k, False: 3]
  ------------------
  152|  2.01k|    ht = createHuffmanPrefixCodeDecoderImpl<T, CodeTag>(bs);
  153|      3|  else
  154|      3|    ht = createSimplePrefixCodeDecoderImpl<T, CodeTag>(bs);
  155|       |
  156|       |  // and one more byte as 'fixDNGBug16' boolean
  157|  2.01k|  const bool fixDNGBug16 = bs.getByte() != 0;
  158|       |
  159|  2.01k|  bool fullDecode = false;
  160|       |  if constexpr (T::Traits::SupportsFullDecode)
  161|  2.01k|    fullDecode = bs.getByte() != 0;
  162|       |
  163|  2.01k|  ht->setup(fullDecode, fixDNGBug16);
  164|       |
  165|  2.01k|  return std::move(*ht);
  166|  2.01k|}
_Z34createHuffmanPrefixCodeDecoderImplIN8rawspeed20PrefixCodeLUTDecoderINS0_15BaselineCodeTagENS0_23PrefixCodeLookupDecoderIS2_EEEES2_Qsr3stdE18is_constructible_vIT_NS0_11HuffmanCodeIT0_EEEES6_RNS0_10ByteStreamE:
  119|  2.01k|inline T createHuffmanPrefixCodeDecoderImpl(rawspeed::ByteStream& bs) {
  120|  2.01k|  auto hc = createHuffmanCode<CodeTag>(bs);
  121|  2.01k|  return T(std::move(hc));
  122|  2.01k|}
_Z17createHuffmanCodeIN8rawspeed15BaselineCodeTagEENS0_11HuffmanCodeIT_EERNS0_10ByteStreamE:
   76|  3.88k|createHuffmanCode(rawspeed::ByteStream& bs) {
   77|  3.88k|  using Traits = rawspeed::CodeTraits<CodeTag>;
   78|       |
   79|  3.88k|  rawspeed::HuffmanCode<CodeTag> hc;
   80|       |
   81|       |  // first bytes are consumed as n-codes-per-length
   82|  3.88k|  const auto count =
   83|  3.88k|      hc.setNCodesPerLength(bs.getBuffer(Traits::MaxCodeLenghtBits));
   84|       |
   85|  3.88k|  if (count) {
  ------------------
  |  Branch (85:7): [True: 3.84k, False: 40]
  ------------------
   86|       |    // and then count more bytes consumed as code values
   87|  3.84k|    rawspeed::ByteStream codeValuesStream =
   88|  3.84k|        bs.getStream(count, sizeof(typename Traits::CodeValueTy));
   89|  3.84k|    const auto codesBuf = getCodeValues<CodeTag>(codeValuesStream, count);
   90|  3.84k|    hc.setCodeValues(rawspeed::Array1DRef<const typename Traits::CodeValueTy>(
   91|  3.84k|        codesBuf.data(),
   92|  3.84k|        rawspeed::implicit_cast<rawspeed::Buffer::size_type>(codesBuf.size())));
   93|  3.84k|  }
   94|       |
   95|  3.88k|  return hc;
   96|  3.88k|}
_Z13getCodeValuesIN8rawspeed15BaselineCodeTagEEDaRNS0_10ByteStreamEj:
   37|  3.83k|auto getCodeValues(rawspeed::ByteStream& bs, unsigned numEntries) {
   38|  3.83k|  using Traits = rawspeed::CodeTraits<CodeTag>;
   39|  3.83k|  using CodeValueTy = typename Traits::CodeValueTy;
   40|       |
   41|  3.83k|  std::vector<CodeValueTy> values;
   42|  3.83k|  values.reserve(numEntries);
   43|  3.83k|  std::generate_n(std::back_inserter(values), numEntries, [&bs]() {
   44|  3.83k|    auto code = bs.get<CodeValueTy>();
   45|  3.83k|    if (!(code <= Traits::MaxCodeValue))
   46|  3.83k|      ThrowRSE("Bad code value");
   47|  3.83k|    return code;
   48|  3.83k|  });
   49|  3.83k|  assert(values.size() == numEntries);
  ------------------
  |  Branch (49:3): [True: 3.83k, False: 0]
  ------------------
   50|  3.83k|  return values;
   51|  3.83k|}
_ZZ13getCodeValuesIN8rawspeed15BaselineCodeTagEEDaRNS0_10ByteStreamEjENKUlvE_clEv:
   43|  18.6k|  std::generate_n(std::back_inserter(values), numEntries, [&bs]() {
   44|  18.6k|    auto code = bs.get<CodeValueTy>();
   45|  18.6k|    if (!(code <= Traits::MaxCodeValue))
  ------------------
  |  Branch (45:9): [True: 0, False: 18.6k]
  ------------------
   46|  18.6k|      ThrowRSE("Bad code value");
  ------------------
  |  |   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__)
  |  |  ------------------
  ------------------
   47|  18.6k|    return code;
   48|  18.6k|  });
_Z33createSimplePrefixCodeDecoderImplIN8rawspeed20PrefixCodeLUTDecoderINS0_15BaselineCodeTagENS0_23PrefixCodeLookupDecoderIS2_EEEES2_Qntsr3stdE18is_constructible_vIT_NS0_10PrefixCodeIT0_EEEES6_RNS0_10ByteStreamE:
  134|      2|inline T createSimplePrefixCodeDecoderImpl(rawspeed::ByteStream& bs) {
  135|      2|  ThrowRSE(
  ------------------
  |  |   95|      2|  ThrowExceptionHelper(rawspeed::RawspeedException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      2|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      2|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      2|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  136|      2|      "This Prefix code decoder implementation only support Huffman codes");
  137|      2|}
Dual.cpp:_ZL23createPrefixCodeDecoderIN8rawspeed21PrefixCodeTreeDecoderINS0_15BaselineCodeTagEEEET_RNS0_10ByteStreamE:
  147|  1.87k|static T createPrefixCodeDecoder(rawspeed::ByteStream& bs) {
  148|  1.87k|  using CodeTag = typename T::Tag;
  149|       |
  150|  1.87k|  rawspeed::Optional<T> ht;
  151|  1.87k|  if (bool huffmanCode = bs.getByte() != 0; huffmanCode)
  ------------------
  |  Branch (151:45): [True: 1.87k, False: 0]
  ------------------
  152|  1.87k|    ht = createHuffmanPrefixCodeDecoderImpl<T, CodeTag>(bs);
  153|      0|  else
  154|      0|    ht = createSimplePrefixCodeDecoderImpl<T, CodeTag>(bs);
  155|       |
  156|       |  // and one more byte as 'fixDNGBug16' boolean
  157|  1.87k|  const bool fixDNGBug16 = bs.getByte() != 0;
  158|       |
  159|  1.87k|  bool fullDecode = false;
  160|       |  if constexpr (T::Traits::SupportsFullDecode)
  161|  1.87k|    fullDecode = bs.getByte() != 0;
  162|       |
  163|  1.87k|  ht->setup(fullDecode, fixDNGBug16);
  164|       |
  165|  1.87k|  return std::move(*ht);
  166|  1.87k|}
_Z34createHuffmanPrefixCodeDecoderImplIN8rawspeed21PrefixCodeTreeDecoderINS0_15BaselineCodeTagEEES2_Qntsr3stdE18is_constructible_vIT_NS0_11HuffmanCodeIT0_EEEES4_RNS0_10ByteStreamE:
  126|  1.87k|inline T createHuffmanPrefixCodeDecoderImpl(rawspeed::ByteStream& bs) {
  127|  1.87k|  auto hc = createHuffmanCode<CodeTag>(bs);
  128|  1.87k|  auto code = hc.operator rawspeed::PrefixCode<CodeTag>();
  129|  1.87k|  return T(std::move(code));
  130|  1.87k|}
Dual.cpp:_ZL23createPrefixCodeDecoderIN8rawspeed20PrefixCodeLUTDecoderINS0_10VC5CodeTagENS0_23PrefixCodeLookupDecoderIS2_EEEEET_RNS0_10ByteStreamE:
  147|  1.02k|static T createPrefixCodeDecoder(rawspeed::ByteStream& bs) {
  148|  1.02k|  using CodeTag = typename T::Tag;
  149|       |
  150|  1.02k|  rawspeed::Optional<T> ht;
  151|  1.02k|  if (bool huffmanCode = bs.getByte() != 0; huffmanCode)
  ------------------
  |  Branch (151:45): [True: 1.02k, False: 3]
  ------------------
  152|  1.02k|    ht = createHuffmanPrefixCodeDecoderImpl<T, CodeTag>(bs);
  153|      3|  else
  154|      3|    ht = createSimplePrefixCodeDecoderImpl<T, CodeTag>(bs);
  155|       |
  156|       |  // and one more byte as 'fixDNGBug16' boolean
  157|  1.02k|  const bool fixDNGBug16 = bs.getByte() != 0;
  158|       |
  159|  1.02k|  bool fullDecode = false;
  160|       |  if constexpr (T::Traits::SupportsFullDecode)
  161|       |    fullDecode = bs.getByte() != 0;
  162|       |
  163|  1.02k|  ht->setup(fullDecode, fixDNGBug16);
  164|       |
  165|  1.02k|  return std::move(*ht);
  166|  1.02k|}
_Z34createHuffmanPrefixCodeDecoderImplIN8rawspeed20PrefixCodeLUTDecoderINS0_10VC5CodeTagENS0_23PrefixCodeLookupDecoderIS2_EEEES2_Qsr3stdE18is_constructible_vIT_NS0_11HuffmanCodeIT0_EEEES6_RNS0_10ByteStreamE:
  119|  1.02k|inline T createHuffmanPrefixCodeDecoderImpl(rawspeed::ByteStream& bs) {
  120|  1.02k|  auto hc = createHuffmanCode<CodeTag>(bs);
  121|  1.02k|  return T(std::move(hc));
  122|  1.02k|}
_Z17createHuffmanCodeIN8rawspeed10VC5CodeTagEENS0_11HuffmanCodeIT_EERNS0_10ByteStreamE:
   76|  1.89k|createHuffmanCode(rawspeed::ByteStream& bs) {
   77|  1.89k|  using Traits = rawspeed::CodeTraits<CodeTag>;
   78|       |
   79|  1.89k|  rawspeed::HuffmanCode<CodeTag> hc;
   80|       |
   81|       |  // first bytes are consumed as n-codes-per-length
   82|  1.89k|  const auto count =
   83|  1.89k|      hc.setNCodesPerLength(bs.getBuffer(Traits::MaxCodeLenghtBits));
   84|       |
   85|  1.89k|  if (count) {
  ------------------
  |  Branch (85:7): [True: 1.85k, False: 35]
  ------------------
   86|       |    // and then count more bytes consumed as code values
   87|  1.85k|    rawspeed::ByteStream codeValuesStream =
   88|  1.85k|        bs.getStream(count, sizeof(typename Traits::CodeValueTy));
   89|  1.85k|    const auto codesBuf = getCodeValues<CodeTag>(codeValuesStream, count);
   90|  1.85k|    hc.setCodeValues(rawspeed::Array1DRef<const typename Traits::CodeValueTy>(
   91|  1.85k|        codesBuf.data(),
   92|  1.85k|        rawspeed::implicit_cast<rawspeed::Buffer::size_type>(codesBuf.size())));
   93|  1.85k|  }
   94|       |
   95|  1.89k|  return hc;
   96|  1.89k|}
_Z13getCodeValuesIN8rawspeed10VC5CodeTagEEDaRNS0_10ByteStreamEj:
   37|  1.84k|auto getCodeValues(rawspeed::ByteStream& bs, unsigned numEntries) {
   38|  1.84k|  using Traits = rawspeed::CodeTraits<CodeTag>;
   39|  1.84k|  using CodeValueTy = typename Traits::CodeValueTy;
   40|       |
   41|  1.84k|  std::vector<CodeValueTy> values;
   42|  1.84k|  values.reserve(numEntries);
   43|  1.84k|  std::generate_n(std::back_inserter(values), numEntries, [&bs]() {
   44|  1.84k|    auto code = bs.get<CodeValueTy>();
   45|  1.84k|    if (!(code <= Traits::MaxCodeValue))
   46|  1.84k|      ThrowRSE("Bad code value");
   47|  1.84k|    return code;
   48|  1.84k|  });
   49|  1.84k|  assert(values.size() == numEntries);
  ------------------
  |  Branch (49:3): [True: 1.82k, False: 17]
  ------------------
   50|  1.82k|  return values;
   51|  1.84k|}
_ZZ13getCodeValuesIN8rawspeed10VC5CodeTagEEDaRNS0_10ByteStreamEjENKUlvE_clEv:
   43|  23.5k|  std::generate_n(std::back_inserter(values), numEntries, [&bs]() {
   44|  23.5k|    auto code = bs.get<CodeValueTy>();
   45|  23.5k|    if (!(code <= Traits::MaxCodeValue))
  ------------------
  |  Branch (45:9): [True: 17, False: 23.4k]
  ------------------
   46|  23.5k|      ThrowRSE("Bad code value");
  ------------------
  |  |   95|     17|  ThrowExceptionHelper(rawspeed::RawspeedException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     17|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     17|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     17|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   47|  23.4k|    return code;
   48|  23.5k|  });
_Z33createSimplePrefixCodeDecoderImplIN8rawspeed20PrefixCodeLUTDecoderINS0_10VC5CodeTagENS0_23PrefixCodeLookupDecoderIS2_EEEES2_Qntsr3stdE18is_constructible_vIT_NS0_10PrefixCodeIT0_EEEES6_RNS0_10ByteStreamE:
  134|      2|inline T createSimplePrefixCodeDecoderImpl(rawspeed::ByteStream& bs) {
  135|      2|  ThrowRSE(
  ------------------
  |  |   95|      2|  ThrowExceptionHelper(rawspeed::RawspeedException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      2|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      2|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      2|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  136|      2|      "This Prefix code decoder implementation only support Huffman codes");
  137|      2|}
Dual.cpp:_ZL23createPrefixCodeDecoderIN8rawspeed21PrefixCodeTreeDecoderINS0_10VC5CodeTagEEEET_RNS0_10ByteStreamE:
  147|    871|static T createPrefixCodeDecoder(rawspeed::ByteStream& bs) {
  148|    871|  using CodeTag = typename T::Tag;
  149|       |
  150|    871|  rawspeed::Optional<T> ht;
  151|    871|  if (bool huffmanCode = bs.getByte() != 0; huffmanCode)
  ------------------
  |  Branch (151:45): [True: 871, False: 0]
  ------------------
  152|    871|    ht = createHuffmanPrefixCodeDecoderImpl<T, CodeTag>(bs);
  153|      0|  else
  154|      0|    ht = createSimplePrefixCodeDecoderImpl<T, CodeTag>(bs);
  155|       |
  156|       |  // and one more byte as 'fixDNGBug16' boolean
  157|    871|  const bool fixDNGBug16 = bs.getByte() != 0;
  158|       |
  159|    871|  bool fullDecode = false;
  160|       |  if constexpr (T::Traits::SupportsFullDecode)
  161|       |    fullDecode = bs.getByte() != 0;
  162|       |
  163|    871|  ht->setup(fullDecode, fixDNGBug16);
  164|       |
  165|    871|  return std::move(*ht);
  166|    871|}
_Z34createHuffmanPrefixCodeDecoderImplIN8rawspeed21PrefixCodeTreeDecoderINS0_10VC5CodeTagEEES2_Qntsr3stdE18is_constructible_vIT_NS0_11HuffmanCodeIT0_EEEES4_RNS0_10ByteStreamE:
  126|    871|inline T createHuffmanPrefixCodeDecoderImpl(rawspeed::ByteStream& bs) {
  127|    871|  auto hc = createHuffmanCode<CodeTag>(bs);
  128|    871|  auto code = hc.operator rawspeed::PrefixCode<CodeTag>();
  129|    871|  return T(std::move(code));
  130|    871|}

LLVMFuzzerTestOneInput:
  161|  3.04k|extern "C" int LLVMFuzzerTestOneInput(const uint8_t* Data, size_t Size) {
  162|  3.04k|  assert(Data);
  ------------------
  |  Branch (162:3): [True: 3.04k, False: 0]
  ------------------
  163|       |
  164|  3.04k|  try {
  165|  3.04k|    const rawspeed::Buffer b(
  166|  3.04k|        Data, rawspeed::implicit_cast<rawspeed::Buffer::size_type>(Size));
  167|  3.04k|    const rawspeed::DataBuffer db(b, rawspeed::Endianness::little);
  168|  3.04k|    rawspeed::ByteStream bs(db);
  169|       |
  170|       |    // Which flavor?
  171|  3.04k|    switch (bs.getByte()) {
  172|  2.01k|    case 0:
  ------------------
  |  Branch (172:5): [True: 2.01k, False: 1.02k]
  ------------------
  173|  2.01k|      checkFlavour<rawspeed::BaselineCodeTag>(bs);
  174|  2.01k|      break;
  175|  1.02k|    case 1:
  ------------------
  |  Branch (175:5): [True: 1.02k, False: 2.01k]
  ------------------
  176|  1.02k|      checkFlavour<rawspeed::VC5CodeTag>(bs);
  177|  1.02k|      break;
  178|      3|    default:
  ------------------
  |  Branch (178:5): [True: 3, False: 3.04k]
  ------------------
  179|      3|      ThrowRSE("Unknown flavor");
  ------------------
  |  |   95|      3|  ThrowExceptionHelper(rawspeed::RawspeedException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      3|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      3|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      3|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  180|  3.04k|    }
  181|  3.04k|  } catch (const rawspeed::RawspeedException&) {
  182|  3.04k|    return 0;
  183|  3.04k|  }
  184|       |
  185|      0|  __builtin_unreachable();
  186|  3.04k|}
Dual.cpp:_ZN12_GLOBAL__N_112checkFlavourIN8rawspeed15BaselineCodeTagEEEvNS1_10ByteStreamE:
  110|  2.01k|template <typename CodeTag> void checkFlavour(rawspeed::ByteStream bs) {
  111|  2.01k|  rawspeed::ByteStream bs0 = bs;
  112|  2.01k|  rawspeed::ByteStream bs1 = bs;
  113|       |
  114|       |#ifndef BACKIMPL0
  115|       |  const auto ht0 = createPrefixCodeDecoder<rawspeed::IMPL0<CodeTag>>(bs0);
  116|       |#else
  117|  2.01k|  const auto ht0 = createPrefixCodeDecoder<
  118|  2.01k|      rawspeed::IMPL0<CodeTag, rawspeed::BACKIMPL0<CodeTag>>>(bs0);
  119|  2.01k|#endif
  120|       |
  121|  2.01k|#ifndef BACKIMPL1
  122|  2.01k|  const auto ht1 = createPrefixCodeDecoder<rawspeed::IMPL1<CodeTag>>(bs1);
  123|       |#else
  124|       |  const auto ht1 = createPrefixCodeDecoder<
  125|       |      rawspeed::IMPL1<CodeTag, rawspeed::BACKIMPL1<CodeTag>>>(bs1);
  126|       |#endif
  127|       |
  128|       |  // Which bit pump should we use?
  129|  2.01k|  const int format0 = bs0.getByte();
  130|  2.01k|  const int format1 = bs1.getByte();
  131|       |
  132|       |  // should have consumed 16 bytes for n-codes-per-length, at *least* 1 byte
  133|       |  // as code value, and a byte per 'fixDNGBug16'/'fullDecode' booleans
  134|  2.01k|  assert(bs0.getPosition() == bs1.getPosition());
  ------------------
  |  Branch (134:3): [True: 1.68k, False: 326]
  ------------------
  135|       |
  136|  2.01k|  assert(format0 == format1);
  ------------------
  |  Branch (136:3): [True: 1.68k, False: 0]
  ------------------
  137|  1.68k|  (void)format1;
  138|       |
  139|  1.68k|  const auto input = bs0.peekRemainingBuffer().getAsArray1DRef();
  140|       |
  141|  1.68k|  assert(format0 == format1);
  ------------------
  |  Branch (141:3): [True: 1.68k, False: 0]
  ------------------
  142|  1.68k|  switch (format0) {
  143|    530|  case 0:
  ------------------
  |  Branch (143:3): [True: 530, False: 1.15k]
  ------------------
  144|    530|    checkPump<rawspeed::BitStreamerMSB>(input, ht0, ht1);
  145|    530|    break;
  146|    491|  case 1:
  ------------------
  |  Branch (146:3): [True: 491, False: 1.19k]
  ------------------
  147|    491|    checkPump<rawspeed::BitStreamerMSB32>(input, ht0, ht1);
  148|    491|    break;
  149|    662|  case 2:
  ------------------
  |  Branch (149:3): [True: 662, False: 1.02k]
  ------------------
  150|    662|    checkPump<rawspeed::BitStreamerJPEG>(input, ht0, ht1);
  151|    662|    break;
  152|      5|  default:
  ------------------
  |  Branch (152:3): [True: 5, False: 1.68k]
  ------------------
  153|      5|    ThrowRSE("Unknown bit pump");
  ------------------
  |  |   95|      5|  ThrowExceptionHelper(rawspeed::RawspeedException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      5|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      5|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      5|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  154|  1.68k|  }
  155|  1.68k|}
Dual.cpp:_ZN12_GLOBAL__N_19checkPumpIN8rawspeed14BitStreamerMSBENS1_20PrefixCodeLUTDecoderINS1_15BaselineCodeTagENS1_23PrefixCodeLookupDecoderIS4_EEEENS1_21PrefixCodeTreeDecoderIS4_EEEEvNS1_10Array1DRefIKhEERKT0_RKT1_:
  102|    530|               const HT1& ht1) {
  103|    530|  assert(ht0.isFullDecode() == ht1.isFullDecode());
  ------------------
  |  Branch (103:3): [True: 530, False: 0]
  ------------------
  104|    530|  if (ht0.isFullDecode())
  ------------------
  |  Branch (104:7): [True: 351, False: 179]
  ------------------
  105|    351|    workloop<Pump, /*IsFullDecode=*/true>(input, ht0, ht1);
  106|    179|  else
  107|    179|    workloop<Pump, /*IsFullDecode=*/false>(input, ht0, ht1);
  108|    530|}
Dual.cpp:_ZN12_GLOBAL__N_18workloopIN8rawspeed14BitStreamerMSBELb1ENS1_20PrefixCodeLUTDecoderINS1_15BaselineCodeTagENS1_23PrefixCodeLookupDecoderIS4_EEEENS1_21PrefixCodeTreeDecoderIS4_EEEEvNS1_10Array1DRefIKhEERKT1_RKT2_:
   56|    351|              const HT1& ht1) {
   57|    351|  Pump bits0(input);
   58|    351|  Pump bits1(input);
   59|       |
   60|  10.3M|  while (true) {
  ------------------
  |  Branch (60:10): [True: 10.3M, Folded]
  ------------------
   61|  10.3M|    int decoded0;
   62|  10.3M|    int decoded1;
   63|       |
   64|  10.3M|    bool failure0 = false;
   65|  10.3M|    bool failure1 = false;
   66|       |
   67|  10.3M|    try {
   68|  10.3M|      decoded1 = ht1.template decode<decltype(bits1), IsFullDecode>(bits1);
   69|  10.3M|    } catch (const rawspeed::IOException&) {
   70|       |      // For now, let's ignore stream depleteon issues.
   71|    216|      throw;
   72|    216|    } catch (const rawspeed::RawspeedException&) {
   73|    132|      failure1 = true;
   74|    132|    }
   75|       |
   76|  10.3M|    try {
   77|  10.3M|      decoded0 = ht0.template decode<decltype(bits0), IsFullDecode>(bits0);
   78|  10.3M|    } catch (const rawspeed::IOException&) {
   79|       |      // For now, let's ignore stream depleteon issues.
   80|      0|      throw;
   81|    132|    } catch (const rawspeed::RawspeedException&) {
   82|    132|      failure0 = true;
   83|    132|    }
   84|       |
   85|       |    // They both should either fail or succeed, else there is a bug.
   86|  10.3M|    assert(failure0 == failure1);
  ------------------
  |  Branch (86:5): [True: 10.3M, False: 0]
  ------------------
   87|       |
   88|       |    // If any failed, we can't continue.
   89|  10.3M|    if (failure0 || failure1)
  ------------------
  |  Branch (89:9): [True: 132, False: 10.3M]
  |  Branch (89:21): [True: 0, False: 10.3M]
  ------------------
   90|  10.3M|      ThrowRSE("Failure detected");
  ------------------
  |  |   95|    132|  ThrowExceptionHelper(rawspeed::RawspeedException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|    132|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|    132|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|    132|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   91|       |
   92|  10.3M|    (void)decoded0;
   93|  10.3M|    (void)decoded1;
   94|       |
   95|       |    // They both should have decoded the same value.
   96|       |    assert(decoded0 == decoded1);
  ------------------
  |  Branch (96:5): [True: 10.3M, False: 0]
  ------------------
   97|  10.3M|  }
   98|    351|}
Dual.cpp:_ZN12_GLOBAL__N_18workloopIN8rawspeed14BitStreamerMSBELb0ENS1_20PrefixCodeLUTDecoderINS1_15BaselineCodeTagENS1_23PrefixCodeLookupDecoderIS4_EEEENS1_21PrefixCodeTreeDecoderIS4_EEEEvNS1_10Array1DRefIKhEERKT1_RKT2_:
   56|    179|              const HT1& ht1) {
   57|    179|  Pump bits0(input);
   58|    179|  Pump bits1(input);
   59|       |
   60|  35.0M|  while (true) {
  ------------------
  |  Branch (60:10): [True: 35.0M, Folded]
  ------------------
   61|  35.0M|    int decoded0;
   62|  35.0M|    int decoded1;
   63|       |
   64|  35.0M|    bool failure0 = false;
   65|  35.0M|    bool failure1 = false;
   66|       |
   67|  35.0M|    try {
   68|  35.0M|      decoded1 = ht1.template decode<decltype(bits1), IsFullDecode>(bits1);
   69|  35.0M|    } catch (const rawspeed::IOException&) {
   70|       |      // For now, let's ignore stream depleteon issues.
   71|     76|      throw;
   72|     97|    } catch (const rawspeed::RawspeedException&) {
   73|     97|      failure1 = true;
   74|     97|    }
   75|       |
   76|  35.0M|    try {
   77|  35.0M|      decoded0 = ht0.template decode<decltype(bits0), IsFullDecode>(bits0);
   78|  35.0M|    } catch (const rawspeed::IOException&) {
   79|       |      // For now, let's ignore stream depleteon issues.
   80|      0|      throw;
   81|     97|    } catch (const rawspeed::RawspeedException&) {
   82|     97|      failure0 = true;
   83|     97|    }
   84|       |
   85|       |    // They both should either fail or succeed, else there is a bug.
   86|  35.0M|    assert(failure0 == failure1);
  ------------------
  |  Branch (86:5): [True: 35.0M, False: 0]
  ------------------
   87|       |
   88|       |    // If any failed, we can't continue.
   89|  35.0M|    if (failure0 || failure1)
  ------------------
  |  Branch (89:9): [True: 97, False: 35.0M]
  |  Branch (89:21): [True: 0, False: 35.0M]
  ------------------
   90|  35.0M|      ThrowRSE("Failure detected");
  ------------------
  |  |   95|     97|  ThrowExceptionHelper(rawspeed::RawspeedException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     97|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     97|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     97|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   91|       |
   92|  35.0M|    (void)decoded0;
   93|  35.0M|    (void)decoded1;
   94|       |
   95|       |    // They both should have decoded the same value.
   96|       |    assert(decoded0 == decoded1);
  ------------------
  |  Branch (96:5): [True: 35.0M, False: 0]
  ------------------
   97|  35.0M|  }
   98|    179|}
Dual.cpp:_ZN12_GLOBAL__N_19checkPumpIN8rawspeed16BitStreamerMSB32ENS1_20PrefixCodeLUTDecoderINS1_15BaselineCodeTagENS1_23PrefixCodeLookupDecoderIS4_EEEENS1_21PrefixCodeTreeDecoderIS4_EEEEvNS1_10Array1DRefIKhEERKT0_RKT1_:
  102|    491|               const HT1& ht1) {
  103|    491|  assert(ht0.isFullDecode() == ht1.isFullDecode());
  ------------------
  |  Branch (103:3): [True: 491, False: 0]
  ------------------
  104|    491|  if (ht0.isFullDecode())
  ------------------
  |  Branch (104:7): [True: 341, False: 150]
  ------------------
  105|    341|    workloop<Pump, /*IsFullDecode=*/true>(input, ht0, ht1);
  106|    150|  else
  107|    150|    workloop<Pump, /*IsFullDecode=*/false>(input, ht0, ht1);
  108|    491|}
Dual.cpp:_ZN12_GLOBAL__N_18workloopIN8rawspeed16BitStreamerMSB32ELb1ENS1_20PrefixCodeLUTDecoderINS1_15BaselineCodeTagENS1_23PrefixCodeLookupDecoderIS4_EEEENS1_21PrefixCodeTreeDecoderIS4_EEEEvNS1_10Array1DRefIKhEERKT1_RKT2_:
   56|    341|              const HT1& ht1) {
   57|    341|  Pump bits0(input);
   58|    341|  Pump bits1(input);
   59|       |
   60|  4.76M|  while (true) {
  ------------------
  |  Branch (60:10): [True: 4.76M, Folded]
  ------------------
   61|  4.76M|    int decoded0;
   62|  4.76M|    int decoded1;
   63|       |
   64|  4.76M|    bool failure0 = false;
   65|  4.76M|    bool failure1 = false;
   66|       |
   67|  4.76M|    try {
   68|  4.76M|      decoded1 = ht1.template decode<decltype(bits1), IsFullDecode>(bits1);
   69|  4.76M|    } catch (const rawspeed::IOException&) {
   70|       |      // For now, let's ignore stream depleteon issues.
   71|    212|      throw;
   72|    212|    } catch (const rawspeed::RawspeedException&) {
   73|    124|      failure1 = true;
   74|    124|    }
   75|       |
   76|  4.75M|    try {
   77|  4.75M|      decoded0 = ht0.template decode<decltype(bits0), IsFullDecode>(bits0);
   78|  4.75M|    } catch (const rawspeed::IOException&) {
   79|       |      // For now, let's ignore stream depleteon issues.
   80|      0|      throw;
   81|    124|    } catch (const rawspeed::RawspeedException&) {
   82|    124|      failure0 = true;
   83|    124|    }
   84|       |
   85|       |    // They both should either fail or succeed, else there is a bug.
   86|  4.75M|    assert(failure0 == failure1);
  ------------------
  |  Branch (86:5): [True: 4.75M, False: 0]
  ------------------
   87|       |
   88|       |    // If any failed, we can't continue.
   89|  4.75M|    if (failure0 || failure1)
  ------------------
  |  Branch (89:9): [True: 124, False: 4.75M]
  |  Branch (89:21): [True: 0, False: 4.75M]
  ------------------
   90|  4.75M|      ThrowRSE("Failure detected");
  ------------------
  |  |   95|    124|  ThrowExceptionHelper(rawspeed::RawspeedException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|    124|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|    124|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|    124|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   91|       |
   92|  4.75M|    (void)decoded0;
   93|  4.75M|    (void)decoded1;
   94|       |
   95|       |    // They both should have decoded the same value.
   96|       |    assert(decoded0 == decoded1);
  ------------------
  |  Branch (96:5): [True: 4.75M, False: 0]
  ------------------
   97|  4.75M|  }
   98|    341|}
Dual.cpp:_ZN12_GLOBAL__N_18workloopIN8rawspeed16BitStreamerMSB32ELb0ENS1_20PrefixCodeLUTDecoderINS1_15BaselineCodeTagENS1_23PrefixCodeLookupDecoderIS4_EEEENS1_21PrefixCodeTreeDecoderIS4_EEEEvNS1_10Array1DRefIKhEERKT1_RKT2_:
   56|    150|              const HT1& ht1) {
   57|    150|  Pump bits0(input);
   58|    150|  Pump bits1(input);
   59|       |
   60|  36.9M|  while (true) {
  ------------------
  |  Branch (60:10): [True: 36.9M, Folded]
  ------------------
   61|  36.9M|    int decoded0;
   62|  36.9M|    int decoded1;
   63|       |
   64|  36.9M|    bool failure0 = false;
   65|  36.9M|    bool failure1 = false;
   66|       |
   67|  36.9M|    try {
   68|  36.9M|      decoded1 = ht1.template decode<decltype(bits1), IsFullDecode>(bits1);
   69|  36.9M|    } catch (const rawspeed::IOException&) {
   70|       |      // For now, let's ignore stream depleteon issues.
   71|     64|      throw;
   72|     82|    } catch (const rawspeed::RawspeedException&) {
   73|     82|      failure1 = true;
   74|     82|    }
   75|       |
   76|  36.9M|    try {
   77|  36.9M|      decoded0 = ht0.template decode<decltype(bits0), IsFullDecode>(bits0);
   78|  36.9M|    } catch (const rawspeed::IOException&) {
   79|       |      // For now, let's ignore stream depleteon issues.
   80|      0|      throw;
   81|     82|    } catch (const rawspeed::RawspeedException&) {
   82|     82|      failure0 = true;
   83|     82|    }
   84|       |
   85|       |    // They both should either fail or succeed, else there is a bug.
   86|  36.9M|    assert(failure0 == failure1);
  ------------------
  |  Branch (86:5): [True: 36.9M, False: 0]
  ------------------
   87|       |
   88|       |    // If any failed, we can't continue.
   89|  36.9M|    if (failure0 || failure1)
  ------------------
  |  Branch (89:9): [True: 82, False: 36.9M]
  |  Branch (89:21): [True: 0, False: 36.9M]
  ------------------
   90|  36.9M|      ThrowRSE("Failure detected");
  ------------------
  |  |   95|     82|  ThrowExceptionHelper(rawspeed::RawspeedException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     82|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     82|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     82|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   91|       |
   92|  36.9M|    (void)decoded0;
   93|  36.9M|    (void)decoded1;
   94|       |
   95|       |    // They both should have decoded the same value.
   96|       |    assert(decoded0 == decoded1);
  ------------------
  |  Branch (96:5): [True: 36.9M, False: 0]
  ------------------
   97|  36.9M|  }
   98|    150|}
Dual.cpp:_ZN12_GLOBAL__N_19checkPumpIN8rawspeed15BitStreamerJPEGENS1_20PrefixCodeLUTDecoderINS1_15BaselineCodeTagENS1_23PrefixCodeLookupDecoderIS4_EEEENS1_21PrefixCodeTreeDecoderIS4_EEEEvNS1_10Array1DRefIKhEERKT0_RKT1_:
  102|    662|               const HT1& ht1) {
  103|    662|  assert(ht0.isFullDecode() == ht1.isFullDecode());
  ------------------
  |  Branch (103:3): [True: 662, False: 0]
  ------------------
  104|    662|  if (ht0.isFullDecode())
  ------------------
  |  Branch (104:7): [True: 437, False: 225]
  ------------------
  105|    437|    workloop<Pump, /*IsFullDecode=*/true>(input, ht0, ht1);
  106|    225|  else
  107|    225|    workloop<Pump, /*IsFullDecode=*/false>(input, ht0, ht1);
  108|    662|}
Dual.cpp:_ZN12_GLOBAL__N_18workloopIN8rawspeed15BitStreamerJPEGELb1ENS1_20PrefixCodeLUTDecoderINS1_15BaselineCodeTagENS1_23PrefixCodeLookupDecoderIS4_EEEENS1_21PrefixCodeTreeDecoderIS4_EEEEvNS1_10Array1DRefIKhEERKT1_RKT2_:
   56|    437|              const HT1& ht1) {
   57|    437|  Pump bits0(input);
   58|    437|  Pump bits1(input);
   59|       |
   60|  4.66M|  while (true) {
  ------------------
  |  Branch (60:10): [True: 4.66M, Folded]
  ------------------
   61|  4.66M|    int decoded0;
   62|  4.66M|    int decoded1;
   63|       |
   64|  4.66M|    bool failure0 = false;
   65|  4.66M|    bool failure1 = false;
   66|       |
   67|  4.66M|    try {
   68|  4.66M|      decoded1 = ht1.template decode<decltype(bits1), IsFullDecode>(bits1);
   69|  4.66M|    } catch (const rawspeed::IOException&) {
   70|       |      // For now, let's ignore stream depleteon issues.
   71|    278|      throw;
   72|    278|    } catch (const rawspeed::RawspeedException&) {
   73|    154|      failure1 = true;
   74|    154|    }
   75|       |
   76|  4.66M|    try {
   77|  4.66M|      decoded0 = ht0.template decode<decltype(bits0), IsFullDecode>(bits0);
   78|  4.66M|    } catch (const rawspeed::IOException&) {
   79|       |      // For now, let's ignore stream depleteon issues.
   80|      0|      throw;
   81|    154|    } catch (const rawspeed::RawspeedException&) {
   82|    154|      failure0 = true;
   83|    154|    }
   84|       |
   85|       |    // They both should either fail or succeed, else there is a bug.
   86|  4.66M|    assert(failure0 == failure1);
  ------------------
  |  Branch (86:5): [True: 4.66M, False: 0]
  ------------------
   87|       |
   88|       |    // If any failed, we can't continue.
   89|  4.66M|    if (failure0 || failure1)
  ------------------
  |  Branch (89:9): [True: 154, False: 4.66M]
  |  Branch (89:21): [True: 0, False: 4.66M]
  ------------------
   90|  4.66M|      ThrowRSE("Failure detected");
  ------------------
  |  |   95|    154|  ThrowExceptionHelper(rawspeed::RawspeedException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|    154|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|    154|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|    154|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   91|       |
   92|  4.66M|    (void)decoded0;
   93|  4.66M|    (void)decoded1;
   94|       |
   95|       |    // They both should have decoded the same value.
   96|       |    assert(decoded0 == decoded1);
  ------------------
  |  Branch (96:5): [True: 4.66M, False: 0]
  ------------------
   97|  4.66M|  }
   98|    437|}
Dual.cpp:_ZN12_GLOBAL__N_18workloopIN8rawspeed15BitStreamerJPEGELb0ENS1_20PrefixCodeLUTDecoderINS1_15BaselineCodeTagENS1_23PrefixCodeLookupDecoderIS4_EEEENS1_21PrefixCodeTreeDecoderIS4_EEEEvNS1_10Array1DRefIKhEERKT1_RKT2_:
   56|    225|              const HT1& ht1) {
   57|    225|  Pump bits0(input);
   58|    225|  Pump bits1(input);
   59|       |
   60|  12.4M|  while (true) {
  ------------------
  |  Branch (60:10): [True: 12.4M, Folded]
  ------------------
   61|  12.4M|    int decoded0;
   62|  12.4M|    int decoded1;
   63|       |
   64|  12.4M|    bool failure0 = false;
   65|  12.4M|    bool failure1 = false;
   66|       |
   67|  12.4M|    try {
   68|  12.4M|      decoded1 = ht1.template decode<decltype(bits1), IsFullDecode>(bits1);
   69|  12.4M|    } catch (const rawspeed::IOException&) {
   70|       |      // For now, let's ignore stream depleteon issues.
   71|    158|      throw;
   72|    158|    } catch (const rawspeed::RawspeedException&) {
   73|     64|      failure1 = true;
   74|     64|    }
   75|       |
   76|  12.4M|    try {
   77|  12.4M|      decoded0 = ht0.template decode<decltype(bits0), IsFullDecode>(bits0);
   78|  12.4M|    } catch (const rawspeed::IOException&) {
   79|       |      // For now, let's ignore stream depleteon issues.
   80|      0|      throw;
   81|     64|    } catch (const rawspeed::RawspeedException&) {
   82|     64|      failure0 = true;
   83|     64|    }
   84|       |
   85|       |    // They both should either fail or succeed, else there is a bug.
   86|  12.4M|    assert(failure0 == failure1);
  ------------------
  |  Branch (86:5): [True: 12.4M, False: 0]
  ------------------
   87|       |
   88|       |    // If any failed, we can't continue.
   89|  12.4M|    if (failure0 || failure1)
  ------------------
  |  Branch (89:9): [True: 64, False: 12.4M]
  |  Branch (89:21): [True: 0, False: 12.4M]
  ------------------
   90|  12.4M|      ThrowRSE("Failure detected");
  ------------------
  |  |   95|     64|  ThrowExceptionHelper(rawspeed::RawspeedException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     64|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     64|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     64|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   91|       |
   92|  12.4M|    (void)decoded0;
   93|  12.4M|    (void)decoded1;
   94|       |
   95|       |    // They both should have decoded the same value.
   96|       |    assert(decoded0 == decoded1);
  ------------------
  |  Branch (96:5): [True: 12.4M, False: 0]
  ------------------
   97|  12.4M|  }
   98|    225|}
Dual.cpp:_ZN12_GLOBAL__N_112checkFlavourIN8rawspeed10VC5CodeTagEEEvNS1_10ByteStreamE:
  110|  1.02k|template <typename CodeTag> void checkFlavour(rawspeed::ByteStream bs) {
  111|  1.02k|  rawspeed::ByteStream bs0 = bs;
  112|  1.02k|  rawspeed::ByteStream bs1 = bs;
  113|       |
  114|       |#ifndef BACKIMPL0
  115|       |  const auto ht0 = createPrefixCodeDecoder<rawspeed::IMPL0<CodeTag>>(bs0);
  116|       |#else
  117|  1.02k|  const auto ht0 = createPrefixCodeDecoder<
  118|  1.02k|      rawspeed::IMPL0<CodeTag, rawspeed::BACKIMPL0<CodeTag>>>(bs0);
  119|  1.02k|#endif
  120|       |
  121|  1.02k|#ifndef BACKIMPL1
  122|  1.02k|  const auto ht1 = createPrefixCodeDecoder<rawspeed::IMPL1<CodeTag>>(bs1);
  123|       |#else
  124|       |  const auto ht1 = createPrefixCodeDecoder<
  125|       |      rawspeed::IMPL1<CodeTag, rawspeed::BACKIMPL1<CodeTag>>>(bs1);
  126|       |#endif
  127|       |
  128|       |  // Which bit pump should we use?
  129|  1.02k|  const int format0 = bs0.getByte();
  130|  1.02k|  const int format1 = bs1.getByte();
  131|       |
  132|       |  // should have consumed 16 bytes for n-codes-per-length, at *least* 1 byte
  133|       |  // as code value, and a byte per 'fixDNGBug16'/'fullDecode' booleans
  134|  1.02k|  assert(bs0.getPosition() == bs1.getPosition());
  ------------------
  |  Branch (134:3): [True: 737, False: 289]
  ------------------
  135|       |
  136|  1.02k|  assert(format0 == format1);
  ------------------
  |  Branch (136:3): [True: 737, False: 0]
  ------------------
  137|    737|  (void)format1;
  138|       |
  139|    737|  const auto input = bs0.peekRemainingBuffer().getAsArray1DRef();
  140|       |
  141|    737|  assert(format0 == format1);
  ------------------
  |  Branch (141:3): [True: 737, False: 0]
  ------------------
  142|    737|  switch (format0) {
  143|    253|  case 0:
  ------------------
  |  Branch (143:3): [True: 253, False: 484]
  ------------------
  144|    253|    checkPump<rawspeed::BitStreamerMSB>(input, ht0, ht1);
  145|    253|    break;
  146|    227|  case 1:
  ------------------
  |  Branch (146:3): [True: 227, False: 510]
  ------------------
  147|    227|    checkPump<rawspeed::BitStreamerMSB32>(input, ht0, ht1);
  148|    227|    break;
  149|    253|  case 2:
  ------------------
  |  Branch (149:3): [True: 253, False: 484]
  ------------------
  150|    253|    checkPump<rawspeed::BitStreamerJPEG>(input, ht0, ht1);
  151|    253|    break;
  152|      4|  default:
  ------------------
  |  Branch (152:3): [True: 4, False: 733]
  ------------------
  153|      4|    ThrowRSE("Unknown bit pump");
  ------------------
  |  |   95|      4|  ThrowExceptionHelper(rawspeed::RawspeedException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      4|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      4|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      4|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  154|    737|  }
  155|    737|}
Dual.cpp:_ZN12_GLOBAL__N_19checkPumpIN8rawspeed14BitStreamerMSBENS1_20PrefixCodeLUTDecoderINS1_10VC5CodeTagENS1_23PrefixCodeLookupDecoderIS4_EEEENS1_21PrefixCodeTreeDecoderIS4_EEEEvNS1_10Array1DRefIKhEERKT0_RKT1_:
  102|    253|               const HT1& ht1) {
  103|    253|  assert(ht0.isFullDecode() == ht1.isFullDecode());
  ------------------
  |  Branch (103:3): [True: 253, False: 0]
  ------------------
  104|    253|  if (ht0.isFullDecode())
  ------------------
  |  Branch (104:7): [True: 0, False: 253]
  ------------------
  105|      0|    workloop<Pump, /*IsFullDecode=*/true>(input, ht0, ht1);
  106|    253|  else
  107|    253|    workloop<Pump, /*IsFullDecode=*/false>(input, ht0, ht1);
  108|    253|}
Dual.cpp:_ZN12_GLOBAL__N_18workloopIN8rawspeed14BitStreamerMSBELb0ENS1_20PrefixCodeLUTDecoderINS1_10VC5CodeTagENS1_23PrefixCodeLookupDecoderIS4_EEEENS1_21PrefixCodeTreeDecoderIS4_EEEEvNS1_10Array1DRefIKhEERKT1_RKT2_:
   56|    253|              const HT1& ht1) {
   57|    253|  Pump bits0(input);
   58|    253|  Pump bits1(input);
   59|       |
   60|  29.7M|  while (true) {
  ------------------
  |  Branch (60:10): [True: 29.7M, Folded]
  ------------------
   61|  29.7M|    int decoded0;
   62|  29.7M|    int decoded1;
   63|       |
   64|  29.7M|    bool failure0 = false;
   65|  29.7M|    bool failure1 = false;
   66|       |
   67|  29.7M|    try {
   68|  29.7M|      decoded1 = ht1.template decode<decltype(bits1), IsFullDecode>(bits1);
   69|  29.7M|    } catch (const rawspeed::IOException&) {
   70|       |      // For now, let's ignore stream depleteon issues.
   71|     84|      throw;
   72|    158|    } catch (const rawspeed::RawspeedException&) {
   73|    158|      failure1 = true;
   74|    158|    }
   75|       |
   76|  29.7M|    try {
   77|  29.7M|      decoded0 = ht0.template decode<decltype(bits0), IsFullDecode>(bits0);
   78|  29.7M|    } catch (const rawspeed::IOException&) {
   79|       |      // For now, let's ignore stream depleteon issues.
   80|      0|      throw;
   81|    158|    } catch (const rawspeed::RawspeedException&) {
   82|    158|      failure0 = true;
   83|    158|    }
   84|       |
   85|       |    // They both should either fail or succeed, else there is a bug.
   86|  29.7M|    assert(failure0 == failure1);
  ------------------
  |  Branch (86:5): [True: 29.7M, False: 0]
  ------------------
   87|       |
   88|       |    // If any failed, we can't continue.
   89|  29.7M|    if (failure0 || failure1)
  ------------------
  |  Branch (89:9): [True: 158, False: 29.7M]
  |  Branch (89:21): [True: 0, False: 29.7M]
  ------------------
   90|  29.7M|      ThrowRSE("Failure detected");
  ------------------
  |  |   95|    158|  ThrowExceptionHelper(rawspeed::RawspeedException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|    158|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|    158|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|    158|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   91|       |
   92|  29.7M|    (void)decoded0;
   93|  29.7M|    (void)decoded1;
   94|       |
   95|       |    // They both should have decoded the same value.
   96|       |    assert(decoded0 == decoded1);
  ------------------
  |  Branch (96:5): [True: 29.7M, False: 0]
  ------------------
   97|  29.7M|  }
   98|    253|}
Dual.cpp:_ZN12_GLOBAL__N_19checkPumpIN8rawspeed16BitStreamerMSB32ENS1_20PrefixCodeLUTDecoderINS1_10VC5CodeTagENS1_23PrefixCodeLookupDecoderIS4_EEEENS1_21PrefixCodeTreeDecoderIS4_EEEEvNS1_10Array1DRefIKhEERKT0_RKT1_:
  102|    227|               const HT1& ht1) {
  103|    227|  assert(ht0.isFullDecode() == ht1.isFullDecode());
  ------------------
  |  Branch (103:3): [True: 227, False: 0]
  ------------------
  104|    227|  if (ht0.isFullDecode())
  ------------------
  |  Branch (104:7): [True: 0, False: 227]
  ------------------
  105|      0|    workloop<Pump, /*IsFullDecode=*/true>(input, ht0, ht1);
  106|    227|  else
  107|    227|    workloop<Pump, /*IsFullDecode=*/false>(input, ht0, ht1);
  108|    227|}
Dual.cpp:_ZN12_GLOBAL__N_18workloopIN8rawspeed16BitStreamerMSB32ELb0ENS1_20PrefixCodeLUTDecoderINS1_10VC5CodeTagENS1_23PrefixCodeLookupDecoderIS4_EEEENS1_21PrefixCodeTreeDecoderIS4_EEEEvNS1_10Array1DRefIKhEERKT1_RKT2_:
   56|    227|              const HT1& ht1) {
   57|    227|  Pump bits0(input);
   58|    227|  Pump bits1(input);
   59|       |
   60|  36.5M|  while (true) {
  ------------------
  |  Branch (60:10): [True: 36.5M, Folded]
  ------------------
   61|  36.5M|    int decoded0;
   62|  36.5M|    int decoded1;
   63|       |
   64|  36.5M|    bool failure0 = false;
   65|  36.5M|    bool failure1 = false;
   66|       |
   67|  36.5M|    try {
   68|  36.5M|      decoded1 = ht1.template decode<decltype(bits1), IsFullDecode>(bits1);
   69|  36.5M|    } catch (const rawspeed::IOException&) {
   70|       |      // For now, let's ignore stream depleteon issues.
   71|     78|      throw;
   72|    147|    } catch (const rawspeed::RawspeedException&) {
   73|    147|      failure1 = true;
   74|    147|    }
   75|       |
   76|  36.5M|    try {
   77|  36.5M|      decoded0 = ht0.template decode<decltype(bits0), IsFullDecode>(bits0);
   78|  36.5M|    } catch (const rawspeed::IOException&) {
   79|       |      // For now, let's ignore stream depleteon issues.
   80|      0|      throw;
   81|    147|    } catch (const rawspeed::RawspeedException&) {
   82|    147|      failure0 = true;
   83|    147|    }
   84|       |
   85|       |    // They both should either fail or succeed, else there is a bug.
   86|  36.5M|    assert(failure0 == failure1);
  ------------------
  |  Branch (86:5): [True: 36.5M, False: 0]
  ------------------
   87|       |
   88|       |    // If any failed, we can't continue.
   89|  36.5M|    if (failure0 || failure1)
  ------------------
  |  Branch (89:9): [True: 147, False: 36.5M]
  |  Branch (89:21): [True: 0, False: 36.5M]
  ------------------
   90|  36.5M|      ThrowRSE("Failure detected");
  ------------------
  |  |   95|    147|  ThrowExceptionHelper(rawspeed::RawspeedException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|    147|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|    147|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|    147|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   91|       |
   92|  36.5M|    (void)decoded0;
   93|  36.5M|    (void)decoded1;
   94|       |
   95|       |    // They both should have decoded the same value.
   96|       |    assert(decoded0 == decoded1);
  ------------------
  |  Branch (96:5): [True: 36.5M, False: 0]
  ------------------
   97|  36.5M|  }
   98|    227|}
Dual.cpp:_ZN12_GLOBAL__N_19checkPumpIN8rawspeed15BitStreamerJPEGENS1_20PrefixCodeLUTDecoderINS1_10VC5CodeTagENS1_23PrefixCodeLookupDecoderIS4_EEEENS1_21PrefixCodeTreeDecoderIS4_EEEEvNS1_10Array1DRefIKhEERKT0_RKT1_:
  102|    253|               const HT1& ht1) {
  103|    253|  assert(ht0.isFullDecode() == ht1.isFullDecode());
  ------------------
  |  Branch (103:3): [True: 253, False: 0]
  ------------------
  104|    253|  if (ht0.isFullDecode())
  ------------------
  |  Branch (104:7): [True: 0, False: 253]
  ------------------
  105|      0|    workloop<Pump, /*IsFullDecode=*/true>(input, ht0, ht1);
  106|    253|  else
  107|    253|    workloop<Pump, /*IsFullDecode=*/false>(input, ht0, ht1);
  108|    253|}
Dual.cpp:_ZN12_GLOBAL__N_18workloopIN8rawspeed15BitStreamerJPEGELb0ENS1_20PrefixCodeLUTDecoderINS1_10VC5CodeTagENS1_23PrefixCodeLookupDecoderIS4_EEEENS1_21PrefixCodeTreeDecoderIS4_EEEEvNS1_10Array1DRefIKhEERKT1_RKT2_:
   56|    253|              const HT1& ht1) {
   57|    253|  Pump bits0(input);
   58|    253|  Pump bits1(input);
   59|       |
   60|  41.6k|  while (true) {
  ------------------
  |  Branch (60:10): [True: 41.6k, Folded]
  ------------------
   61|  41.6k|    int decoded0;
   62|  41.6k|    int decoded1;
   63|       |
   64|  41.6k|    bool failure0 = false;
   65|  41.6k|    bool failure1 = false;
   66|       |
   67|  41.6k|    try {
   68|  41.6k|      decoded1 = ht1.template decode<decltype(bits1), IsFullDecode>(bits1);
   69|  41.6k|    } catch (const rawspeed::IOException&) {
   70|       |      // For now, let's ignore stream depleteon issues.
   71|    107|      throw;
   72|    144|    } catch (const rawspeed::RawspeedException&) {
   73|    144|      failure1 = true;
   74|    144|    }
   75|       |
   76|  41.5k|    try {
   77|  41.5k|      decoded0 = ht0.template decode<decltype(bits0), IsFullDecode>(bits0);
   78|  41.5k|    } catch (const rawspeed::IOException&) {
   79|       |      // For now, let's ignore stream depleteon issues.
   80|      0|      throw;
   81|    144|    } catch (const rawspeed::RawspeedException&) {
   82|    144|      failure0 = true;
   83|    144|    }
   84|       |
   85|       |    // They both should either fail or succeed, else there is a bug.
   86|  41.5k|    assert(failure0 == failure1);
  ------------------
  |  Branch (86:5): [True: 41.5k, False: 0]
  ------------------
   87|       |
   88|       |    // If any failed, we can't continue.
   89|  41.5k|    if (failure0 || failure1)
  ------------------
  |  Branch (89:9): [True: 144, False: 41.3k]
  |  Branch (89:21): [True: 0, False: 41.3k]
  ------------------
   90|  41.5k|      ThrowRSE("Failure detected");
  ------------------
  |  |   95|    144|  ThrowExceptionHelper(rawspeed::RawspeedException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|    144|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|    144|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|    144|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   91|       |
   92|  41.3k|    (void)decoded0;
   93|  41.3k|    (void)decoded1;
   94|       |
   95|       |    // They both should have decoded the same value.
   96|       |    assert(decoded0 == decoded1);
  ------------------
  |  Branch (96:5): [True: 41.3k, False: 0]
  ------------------
   97|  41.3k|  }
   98|    253|}

_ZN8rawspeed10Array1DRefIKhEC2EPS1_i:
  104|   265k|    : data(data_), numElts(numElts_) {
  105|   265k|  establishClassInvariants();
  106|   265k|}
_ZNK8rawspeed10Array1DRefIKhE24establishClassInvariantsEv:
   97|  2.27M|Array1DRef<T>::establishClassInvariants() const noexcept {
   98|  2.27M|  invariant(data);
  ------------------
  |  |   27|  2.27M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (98:3): [True: 2.27M, False: 0]
  ------------------
   99|  2.27M|  invariant(numElts >= 0);
  ------------------
  |  |   27|  2.27M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (99:3): [True: 2.27M, False: 0]
  ------------------
  100|  2.27M|}
_ZNK8rawspeed10Array1DRefIKhE5beginEv:
  159|   171k|template <class T> inline T* Array1DRef<T>::begin() const {
  160|   171k|  establishClassInvariants();
  161|   171k|  return addressOf(/*eltIdx=*/0);
  162|   171k|}
_ZNK8rawspeed10Array1DRefIKhE9addressOfEi:
  133|   266k|Array1DRef<T>::addressOf(const int eltIdx) const {
  134|   266k|  establishClassInvariants();
  135|   266k|  invariant(eltIdx >= 0);
  ------------------
  |  |   27|   266k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (135:3): [True: 266k, False: 0]
  ------------------
  136|   266k|  invariant(eltIdx <= numElts);
  ------------------
  |  |   27|   266k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (136:3): [True: 266k, False: 0]
  ------------------
  137|   266k|#pragma GCC diagnostic push
  138|   266k|#pragma GCC diagnostic ignored "-Wpragmas"
  139|   266k|#pragma GCC diagnostic ignored "-Wunknown-warning-option"
  140|   266k|#pragma GCC diagnostic ignored "-Wunsafe-buffer-usage"
  141|   266k|  return data + eltIdx;
  142|   266k|#pragma GCC diagnostic pop
  143|   266k|}
_ZNK8rawspeed10Array1DRefIKhE4sizeEv:
  154|  1.13M|template <class T> inline int Array1DRef<T>::size() const {
  155|  1.13M|  establishClassInvariants();
  156|  1.13M|  return numElts;
  157|  1.13M|}
_ZNK8rawspeed10Array1DRefIKhE7getCropEii:
  110|  86.1k|Array1DRef<T>::getCrop(int offset, int size) const {
  111|  86.1k|  establishClassInvariants();
  112|  86.1k|  invariant(offset >= 0);
  ------------------
  |  |   27|  86.1k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (112:3): [True: 86.1k, False: 0]
  ------------------
  113|  86.1k|  invariant(size >= 0);
  ------------------
  |  |   27|  86.1k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (113:3): [True: 86.1k, False: 0]
  ------------------
  114|  86.1k|  invariant(offset <= numElts);
  ------------------
  |  |   27|  86.1k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (114:3): [True: 86.1k, False: 0]
  ------------------
  115|  86.1k|  invariant(size <= numElts);
  ------------------
  |  |   27|  86.1k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (115:3): [True: 86.1k, False: 0]
  ------------------
  116|  86.1k|  invariant(offset + size <= numElts);
  ------------------
  |  |   27|  86.1k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (116:3): [True: 86.1k, False: 0]
  ------------------
  117|  86.1k|  return {*this, offset, size};
  118|  86.1k|}
_ZNK8rawspeed10Array1DRefIKhE3endEv:
  163|  9.58k|template <class T> inline T* Array1DRef<T>::end() const {
  164|  9.58k|  establishClassInvariants();
  165|  9.58k|  return addressOf(/*eltIdx=*/numElts);
  166|  9.58k|}
_ZN8rawspeed10Array1DRefIKSt4byteEC2IKhQaaaantaasr3stdE10is_const_vITL0__Entsr3stdE10is_const_vIT_Entsr3stdE9is_same_vIu14__remove_constIS7_Eu14__remove_constIS6_EEsr3stdE9is_same_vIS8_S1_EEENS0_IS7_EE:
   78|  4.79k|      : Array1DRef(reinterpret_cast<T*>(RHS.data), sizeof(T2) * RHS.numElts) {}
_ZN8rawspeed10Array1DRefIKSt4byteEC2EPS2_i:
  104|  24.8M|    : data(data_), numElts(numElts_) {
  105|  24.8M|  establishClassInvariants();
  106|  24.8M|}
_ZNK8rawspeed10Array1DRefIKSt4byteE24establishClassInvariantsEv:
   97|  3.81G|Array1DRef<T>::establishClassInvariants() const noexcept {
   98|  3.81G|  invariant(data);
  ------------------
  |  |   27|  3.81G|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (98:3): [True: 3.81G, False: 0]
  ------------------
   99|  3.81G|  invariant(numElts >= 0);
  ------------------
  |  |   27|  3.81G|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (99:3): [True: 3.81G, False: 0]
  ------------------
  100|  3.81G|}
_ZNK8rawspeed10Array1DRefIKSt4byteE4sizeEv:
  154|  1.97G|template <class T> inline int Array1DRef<T>::size() const {
  155|  1.97G|  establishClassInvariants();
  156|  1.97G|  return numElts;
  157|  1.97G|}
_ZN8rawspeed10Array1DRefISt4byteEC2EPS1_i:
  104|  49.7M|    : data(data_), numElts(numElts_) {
  105|  49.7M|  establishClassInvariants();
  106|  49.7M|}
_ZNK8rawspeed10Array1DRefISt4byteE24establishClassInvariantsEv:
   97|   509M|Array1DRef<T>::establishClassInvariants() const noexcept {
   98|   509M|  invariant(data);
  ------------------
  |  |   27|   509M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (98:3): [True: 509M, False: 0]
  ------------------
   99|   509M|  invariant(numElts >= 0);
  ------------------
  |  |   27|   509M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (99:3): [True: 509M, False: 0]
  ------------------
  100|   509M|}
_ZNK8rawspeed10Array1DRefIKSt4byteE7getCropEii:
  110|  24.8M|Array1DRef<T>::getCrop(int offset, int size) const {
  111|  24.8M|  establishClassInvariants();
  112|  24.8M|  invariant(offset >= 0);
  ------------------
  |  |   27|  24.8M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (112:3): [True: 24.8M, False: 0]
  ------------------
  113|  24.8M|  invariant(size >= 0);
  ------------------
  |  |   27|  24.8M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (113:3): [True: 24.8M, False: 0]
  ------------------
  114|  24.8M|  invariant(offset <= numElts);
  ------------------
  |  |   27|  24.8M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (114:3): [True: 24.8M, False: 0]
  ------------------
  115|  24.8M|  invariant(size <= numElts);
  ------------------
  |  |   27|  24.8M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (115:3): [True: 24.8M, False: 0]
  ------------------
  116|  24.8M|  invariant(offset + size <= numElts);
  ------------------
  |  |   27|  24.8M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (116:3): [True: 24.8M, False: 0]
  ------------------
  117|  24.8M|  return {*this, offset, size};
  118|  24.8M|}
_ZNK8rawspeed10Array1DRefIKSt4byteE9addressOfEi:
  133|  49.7M|Array1DRef<T>::addressOf(const int eltIdx) const {
  134|  49.7M|  establishClassInvariants();
  135|  49.7M|  invariant(eltIdx >= 0);
  ------------------
  |  |   27|  49.7M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (135:3): [True: 49.7M, False: 0]
  ------------------
  136|  49.7M|  invariant(eltIdx <= numElts);
  ------------------
  |  |   27|  49.7M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (136:3): [True: 49.7M, False: 0]
  ------------------
  137|  49.7M|#pragma GCC diagnostic push
  138|  49.7M|#pragma GCC diagnostic ignored "-Wpragmas"
  139|  49.7M|#pragma GCC diagnostic ignored "-Wunknown-warning-option"
  140|  49.7M|#pragma GCC diagnostic ignored "-Wunsafe-buffer-usage"
  141|  49.7M|  return data + eltIdx;
  142|  49.7M|#pragma GCC diagnostic pop
  143|  49.7M|}
_ZNK8rawspeed10Array1DRefISt4byteE4sizeEv:
  154|   261M|template <class T> inline int Array1DRef<T>::size() const {
  155|   261M|  establishClassInvariants();
  156|   261M|  return numElts;
  157|   261M|}
_ZNK8rawspeed10Array1DRefISt4byteE5beginEv:
  159|  26.2M|template <class T> inline T* Array1DRef<T>::begin() const {
  160|  26.2M|  establishClassInvariants();
  161|  26.2M|  return addressOf(/*eltIdx=*/0);
  162|  26.2M|}
_ZNK8rawspeed10Array1DRefISt4byteE9addressOfEi:
  133|  52.5M|Array1DRef<T>::addressOf(const int eltIdx) const {
  134|  52.5M|  establishClassInvariants();
  135|  52.5M|  invariant(eltIdx >= 0);
  ------------------
  |  |   27|  52.5M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (135:3): [True: 52.5M, False: 0]
  ------------------
  136|  52.5M|  invariant(eltIdx <= numElts);
  ------------------
  |  |   27|  52.5M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (136:3): [True: 52.5M, False: 0]
  ------------------
  137|  52.5M|#pragma GCC diagnostic push
  138|  52.5M|#pragma GCC diagnostic ignored "-Wpragmas"
  139|  52.5M|#pragma GCC diagnostic ignored "-Wunknown-warning-option"
  140|  52.5M|#pragma GCC diagnostic ignored "-Wunsafe-buffer-usage"
  141|  52.5M|  return data + eltIdx;
  142|  52.5M|#pragma GCC diagnostic pop
  143|  52.5M|}
_ZNK8rawspeed10Array1DRefIKSt4byteE5beginEv:
  159|  24.8M|template <class T> inline T* Array1DRef<T>::begin() const {
  160|  24.8M|  establishClassInvariants();
  161|  24.8M|  return addressOf(/*eltIdx=*/0);
  162|  24.8M|}
_ZNK8rawspeed10Array1DRefISt4byteE3endEv:
  163|  10.7k|template <class T> inline T* Array1DRef<T>::end() const {
  164|  10.7k|  establishClassInvariants();
  165|  10.7k|  return addressOf(/*eltIdx=*/numElts);
  166|  10.7k|}
_ZNK8rawspeed10Array1DRefISt4byteE7getCropEii:
  110|  23.4M|Array1DRef<T>::getCrop(int offset, int size) const {
  111|  23.4M|  establishClassInvariants();
  112|  23.4M|  invariant(offset >= 0);
  ------------------
  |  |   27|  23.4M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (112:3): [True: 23.4M, False: 0]
  ------------------
  113|  23.4M|  invariant(size >= 0);
  ------------------
  |  |   27|  23.4M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (113:3): [True: 23.4M, False: 0]
  ------------------
  114|  23.4M|  invariant(offset <= numElts);
  ------------------
  |  |   27|  23.4M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (114:3): [True: 23.4M, False: 0]
  ------------------
  115|  23.4M|  invariant(size <= numElts);
  ------------------
  |  |   27|  23.4M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (115:3): [True: 23.4M, False: 0]
  ------------------
  116|  23.4M|  invariant(offset + size <= numElts);
  ------------------
  |  |   27|  23.4M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (116:3): [True: 23.4M, False: 0]
  ------------------
  117|  23.4M|  return {*this, offset, size};
  118|  23.4M|}
_ZNK8rawspeed10Array1DRefISt4byteE8getBlockEii:
  122|  23.4M|Array1DRef<T>::getBlock(int size, int index) const {
  123|  23.4M|  establishClassInvariants();
  124|  23.4M|  invariant(index >= 0);
  ------------------
  |  |   27|  23.4M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (124:3): [True: 23.4M, False: 0]
  ------------------
  125|  23.4M|  invariant(size >= 0);
  ------------------
  |  |   27|  23.4M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (125:3): [True: 23.4M, False: 0]
  ------------------
  126|  23.4M|  invariant(index <= numElts);
  ------------------
  |  |   27|  23.4M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (126:3): [True: 23.4M, False: 0]
  ------------------
  127|  23.4M|  invariant(size <= numElts);
  ------------------
  |  |   27|  23.4M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (127:3): [True: 23.4M, False: 0]
  ------------------
  128|  23.4M|  return getCrop(size * index, size);
  129|  23.4M|}
_ZNK8rawspeed10Array1DRefISt4byteEclEi:
  147|  2.83M|Array1DRef<T>::operator()(const int eltIdx) const {
  148|  2.83M|  establishClassInvariants();
  149|  2.83M|  invariant(eltIdx >= 0);
  ------------------
  |  |   27|  2.83M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (149:3): [True: 2.83M, False: 0]
  ------------------
  150|  2.83M|  invariant(eltIdx < numElts);
  ------------------
  |  |   27|  2.83M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (150:3): [True: 2.83M, False: 0]
  ------------------
  151|  2.83M|  return *addressOf(eltIdx);
  152|  2.83M|}
_ZNK8rawspeed10Array1DRefIKjE4sizeEv:
  154|  3.65k|template <class T> inline int Array1DRef<T>::size() const {
  155|  3.65k|  establishClassInvariants();
  156|  3.65k|  return numElts;
  157|  3.65k|}
_ZNK8rawspeed10Array1DRefIKjE24establishClassInvariantsEv:
   97|  12.7k|Array1DRef<T>::establishClassInvariants() const noexcept {
   98|  12.7k|  invariant(data);
  ------------------
  |  |   27|  12.7k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (98:3): [True: 12.7k, False: 0]
  ------------------
   99|  12.7k|  invariant(numElts >= 0);
  ------------------
  |  |   27|  12.7k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (99:3): [True: 12.7k, False: 0]
  ------------------
  100|  12.7k|}
_ZNK8rawspeed10Array1DRefIKjE5beginEv:
  159|  1.82k|template <class T> inline T* Array1DRef<T>::begin() const {
  160|  1.82k|  establishClassInvariants();
  161|  1.82k|  return addressOf(/*eltIdx=*/0);
  162|  1.82k|}
_ZNK8rawspeed10Array1DRefIKjE9addressOfEi:
  133|  3.65k|Array1DRef<T>::addressOf(const int eltIdx) const {
  134|  3.65k|  establishClassInvariants();
  135|  3.65k|  invariant(eltIdx >= 0);
  ------------------
  |  |   27|  3.65k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (135:3): [True: 3.65k, False: 0]
  ------------------
  136|  3.65k|  invariant(eltIdx <= numElts);
  ------------------
  |  |   27|  3.65k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (136:3): [True: 3.65k, False: 0]
  ------------------
  137|  3.65k|#pragma GCC diagnostic push
  138|  3.65k|#pragma GCC diagnostic ignored "-Wpragmas"
  139|  3.65k|#pragma GCC diagnostic ignored "-Wunknown-warning-option"
  140|  3.65k|#pragma GCC diagnostic ignored "-Wunsafe-buffer-usage"
  141|  3.65k|  return data + eltIdx;
  142|  3.65k|#pragma GCC diagnostic pop
  143|  3.65k|}
_ZNK8rawspeed10Array1DRefIKjE3endEv:
  163|  1.82k|template <class T> inline T* Array1DRef<T>::end() const {
  164|  1.82k|  establishClassInvariants();
  165|  1.82k|  return addressOf(/*eltIdx=*/numElts);
  166|  1.82k|}
_ZN8rawspeed10Array1DRefIKjEC2EPS1_i:
  104|  1.82k|    : data(data_), numElts(numElts_) {
  105|  1.82k|  establishClassInvariants();
  106|  1.82k|}

_ZN8rawspeed15extractHighBitsItQsr3stdE13is_unsigned_vIT_EEES1_S1_jj:
  121|   815k|    T value, unsigned nBits, unsigned effectiveBitwidth = bitwidth<T>()) {
  122|   815k|  invariant(effectiveBitwidth <= bitwidth<T>());
  ------------------
  |  |   27|   815k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (122:3): [True: 815k, False: 0]
  ------------------
  123|   815k|  invariant(nBits <= effectiveBitwidth);
  ------------------
  |  |   27|   815k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (123:3): [True: 815k, False: 0]
  ------------------
  124|   815k|  auto numLowBitsToSkip = effectiveBitwidth - nBits;
  125|   815k|  invariant(numLowBitsToSkip < bitwidth<T>());
  ------------------
  |  |   27|   815k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (125:3): [True: 815k, False: 0]
  ------------------
  126|   815k|  return value >> numLowBitsToSkip;
  127|   815k|}
_ZN8rawspeed8bitwidthItEEjT_:
   43|   209M|constexpr unsigned RAWSPEED_READNONE bitwidth([[maybe_unused]] T unused = {}) {
   44|       |  return CHAR_BIT * sizeof(T);
   45|   209M|}
_ZN8rawspeed15extractHighBitsImQsr3stdE13is_unsigned_vIT_EEES1_S1_jj:
  121|   439M|    T value, unsigned nBits, unsigned effectiveBitwidth = bitwidth<T>()) {
  122|   439M|  invariant(effectiveBitwidth <= bitwidth<T>());
  ------------------
  |  |   27|   439M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (122:3): [True: 439M, False: 0]
  ------------------
  123|   439M|  invariant(nBits <= effectiveBitwidth);
  ------------------
  |  |   27|   439M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (123:3): [True: 439M, False: 0]
  ------------------
  124|   439M|  auto numLowBitsToSkip = effectiveBitwidth - nBits;
  125|   439M|  invariant(numLowBitsToSkip < bitwidth<T>());
  ------------------
  |  |   27|   439M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (125:3): [True: 439M, False: 0]
  ------------------
  126|   439M|  return value >> numLowBitsToSkip;
  127|   439M|}
_ZN8rawspeed8bitwidthImEEjT_:
   43|   439M|constexpr unsigned RAWSPEED_READNONE bitwidth([[maybe_unused]] T unused = {}) {
   44|       |  return CHAR_BIT * sizeof(T);
   45|   439M|}
_ZN8rawspeed15extractHighBitsIjQsr3stdE13is_unsigned_vIT_EEES1_S1_jj:
  121|  1.78M|    T value, unsigned nBits, unsigned effectiveBitwidth = bitwidth<T>()) {
  122|  1.78M|  invariant(effectiveBitwidth <= bitwidth<T>());
  ------------------
  |  |   27|  1.78M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (122:3): [True: 1.78M, False: 0]
  ------------------
  123|  1.78M|  invariant(nBits <= effectiveBitwidth);
  ------------------
  |  |   27|  1.78M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (123:3): [True: 1.78M, False: 0]
  ------------------
  124|  1.78M|  auto numLowBitsToSkip = effectiveBitwidth - nBits;
  125|  1.78M|  invariant(numLowBitsToSkip < bitwidth<T>());
  ------------------
  |  |   27|  1.78M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (125:3): [True: 1.78M, False: 0]
  ------------------
  126|  1.78M|  return value >> numLowBitsToSkip;
  127|  1.78M|}
_ZN8rawspeed8bitwidthIjEEjT_:
   43|   134M|constexpr unsigned RAWSPEED_READNONE bitwidth([[maybe_unused]] T unused = {}) {
   44|       |  return CHAR_BIT * sizeof(T);
   45|   134M|}

_ZN8rawspeed14BitMSBIteratorItEC2Eti:
   43|   208M|  BitMSBIterator(T bitsPat_, int bitIdx_) : bitsPat(bitsPat_), bitIdx(bitIdx_) {
   44|       |    invariant(bitIdx < static_cast<int>(bitwidth<T>()) && bitIdx >= -1);
  ------------------
  |  |   27|   208M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (44:5): [True: 208M, False: 0]
  |  Branch (44:5): [True: 208M, False: 0]
  |  Branch (44:5): [True: 208M, False: 0]
  ------------------
   45|   208M|  }
_ZN8rawspeedeqERKNS_14BitMSBIteratorItEES3_:
   57|   104M|  friend bool operator==(const BitMSBIterator& a, const BitMSBIterator& b) {
   58|   104M|    invariant(a.bitsPat == b.bitsPat && "Comparing unrelated iterators.");
  ------------------
  |  |   27|   104M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (58:5): [True: 104M, False: 0]
  |  Branch (58:5): [True: 104M, Folded]
  |  Branch (58:5): [True: 104M, False: 0]
  ------------------
   59|   104M|    return a.bitIdx == b.bitIdx;
   60|   104M|  }
_ZNK8rawspeed14BitMSBIteratorItEdeEv:
   47|  81.3k|  value_type operator*() const {
   48|  81.3k|    invariant(static_cast<unsigned>(bitIdx) < bitwidth<T>() &&
  ------------------
  |  |   27|  81.3k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (48:5): [True: 81.3k, False: 0]
  |  Branch (48:5): [True: 81.3k, Folded]
  |  Branch (48:5): [True: 81.3k, False: 0]
  ------------------
   49|  81.3k|              "Iterator overflow");
   50|  81.3k|    return (bitsPat >> bitIdx) & 0b1;
   51|  81.3k|  }
_ZN8rawspeed14BitMSBIteratorItEppEv:
   52|  81.3k|  BitMSBIterator& operator++() {
   53|  81.3k|    --bitIdx; // We go from MSB to LSB.
   54|  81.3k|    invariant(bitIdx >= -1);
  ------------------
  |  |   27|  81.3k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (54:5): [True: 81.3k, False: 0]
  ------------------
   55|  81.3k|    return *this;
   56|  81.3k|  }
_ZN8rawspeed14BitMSBIteratorIjEC2Eji:
   43|   132M|  BitMSBIterator(T bitsPat_, int bitIdx_) : bitsPat(bitsPat_), bitIdx(bitIdx_) {
   44|       |    invariant(bitIdx < static_cast<int>(bitwidth<T>()) && bitIdx >= -1);
  ------------------
  |  |   27|   132M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (44:5): [True: 132M, False: 0]
  |  Branch (44:5): [True: 132M, False: 0]
  |  Branch (44:5): [True: 132M, False: 0]
  ------------------
   45|   132M|  }
_ZN8rawspeedeqERKNS_14BitMSBIteratorIjEES3_:
   57|  66.5M|  friend bool operator==(const BitMSBIterator& a, const BitMSBIterator& b) {
   58|  66.5M|    invariant(a.bitsPat == b.bitsPat && "Comparing unrelated iterators.");
  ------------------
  |  |   27|  66.5M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (58:5): [True: 66.5M, False: 0]
  |  Branch (58:5): [True: 66.5M, Folded]
  |  Branch (58:5): [True: 66.5M, False: 0]
  ------------------
   59|  66.5M|    return a.bitIdx == b.bitIdx;
   60|  66.5M|  }
_ZNK8rawspeed14BitMSBIteratorIjEdeEv:
   47|   175k|  value_type operator*() const {
   48|   175k|    invariant(static_cast<unsigned>(bitIdx) < bitwidth<T>() &&
  ------------------
  |  |   27|   175k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (48:5): [True: 175k, False: 0]
  |  Branch (48:5): [True: 175k, Folded]
  |  Branch (48:5): [True: 175k, False: 0]
  ------------------
   49|   175k|              "Iterator overflow");
   50|   175k|    return (bitsPat >> bitIdx) & 0b1;
   51|   175k|  }
_ZN8rawspeed14BitMSBIteratorIjEppEv:
   52|   175k|  BitMSBIterator& operator++() {
   53|   175k|    --bitIdx; // We go from MSB to LSB.
   54|   175k|    invariant(bitIdx >= -1);
  ------------------
  |  |   27|   175k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (54:5): [True: 175k, False: 0]
  ------------------
   55|   175k|    return *this;
   56|   175k|  }

_ZN8rawspeed13implicit_castIjmQaaaaoosr3stdE13is_integral_vIT0_Esr3stdE19is_floating_point_vIS1_Eoosr3stdE13is_integral_vIT_Esr3stdE19is_floating_point_vIS2_Entsr3stdE9is_same_vIS1_S2_EEES2_S1_:
   32|   439M|constexpr RAWSPEED_READNONE Ttgt implicit_cast(Tsrc value) {
   33|   439M|#pragma GCC diagnostic push
   34|   439M|#pragma GCC diagnostic ignored "-Wconversion"
   35|   439M|#pragma GCC diagnostic ignored "-Wdouble-promotion"
   36|   439M|  return value;
   37|   439M|#pragma GCC diagnostic pop
   38|   439M|}
_ZN8rawspeed13implicit_castIijQaaaaoosr3stdE13is_integral_vIT0_Esr3stdE19is_floating_point_vIS1_Eoosr3stdE13is_integral_vIT_Esr3stdE19is_floating_point_vIS2_Entsr3stdE9is_same_vIS1_S2_EEES2_S1_:
   32|   175k|constexpr RAWSPEED_READNONE Ttgt implicit_cast(Tsrc value) {
   33|   175k|#pragma GCC diagnostic push
   34|   175k|#pragma GCC diagnostic ignored "-Wconversion"
   35|   175k|#pragma GCC diagnostic ignored "-Wdouble-promotion"
   36|   175k|  return value;
   37|   175k|#pragma GCC diagnostic pop
   38|   175k|}
_ZN8rawspeed13implicit_castItjQaaaaoosr3stdE13is_integral_vIT0_Esr3stdE19is_floating_point_vIS1_Eoosr3stdE13is_integral_vIT_Esr3stdE19is_floating_point_vIS2_Entsr3stdE9is_same_vIS1_S2_EEES2_S1_:
   32|   117M|constexpr RAWSPEED_READNONE Ttgt implicit_cast(Tsrc value) {
   33|   117M|#pragma GCC diagnostic push
   34|   117M|#pragma GCC diagnostic ignored "-Wconversion"
   35|   117M|#pragma GCC diagnostic ignored "-Wdouble-promotion"
   36|   117M|  return value;
   37|   117M|#pragma GCC diagnostic pop
   38|   117M|}
_ZN8rawspeed13implicit_castItiQaaaaoosr3stdE13is_integral_vIT0_Esr3stdE19is_floating_point_vIS1_Eoosr3stdE13is_integral_vIT_Esr3stdE19is_floating_point_vIS2_Entsr3stdE9is_same_vIS1_S2_EEES2_S1_:
   32|  11.1k|constexpr RAWSPEED_READNONE Ttgt implicit_cast(Tsrc value) {
   33|  11.1k|#pragma GCC diagnostic push
   34|  11.1k|#pragma GCC diagnostic ignored "-Wconversion"
   35|  11.1k|#pragma GCC diagnostic ignored "-Wdouble-promotion"
   36|  11.1k|  return value;
   37|  11.1k|#pragma GCC diagnostic pop
   38|  11.1k|}
_ZN8rawspeed13implicit_castIimQaaaaoosr3stdE13is_integral_vIT0_Esr3stdE19is_floating_point_vIS1_Eoosr3stdE13is_integral_vIT_Esr3stdE19is_floating_point_vIS2_Entsr3stdE9is_same_vIS1_S2_EEES2_S1_:
   32|  49.7M|constexpr RAWSPEED_READNONE Ttgt implicit_cast(Tsrc value) {
   33|  49.7M|#pragma GCC diagnostic push
   34|  49.7M|#pragma GCC diagnostic ignored "-Wconversion"
   35|  49.7M|#pragma GCC diagnostic ignored "-Wdouble-promotion"
   36|  49.7M|  return value;
   37|  49.7M|#pragma GCC diagnostic pop
   38|  49.7M|}
_ZN8rawspeed13implicit_castIhiQaaaaoosr3stdE13is_integral_vIT0_Esr3stdE19is_floating_point_vIS1_Eoosr3stdE13is_integral_vIT_Esr3stdE19is_floating_point_vIS2_Entsr3stdE9is_same_vIS1_S2_EEES2_S1_:
   32|  15.3M|constexpr RAWSPEED_READNONE Ttgt implicit_cast(Tsrc value) {
   33|  15.3M|#pragma GCC diagnostic push
   34|  15.3M|#pragma GCC diagnostic ignored "-Wconversion"
   35|  15.3M|#pragma GCC diagnostic ignored "-Wdouble-promotion"
   36|  15.3M|  return value;
   37|  15.3M|#pragma GCC diagnostic pop
   38|  15.3M|}
_ZN8rawspeed13implicit_castIjjQaaaaoosr3stdE13is_integral_vIT0_Esr3stdE19is_floating_point_vIS1_Eoosr3stdE13is_integral_vIT_Esr3stdE19is_floating_point_vIS2_Esr3stdE9is_same_vIS1_S2_EEES2_S1_:
   46|  66.6M|constexpr RAWSPEED_READNONE Ttgt implicit_cast(Tsrc value) {
   47|  66.6M|  return value;
   48|  66.6M|}

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

_ZN8rawspeed8OptionalINS_20PrefixCodeLUTDecoderINS_15BaselineCodeTagENS_23PrefixCodeLookupDecoderIS2_EEEEEC2Ev:
   35|  2.01k|  Optional() = default;
_ZN8rawspeed8OptionalINS_20PrefixCodeLUTDecoderINS_15BaselineCodeTagENS_23PrefixCodeLookupDecoderIS2_EEEEEaSIS5_Qsr3stdE7same_asITL0__T_EEERS6_OS9_:
   46|  1.95k|  Optional<T>& operator=(U&& value) {
   47|  1.95k|    impl = std::forward<U>(value);
   48|  1.95k|    return *this;
   49|  1.95k|  }
_ZN8rawspeed8OptionalINS_20PrefixCodeLUTDecoderINS_15BaselineCodeTagENS_23PrefixCodeLookupDecoderIS2_EEEEEptEv:
   60|  1.87k|  T* operator->() {
   61|  1.87k|    invariant(has_value());
  ------------------
  |  |   27|  1.87k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (61:5): [True: 1.87k, False: 0]
  ------------------
   62|  1.87k|    return &impl.value();
   63|  1.87k|  }
_ZNK8rawspeed8OptionalINS_20PrefixCodeLUTDecoderINS_15BaselineCodeTagENS_23PrefixCodeLookupDecoderIS2_EEEEE9has_valueEv:
   85|  3.75k|  [[nodiscard]] bool has_value() const RAWSPEED_READNONE {
   86|  3.75k|    return impl.has_value();
   87|  3.75k|  }
_ZNR8rawspeed8OptionalINS_20PrefixCodeLUTDecoderINS_15BaselineCodeTagENS_23PrefixCodeLookupDecoderIS2_EEEEEdeEv:
   70|  1.87k|  T& operator*() & {
   71|  1.87k|    invariant(has_value());
  ------------------
  |  |   27|  1.87k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (71:5): [True: 1.87k, False: 0]
  ------------------
   72|  1.87k|    return impl.value();
   73|  1.87k|  }
_ZN8rawspeed8OptionalINS_21PrefixCodeTreeDecoderINS_15BaselineCodeTagEEEEC2Ev:
   35|  1.87k|  Optional() = default;
_ZN8rawspeed8OptionalINS_21PrefixCodeTreeDecoderINS_15BaselineCodeTagEEEEaSIS3_Qsr3stdE7same_asITL0__T_EEERS4_OS7_:
   46|  1.87k|  Optional<T>& operator=(U&& value) {
   47|  1.87k|    impl = std::forward<U>(value);
   48|  1.87k|    return *this;
   49|  1.87k|  }
_ZN8rawspeed8OptionalINS_21PrefixCodeTreeDecoderINS_15BaselineCodeTagEEEEptEv:
   60|  1.87k|  T* operator->() {
   61|  1.87k|    invariant(has_value());
  ------------------
  |  |   27|  1.87k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (61:5): [True: 1.87k, False: 0]
  ------------------
   62|  1.87k|    return &impl.value();
   63|  1.87k|  }
_ZNK8rawspeed8OptionalINS_21PrefixCodeTreeDecoderINS_15BaselineCodeTagEEEE9has_valueEv:
   85|  3.74k|  [[nodiscard]] bool has_value() const RAWSPEED_READNONE {
   86|  3.74k|    return impl.has_value();
   87|  3.74k|  }
_ZNR8rawspeed8OptionalINS_21PrefixCodeTreeDecoderINS_15BaselineCodeTagEEEEdeEv:
   70|  1.87k|  T& operator*() & {
   71|  1.87k|    invariant(has_value());
  ------------------
  |  |   27|  1.87k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (71:5): [True: 1.87k, False: 0]
  ------------------
   72|  1.87k|    return impl.value();
   73|  1.87k|  }
_ZN8rawspeed8OptionalINSt3__14pairINS_18AbstractPrefixCodeINS_15BaselineCodeTagEE10CodeSymbolEiEEEC2IS7_Qaaaaaantsr3stdE7same_asITL0__NS0_IT_EEEntsr3stdE7same_asISA_RSD_Entsr3stdE7same_asISA_OSD_Entsr3stdE7same_asISA_NS1_8optionalISB_EEEEEOSB_:
   42|   104M|  Optional(U&& value) : impl(std::forward<U>(value)) {}
_ZN8rawspeed8OptionalINSt3__14pairINS_18AbstractPrefixCodeINS_15BaselineCodeTagEE10CodeSymbolEiEEEC2IRKNS1_9nullopt_tEQaaaaaantsr3stdE7same_asITL0__NS0_IT_EEEntsr3stdE7same_asISD_RSG_Entsr3stdE7same_asISD_OSG_Entsr3stdE7same_asISD_NS1_8optionalISE_EEEEEOSE_:
   42|  50.9M|  Optional(U&& value) : impl(std::forward<U>(value)) {}
_ZNK8rawspeed8OptionalINSt3__14pairINS_18AbstractPrefixCodeINS_15BaselineCodeTagEE10CodeSymbolEiEEEcvbEv:
   89|   155M|  explicit operator bool() const { return has_value(); }
_ZNK8rawspeed8OptionalINSt3__14pairINS_18AbstractPrefixCodeINS_15BaselineCodeTagEE10CodeSymbolEiEEE9has_valueEv:
   85|   259M|  [[nodiscard]] bool has_value() const RAWSPEED_READNONE {
   86|   259M|    return impl.has_value();
   87|   259M|  }
_ZNR8rawspeed8OptionalINSt3__14pairINS_18AbstractPrefixCodeINS_15BaselineCodeTagEE10CodeSymbolEiEEEdeEv:
   70|   104M|  T& operator*() & {
   71|   104M|    invariant(has_value());
  ------------------
  |  |   27|   104M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (71:5): [True: 104M, False: 0]
  ------------------
   72|   104M|    return impl.value();
   73|   104M|  }
_ZN8rawspeed8OptionalINS_20PrefixCodeLUTDecoderINS_10VC5CodeTagENS_23PrefixCodeLookupDecoderIS2_EEEEEC2Ev:
   35|  1.02k|  Optional() = default;
_ZN8rawspeed8OptionalINS_20PrefixCodeLUTDecoderINS_10VC5CodeTagENS_23PrefixCodeLookupDecoderIS2_EEEEEaSIS5_Qsr3stdE7same_asITL0__T_EEERS6_OS9_:
   46|    954|  Optional<T>& operator=(U&& value) {
   47|    954|    impl = std::forward<U>(value);
   48|    954|    return *this;
   49|    954|  }
_ZN8rawspeed8OptionalINS_20PrefixCodeLUTDecoderINS_10VC5CodeTagENS_23PrefixCodeLookupDecoderIS2_EEEEEptEv:
   60|    871|  T* operator->() {
   61|    871|    invariant(has_value());
  ------------------
  |  |   27|    871|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (61:5): [True: 871, False: 0]
  ------------------
   62|    871|    return &impl.value();
   63|    871|  }
_ZNK8rawspeed8OptionalINS_20PrefixCodeLUTDecoderINS_10VC5CodeTagENS_23PrefixCodeLookupDecoderIS2_EEEEE9has_valueEv:
   85|  1.74k|  [[nodiscard]] bool has_value() const RAWSPEED_READNONE {
   86|  1.74k|    return impl.has_value();
   87|  1.74k|  }
_ZNR8rawspeed8OptionalINS_20PrefixCodeLUTDecoderINS_10VC5CodeTagENS_23PrefixCodeLookupDecoderIS2_EEEEEdeEv:
   70|    871|  T& operator*() & {
   71|    871|    invariant(has_value());
  ------------------
  |  |   27|    871|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (71:5): [True: 871, False: 0]
  ------------------
   72|    871|    return impl.value();
   73|    871|  }
_ZN8rawspeed8OptionalINS_21PrefixCodeTreeDecoderINS_10VC5CodeTagEEEEC2Ev:
   35|    871|  Optional() = default;
_ZN8rawspeed8OptionalINS_21PrefixCodeTreeDecoderINS_10VC5CodeTagEEEEaSIS3_Qsr3stdE7same_asITL0__T_EEERS4_OS7_:
   46|    871|  Optional<T>& operator=(U&& value) {
   47|    871|    impl = std::forward<U>(value);
   48|    871|    return *this;
   49|    871|  }
_ZN8rawspeed8OptionalINS_21PrefixCodeTreeDecoderINS_10VC5CodeTagEEEEptEv:
   60|    871|  T* operator->() {
   61|    871|    invariant(has_value());
  ------------------
  |  |   27|    871|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (61:5): [True: 871, False: 0]
  ------------------
   62|    871|    return &impl.value();
   63|    871|  }
_ZNK8rawspeed8OptionalINS_21PrefixCodeTreeDecoderINS_10VC5CodeTagEEEE9has_valueEv:
   85|  1.74k|  [[nodiscard]] bool has_value() const RAWSPEED_READNONE {
   86|  1.74k|    return impl.has_value();
   87|  1.74k|  }
_ZNR8rawspeed8OptionalINS_21PrefixCodeTreeDecoderINS_10VC5CodeTagEEEEdeEv:
   70|    871|  T& operator*() & {
   71|    871|    invariant(has_value());
  ------------------
  |  |   27|    871|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (71:5): [True: 871, False: 0]
  ------------------
   72|    871|    return impl.value();
   73|    871|  }
_ZN8rawspeed8OptionalINSt3__14pairINS_18AbstractPrefixCodeINS_10VC5CodeTagEE10CodeSymbolEiEEEC2IS7_Qaaaaaantsr3stdE7same_asITL0__NS0_IT_EEEntsr3stdE7same_asISA_RSD_Entsr3stdE7same_asISA_OSD_Entsr3stdE7same_asISA_NS1_8optionalISB_EEEEEOSB_:
   42|  66.3M|  Optional(U&& value) : impl(std::forward<U>(value)) {}
_ZN8rawspeed8OptionalINSt3__14pairINS_18AbstractPrefixCodeINS_10VC5CodeTagEE10CodeSymbolEiEEEC2IRKNS1_9nullopt_tEQaaaaaantsr3stdE7same_asITL0__NS0_IT_EEEntsr3stdE7same_asISD_RSG_Entsr3stdE7same_asISD_OSG_Entsr3stdE7same_asISD_NS1_8optionalISE_EEEEEOSE_:
   42|  13.7M|  Optional(U&& value) : impl(std::forward<U>(value)) {}
_ZNK8rawspeed8OptionalINSt3__14pairINS_18AbstractPrefixCodeINS_10VC5CodeTagEE10CodeSymbolEiEEEcvbEv:
   89|  80.1M|  explicit operator bool() const { return has_value(); }
_ZNK8rawspeed8OptionalINSt3__14pairINS_18AbstractPrefixCodeINS_10VC5CodeTagEE10CodeSymbolEiEEE9has_valueEv:
   85|   146M|  [[nodiscard]] bool has_value() const RAWSPEED_READNONE {
   86|   146M|    return impl.has_value();
   87|   146M|  }
_ZNR8rawspeed8OptionalINSt3__14pairINS_18AbstractPrefixCodeINS_10VC5CodeTagEE10CodeSymbolEiEEEdeEv:
   70|  66.3M|  T& operator*() & {
   71|  66.3M|    invariant(has_value());
  ------------------
  |  |   27|  66.3M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (71:5): [True: 66.3M, False: 0]
  ------------------
   72|  66.3M|    return impl.value();
   73|  66.3M|  }

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

_ZN8rawspeed14iterator_rangeINS_14BitMSBIteratorItEEEC2ES2_S2_:
   33|   104M|      : begin_iterator(std::move(begin_iterator_)),
   34|   104M|        end_iterator(std::move(end_iterator_)) {}
_ZNK8rawspeed14iterator_rangeINS_14BitMSBIteratorItEEE5beginEv:
   36|   104M|  [[nodiscard]] Iter begin() const { return begin_iterator; }
_ZNK8rawspeed14iterator_rangeINS_14BitMSBIteratorItEEE3endEv:
   37|   104M|  [[nodiscard]] Iter end() const { return end_iterator; }
_ZN8rawspeed14iterator_rangeINS_14BitMSBIteratorIjEEEC2ES2_S2_:
   33|  66.3M|      : begin_iterator(std::move(begin_iterator_)),
   34|  66.3M|        end_iterator(std::move(end_iterator_)) {}
_ZNK8rawspeed14iterator_rangeINS_14BitMSBIteratorIjEEE5beginEv:
   36|  66.3M|  [[nodiscard]] Iter begin() const { return begin_iterator; }
_ZNK8rawspeed14iterator_rangeINS_14BitMSBIteratorIjEEE3endEv:
   37|  66.3M|  [[nodiscard]] Iter end() const { return end_iterator; }

_ZNK8rawspeed18BitStreamCacheBase24establishClassInvariantsEv:
   54|  2.43G|BitStreamCacheBase::establishClassInvariants() const noexcept {
   55|  2.43G|  invariant(fillLevel >= 0);
  ------------------
  |  |   27|  2.43G|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (55:3): [True: 2.43G, False: 0]
  ------------------
   56|  2.43G|  invariant(fillLevel <= Size);
  ------------------
  |  |   27|  2.43G|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (56:3): [True: 2.43G, False: 0]
  ------------------
   57|  2.43G|}
_ZN8rawspeed28BitStreamCacheRightInLeftOut4pushEmi:
   93|  24.8M|  void push(uint64_t bits, int count) noexcept {
   94|  24.8M|    establishClassInvariants();
   95|  24.8M|    invariant(count >= 0);
  ------------------
  |  |   27|  24.8M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (95:5): [True: 24.8M, False: 0]
  ------------------
   96|       |    // NOTE: count may be zero!
   97|  24.8M|    invariant(count <= Size);
  ------------------
  |  |   27|  24.8M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (97:5): [True: 24.8M, False: 0]
  ------------------
   98|  24.8M|    invariant(count + fillLevel <= Size);
  ------------------
  |  |   27|  24.8M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (98:5): [True: 24.8M, 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|  24.8M|    const int vacantBits = BitStreamCacheBase::Size - fillLevel;
  102|  24.8M|    invariant(vacantBits >= 0);
  ------------------
  |  |   27|  24.8M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (102:5): [True: 24.8M, False: 0]
  ------------------
  103|  24.8M|    invariant(vacantBits <= Size);
  ------------------
  |  |   27|  24.8M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (103:5): [True: 24.8M, False: 0]
  ------------------
  104|  24.8M|    invariant(vacantBits != 0);
  ------------------
  |  |   27|  24.8M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (104:5): [True: 24.8M, False: 0]
  ------------------
  105|  24.8M|    invariant(vacantBits >= count);
  ------------------
  |  |   27|  24.8M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (105:5): [True: 24.8M, 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|  24.8M|    const int emptyBitsGap = vacantBits - count;
  109|  24.8M|    invariant(emptyBitsGap >= 0);
  ------------------
  |  |   27|  24.8M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (109:5): [True: 24.8M, False: 0]
  ------------------
  110|  24.8M|    invariant(emptyBitsGap <= Size);
  ------------------
  |  |   27|  24.8M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (110:5): [True: 24.8M, False: 0]
  ------------------
  111|  24.8M|    if (count != 0) {
  ------------------
  |  Branch (111:9): [True: 24.8M, False: 0]
  ------------------
  112|  24.8M|      invariant(emptyBitsGap < Size);
  ------------------
  |  |   27|  24.8M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (112:7): [True: 24.8M, False: 0]
  ------------------
  113|       |      // So just shift the new bits so that there is no gap in the middle.
  114|  24.8M|      cache |= bits << emptyBitsGap;
  115|  24.8M|    }
  116|  24.8M|    fillLevel += count;
  117|  24.8M|  }
_ZNK8rawspeed28BitStreamCacheRightInLeftOut4peekEi:
  119|   439M|  [[nodiscard]] auto peek(int count) const noexcept {
  120|   439M|    establishClassInvariants();
  121|   439M|    invariant(count >= 0);
  ------------------
  |  |   27|   439M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (121:5): [True: 439M, False: 0]
  ------------------
  122|   439M|    invariant(count <= Size);
  ------------------
  |  |   27|   439M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (122:5): [True: 439M, False: 0]
  ------------------
  123|   439M|    invariant(count <= MaxGetBits);
  ------------------
  |  |   27|   439M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (123:5): [True: 439M, False: 0]
  ------------------
  124|   439M|    invariant(count != 0);
  ------------------
  |  |   27|   439M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (124:5): [True: 439M, False: 0]
  ------------------
  125|   439M|    invariant(count <= fillLevel);
  ------------------
  |  |   27|   439M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (125:5): [True: 439M, False: 0]
  ------------------
  126|   439M|    return implicit_cast<uint32_t>(
  127|   439M|        extractHighBits(cache, count,
  128|   439M|                        /*effectiveBitwidth=*/BitStreamCacheBase::Size));
  129|   439M|  }
_ZN8rawspeed28BitStreamCacheRightInLeftOut4skipEi:
  131|   448M|  void skip(int count) noexcept {
  132|   448M|    establishClassInvariants();
  133|   448M|    invariant(count >= 0);
  ------------------
  |  |   27|   448M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (133:5): [True: 448M, False: 0]
  ------------------
  134|       |    // `count` *could* be larger than `MaxGetBits`.
  135|       |    // `count` could be zero.
  136|   448M|    invariant(count <= Size);
  ------------------
  |  |   27|   448M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (136:5): [True: 448M, False: 0]
  ------------------
  137|   448M|    invariant(count <= fillLevel);
  ------------------
  |  |   27|   448M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (137:5): [True: 448M, False: 0]
  ------------------
  138|   448M|    fillLevel -= count;
  139|   448M|    cache <<= count;
  140|   448M|  }

_ZN8rawspeed11BitStreamerINS_14BitStreamerMSBENS_39BitStreamerForwardSequentialReplenisherIS1_EEEC2ENS_10Array1DRefIKSt4byteEE:
  192|  1.54k|  explicit BitStreamer(Array1DRef<const std::byte> input) : replenisher(input) {
  193|  1.54k|    establishClassInvariants();
  194|  1.54k|  }
_ZN8rawspeed26BitStreamerReplenisherBaseINS_14BitStreamerMSBEEC2ENS_10Array1DRefIKSt4byteEE:
   57|  1.54k|      : input(input_) {
   58|  1.54k|    if (input.size() < BitStreamerTraits<Tag>::MaxProcessBytes)
  ------------------
  |  Branch (58:9): [True: 20, False: 1.52k]
  ------------------
   59|  1.54k|      ThrowIOE("Bit stream size is smaller than MaxProcessBytes");
  ------------------
  |  |   37|     20|#define ThrowIOE(...) ThrowExceptionHelper(rawspeed::IOException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     20|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     20|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     20|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   60|  1.54k|  }
_ZNK8rawspeed11BitStreamerINS_14BitStreamerMSBENS_39BitStreamerForwardSequentialReplenisherIS1_EEE24establishClassInvariantsEv:
  185|   766M|  void establishClassInvariants() const noexcept {
  186|   766M|    cache.establishClassInvariants();
  187|   766M|    replenisher.establishClassInvariants();
  188|   766M|  }
_ZNK8rawspeed26BitStreamerReplenisherBaseINS_14BitStreamerMSBEE24establishClassInvariantsEv:
   65|   821M|BitStreamerReplenisherBase<Tag>::establishClassInvariants() const noexcept {
   66|   821M|  input.establishClassInvariants();
   67|   821M|  invariant(input.size() >= BitStreamerTraits<Tag>::MaxProcessBytes);
  ------------------
  |  |   27|   821M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (67:3): [True: 821M, False: 0]
  ------------------
   68|   821M|  invariant(pos >= 0);
  ------------------
  |  |   27|   821M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (68:3): [True: 821M, False: 0]
  ------------------
   69|   821M|  invariant(pos % StreamTraits::MinLoadStepByteMultiple == 0);
  ------------------
  |  |   27|   821M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (69:3): [True: 821M, False: 0]
  ------------------
   70|       |  // `pos` *could* be out-of-bounds of `input`.
   71|   821M|}
_ZN8rawspeed11BitStreamerINS_14BitStreamerMSBENS_39BitStreamerForwardSequentialReplenisherIS1_EEE4fillEi:
  216|   150M|  void fill(int nbits = Cache::MaxGetBits) {
  217|   150M|    establishClassInvariants();
  218|   150M|    invariant(nbits >= 0);
  ------------------
  |  |   27|   150M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (218:5): [True: 150M, False: 0]
  ------------------
  219|   150M|    invariant(nbits != 0);
  ------------------
  |  |   27|   150M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (219:5): [True: 150M, False: 0]
  ------------------
  220|   150M|    invariant(nbits <= Cache::MaxGetBits);
  ------------------
  |  |   27|   150M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (220:5): [True: 150M, False: 0]
  ------------------
  221|       |
  222|   150M|    if (cache.fillLevel >= nbits)
  ------------------
  |  Branch (222:9): [True: 136M, False: 13.8M]
  ------------------
  223|   136M|      return;
  224|       |
  225|  13.8M|    const auto input = replenisher.getInput();
  226|  13.8M|    const auto numBytes = static_cast<Derived*>(this)->fillCache(input);
  227|  13.8M|    replenisher.markNumBytesAsConsumed(numBytes);
  228|       |    invariant(cache.fillLevel >= nbits);
  ------------------
  |  |   27|  13.8M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (228:5): [True: 13.8M, False: 376]
  ------------------
  229|  13.8M|  }
_ZN8rawspeed39BitStreamerForwardSequentialReplenisherINS_14BitStreamerMSBEE8getInputEv:
  100|  13.8M|  std::array<std::byte, BitStreamerTraits<Tag>::MaxProcessBytes> getInput() {
  101|  13.8M|    Base::establishClassInvariants();
  102|       |
  103|  13.8M|    std::array<std::byte, BitStreamerTraits<Tag>::MaxProcessBytes> tmpStorage;
  104|  13.8M|    auto tmp = Array1DRef<std::byte>(tmpStorage.data(),
  105|  13.8M|                                     implicit_cast<int>(tmpStorage.size()));
  106|       |
  107|       |    // Do we have BitStreamerTraits<Tag>::MaxProcessBytes or more bytes left in
  108|       |    // the input buffer? If so, then we can just read from said buffer.
  109|  13.8M|    if (getPos() + BitStreamerTraits<Tag>::MaxProcessBytes <=
  ------------------
  |  Branch (109:9): [True: 13.8M, False: 2.98k]
  ------------------
  110|  13.8M|        Base::input.size()) [[likely]] {
  111|  13.8M|      auto currInput =
  112|  13.8M|          Base::input.getCrop(getPos(), BitStreamerTraits<Tag>::MaxProcessBytes)
  113|  13.8M|              .getAsArray1DRef();
  114|  13.8M|      invariant(currInput.size() == tmp.size());
  ------------------
  |  |   27|  13.8M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (114:7): [True: 13.8M, False: 0]
  ------------------
  115|  13.8M|      memcpy(tmp.begin(), currInput.begin(),
  116|  13.8M|             BitStreamerTraits<Tag>::MaxProcessBytes);
  117|  13.8M|      return tmpStorage;
  118|  13.8M|    }
  119|       |
  120|       |    // We have to use intermediate buffer, either because the input is running
  121|       |    // out of bytes, or because we want to enforce bounds checking.
  122|       |
  123|       |    // Note that in order to keep all fill-level invariants we must allow to
  124|       |    // over-read past-the-end a bit.
  125|  2.98k|    if (getPos() > Base::input.size() +
  ------------------
  |  Branch (125:9): [True: 376, False: 2.61k]
  ------------------
  126|  2.98k|                       2 * BitStreamerTraits<Tag>::MaxProcessBytes) [[unlikely]]
  127|    376|      ThrowIOE("Buffer overflow read in BitStreamer");
  ------------------
  |  |   37|    376|#define ThrowIOE(...) ThrowExceptionHelper(rawspeed::IOException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|    376|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|    376|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|    376|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  128|       |
  129|  2.61k|    variableLengthLoadNaiveViaMemcpy(tmp, Base::input, getPos());
  130|       |
  131|  2.61k|    return tmpStorage;
  132|  2.98k|  }
_ZNK8rawspeed39BitStreamerForwardSequentialReplenisherINS_14BitStreamerMSBEE6getPosEv:
   84|  27.7M|  [[nodiscard]] typename Base::size_type getPos() const {
   85|  27.7M|    Base::establishClassInvariants();
   86|  27.7M|    return Base::pos;
   87|  27.7M|  }
_ZN8rawspeed11BitStreamerINS_14BitStreamerMSBENS_39BitStreamerForwardSequentialReplenisherIS1_EEE9fillCacheENSt3__15arrayISt4byteLm4EEE:
  157|  13.8M|                inputStorage) {
  158|  13.8M|    static_assert(BitStreamCacheBase::MaxGetBits >= 32, "check implementation");
  159|  13.8M|    establishClassInvariants();
  160|  13.8M|    auto input = Array1DRef<std::byte>(inputStorage.data(),
  161|  13.8M|                                       implicit_cast<int>(inputStorage.size()));
  162|  13.8M|    invariant(input.size() == Traits::MaxProcessBytes);
  ------------------
  |  |   27|  13.8M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (162:5): [True: 13.8M, False: 0]
  ------------------
  163|       |
  164|  13.8M|    constexpr int StreamChunkBitwidth =
  165|  13.8M|        bitwidth<typename StreamTraits::ChunkType>();
  166|  13.8M|    static_assert(CHAR_BIT * Traits::MaxProcessBytes >= StreamChunkBitwidth);
  167|  13.8M|    static_assert(CHAR_BIT * Traits::MaxProcessBytes % StreamChunkBitwidth ==
  168|  13.8M|                  0);
  169|  13.8M|    constexpr int NumChunksNeeded =
  170|  13.8M|        (CHAR_BIT * Traits::MaxProcessBytes) / StreamChunkBitwidth;
  171|  13.8M|    static_assert(NumChunksNeeded >= 1);
  172|       |
  173|  27.7M|    for (int i = 0; i != NumChunksNeeded; ++i) {
  ------------------
  |  Branch (173:21): [True: 13.8M, False: 13.8M]
  ------------------
  174|  13.8M|      auto chunkInput =
  175|  13.8M|          input.getBlock(sizeof(typename StreamTraits::ChunkType), i);
  176|  13.8M|      auto chunk = getByteSwapped<typename StreamTraits::ChunkType>(
  177|  13.8M|          chunkInput.begin(),
  178|  13.8M|          StreamTraits::ChunkEndianness != getHostEndianness());
  179|  13.8M|      cache.push(chunk, StreamChunkBitwidth);
  180|  13.8M|    }
  181|  13.8M|    return Traits::MaxProcessBytes;
  182|  13.8M|  }
_ZN8rawspeed39BitStreamerForwardSequentialReplenisherINS_14BitStreamerMSBEE22markNumBytesAsConsumedEi:
   92|  13.8M|  void markNumBytesAsConsumed(typename Base::size_type numBytes) {
   93|  13.8M|    Base::establishClassInvariants();
   94|  13.8M|    invariant(numBytes >= 0);
  ------------------
  |  |   27|  13.8M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (94:5): [True: 13.8M, False: 0]
  ------------------
   95|  13.8M|    invariant(numBytes != 0);
  ------------------
  |  |   27|  13.8M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (95:5): [True: 13.8M, False: 0]
  ------------------
   96|  13.8M|    invariant(numBytes % StreamTraits::MinLoadStepByteMultiple == 0);
  ------------------
  |  |   27|  13.8M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (96:5): [True: 13.8M, False: 0]
  ------------------
   97|  13.8M|    Base::pos += numBytes;
   98|  13.8M|  }
_ZN8rawspeed11BitStreamerINS_14BitStreamerMSBENS_39BitStreamerForwardSequentialReplenisherIS1_EEE13getBitsNoFillEi:
  269|   148M|  uint32_t getBitsNoFill(int nbits) {
  270|   148M|    establishClassInvariants();
  271|   148M|    invariant(nbits >= 0);
  ------------------
  |  |   27|   148M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (271:5): [True: 148M, False: 0]
  ------------------
  272|   148M|    invariant(nbits != 0);
  ------------------
  |  |   27|   148M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (272:5): [True: 148M, False: 0]
  ------------------
  273|   148M|    invariant(nbits <= Cache::MaxGetBits);
  ------------------
  |  |   27|   148M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (273:5): [True: 148M, False: 0]
  ------------------
  274|   148M|    uint32_t ret = peekBitsNoFill(nbits);
  275|   148M|    skipBitsNoFill(nbits);
  276|   148M|    return ret;
  277|   148M|  }
_ZN8rawspeed11BitStreamerINS_14BitStreamerMSBENS_39BitStreamerForwardSequentialReplenisherIS1_EEE14peekBitsNoFillEi:
  253|   223M|  uint32_t RAWSPEED_READONLY peekBitsNoFill(int nbits) {
  254|   223M|    establishClassInvariants();
  255|   223M|    invariant(nbits >= 0);
  ------------------
  |  |   27|   223M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (255:5): [True: 223M, False: 0]
  ------------------
  256|   223M|    invariant(nbits != 0);
  ------------------
  |  |   27|   223M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (256:5): [True: 223M, False: 0]
  ------------------
  257|   223M|    invariant(nbits <= Cache::MaxGetBits);
  ------------------
  |  |   27|   223M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (257:5): [True: 223M, False: 0]
  ------------------
  258|   223M|    return cache.peek(nbits);
  259|   223M|  }
_ZN8rawspeed11BitStreamerINS_14BitStreamerMSBENS_39BitStreamerForwardSequentialReplenisherIS1_EEE14skipBitsNoFillEi:
  261|   229M|  void skipBitsNoFill(int nbits) {
  262|   229M|    establishClassInvariants();
  263|   229M|    invariant(nbits >= 0);
  ------------------
  |  |   27|   229M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (263:5): [True: 229M, False: 0]
  ------------------
  264|       |    // `nbits` could be zero.
  265|   229M|    invariant(nbits <= Cache::MaxGetBits);
  ------------------
  |  |   27|   229M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (265:5): [True: 229M, False: 0]
  ------------------
  266|   229M|    cache.skip(nbits);
  267|   229M|  }
_ZN8rawspeed11BitStreamerINS_16BitStreamerMSB32ENS_39BitStreamerForwardSequentialReplenisherIS1_EEEC2ENS_10Array1DRefIKSt4byteEE:
  192|  1.42k|  explicit BitStreamer(Array1DRef<const std::byte> input) : replenisher(input) {
  193|  1.42k|    establishClassInvariants();
  194|  1.42k|  }
_ZN8rawspeed26BitStreamerReplenisherBaseINS_16BitStreamerMSB32EEC2ENS_10Array1DRefIKSt4byteEE:
   57|  1.42k|      : input(input_) {
   58|  1.42k|    if (input.size() < BitStreamerTraits<Tag>::MaxProcessBytes)
  ------------------
  |  Branch (58:9): [True: 11, False: 1.41k]
  ------------------
   59|  1.42k|      ThrowIOE("Bit stream size is smaller than MaxProcessBytes");
  ------------------
  |  |   37|     11|#define ThrowIOE(...) ThrowExceptionHelper(rawspeed::IOException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     11|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     11|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     11|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   60|  1.42k|  }
_ZNK8rawspeed11BitStreamerINS_16BitStreamerMSB32ENS_39BitStreamerForwardSequentialReplenisherIS1_EEE24establishClassInvariantsEv:
  185|   631M|  void establishClassInvariants() const noexcept {
  186|   631M|    cache.establishClassInvariants();
  187|   631M|    replenisher.establishClassInvariants();
  188|   631M|  }
_ZNK8rawspeed26BitStreamerReplenisherBaseINS_16BitStreamerMSB32EE24establishClassInvariantsEv:
   65|   670M|BitStreamerReplenisherBase<Tag>::establishClassInvariants() const noexcept {
   66|   670M|  input.establishClassInvariants();
   67|   670M|  invariant(input.size() >= BitStreamerTraits<Tag>::MaxProcessBytes);
  ------------------
  |  |   27|   670M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (67:3): [True: 670M, False: 0]
  ------------------
   68|   670M|  invariant(pos >= 0);
  ------------------
  |  |   27|   670M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (68:3): [True: 670M, False: 0]
  ------------------
   69|   670M|  invariant(pos % StreamTraits::MinLoadStepByteMultiple == 0);
  ------------------
  |  |   27|   670M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (69:3): [True: 670M, False: 0]
  ------------------
   70|       |  // `pos` *could* be out-of-bounds of `input`.
   71|   670M|}
_ZN8rawspeed11BitStreamerINS_16BitStreamerMSB32ENS_39BitStreamerForwardSequentialReplenisherIS1_EEE4fillEi:
  216|   156M|  void fill(int nbits = Cache::MaxGetBits) {
  217|   156M|    establishClassInvariants();
  218|   156M|    invariant(nbits >= 0);
  ------------------
  |  |   27|   156M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (218:5): [True: 156M, False: 0]
  ------------------
  219|   156M|    invariant(nbits != 0);
  ------------------
  |  |   27|   156M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (219:5): [True: 156M, False: 0]
  ------------------
  220|   156M|    invariant(nbits <= Cache::MaxGetBits);
  ------------------
  |  |   27|   156M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (220:5): [True: 156M, False: 0]
  ------------------
  221|       |
  222|   156M|    if (cache.fillLevel >= nbits)
  ------------------
  |  Branch (222:9): [True: 147M, False: 9.59M]
  ------------------
  223|   147M|      return;
  224|       |
  225|  9.59M|    const auto input = replenisher.getInput();
  226|  9.59M|    const auto numBytes = static_cast<Derived*>(this)->fillCache(input);
  227|  9.59M|    replenisher.markNumBytesAsConsumed(numBytes);
  228|       |    invariant(cache.fillLevel >= nbits);
  ------------------
  |  |   27|  9.59M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (228:5): [True: 9.59M, False: 354]
  ------------------
  229|  9.59M|  }
_ZN8rawspeed39BitStreamerForwardSequentialReplenisherINS_16BitStreamerMSB32EE8getInputEv:
  100|  9.59M|  std::array<std::byte, BitStreamerTraits<Tag>::MaxProcessBytes> getInput() {
  101|  9.59M|    Base::establishClassInvariants();
  102|       |
  103|  9.59M|    std::array<std::byte, BitStreamerTraits<Tag>::MaxProcessBytes> tmpStorage;
  104|  9.59M|    auto tmp = Array1DRef<std::byte>(tmpStorage.data(),
  105|  9.59M|                                     implicit_cast<int>(tmpStorage.size()));
  106|       |
  107|       |    // Do we have BitStreamerTraits<Tag>::MaxProcessBytes or more bytes left in
  108|       |    // the input buffer? If so, then we can just read from said buffer.
  109|  9.59M|    if (getPos() + BitStreamerTraits<Tag>::MaxProcessBytes <=
  ------------------
  |  Branch (109:9): [True: 9.58M, False: 2.76k]
  ------------------
  110|  9.59M|        Base::input.size()) [[likely]] {
  111|  9.58M|      auto currInput =
  112|  9.58M|          Base::input.getCrop(getPos(), BitStreamerTraits<Tag>::MaxProcessBytes)
  113|  9.58M|              .getAsArray1DRef();
  114|  9.58M|      invariant(currInput.size() == tmp.size());
  ------------------
  |  |   27|  9.58M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (114:7): [True: 9.58M, False: 0]
  ------------------
  115|  9.58M|      memcpy(tmp.begin(), currInput.begin(),
  116|  9.58M|             BitStreamerTraits<Tag>::MaxProcessBytes);
  117|  9.58M|      return tmpStorage;
  118|  9.58M|    }
  119|       |
  120|       |    // We have to use intermediate buffer, either because the input is running
  121|       |    // out of bytes, or because we want to enforce bounds checking.
  122|       |
  123|       |    // Note that in order to keep all fill-level invariants we must allow to
  124|       |    // over-read past-the-end a bit.
  125|  2.76k|    if (getPos() > Base::input.size() +
  ------------------
  |  Branch (125:9): [True: 354, False: 2.41k]
  ------------------
  126|  2.76k|                       2 * BitStreamerTraits<Tag>::MaxProcessBytes) [[unlikely]]
  127|    354|      ThrowIOE("Buffer overflow read in BitStreamer");
  ------------------
  |  |   37|    354|#define ThrowIOE(...) ThrowExceptionHelper(rawspeed::IOException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|    354|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|    354|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|    354|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  128|       |
  129|  2.41k|    variableLengthLoadNaiveViaMemcpy(tmp, Base::input, getPos());
  130|       |
  131|  2.41k|    return tmpStorage;
  132|  2.76k|  }
_ZNK8rawspeed39BitStreamerForwardSequentialReplenisherINS_16BitStreamerMSB32EE6getPosEv:
   84|  19.1M|  [[nodiscard]] typename Base::size_type getPos() const {
   85|  19.1M|    Base::establishClassInvariants();
   86|  19.1M|    return Base::pos;
   87|  19.1M|  }
_ZN8rawspeed11BitStreamerINS_16BitStreamerMSB32ENS_39BitStreamerForwardSequentialReplenisherIS1_EEE9fillCacheENSt3__15arrayISt4byteLm4EEE:
  157|  9.59M|                inputStorage) {
  158|  9.59M|    static_assert(BitStreamCacheBase::MaxGetBits >= 32, "check implementation");
  159|  9.59M|    establishClassInvariants();
  160|  9.59M|    auto input = Array1DRef<std::byte>(inputStorage.data(),
  161|  9.59M|                                       implicit_cast<int>(inputStorage.size()));
  162|  9.59M|    invariant(input.size() == Traits::MaxProcessBytes);
  ------------------
  |  |   27|  9.59M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (162:5): [True: 9.59M, False: 0]
  ------------------
  163|       |
  164|  9.59M|    constexpr int StreamChunkBitwidth =
  165|  9.59M|        bitwidth<typename StreamTraits::ChunkType>();
  166|  9.59M|    static_assert(CHAR_BIT * Traits::MaxProcessBytes >= StreamChunkBitwidth);
  167|  9.59M|    static_assert(CHAR_BIT * Traits::MaxProcessBytes % StreamChunkBitwidth ==
  168|  9.59M|                  0);
  169|  9.59M|    constexpr int NumChunksNeeded =
  170|  9.59M|        (CHAR_BIT * Traits::MaxProcessBytes) / StreamChunkBitwidth;
  171|  9.59M|    static_assert(NumChunksNeeded >= 1);
  172|       |
  173|  19.1M|    for (int i = 0; i != NumChunksNeeded; ++i) {
  ------------------
  |  Branch (173:21): [True: 9.59M, False: 9.59M]
  ------------------
  174|  9.59M|      auto chunkInput =
  175|  9.59M|          input.getBlock(sizeof(typename StreamTraits::ChunkType), i);
  176|  9.59M|      auto chunk = getByteSwapped<typename StreamTraits::ChunkType>(
  177|  9.59M|          chunkInput.begin(),
  178|  9.59M|          StreamTraits::ChunkEndianness != getHostEndianness());
  179|  9.59M|      cache.push(chunk, StreamChunkBitwidth);
  180|  9.59M|    }
  181|  9.59M|    return Traits::MaxProcessBytes;
  182|  9.59M|  }
_ZN8rawspeed39BitStreamerForwardSequentialReplenisherINS_16BitStreamerMSB32EE22markNumBytesAsConsumedEi:
   92|  9.59M|  void markNumBytesAsConsumed(typename Base::size_type numBytes) {
   93|  9.59M|    Base::establishClassInvariants();
   94|  9.59M|    invariant(numBytes >= 0);
  ------------------
  |  |   27|  9.59M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (94:5): [True: 9.59M, False: 0]
  ------------------
   95|  9.59M|    invariant(numBytes != 0);
  ------------------
  |  |   27|  9.59M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (95:5): [True: 9.59M, False: 0]
  ------------------
   96|  9.59M|    invariant(numBytes % StreamTraits::MinLoadStepByteMultiple == 0);
  ------------------
  |  |   27|  9.59M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (96:5): [True: 9.59M, False: 0]
  ------------------
   97|  9.59M|    Base::pos += numBytes;
   98|  9.59M|  }
_ZN8rawspeed11BitStreamerINS_16BitStreamerMSB32ENS_39BitStreamerForwardSequentialReplenisherIS1_EEE13getBitsNoFillEi:
  269|   102M|  uint32_t getBitsNoFill(int nbits) {
  270|   102M|    establishClassInvariants();
  271|   102M|    invariant(nbits >= 0);
  ------------------
  |  |   27|   102M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (271:5): [True: 102M, False: 0]
  ------------------
  272|   102M|    invariant(nbits != 0);
  ------------------
  |  |   27|   102M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (272:5): [True: 102M, False: 0]
  ------------------
  273|   102M|    invariant(nbits <= Cache::MaxGetBits);
  ------------------
  |  |   27|   102M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (273:5): [True: 102M, False: 0]
  ------------------
  274|   102M|    uint32_t ret = peekBitsNoFill(nbits);
  275|   102M|    skipBitsNoFill(nbits);
  276|   102M|    return ret;
  277|   102M|  }
_ZN8rawspeed11BitStreamerINS_16BitStreamerMSB32ENS_39BitStreamerForwardSequentialReplenisherIS1_EEE14peekBitsNoFillEi:
  253|   180M|  uint32_t RAWSPEED_READONLY peekBitsNoFill(int nbits) {
  254|   180M|    establishClassInvariants();
  255|   180M|    invariant(nbits >= 0);
  ------------------
  |  |   27|   180M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (255:5): [True: 180M, False: 0]
  ------------------
  256|   180M|    invariant(nbits != 0);
  ------------------
  |  |   27|   180M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (256:5): [True: 180M, False: 0]
  ------------------
  257|   180M|    invariant(nbits <= Cache::MaxGetBits);
  ------------------
  |  |   27|   180M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (257:5): [True: 180M, False: 0]
  ------------------
  258|   180M|    return cache.peek(nbits);
  259|   180M|  }
_ZN8rawspeed11BitStreamerINS_16BitStreamerMSB32ENS_39BitStreamerForwardSequentialReplenisherIS1_EEE14skipBitsNoFillEi:
  261|   183M|  void skipBitsNoFill(int nbits) {
  262|   183M|    establishClassInvariants();
  263|   183M|    invariant(nbits >= 0);
  ------------------
  |  |   27|   183M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (263:5): [True: 183M, False: 0]
  ------------------
  264|       |    // `nbits` could be zero.
  265|   183M|    invariant(nbits <= Cache::MaxGetBits);
  ------------------
  |  |   27|   183M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (265:5): [True: 183M, False: 0]
  ------------------
  266|   183M|    cache.skip(nbits);
  267|   183M|  }
_ZN8rawspeed11BitStreamerINS_15BitStreamerJPEGENS_39BitStreamerForwardSequentialReplenisherIS1_EEEC2ENS_10Array1DRefIKSt4byteEE:
  192|  1.82k|  explicit BitStreamer(Array1DRef<const std::byte> input) : replenisher(input) {
  193|  1.82k|    establishClassInvariants();
  194|  1.82k|  }
_ZN8rawspeed26BitStreamerReplenisherBaseINS_15BitStreamerJPEGEEC2ENS_10Array1DRefIKSt4byteEE:
   57|  1.82k|      : input(input_) {
   58|  1.82k|    if (input.size() < BitStreamerTraits<Tag>::MaxProcessBytes)
  ------------------
  |  Branch (58:9): [True: 10, False: 1.81k]
  ------------------
   59|  1.82k|      ThrowIOE("Bit stream size is smaller than MaxProcessBytes");
  ------------------
  |  |   37|     10|#define ThrowIOE(...) ThrowExceptionHelper(rawspeed::IOException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     10|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     10|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     10|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   60|  1.82k|  }
_ZNK8rawspeed11BitStreamerINS_15BitStreamerJPEGENS_39BitStreamerForwardSequentialReplenisherIS1_EEE24establishClassInvariantsEv:
  185|   124M|  void establishClassInvariants() const noexcept {
  186|   124M|    cache.establishClassInvariants();
  187|   124M|    replenisher.establishClassInvariants();
  188|   124M|  }
_ZNK8rawspeed26BitStreamerReplenisherBaseINS_15BitStreamerJPEGEE24establishClassInvariantsEv:
   65|   130M|BitStreamerReplenisherBase<Tag>::establishClassInvariants() const noexcept {
   66|   130M|  input.establishClassInvariants();
   67|   130M|  invariant(input.size() >= BitStreamerTraits<Tag>::MaxProcessBytes);
  ------------------
  |  |   27|   130M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (67:3): [True: 130M, False: 0]
  ------------------
   68|   130M|  invariant(pos >= 0);
  ------------------
  |  |   27|   130M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (68:3): [True: 130M, False: 0]
  ------------------
   69|   130M|  invariant(pos % StreamTraits::MinLoadStepByteMultiple == 0);
  ------------------
  |  |   27|   130M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (69:3): [True: 130M, False: 0]
  ------------------
   70|       |  // `pos` *could* be out-of-bounds of `input`.
   71|   130M|}
_ZN8rawspeed11BitStreamerINS_15BitStreamerJPEGENS_39BitStreamerForwardSequentialReplenisherIS1_EEE4fillEi:
  216|  34.2M|  void fill(int nbits = Cache::MaxGetBits) {
  217|  34.2M|    establishClassInvariants();
  218|  34.2M|    invariant(nbits >= 0);
  ------------------
  |  |   27|  34.2M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (218:5): [True: 34.2M, False: 0]
  ------------------
  219|  34.2M|    invariant(nbits != 0);
  ------------------
  |  |   27|  34.2M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (219:5): [True: 34.2M, False: 0]
  ------------------
  220|  34.2M|    invariant(nbits <= Cache::MaxGetBits);
  ------------------
  |  |   27|  34.2M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (220:5): [True: 34.2M, False: 0]
  ------------------
  221|       |
  222|  34.2M|    if (cache.fillLevel >= nbits)
  ------------------
  |  Branch (222:9): [True: 32.8M, False: 1.39M]
  ------------------
  223|  32.8M|      return;
  224|       |
  225|  1.39M|    const auto input = replenisher.getInput();
  226|  1.39M|    const auto numBytes = static_cast<Derived*>(this)->fillCache(input);
  227|  1.39M|    replenisher.markNumBytesAsConsumed(numBytes);
  228|       |    invariant(cache.fillLevel >= nbits);
  ------------------
  |  |   27|  1.39M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (228:5): [True: 1.39M, False: 543]
  ------------------
  229|  1.39M|  }
_ZN8rawspeed39BitStreamerForwardSequentialReplenisherINS_15BitStreamerJPEGEE8getInputEv:
  100|  1.39M|  std::array<std::byte, BitStreamerTraits<Tag>::MaxProcessBytes> getInput() {
  101|  1.39M|    Base::establishClassInvariants();
  102|       |
  103|  1.39M|    std::array<std::byte, BitStreamerTraits<Tag>::MaxProcessBytes> tmpStorage;
  104|  1.39M|    auto tmp = Array1DRef<std::byte>(tmpStorage.data(),
  105|  1.39M|                                     implicit_cast<int>(tmpStorage.size()));
  106|       |
  107|       |    // Do we have BitStreamerTraits<Tag>::MaxProcessBytes or more bytes left in
  108|       |    // the input buffer? If so, then we can just read from said buffer.
  109|  1.39M|    if (getPos() + BitStreamerTraits<Tag>::MaxProcessBytes <=
  ------------------
  |  Branch (109:9): [True: 1.38M, False: 6.30k]
  ------------------
  110|  1.39M|        Base::input.size()) [[likely]] {
  111|  1.38M|      auto currInput =
  112|  1.38M|          Base::input.getCrop(getPos(), BitStreamerTraits<Tag>::MaxProcessBytes)
  113|  1.38M|              .getAsArray1DRef();
  114|  1.38M|      invariant(currInput.size() == tmp.size());
  ------------------
  |  |   27|  1.38M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (114:7): [True: 1.38M, False: 0]
  ------------------
  115|  1.38M|      memcpy(tmp.begin(), currInput.begin(),
  116|  1.38M|             BitStreamerTraits<Tag>::MaxProcessBytes);
  117|  1.38M|      return tmpStorage;
  118|  1.38M|    }
  119|       |
  120|       |    // We have to use intermediate buffer, either because the input is running
  121|       |    // out of bytes, or because we want to enforce bounds checking.
  122|       |
  123|       |    // Note that in order to keep all fill-level invariants we must allow to
  124|       |    // over-read past-the-end a bit.
  125|  6.30k|    if (getPos() > Base::input.size() +
  ------------------
  |  Branch (125:9): [True: 543, False: 5.76k]
  ------------------
  126|  6.30k|                       2 * BitStreamerTraits<Tag>::MaxProcessBytes) [[unlikely]]
  127|    543|      ThrowIOE("Buffer overflow read in BitStreamer");
  ------------------
  |  |   37|    543|#define ThrowIOE(...) ThrowExceptionHelper(rawspeed::IOException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|    543|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|    543|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|    543|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  128|       |
  129|  5.76k|    variableLengthLoadNaiveViaMemcpy(tmp, Base::input, getPos());
  130|       |
  131|  5.76k|    return tmpStorage;
  132|  6.30k|  }
_ZNK8rawspeed39BitStreamerForwardSequentialReplenisherINS_15BitStreamerJPEGEE6getPosEv:
   84|  2.79M|  [[nodiscard]] typename Base::size_type getPos() const {
   85|  2.79M|    Base::establishClassInvariants();
   86|  2.79M|    return Base::pos;
   87|  2.79M|  }
_ZNK8rawspeed11BitStreamerINS_15BitStreamerJPEGENS_39BitStreamerForwardSequentialReplenisherIS1_EEE16getInputPositionEv:
  232|    814|  [[nodiscard]] size_type RAWSPEED_READONLY getInputPosition() const {
  233|    814|    establishClassInvariants();
  234|    814|    return replenisher.getPos();
  235|    814|  }
_ZNK8rawspeed11BitStreamerINS_15BitStreamerJPEGENS_39BitStreamerForwardSequentialReplenisherIS1_EEE16getRemainingSizeEv:
  243|    814|  [[nodiscard]] size_type getRemainingSize() const {
  244|    814|    establishClassInvariants();
  245|    814|    return replenisher.getRemainingSize();
  246|    814|  }
_ZNK8rawspeed39BitStreamerForwardSequentialReplenisherINS_15BitStreamerJPEGEE16getRemainingSizeEv:
   88|    814|  [[nodiscard]] typename Base::size_type getRemainingSize() const {
   89|    814|    Base::establishClassInvariants();
   90|    814|    return Base::input.size() - getPos();
   91|    814|  }
_ZN8rawspeed39BitStreamerForwardSequentialReplenisherINS_15BitStreamerJPEGEE22markNumBytesAsConsumedEi:
   92|  1.39M|  void markNumBytesAsConsumed(typename Base::size_type numBytes) {
   93|  1.39M|    Base::establishClassInvariants();
   94|  1.39M|    invariant(numBytes >= 0);
  ------------------
  |  |   27|  1.39M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (94:5): [True: 1.39M, False: 0]
  ------------------
   95|  1.39M|    invariant(numBytes != 0);
  ------------------
  |  |   27|  1.39M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (95:5): [True: 1.39M, False: 0]
  ------------------
   96|  1.39M|    invariant(numBytes % StreamTraits::MinLoadStepByteMultiple == 0);
  ------------------
  |  |   27|  1.39M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (96:5): [True: 1.39M, False: 0]
  ------------------
   97|  1.39M|    Base::pos += numBytes;
   98|  1.39M|  }
_ZN8rawspeed11BitStreamerINS_15BitStreamerJPEGENS_39BitStreamerForwardSequentialReplenisherIS1_EEE13getBitsNoFillEi:
  269|  18.2M|  uint32_t getBitsNoFill(int nbits) {
  270|  18.2M|    establishClassInvariants();
  271|  18.2M|    invariant(nbits >= 0);
  ------------------
  |  |   27|  18.2M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (271:5): [True: 18.2M, False: 0]
  ------------------
  272|  18.2M|    invariant(nbits != 0);
  ------------------
  |  |   27|  18.2M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (272:5): [True: 18.2M, False: 0]
  ------------------
  273|  18.2M|    invariant(nbits <= Cache::MaxGetBits);
  ------------------
  |  |   27|  18.2M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (273:5): [True: 18.2M, False: 0]
  ------------------
  274|  18.2M|    uint32_t ret = peekBitsNoFill(nbits);
  275|  18.2M|    skipBitsNoFill(nbits);
  276|  18.2M|    return ret;
  277|  18.2M|  }
_ZN8rawspeed11BitStreamerINS_15BitStreamerJPEGENS_39BitStreamerForwardSequentialReplenisherIS1_EEE14peekBitsNoFillEi:
  253|  35.4M|  uint32_t RAWSPEED_READONLY peekBitsNoFill(int nbits) {
  254|  35.4M|    establishClassInvariants();
  255|  35.4M|    invariant(nbits >= 0);
  ------------------
  |  |   27|  35.4M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (255:5): [True: 35.4M, False: 0]
  ------------------
  256|  35.4M|    invariant(nbits != 0);
  ------------------
  |  |   27|  35.4M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (256:5): [True: 35.4M, False: 0]
  ------------------
  257|  35.4M|    invariant(nbits <= Cache::MaxGetBits);
  ------------------
  |  |   27|  35.4M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (257:5): [True: 35.4M, False: 0]
  ------------------
  258|  35.4M|    return cache.peek(nbits);
  259|  35.4M|  }
_ZN8rawspeed11BitStreamerINS_15BitStreamerJPEGENS_39BitStreamerForwardSequentialReplenisherIS1_EEE14skipBitsNoFillEi:
  261|  35.4M|  void skipBitsNoFill(int nbits) {
  262|  35.4M|    establishClassInvariants();
  263|  35.4M|    invariant(nbits >= 0);
  ------------------
  |  |   27|  35.4M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (263:5): [True: 35.4M, False: 0]
  ------------------
  264|       |    // `nbits` could be zero.
  265|  35.4M|    invariant(nbits <= Cache::MaxGetBits);
  ------------------
  |  |   27|  35.4M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (265:5): [True: 35.4M, False: 0]
  ------------------
  266|  35.4M|    cache.skip(nbits);
  267|  35.4M|  }

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

_ZN8rawspeed18AbstractPrefixCodeINS_15BaselineCodeTagEEC2Ev:
  178|  3.88k|  AbstractPrefixCode() = default;
_ZN8rawspeed18AbstractPrefixCodeINS_15BaselineCodeTagEE10CodeSymbolC2Eth:
  151|  18.6k|        : code(code_), code_len(code_len_) {
  152|  18.6k|      assert(code_len > 0);
  ------------------
  |  Branch (152:7): [True: 18.6k, False: 0]
  ------------------
  153|  18.6k|      assert(code_len <= Traits::MaxCodeLenghtBits);
  ------------------
  |  Branch (153:7): [True: 18.6k, False: 0]
  ------------------
  154|  18.6k|      assert(code <= ((1U << code_len) - 1U));
  ------------------
  |  Branch (154:7): [True: 18.6k, False: 0]
  ------------------
  155|  18.6k|    }
_ZN8rawspeed18AbstractPrefixCodeINS_15BaselineCodeTagEEC2ENSt3__16vectorIhNS3_9allocatorIhEEEE:
  181|  3.83k|      : codeValues(std::move(codeValues_)) {
  182|  3.83k|    if (codeValues.empty())
  ------------------
  |  Branch (182:9): [True: 0, False: 3.83k]
  ------------------
  183|  3.83k|      ThrowRDE("Empty code alphabet?");
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  184|  3.83k|    assert(
  ------------------
  |  Branch (184:5): [True: 3.83k, False: 0]
  ------------------
  185|  3.83k|        all_of(codeValues.begin(), codeValues.end(),
  186|  3.83k|               [](const CodeValueTy& v) { return v <= Traits::MaxCodeValue; }));
  187|  3.83k|  }
_ZN8rawspeed18AbstractPrefixCodeINS_15BaselineCodeTagEE10CodeSymbol16HaveCommonPrefixERKS3_S5_:
  163|   618k|                                 const CodeSymbol& partial) {
  164|   618k|      assert(partial.code_len <= symbol.code_len);
  ------------------
  |  Branch (164:7): [True: 618k, False: 0]
  ------------------
  165|       |
  166|   618k|      const auto s0 = extractHighBits(symbol.code, partial.code_len,
  167|   618k|                                      /*effectiveBitwidth=*/symbol.code_len);
  168|   618k|      const auto s1 = partial.code;
  169|       |
  170|   618k|      return s0 == s1;
  171|   618k|    }
_ZNK8rawspeed18AbstractPrefixCodeINS_15BaselineCodeTagEE10CodeSymbol10getBitsMSBEv:
  158|   104M|    getBitsMSB() const {
  159|   104M|      return {{code, code_len - 1}, {code, -1}};
  160|   104M|    }
_ZNK8rawspeed18AbstractPrefixCodeINS_15BaselineCodeTagEE10CodeSymboleqERKS3_:
  173|  8.35k|    bool RAWSPEED_READONLY operator==(const CodeSymbol& other) const {
  174|  8.35k|      return code == other.code && code_len == other.code_len;
  ------------------
  |  Branch (174:14): [True: 8.35k, False: 0]
  |  Branch (174:36): [True: 8.35k, False: 0]
  ------------------
  175|  8.35k|    }
_ZN8rawspeed18AbstractPrefixCodeINS_10VC5CodeTagEEC2Ev:
  178|  1.89k|  AbstractPrefixCode() = default;
_ZN8rawspeed18AbstractPrefixCodeINS_10VC5CodeTagEE10CodeSymbolC2Ejh:
  151|  23.4k|        : code(code_), code_len(code_len_) {
  152|  23.4k|      assert(code_len > 0);
  ------------------
  |  Branch (152:7): [True: 23.4k, False: 0]
  ------------------
  153|  23.4k|      assert(code_len <= Traits::MaxCodeLenghtBits);
  ------------------
  |  Branch (153:7): [True: 23.4k, False: 0]
  ------------------
  154|  23.4k|      assert(code <= ((1U << code_len) - 1U));
  ------------------
  |  Branch (154:7): [True: 23.4k, False: 0]
  ------------------
  155|  23.4k|    }
_ZN8rawspeed18AbstractPrefixCodeINS_10VC5CodeTagEEC2ENSt3__16vectorIjNS3_9allocatorIjEEEE:
  181|  1.82k|      : codeValues(std::move(codeValues_)) {
  182|  1.82k|    if (codeValues.empty())
  ------------------
  |  Branch (182:9): [True: 0, False: 1.82k]
  ------------------
  183|  1.82k|      ThrowRDE("Empty code alphabet?");
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  184|  1.82k|    assert(
  ------------------
  |  Branch (184:5): [True: 1.82k, False: 0]
  ------------------
  185|  1.82k|        all_of(codeValues.begin(), codeValues.end(),
  186|  1.82k|               [](const CodeValueTy& v) { return v <= Traits::MaxCodeValue; }));
  187|  1.82k|  }
_ZN8rawspeed18AbstractPrefixCodeINS_10VC5CodeTagEE10CodeSymbol16HaveCommonPrefixERKS3_S5_:
  163|  1.78M|                                 const CodeSymbol& partial) {
  164|  1.78M|      assert(partial.code_len <= symbol.code_len);
  ------------------
  |  Branch (164:7): [True: 1.78M, False: 0]
  ------------------
  165|       |
  166|  1.78M|      const auto s0 = extractHighBits(symbol.code, partial.code_len,
  167|  1.78M|                                      /*effectiveBitwidth=*/symbol.code_len);
  168|  1.78M|      const auto s1 = partial.code;
  169|       |
  170|  1.78M|      return s0 == s1;
  171|  1.78M|    }
_ZNK8rawspeed18AbstractPrefixCodeINS_10VC5CodeTagEE10CodeSymbol10getBitsMSBEv:
  158|  66.3M|    getBitsMSB() const {
  159|  66.3M|      return {{code, code_len - 1}, {code, -1}};
  160|  66.3M|    }
_ZNK8rawspeed18AbstractPrefixCodeINS_10VC5CodeTagEE10CodeSymboleqERKS3_:
  173|  10.4k|    bool RAWSPEED_READONLY operator==(const CodeSymbol& other) const {
  174|  10.4k|      return code == other.code && code_len == other.code_len;
  ------------------
  |  Branch (174:14): [True: 10.4k, False: 0]
  |  Branch (174:36): [True: 10.4k, False: 0]
  ------------------
  175|  10.4k|    }

_ZN8rawspeed25AbstractPrefixCodeDecoderINS_15BaselineCodeTagEE6extendEjj:
   70|  20.3M|  static int RAWSPEED_READNONE extend(uint32_t diff, uint32_t len) {
   71|  20.3M|    invariant(len > 0);
  ------------------
  |  |   27|  20.3M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (71:5): [True: 20.3M, False: 0]
  ------------------
   72|  20.3M|    auto ret = static_cast<int32_t>(diff);
   73|  20.3M|    if ((diff & (1 << (len - 1))) == 0)
  ------------------
  |  Branch (73:9): [True: 19.3M, False: 1.00M]
  ------------------
   74|  19.3M|      ret -= (1 << len) - 1;
   75|  20.3M|    return ret;
   76|  20.3M|  }
_ZNK8rawspeed25AbstractPrefixCodeDecoderINS_15BaselineCodeTagEE13processSymbolINS_14BitStreamerMSBELb1EEEiRT_NS_18AbstractPrefixCodeIS1_E10CodeSymbolEh:
   45|  16.3M|                    typename Traits::CodeValueTy codeValue) const {
   46|  16.3M|    invariant(symbol.code_len >= 0 &&
  ------------------
  |  |   27|  16.3M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (46:5): [True: 16.3M, False: 0]
  |  Branch (46:5): [True: 16.3M, False: 0]
  |  Branch (46:5): [True: 16.3M, False: 0]
  ------------------
   47|  16.3M|              symbol.code_len <= Traits::MaxCodeLenghtBits);
   48|       |
   49|       |    // If we were only looking for symbol's code value, then just return it.
   50|       |    if constexpr (!FULL_DECODE)
   51|       |      return codeValue;
   52|       |
   53|       |    // Else, treat it as the length of following difference
   54|       |    // that we need to read and extend.
   55|  16.3M|    int diff_l = codeValue;
   56|  16.3M|    invariant(diff_l >= 0 && diff_l <= 16);
  ------------------
  |  |   27|  16.3M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (56:5): [True: 16.3M, False: 0]
  |  Branch (56:5): [True: 16.3M, False: 0]
  |  Branch (56:5): [True: 16.3M, False: 0]
  ------------------
   57|       |
   58|  16.3M|    if (diff_l == 16) {
  ------------------
  |  Branch (58:9): [True: 4.04M, False: 12.3M]
  ------------------
   59|  4.04M|      if (Base::handleDNGBug16())
  ------------------
  |  Branch (59:11): [True: 4.04M, False: 877]
  ------------------
   60|  4.04M|        bs.skipBitsNoFill(16);
   61|  4.04M|      return -32768;
   62|  4.04M|    }
   63|       |
   64|  12.3M|    invariant(symbol.code_len + diff_l <= 32);
  ------------------
  |  |   27|  12.3M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (64:5): [True: 12.3M, False: 0]
  ------------------
   65|  12.3M|    return diff_l ? extend(bs.getBitsNoFill(diff_l), diff_l) : 0;
  ------------------
  |  Branch (65:12): [True: 12.3M, False: 6.62k]
  ------------------
   66|  12.3M|  }
_ZNK8rawspeed25AbstractPrefixCodeDecoderINS_15BaselineCodeTagEE13processSymbolINS_14BitStreamerMSBELb0EEEiRT_NS_18AbstractPrefixCodeIS1_E10CodeSymbolEh:
   45|  35.0M|                    typename Traits::CodeValueTy codeValue) const {
   46|  35.0M|    invariant(symbol.code_len >= 0 &&
  ------------------
  |  |   27|  35.0M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (46:5): [True: 35.0M, False: 0]
  |  Branch (46:5): [True: 35.0M, False: 0]
  |  Branch (46:5): [True: 35.0M, False: 0]
  ------------------
   47|  35.0M|              symbol.code_len <= Traits::MaxCodeLenghtBits);
   48|       |
   49|       |    // If we were only looking for symbol's code value, then just return it.
   50|       |    if constexpr (!FULL_DECODE)
   51|  35.0M|      return codeValue;
   52|       |
   53|       |    // Else, treat it as the length of following difference
   54|       |    // that we need to read and extend.
   55|      0|    int diff_l = codeValue;
   56|  35.0M|    invariant(diff_l >= 0 && diff_l <= 16);
  ------------------
  |  |   27|  35.0M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (56:5): [True: 0, False: 35.0M]
  |  Branch (56:5): [True: 0, False: 0]
  |  Branch (56:5): [True: 0, False: 35.0M]
  ------------------
   57|       |
   58|      0|    if (diff_l == 16) {
  ------------------
  |  Branch (58:9): [True: 0, False: 0]
  ------------------
   59|      0|      if (Base::handleDNGBug16())
  ------------------
  |  Branch (59:11): [True: 0, False: 0]
  ------------------
   60|      0|        bs.skipBitsNoFill(16);
   61|      0|      return -32768;
   62|      0|    }
   63|       |
   64|      0|    invariant(symbol.code_len + diff_l <= 32);
  ------------------
  |  |   27|      0|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (64:5): [True: 0, False: 0]
  ------------------
   65|      0|    return diff_l ? extend(bs.getBitsNoFill(diff_l), diff_l) : 0;
  ------------------
  |  Branch (65:12): [True: 0, False: 0]
  ------------------
   66|      0|  }
_ZNK8rawspeed25AbstractPrefixCodeDecoderINS_15BaselineCodeTagEE13processSymbolINS_16BitStreamerMSB32ELb1EEEiRT_NS_18AbstractPrefixCodeIS1_E10CodeSymbolEh:
   45|  9.07M|                    typename Traits::CodeValueTy codeValue) const {
   46|  9.07M|    invariant(symbol.code_len >= 0 &&
  ------------------
  |  |   27|  9.07M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (46:5): [True: 9.07M, False: 0]
  |  Branch (46:5): [True: 9.07M, False: 0]
  |  Branch (46:5): [True: 9.07M, False: 0]
  ------------------
   47|  9.07M|              symbol.code_len <= Traits::MaxCodeLenghtBits);
   48|       |
   49|       |    // If we were only looking for symbol's code value, then just return it.
   50|       |    if constexpr (!FULL_DECODE)
   51|       |      return codeValue;
   52|       |
   53|       |    // Else, treat it as the length of following difference
   54|       |    // that we need to read and extend.
   55|  9.07M|    int diff_l = codeValue;
   56|  9.07M|    invariant(diff_l >= 0 && diff_l <= 16);
  ------------------
  |  |   27|  9.07M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (56:5): [True: 9.07M, False: 0]
  |  Branch (56:5): [True: 9.07M, False: 0]
  |  Branch (56:5): [True: 9.07M, False: 0]
  ------------------
   57|       |
   58|  9.07M|    if (diff_l == 16) {
  ------------------
  |  Branch (58:9): [True: 2.15M, False: 6.92M]
  ------------------
   59|  2.15M|      if (Base::handleDNGBug16())
  ------------------
  |  Branch (59:11): [True: 2.02M, False: 130k]
  ------------------
   60|  2.02M|        bs.skipBitsNoFill(16);
   61|  2.15M|      return -32768;
   62|  2.15M|    }
   63|       |
   64|  6.92M|    invariant(symbol.code_len + diff_l <= 32);
  ------------------
  |  |   27|  6.92M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (64:5): [True: 6.92M, False: 0]
  ------------------
   65|  6.92M|    return diff_l ? extend(bs.getBitsNoFill(diff_l), diff_l) : 0;
  ------------------
  |  Branch (65:12): [True: 6.73M, False: 187k]
  ------------------
   66|  6.92M|  }
_ZNK8rawspeed25AbstractPrefixCodeDecoderINS_15BaselineCodeTagEE13processSymbolINS_16BitStreamerMSB32ELb0EEEiRT_NS_18AbstractPrefixCodeIS1_E10CodeSymbolEh:
   45|  36.9M|                    typename Traits::CodeValueTy codeValue) const {
   46|  36.9M|    invariant(symbol.code_len >= 0 &&
  ------------------
  |  |   27|  36.9M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (46:5): [True: 36.9M, False: 0]
  |  Branch (46:5): [True: 36.9M, False: 0]
  |  Branch (46:5): [True: 36.9M, False: 0]
  ------------------
   47|  36.9M|              symbol.code_len <= Traits::MaxCodeLenghtBits);
   48|       |
   49|       |    // If we were only looking for symbol's code value, then just return it.
   50|       |    if constexpr (!FULL_DECODE)
   51|  36.9M|      return codeValue;
   52|       |
   53|       |    // Else, treat it as the length of following difference
   54|       |    // that we need to read and extend.
   55|      0|    int diff_l = codeValue;
   56|  36.9M|    invariant(diff_l >= 0 && diff_l <= 16);
  ------------------
  |  |   27|  36.9M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (56:5): [True: 0, False: 36.9M]
  |  Branch (56:5): [True: 0, False: 0]
  |  Branch (56:5): [True: 0, False: 36.9M]
  ------------------
   57|       |
   58|      0|    if (diff_l == 16) {
  ------------------
  |  Branch (58:9): [True: 0, False: 0]
  ------------------
   59|      0|      if (Base::handleDNGBug16())
  ------------------
  |  Branch (59:11): [True: 0, False: 0]
  ------------------
   60|      0|        bs.skipBitsNoFill(16);
   61|      0|      return -32768;
   62|      0|    }
   63|       |
   64|      0|    invariant(symbol.code_len + diff_l <= 32);
  ------------------
  |  |   27|      0|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (64:5): [True: 0, False: 0]
  ------------------
   65|      0|    return diff_l ? extend(bs.getBitsNoFill(diff_l), diff_l) : 0;
  ------------------
  |  Branch (65:12): [True: 0, False: 0]
  ------------------
   66|      0|  }
_ZNK8rawspeed25AbstractPrefixCodeDecoderINS_15BaselineCodeTagEE13processSymbolINS_15BitStreamerJPEGELb1EEEiRT_NS_18AbstractPrefixCodeIS1_E10CodeSymbolEh:
   45|  4.94M|                    typename Traits::CodeValueTy codeValue) const {
   46|  4.94M|    invariant(symbol.code_len >= 0 &&
  ------------------
  |  |   27|  4.94M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (46:5): [True: 4.94M, False: 0]
  |  Branch (46:5): [True: 4.94M, False: 0]
  |  Branch (46:5): [True: 4.94M, False: 0]
  ------------------
   47|  4.94M|              symbol.code_len <= Traits::MaxCodeLenghtBits);
   48|       |
   49|       |    // If we were only looking for symbol's code value, then just return it.
   50|       |    if constexpr (!FULL_DECODE)
   51|       |      return codeValue;
   52|       |
   53|       |    // Else, treat it as the length of following difference
   54|       |    // that we need to read and extend.
   55|  4.94M|    int diff_l = codeValue;
   56|  4.94M|    invariant(diff_l >= 0 && diff_l <= 16);
  ------------------
  |  |   27|  4.94M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (56:5): [True: 4.94M, False: 0]
  |  Branch (56:5): [True: 4.94M, False: 0]
  |  Branch (56:5): [True: 4.94M, False: 0]
  ------------------
   57|       |
   58|  4.94M|    if (diff_l == 16) {
  ------------------
  |  Branch (58:9): [True: 5.12k, False: 4.94M]
  ------------------
   59|  5.12k|      if (Base::handleDNGBug16())
  ------------------
  |  Branch (59:11): [True: 4.17k, False: 949]
  ------------------
   60|  4.17k|        bs.skipBitsNoFill(16);
   61|  5.12k|      return -32768;
   62|  5.12k|    }
   63|       |
   64|  4.94M|    invariant(symbol.code_len + diff_l <= 32);
  ------------------
  |  |   27|  4.94M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (64:5): [True: 4.94M, False: 0]
  ------------------
   65|  4.94M|    return diff_l ? extend(bs.getBitsNoFill(diff_l), diff_l) : 0;
  ------------------
  |  Branch (65:12): [True: 982k, False: 3.95M]
  ------------------
   66|  4.94M|  }
_ZNK8rawspeed25AbstractPrefixCodeDecoderINS_15BaselineCodeTagEE13processSymbolINS_15BitStreamerJPEGELb0EEEiRT_NS_18AbstractPrefixCodeIS1_E10CodeSymbolEh:
   45|  12.4M|                    typename Traits::CodeValueTy codeValue) const {
   46|  12.4M|    invariant(symbol.code_len >= 0 &&
  ------------------
  |  |   27|  12.4M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (46:5): [True: 12.4M, False: 0]
  |  Branch (46:5): [True: 12.4M, False: 0]
  |  Branch (46:5): [True: 12.4M, False: 0]
  ------------------
   47|  12.4M|              symbol.code_len <= Traits::MaxCodeLenghtBits);
   48|       |
   49|       |    // If we were only looking for symbol's code value, then just return it.
   50|       |    if constexpr (!FULL_DECODE)
   51|  12.4M|      return codeValue;
   52|       |
   53|       |    // Else, treat it as the length of following difference
   54|       |    // that we need to read and extend.
   55|      0|    int diff_l = codeValue;
   56|  12.4M|    invariant(diff_l >= 0 && diff_l <= 16);
  ------------------
  |  |   27|  12.4M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (56:5): [True: 0, False: 12.4M]
  |  Branch (56:5): [True: 0, False: 0]
  |  Branch (56:5): [True: 0, False: 12.4M]
  ------------------
   57|       |
   58|      0|    if (diff_l == 16) {
  ------------------
  |  Branch (58:9): [True: 0, False: 0]
  ------------------
   59|      0|      if (Base::handleDNGBug16())
  ------------------
  |  Branch (59:11): [True: 0, False: 0]
  ------------------
   60|      0|        bs.skipBitsNoFill(16);
   61|      0|      return -32768;
   62|      0|    }
   63|       |
   64|      0|    invariant(symbol.code_len + diff_l <= 32);
  ------------------
  |  |   27|      0|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (64:5): [True: 0, False: 0]
  ------------------
   65|      0|    return diff_l ? extend(bs.getBitsNoFill(diff_l), diff_l) : 0;
  ------------------
  |  Branch (65:12): [True: 0, False: 0]
  ------------------
   66|      0|  }
_ZNK8rawspeed25AbstractPrefixCodeDecoderINS_10VC5CodeTagEE13processSymbolINS_14BitStreamerMSBELb0EEEiRT_NS_18AbstractPrefixCodeIS1_E10CodeSymbolEj:
   45|  29.7M|                    typename Traits::CodeValueTy codeValue) const {
   46|  29.7M|    invariant(symbol.code_len >= 0 &&
  ------------------
  |  |   27|  29.7M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (46:5): [True: 29.7M, False: 0]
  |  Branch (46:5): [True: 29.7M, False: 0]
  |  Branch (46:5): [True: 29.7M, False: 0]
  ------------------
   47|  29.7M|              symbol.code_len <= Traits::MaxCodeLenghtBits);
   48|       |
   49|       |    // If we were only looking for symbol's code value, then just return it.
   50|       |    if constexpr (!FULL_DECODE)
   51|  29.7M|      return codeValue;
   52|       |
   53|       |    // Else, treat it as the length of following difference
   54|       |    // that we need to read and extend.
   55|      0|    int diff_l = codeValue;
   56|  29.7M|    invariant(diff_l >= 0 && diff_l <= 16);
  ------------------
  |  |   27|  29.7M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (56:5): [True: 0, False: 29.7M]
  |  Branch (56:5): [True: 0, False: 0]
  |  Branch (56:5): [True: 0, False: 29.7M]
  ------------------
   57|       |
   58|      0|    if (diff_l == 16) {
  ------------------
  |  Branch (58:9): [True: 0, False: 0]
  ------------------
   59|      0|      if (Base::handleDNGBug16())
  ------------------
  |  Branch (59:11): [True: 0, False: 0]
  ------------------
   60|      0|        bs.skipBitsNoFill(16);
   61|      0|      return -32768;
   62|      0|    }
   63|       |
   64|      0|    invariant(symbol.code_len + diff_l <= 32);
  ------------------
  |  |   27|      0|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (64:5): [True: 0, False: 0]
  ------------------
   65|      0|    return diff_l ? extend(bs.getBitsNoFill(diff_l), diff_l) : 0;
  ------------------
  |  Branch (65:12): [True: 0, False: 0]
  ------------------
   66|      0|  }
_ZNK8rawspeed25AbstractPrefixCodeDecoderINS_10VC5CodeTagEE13processSymbolINS_16BitStreamerMSB32ELb0EEEiRT_NS_18AbstractPrefixCodeIS1_E10CodeSymbolEj:
   45|  36.5M|                    typename Traits::CodeValueTy codeValue) const {
   46|  36.5M|    invariant(symbol.code_len >= 0 &&
  ------------------
  |  |   27|  36.5M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (46:5): [True: 36.5M, False: 0]
  |  Branch (46:5): [True: 36.5M, False: 0]
  |  Branch (46:5): [True: 36.5M, False: 0]
  ------------------
   47|  36.5M|              symbol.code_len <= Traits::MaxCodeLenghtBits);
   48|       |
   49|       |    // If we were only looking for symbol's code value, then just return it.
   50|       |    if constexpr (!FULL_DECODE)
   51|  36.5M|      return codeValue;
   52|       |
   53|       |    // Else, treat it as the length of following difference
   54|       |    // that we need to read and extend.
   55|      0|    int diff_l = codeValue;
   56|  36.5M|    invariant(diff_l >= 0 && diff_l <= 16);
  ------------------
  |  |   27|  36.5M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (56:5): [True: 0, False: 36.5M]
  |  Branch (56:5): [True: 0, False: 0]
  |  Branch (56:5): [True: 0, False: 36.5M]
  ------------------
   57|       |
   58|      0|    if (diff_l == 16) {
  ------------------
  |  Branch (58:9): [True: 0, False: 0]
  ------------------
   59|      0|      if (Base::handleDNGBug16())
  ------------------
  |  Branch (59:11): [True: 0, False: 0]
  ------------------
   60|      0|        bs.skipBitsNoFill(16);
   61|      0|      return -32768;
   62|      0|    }
   63|       |
   64|      0|    invariant(symbol.code_len + diff_l <= 32);
  ------------------
  |  |   27|      0|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (64:5): [True: 0, False: 0]
  ------------------
   65|      0|    return diff_l ? extend(bs.getBitsNoFill(diff_l), diff_l) : 0;
  ------------------
  |  Branch (65:12): [True: 0, False: 0]
  ------------------
   66|      0|  }
_ZNK8rawspeed25AbstractPrefixCodeDecoderINS_10VC5CodeTagEE13processSymbolINS_15BitStreamerJPEGELb0EEEiRT_NS_18AbstractPrefixCodeIS1_E10CodeSymbolEj:
   45|  43.9k|                    typename Traits::CodeValueTy codeValue) const {
   46|  43.9k|    invariant(symbol.code_len >= 0 &&
  ------------------
  |  |   27|  43.9k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (46:5): [True: 43.9k, False: 0]
  |  Branch (46:5): [True: 43.9k, False: 0]
  |  Branch (46:5): [True: 43.9k, False: 0]
  ------------------
   47|  43.9k|              symbol.code_len <= Traits::MaxCodeLenghtBits);
   48|       |
   49|       |    // If we were only looking for symbol's code value, then just return it.
   50|       |    if constexpr (!FULL_DECODE)
   51|  43.9k|      return codeValue;
   52|       |
   53|       |    // Else, treat it as the length of following difference
   54|       |    // that we need to read and extend.
   55|      0|    int diff_l = codeValue;
   56|  43.9k|    invariant(diff_l >= 0 && diff_l <= 16);
  ------------------
  |  |   27|  43.9k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (56:5): [True: 0, False: 43.9k]
  |  Branch (56:5): [True: 0, False: 0]
  |  Branch (56:5): [True: 0, False: 43.9k]
  ------------------
   57|       |
   58|      0|    if (diff_l == 16) {
  ------------------
  |  Branch (58:9): [True: 0, False: 0]
  ------------------
   59|      0|      if (Base::handleDNGBug16())
  ------------------
  |  Branch (59:11): [True: 0, False: 0]
  ------------------
   60|      0|        bs.skipBitsNoFill(16);
   61|      0|      return -32768;
   62|      0|    }
   63|       |
   64|      0|    invariant(symbol.code_len + diff_l <= 32);
  ------------------
  |  |   27|      0|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (64:5): [True: 0, False: 0]
  ------------------
   65|      0|    return diff_l ? extend(bs.getBitsNoFill(diff_l), diff_l) : 0;
  ------------------
  |  Branch (65:12): [True: 0, False: 0]
  ------------------
   66|      0|  }

_ZN8rawspeed28AbstractPrefixCodeTranscoderINS_15BaselineCodeTagEEC2ENS_10PrefixCodeIS1_EE:
   48|  3.83k|      : code(std::move(code_)) {}
_ZN8rawspeed28AbstractPrefixCodeTranscoderINS_15BaselineCodeTagEE5setupEbb:
   71|  3.75k|  void setup(bool fullDecode_, bool fixDNGBug16_) {
   72|  3.75k|    invariant(!fullDecode_ || Traits::SupportsFullDecode);
  ------------------
  |  |   27|  3.75k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (72:5): [True: 1.20k, False: 2.54k]
  |  Branch (72:5): [True: 2.54k, Folded]
  |  Branch (72:5): [True: 3.75k, False: 0]
  ------------------
   73|       |
   74|  3.75k|    this->fullDecode = fullDecode_;
   75|  3.75k|    this->fixDNGBug16 = fixDNGBug16_;
   76|       |
   77|  3.75k|    if (fullDecode) {
  ------------------
  |  Branch (77:9): [True: 2.54k, False: 1.20k]
  ------------------
   78|       |      // If we are in a full-decoding mode, we will be interpreting code values
   79|       |      // as bit length of the following difference, which incurs hard limit
   80|       |      // of 16 (since we want to need to read at most 32 bits max for a symbol
   81|       |      // plus difference). Though we could enforce it per-code instead?
   82|  2.54k|      verifyCodeValuesAsDiffLengths();
   83|  2.54k|    }
   84|  3.75k|  }
_ZNK8rawspeed28AbstractPrefixCodeTranscoderINS_15BaselineCodeTagEE29verifyCodeValuesAsDiffLengthsEv:
   50|  2.54k|  void verifyCodeValuesAsDiffLengths() const {
   51|  7.60k|    for (const auto cValue : code.Base::codeValues) {
  ------------------
  |  Branch (51:28): [True: 7.60k, False: 2.54k]
  ------------------
   52|  7.60k|      if (cValue <= Traits::MaxDiffLength)
  ------------------
  |  Branch (52:11): [True: 7.59k, False: 5]
  ------------------
   53|  7.59k|        continue;
   54|  7.60k|      ThrowRDE("Corrupt Huffman code: difference length %u longer than %u",
  ------------------
  |  |   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__)
  |  |  ------------------
  ------------------
   55|  7.60k|               cValue, Traits::MaxDiffLength);
   56|  7.60k|    }
   57|  2.54k|    assert(maxCodePlusDiffLength() <= 32U);
  ------------------
  |  Branch (57:5): [True: 2.54k, False: 0]
  ------------------
   58|  2.54k|  }
_ZNK8rawspeed28AbstractPrefixCodeTranscoderINS_15BaselineCodeTagEE21maxCodePlusDiffLengthEv:
   66|  2.54k|  maxCodePlusDiffLength() const {
   67|  2.54k|    return maxCodeLength() + *(std::max_element(code.Base::codeValues.cbegin(),
   68|  2.54k|                                                code.Base::codeValues.cend()));
   69|  2.54k|  }
_ZNK8rawspeed28AbstractPrefixCodeTranscoderINS_15BaselineCodeTagEE13maxCodeLengthEv:
   61|  19.6M|  [[nodiscard]] size_t RAWSPEED_READONLY maxCodeLength() const {
   62|  19.6M|    return code.nCodesPerLength.size() - 1;
   63|  19.6M|  }
_ZNK8rawspeed28AbstractPrefixCodeTranscoderINS_15BaselineCodeTagEE12isFullDecodeEv:
   87|   211M|  [[nodiscard]] bool RAWSPEED_READONLY isFullDecode() const {
   88|   211M|    return fullDecode;
   89|   211M|  }
_ZNK8rawspeed28AbstractPrefixCodeTranscoderINS_15BaselineCodeTagEE14handleDNGBug16Ev:
   90|  6.26M|  [[nodiscard]] bool RAWSPEED_READONLY handleDNGBug16() const {
   91|  6.26M|    return fixDNGBug16;
   92|  6.26M|  }
_ZN8rawspeed28AbstractPrefixCodeTranscoderINS_10VC5CodeTagEEC2ENS_10PrefixCodeIS1_EE:
   48|  1.82k|      : code(std::move(code_)) {}
_ZN8rawspeed28AbstractPrefixCodeTranscoderINS_10VC5CodeTagEE5setupEbb:
   71|  1.74k|  void setup(bool fullDecode_, bool fixDNGBug16_) {
   72|  1.74k|    invariant(!fullDecode_ || Traits::SupportsFullDecode);
  ------------------
  |  |   27|  1.74k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (72:5): [True: 1.74k, False: 0]
  |  Branch (72:5): [Folded, False: 0]
  |  Branch (72:5): [True: 1.74k, False: 0]
  ------------------
   73|       |
   74|  1.74k|    this->fullDecode = fullDecode_;
   75|  1.74k|    this->fixDNGBug16 = fixDNGBug16_;
   76|       |
   77|  1.74k|    if (fullDecode) {
  ------------------
  |  Branch (77:9): [True: 0, False: 1.74k]
  ------------------
   78|       |      // If we are in a full-decoding mode, we will be interpreting code values
   79|       |      // as bit length of the following difference, which incurs hard limit
   80|       |      // of 16 (since we want to need to read at most 32 bits max for a symbol
   81|       |      // plus difference). Though we could enforce it per-code instead?
   82|      0|      verifyCodeValuesAsDiffLengths();
   83|      0|    }
   84|  1.74k|  }
_ZNK8rawspeed28AbstractPrefixCodeTranscoderINS_10VC5CodeTagEE13maxCodeLengthEv:
   61|   139k|  [[nodiscard]] size_t RAWSPEED_READONLY maxCodeLength() const {
   62|   139k|    return code.nCodesPerLength.size() - 1;
   63|   139k|  }
_ZNK8rawspeed28AbstractPrefixCodeTranscoderINS_10VC5CodeTagEE12isFullDecodeEv:
   87|   133M|  [[nodiscard]] bool RAWSPEED_READONLY isFullDecode() const {
   88|   133M|    return fullDecode;
   89|   133M|  }

_ZN8rawspeed16BinaryPrefixTreeINS_15BaselineCodeTagEE3addENS_18AbstractPrefixCodeIS1_E10CodeSymbolEt:
   88|  8.35k|void BinaryPrefixTree<CodeTag>::add(const CodeSymbol symbol, CodeTy value) {
   89|  8.35k|  invariant(symbol.code_len > 0);
  ------------------
  |  |   27|  8.35k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (89:3): [True: 8.35k, False: 0]
  ------------------
   90|  8.35k|  invariant(symbol.code_len <= Traits::MaxCodeLenghtBits);
  ------------------
  |  |   27|  8.35k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (90:3): [True: 8.35k, False: 0]
  ------------------
   91|       |
   92|  8.35k|  CodeSymbol partial;
   93|  8.35k|  partial.code = 0;
   94|  8.35k|  partial.code_len = 0;
   95|       |
   96|  8.35k|  std::reference_wrapper<std::unique_ptr<Node>> newBud = root;
   97|  81.3k|  for (unsigned bit : symbol.getBitsMSB()) {
  ------------------
  |  Branch (97:21): [True: 81.3k, False: 8.35k]
  ------------------
   98|  81.3k|    ++partial.code_len;
   99|  81.3k|    partial.code =
  100|  81.3k|        implicit_cast<typename Traits::CodeTy>((partial.code << 1) | bit);
  101|  81.3k|    std::unique_ptr<Node>& bud = newBud;
  102|  81.3k|    if (!bud)
  ------------------
  |  Branch (102:9): [True: 19.0k, False: 62.3k]
  ------------------
  103|  19.0k|      bud = std::make_unique<Branch>();
  104|       |    // NOTE: if this bud is already a Leaf, this is not a prefix code.
  105|  81.3k|    newBud = bud->getAsBranch().buds[bit];
  106|  81.3k|  }
  107|  8.35k|  invariant(partial == symbol && "Failed to interpret symbol as bit sequence.");
  ------------------
  |  |   27|  8.35k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (107:3): [True: 8.35k, False: 0]
  |  Branch (107:3): [True: 8.35k, Folded]
  |  Branch (107:3): [True: 8.35k, False: 0]
  ------------------
  108|       |
  109|  8.35k|  std::unique_ptr<Node>& bud = newBud;
  110|  8.35k|  assert(!bud && "This Node should be vacant!");
  ------------------
  |  Branch (110:3): [True: 8.35k, False: 0]
  |  Branch (110:3): [True: 8.35k, Folded]
  |  Branch (110:3): [True: 8.35k, False: 0]
  ------------------
  111|       |
  112|       |  // And add this node/leaf to tree in the given position
  113|  8.35k|  bud = std::make_unique<Leaf>(value);
  114|  8.35k|}
_ZN8rawspeed16BinaryPrefixTreeINS_15BaselineCodeTagEE4NodeD2Ev:
   59|  27.3k|    virtual ~Node() = default;
_ZNK8rawspeed16BinaryPrefixTreeINS_15BaselineCodeTagEE6BranchcvNS2_4Node4TypeEEv:
   63|   206M|    explicit operator typename Node::Type() const final {
   64|   206M|      return Node::Type::Branch;
   65|   206M|    }
_ZN8rawspeed16BinaryPrefixTreeINS_15BaselineCodeTagEE4Node11getAsBranchEv:
   49|   155M|    Branch& getAsBranch() {
   50|   155M|      assert(Node::Type::Branch == static_cast<Node::Type>(*this));
  ------------------
  |  Branch (50:7): [True: 155M, False: 0]
  ------------------
   51|   155M|      return static_cast<Branch&>(*this);
   52|   155M|    }
_ZN8rawspeed16BinaryPrefixTreeINS_15BaselineCodeTagEE4LeafC2Et:
   79|  8.35k|    explicit Leaf(CodeTy value_) : value(value_) {}
_ZNK8rawspeed16BinaryPrefixTreeINS_15BaselineCodeTagEE4LeafcvNS2_4Node4TypeEEv:
   71|   208M|    explicit operator typename Node::Type() const final {
   72|   208M|      return Node::Type::Leaf;
   73|   208M|    }
_ZN8rawspeed16BinaryPrefixTreeINS_15BaselineCodeTagEE4Node9getAsLeafEv:
   54|   104M|    Leaf& getAsLeaf() {
   55|   104M|      assert(Node::Type::Leaf == static_cast<Node::Type>(*this));
  ------------------
  |  Branch (55:7): [True: 104M, False: 0]
  ------------------
   56|   104M|      return static_cast<Leaf&>(*this);
   57|   104M|    }
_ZN8rawspeed16BinaryPrefixTreeINS_10VC5CodeTagEE3addENS_18AbstractPrefixCodeIS1_E10CodeSymbolEj:
   88|  10.4k|void BinaryPrefixTree<CodeTag>::add(const CodeSymbol symbol, CodeTy value) {
   89|  10.4k|  invariant(symbol.code_len > 0);
  ------------------
  |  |   27|  10.4k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (89:3): [True: 10.4k, False: 0]
  ------------------
   90|  10.4k|  invariant(symbol.code_len <= Traits::MaxCodeLenghtBits);
  ------------------
  |  |   27|  10.4k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (90:3): [True: 10.4k, False: 0]
  ------------------
   91|       |
   92|  10.4k|  CodeSymbol partial;
   93|  10.4k|  partial.code = 0;
   94|  10.4k|  partial.code_len = 0;
   95|       |
   96|  10.4k|  std::reference_wrapper<std::unique_ptr<Node>> newBud = root;
   97|   175k|  for (unsigned bit : symbol.getBitsMSB()) {
  ------------------
  |  Branch (97:21): [True: 175k, False: 10.4k]
  ------------------
   98|   175k|    ++partial.code_len;
   99|   175k|    partial.code =
  100|   175k|        implicit_cast<typename Traits::CodeTy>((partial.code << 1) | bit);
  101|   175k|    std::unique_ptr<Node>& bud = newBud;
  102|   175k|    if (!bud)
  ------------------
  |  Branch (102:9): [True: 21.7k, False: 154k]
  ------------------
  103|  21.7k|      bud = std::make_unique<Branch>();
  104|       |    // NOTE: if this bud is already a Leaf, this is not a prefix code.
  105|   175k|    newBud = bud->getAsBranch().buds[bit];
  106|   175k|  }
  107|  10.4k|  invariant(partial == symbol && "Failed to interpret symbol as bit sequence.");
  ------------------
  |  |   27|  10.4k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (107:3): [True: 10.4k, False: 0]
  |  Branch (107:3): [True: 10.4k, Folded]
  |  Branch (107:3): [True: 10.4k, False: 0]
  ------------------
  108|       |
  109|  10.4k|  std::unique_ptr<Node>& bud = newBud;
  110|  10.4k|  assert(!bud && "This Node should be vacant!");
  ------------------
  |  Branch (110:3): [True: 10.4k, False: 0]
  |  Branch (110:3): [True: 10.4k, Folded]
  |  Branch (110:3): [True: 10.4k, False: 0]
  ------------------
  111|       |
  112|       |  // And add this node/leaf to tree in the given position
  113|  10.4k|  bud = std::make_unique<Leaf>(value);
  114|  10.4k|}
_ZN8rawspeed16BinaryPrefixTreeINS_10VC5CodeTagEE4NodeD2Ev:
   59|  32.2k|    virtual ~Node() = default;
_ZNK8rawspeed16BinaryPrefixTreeINS_10VC5CodeTagEE6BranchcvNS2_4Node4TypeEEv:
   63|  94.0M|    explicit operator typename Node::Type() const final {
   64|  94.0M|      return Node::Type::Branch;
   65|  94.0M|    }
_ZN8rawspeed16BinaryPrefixTreeINS_10VC5CodeTagEE4Node11getAsBranchEv:
   49|  80.3M|    Branch& getAsBranch() {
   50|  80.3M|      assert(Node::Type::Branch == static_cast<Node::Type>(*this));
  ------------------
  |  Branch (50:7): [True: 80.3M, False: 0]
  ------------------
   51|  80.3M|      return static_cast<Branch&>(*this);
   52|  80.3M|    }
_ZN8rawspeed16BinaryPrefixTreeINS_10VC5CodeTagEE4LeafC2Ej:
   79|  10.4k|    explicit Leaf(CodeTy value_) : value(value_) {}
_ZNK8rawspeed16BinaryPrefixTreeINS_10VC5CodeTagEE4LeafcvNS2_4Node4TypeEEv:
   71|   132M|    explicit operator typename Node::Type() const final {
   72|   132M|      return Node::Type::Leaf;
   73|   132M|    }
_ZN8rawspeed16BinaryPrefixTreeINS_10VC5CodeTagEE4Node9getAsLeafEv:
   54|  66.3M|    Leaf& getAsLeaf() {
   55|  66.3M|      assert(Node::Type::Leaf == static_cast<Node::Type>(*this));
  ------------------
  |  Branch (55:7): [True: 66.3M, False: 0]
  ------------------
   56|  66.3M|      return static_cast<Leaf&>(*this);
   57|  66.3M|    }

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

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

_ZN8rawspeed20PrefixCodeLUTDecoderINS_15BaselineCodeTagENS_23PrefixCodeLookupDecoderIS1_EEE5setupEbb:
   95|  1.87k|  void setup(bool fullDecode_, bool fixDNGBug16_) {
   96|  1.87k|    Base::setup(fullDecode_, fixDNGBug16_);
   97|       |
   98|       |    // Generate lookup table for fast decoding lookup.
   99|       |    // See definition of decodeLookup above
  100|  1.87k|    decodeLookup.resize(1 << LookupDepth);
  101|  6.28k|    for (size_t i = 0; i < Base::code.symbols.size(); i++) {
  ------------------
  |  Branch (101:24): [True: 5.17k, False: 1.11k]
  ------------------
  102|  5.17k|      uint8_t code_l = Base::code.symbols[i].code_len;
  103|  5.17k|      if (code_l > static_cast<int>(LookupDepth))
  ------------------
  |  Branch (103:11): [True: 767, False: 4.40k]
  ------------------
  104|    767|        break;
  105|       |
  106|  4.40k|      auto ll = implicit_cast<uint16_t>(Base::code.symbols[i].code
  107|  4.40k|                                        << (LookupDepth - code_l));
  108|  4.40k|      auto ul =
  109|  4.40k|          implicit_cast<uint16_t>(ll | ((1 << (LookupDepth - code_l)) - 1));
  110|  4.40k|      static_assert(Traits::MaxCodeValueLenghtBits <=
  111|  4.40k|                    bitwidth<LUTEntryTy>() - PayloadShift);
  112|  4.40k|      LUTUnsignedEntryTy diff_l = Base::code.codeValues[i];
  113|  1.33M|      for (uint16_t c = ll; c <= ul; c++) {
  ------------------
  |  Branch (113:29): [True: 1.33M, False: 4.40k]
  ------------------
  114|  1.33M|        if (!(c < decodeLookup.size()))
  ------------------
  |  Branch (114:13): [True: 0, False: 1.33M]
  ------------------
  115|  1.33M|          ThrowRDE("Corrupt Huffman");
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  116|       |
  117|  1.33M|        if (!FlagMask || !Base::isFullDecode() || code_l > LookupDepth ||
  ------------------
  |  Branch (117:13): [Folded, False: 1.33M]
  |  Branch (117:26): [True: 401k, False: 928k]
  |  Branch (117:51): [True: 0, False: 928k]
  ------------------
  118|   928k|            (code_l + diff_l > LookupDepth && diff_l != 16)) {
  ------------------
  |  Branch (118:14): [True: 505k, False: 423k]
  |  Branch (118:47): [True: 433k, False: 72.4k]
  ------------------
  119|       |          // lookup bit depth is too small to fit both the encoded length
  120|       |          // and the final difference value.
  121|       |          // -> store only the length and do a normal sign extension later
  122|   835k|          invariant(!Base::isFullDecode() || diff_l > 0);
  ------------------
  |  |   27|   835k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (122:11): [True: 401k, False: 433k]
  |  Branch (122:11): [True: 433k, False: 0]
  |  Branch (122:11): [True: 835k, False: 0]
  ------------------
  123|   835k|          decodeLookup[c] = diff_l << PayloadShift | code_l;
  124|       |
  125|   835k|          if (!Base::isFullDecode())
  ------------------
  |  Branch (125:15): [True: 401k, False: 433k]
  ------------------
  126|   401k|            decodeLookup[c] |= FlagMask;
  127|   835k|        } else {
  128|       |          // Lookup bit depth is sufficient to encode the final value.
  129|   495k|          decodeLookup[c] = FlagMask | code_l;
  130|   495k|          if (diff_l != 16 || Base::handleDNGBug16())
  ------------------
  |  Branch (130:15): [True: 423k, False: 72.4k]
  |  Branch (130:31): [True: 58.6k, False: 13.8k]
  ------------------
  131|   481k|            decodeLookup[c] += diff_l;
  132|       |
  133|   495k|          if (diff_l) {
  ------------------
  |  Branch (133:15): [True: 269k, False: 226k]
  ------------------
  134|   269k|            LUTUnsignedEntryTy diff;
  135|   269k|            if (diff_l != 16) {
  ------------------
  |  Branch (135:17): [True: 197k, False: 72.4k]
  ------------------
  136|   197k|              diff = extractHighBits(c, code_l + diff_l,
  137|   197k|                                     /*effectiveBitwidth=*/LookupDepth);
  138|   197k|              diff &= ((1 << diff_l) - 1);
  139|   197k|            } else {
  140|  72.4k|              diff = LUTUnsignedEntryTy(-32768);
  141|  72.4k|            }
  142|   269k|            decodeLookup[c] |= static_cast<LUTEntryTy>(
  143|   269k|                static_cast<LUTUnsignedEntryTy>(Base::extend(diff, diff_l))
  144|   269k|                << PayloadShift);
  145|   269k|          }
  146|   495k|        }
  147|  1.33M|      }
  148|  4.40k|    }
  149|  1.87k|  }
_ZNK8rawspeed20PrefixCodeLUTDecoderINS_15BaselineCodeTagENS_23PrefixCodeLookupDecoderIS1_EEE6decodeINS_14BitStreamerMSBELb1EEEiRT_:
  174|  10.3M|  __attribute__((always_inline)) int decode(BIT_STREAM& bs) const {
  175|  10.3M|    static_assert(
  176|  10.3M|        BitStreamerTraits<BIT_STREAM>::canUseWithPrefixCodeDecoder,
  177|  10.3M|        "This BitStreamer specialization is not marked as usable here");
  178|  10.3M|    invariant(FULL_DECODE == Base::isFullDecode());
  ------------------
  |  |   27|  10.3M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (178:5): [True: 10.3M, False: 0]
  ------------------
  179|  10.3M|    bs.fill(32);
  180|       |
  181|  10.3M|    typename Base::CodeSymbol partial;
  182|  10.3M|    partial.code_len = LookupDepth;
  183|  10.3M|    partial.code = implicit_cast<typename Traits::CodeTy>(
  184|  10.3M|        bs.peekBitsNoFill(partial.code_len));
  185|       |
  186|  10.3M|    assert(partial.code < decodeLookup.size());
  ------------------
  |  Branch (186:5): [True: 10.3M, False: 0]
  ------------------
  187|  10.3M|    auto lutEntry = static_cast<unsigned>(decodeLookup[partial.code]);
  188|  10.3M|    int payload = static_cast<int>(lutEntry) >> PayloadShift;
  189|  10.3M|    int len = lutEntry & LenMask;
  190|       |
  191|       |    // How far did reading of those LookupDepth bits *actually* move us forward?
  192|  10.3M|    bs.skipBitsNoFill(len);
  193|       |
  194|       |    // If the flag bit is set, then we have already skipped all the len bits
  195|       |    // we needed to skip, and payload is the answer we were looking for.
  196|  10.3M|    if (lutEntry & FlagMask)
  ------------------
  |  Branch (196:9): [True: 4.21M, False: 6.08M]
  ------------------
  197|  4.21M|      return payload;
  198|       |
  199|  6.08M|    typename Traits::CodeValueTy codeValue;
  200|  6.08M|    if (lutEntry) {
  ------------------
  |  Branch (200:9): [True: 4.06M, False: 2.01M]
  ------------------
  201|       |      // If the flag is not set, but the entry is not empty,
  202|       |      // the payload is the code value for this symbol.
  203|  4.06M|      partial.code_len = implicit_cast<uint8_t>(len);
  204|  4.06M|      codeValue = implicit_cast<typename Traits::CodeValueTy>(payload);
  205|  4.06M|      invariant(!FULL_DECODE || codeValue /*aka diff_l*/ > 0);
  ------------------
  |  |   27|  4.06M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (205:7): [Folded, False: 4.06M]
  |  Branch (205:7): [True: 4.06M, False: 0]
  |  Branch (205:7): [True: 4.06M, False: 0]
  ------------------
  206|  4.06M|    } else {
  207|       |      // No match in the lookup table, because either the code is longer
  208|       |      // than LookupDepth or the input is corrupt. Need to read more bits...
  209|  2.01M|      invariant(len == 0);
  ------------------
  |  |   27|  2.01M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (209:7): [True: 2.01M, False: 0]
  ------------------
  210|  2.01M|      bs.skipBitsNoFill(partial.code_len);
  211|  2.01M|      std::tie(partial, codeValue) =
  212|  2.01M|          Base::finishReadingPartialSymbol(bs, partial);
  213|  2.01M|    }
  214|       |
  215|  6.08M|    return Base::template processSymbol<BIT_STREAM, FULL_DECODE>(bs, partial,
  216|  6.08M|                                                                 codeValue);
  217|  6.08M|  }
_ZNK8rawspeed20PrefixCodeLUTDecoderINS_15BaselineCodeTagENS_23PrefixCodeLookupDecoderIS1_EEE6decodeINS_14BitStreamerMSBELb0EEEiRT_:
  174|  35.0M|  __attribute__((always_inline)) int decode(BIT_STREAM& bs) const {
  175|  35.0M|    static_assert(
  176|  35.0M|        BitStreamerTraits<BIT_STREAM>::canUseWithPrefixCodeDecoder,
  177|  35.0M|        "This BitStreamer specialization is not marked as usable here");
  178|  35.0M|    invariant(FULL_DECODE == Base::isFullDecode());
  ------------------
  |  |   27|  35.0M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (178:5): [True: 35.0M, False: 0]
  ------------------
  179|  35.0M|    bs.fill(32);
  180|       |
  181|  35.0M|    typename Base::CodeSymbol partial;
  182|  35.0M|    partial.code_len = LookupDepth;
  183|  35.0M|    partial.code = implicit_cast<typename Traits::CodeTy>(
  184|  35.0M|        bs.peekBitsNoFill(partial.code_len));
  185|       |
  186|  35.0M|    assert(partial.code < decodeLookup.size());
  ------------------
  |  Branch (186:5): [True: 35.0M, False: 0]
  ------------------
  187|  35.0M|    auto lutEntry = static_cast<unsigned>(decodeLookup[partial.code]);
  188|  35.0M|    int payload = static_cast<int>(lutEntry) >> PayloadShift;
  189|  35.0M|    int len = lutEntry & LenMask;
  190|       |
  191|       |    // How far did reading of those LookupDepth bits *actually* move us forward?
  192|  35.0M|    bs.skipBitsNoFill(len);
  193|       |
  194|       |    // If the flag bit is set, then we have already skipped all the len bits
  195|       |    // we needed to skip, and payload is the answer we were looking for.
  196|  35.0M|    if (lutEntry & FlagMask)
  ------------------
  |  Branch (196:9): [True: 35.0M, False: 1.27k]
  ------------------
  197|  35.0M|      return payload;
  198|       |
  199|  1.27k|    typename Traits::CodeValueTy codeValue;
  200|  1.27k|    if (lutEntry) {
  ------------------
  |  Branch (200:9): [True: 0, False: 1.27k]
  ------------------
  201|       |      // If the flag is not set, but the entry is not empty,
  202|       |      // the payload is the code value for this symbol.
  203|      0|      partial.code_len = implicit_cast<uint8_t>(len);
  204|      0|      codeValue = implicit_cast<typename Traits::CodeValueTy>(payload);
  205|      0|      invariant(!FULL_DECODE || codeValue /*aka diff_l*/ > 0);
  ------------------
  |  |   27|      0|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (205:7): [True: 0, Folded]
  |  Branch (205:7): [True: 0, False: 0]
  |  Branch (205:7): [True: 0, Folded]
  ------------------
  206|  1.27k|    } else {
  207|       |      // No match in the lookup table, because either the code is longer
  208|       |      // than LookupDepth or the input is corrupt. Need to read more bits...
  209|  1.27k|      invariant(len == 0);
  ------------------
  |  |   27|  1.27k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (209:7): [True: 1.27k, False: 0]
  ------------------
  210|  1.27k|      bs.skipBitsNoFill(partial.code_len);
  211|  1.27k|      std::tie(partial, codeValue) =
  212|  1.27k|          Base::finishReadingPartialSymbol(bs, partial);
  213|  1.27k|    }
  214|       |
  215|  1.27k|    return Base::template processSymbol<BIT_STREAM, FULL_DECODE>(bs, partial,
  216|  1.27k|                                                                 codeValue);
  217|  1.27k|  }
_ZNK8rawspeed20PrefixCodeLUTDecoderINS_15BaselineCodeTagENS_23PrefixCodeLookupDecoderIS1_EEE6decodeINS_16BitStreamerMSB32ELb1EEEiRT_:
  174|  4.75M|  __attribute__((always_inline)) int decode(BIT_STREAM& bs) const {
  175|  4.75M|    static_assert(
  176|  4.75M|        BitStreamerTraits<BIT_STREAM>::canUseWithPrefixCodeDecoder,
  177|  4.75M|        "This BitStreamer specialization is not marked as usable here");
  178|  4.75M|    invariant(FULL_DECODE == Base::isFullDecode());
  ------------------
  |  |   27|  4.75M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (178:5): [True: 4.75M, False: 0]
  ------------------
  179|  4.75M|    bs.fill(32);
  180|       |
  181|  4.75M|    typename Base::CodeSymbol partial;
  182|  4.75M|    partial.code_len = LookupDepth;
  183|  4.75M|    partial.code = implicit_cast<typename Traits::CodeTy>(
  184|  4.75M|        bs.peekBitsNoFill(partial.code_len));
  185|       |
  186|  4.75M|    assert(partial.code < decodeLookup.size());
  ------------------
  |  Branch (186:5): [True: 4.75M, False: 0]
  ------------------
  187|  4.75M|    auto lutEntry = static_cast<unsigned>(decodeLookup[partial.code]);
  188|  4.75M|    int payload = static_cast<int>(lutEntry) >> PayloadShift;
  189|  4.75M|    int len = lutEntry & LenMask;
  190|       |
  191|       |    // How far did reading of those LookupDepth bits *actually* move us forward?
  192|  4.75M|    bs.skipBitsNoFill(len);
  193|       |
  194|       |    // If the flag bit is set, then we have already skipped all the len bits
  195|       |    // we needed to skip, and payload is the answer we were looking for.
  196|  4.75M|    if (lutEntry & FlagMask)
  ------------------
  |  Branch (196:9): [True: 446k, False: 4.31M]
  ------------------
  197|   446k|      return payload;
  198|       |
  199|  4.31M|    typename Traits::CodeValueTy codeValue;
  200|  4.31M|    if (lutEntry) {
  ------------------
  |  Branch (200:9): [True: 3.33M, False: 977k]
  ------------------
  201|       |      // If the flag is not set, but the entry is not empty,
  202|       |      // the payload is the code value for this symbol.
  203|  3.33M|      partial.code_len = implicit_cast<uint8_t>(len);
  204|  3.33M|      codeValue = implicit_cast<typename Traits::CodeValueTy>(payload);
  205|  3.33M|      invariant(!FULL_DECODE || codeValue /*aka diff_l*/ > 0);
  ------------------
  |  |   27|  3.33M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (205:7): [Folded, False: 3.33M]
  |  Branch (205:7): [True: 3.33M, False: 0]
  |  Branch (205:7): [True: 3.33M, False: 0]
  ------------------
  206|  3.33M|    } else {
  207|       |      // No match in the lookup table, because either the code is longer
  208|       |      // than LookupDepth or the input is corrupt. Need to read more bits...
  209|   977k|      invariant(len == 0);
  ------------------
  |  |   27|   977k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (209:7): [True: 977k, False: 0]
  ------------------
  210|   977k|      bs.skipBitsNoFill(partial.code_len);
  211|   977k|      std::tie(partial, codeValue) =
  212|   977k|          Base::finishReadingPartialSymbol(bs, partial);
  213|   977k|    }
  214|       |
  215|  4.31M|    return Base::template processSymbol<BIT_STREAM, FULL_DECODE>(bs, partial,
  216|  4.31M|                                                                 codeValue);
  217|  4.31M|  }
_ZNK8rawspeed20PrefixCodeLUTDecoderINS_15BaselineCodeTagENS_23PrefixCodeLookupDecoderIS1_EEE6decodeINS_16BitStreamerMSB32ELb0EEEiRT_:
  174|  36.9M|  __attribute__((always_inline)) int decode(BIT_STREAM& bs) const {
  175|  36.9M|    static_assert(
  176|  36.9M|        BitStreamerTraits<BIT_STREAM>::canUseWithPrefixCodeDecoder,
  177|  36.9M|        "This BitStreamer specialization is not marked as usable here");
  178|  36.9M|    invariant(FULL_DECODE == Base::isFullDecode());
  ------------------
  |  |   27|  36.9M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (178:5): [True: 36.9M, False: 0]
  ------------------
  179|  36.9M|    bs.fill(32);
  180|       |
  181|  36.9M|    typename Base::CodeSymbol partial;
  182|  36.9M|    partial.code_len = LookupDepth;
  183|  36.9M|    partial.code = implicit_cast<typename Traits::CodeTy>(
  184|  36.9M|        bs.peekBitsNoFill(partial.code_len));
  185|       |
  186|  36.9M|    assert(partial.code < decodeLookup.size());
  ------------------
  |  Branch (186:5): [True: 36.9M, False: 0]
  ------------------
  187|  36.9M|    auto lutEntry = static_cast<unsigned>(decodeLookup[partial.code]);
  188|  36.9M|    int payload = static_cast<int>(lutEntry) >> PayloadShift;
  189|  36.9M|    int len = lutEntry & LenMask;
  190|       |
  191|       |    // How far did reading of those LookupDepth bits *actually* move us forward?
  192|  36.9M|    bs.skipBitsNoFill(len);
  193|       |
  194|       |    // If the flag bit is set, then we have already skipped all the len bits
  195|       |    // we needed to skip, and payload is the answer we were looking for.
  196|  36.9M|    if (lutEntry & FlagMask)
  ------------------
  |  Branch (196:9): [True: 36.9M, False: 3.61k]
  ------------------
  197|  36.9M|      return payload;
  198|       |
  199|  3.61k|    typename Traits::CodeValueTy codeValue;
  200|  3.61k|    if (lutEntry) {
  ------------------
  |  Branch (200:9): [True: 0, False: 3.61k]
  ------------------
  201|       |      // If the flag is not set, but the entry is not empty,
  202|       |      // the payload is the code value for this symbol.
  203|      0|      partial.code_len = implicit_cast<uint8_t>(len);
  204|      0|      codeValue = implicit_cast<typename Traits::CodeValueTy>(payload);
  205|      0|      invariant(!FULL_DECODE || codeValue /*aka diff_l*/ > 0);
  ------------------
  |  |   27|      0|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (205:7): [True: 0, Folded]
  |  Branch (205:7): [True: 0, False: 0]
  |  Branch (205:7): [True: 0, Folded]
  ------------------
  206|  3.61k|    } else {
  207|       |      // No match in the lookup table, because either the code is longer
  208|       |      // than LookupDepth or the input is corrupt. Need to read more bits...
  209|  3.61k|      invariant(len == 0);
  ------------------
  |  |   27|  3.61k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (209:7): [True: 3.61k, False: 0]
  ------------------
  210|  3.61k|      bs.skipBitsNoFill(partial.code_len);
  211|  3.61k|      std::tie(partial, codeValue) =
  212|  3.61k|          Base::finishReadingPartialSymbol(bs, partial);
  213|  3.61k|    }
  214|       |
  215|  3.61k|    return Base::template processSymbol<BIT_STREAM, FULL_DECODE>(bs, partial,
  216|  3.61k|                                                                 codeValue);
  217|  3.61k|  }
_ZNK8rawspeed20PrefixCodeLUTDecoderINS_15BaselineCodeTagENS_23PrefixCodeLookupDecoderIS1_EEE6decodeINS_15BitStreamerJPEGELb1EEEiRT_:
  174|  4.66M|  __attribute__((always_inline)) int decode(BIT_STREAM& bs) const {
  175|  4.66M|    static_assert(
  176|  4.66M|        BitStreamerTraits<BIT_STREAM>::canUseWithPrefixCodeDecoder,
  177|  4.66M|        "This BitStreamer specialization is not marked as usable here");
  178|  4.66M|    invariant(FULL_DECODE == Base::isFullDecode());
  ------------------
  |  |   27|  4.66M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (178:5): [True: 4.66M, False: 0]
  ------------------
  179|  4.66M|    bs.fill(32);
  180|       |
  181|  4.66M|    typename Base::CodeSymbol partial;
  182|  4.66M|    partial.code_len = LookupDepth;
  183|  4.66M|    partial.code = implicit_cast<typename Traits::CodeTy>(
  184|  4.66M|        bs.peekBitsNoFill(partial.code_len));
  185|       |
  186|  4.66M|    assert(partial.code < decodeLookup.size());
  ------------------
  |  Branch (186:5): [True: 4.66M, False: 0]
  ------------------
  187|  4.66M|    auto lutEntry = static_cast<unsigned>(decodeLookup[partial.code]);
  188|  4.66M|    int payload = static_cast<int>(lutEntry) >> PayloadShift;
  189|  4.66M|    int len = lutEntry & LenMask;
  190|       |
  191|       |    // How far did reading of those LookupDepth bits *actually* move us forward?
  192|  4.66M|    bs.skipBitsNoFill(len);
  193|       |
  194|       |    // If the flag bit is set, then we have already skipped all the len bits
  195|       |    // we needed to skip, and payload is the answer we were looking for.
  196|  4.66M|    if (lutEntry & FlagMask)
  ------------------
  |  Branch (196:9): [True: 4.39M, False: 277k]
  ------------------
  197|  4.39M|      return payload;
  198|       |
  199|   277k|    typename Traits::CodeValueTy codeValue;
  200|   277k|    if (lutEntry) {
  ------------------
  |  Branch (200:9): [True: 275k, False: 2.63k]
  ------------------
  201|       |      // If the flag is not set, but the entry is not empty,
  202|       |      // the payload is the code value for this symbol.
  203|   275k|      partial.code_len = implicit_cast<uint8_t>(len);
  204|   275k|      codeValue = implicit_cast<typename Traits::CodeValueTy>(payload);
  205|   275k|      invariant(!FULL_DECODE || codeValue /*aka diff_l*/ > 0);
  ------------------
  |  |   27|   275k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (205:7): [Folded, False: 275k]
  |  Branch (205:7): [True: 275k, False: 0]
  |  Branch (205:7): [True: 275k, False: 0]
  ------------------
  206|   275k|    } else {
  207|       |      // No match in the lookup table, because either the code is longer
  208|       |      // than LookupDepth or the input is corrupt. Need to read more bits...
  209|  2.63k|      invariant(len == 0);
  ------------------
  |  |   27|  2.63k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (209:7): [True: 2.63k, False: 0]
  ------------------
  210|  2.63k|      bs.skipBitsNoFill(partial.code_len);
  211|  2.63k|      std::tie(partial, codeValue) =
  212|  2.63k|          Base::finishReadingPartialSymbol(bs, partial);
  213|  2.63k|    }
  214|       |
  215|   277k|    return Base::template processSymbol<BIT_STREAM, FULL_DECODE>(bs, partial,
  216|   277k|                                                                 codeValue);
  217|   277k|  }
_ZNK8rawspeed20PrefixCodeLUTDecoderINS_15BaselineCodeTagENS_23PrefixCodeLookupDecoderIS1_EEE6decodeINS_15BitStreamerJPEGELb0EEEiRT_:
  174|  12.4M|  __attribute__((always_inline)) int decode(BIT_STREAM& bs) const {
  175|  12.4M|    static_assert(
  176|  12.4M|        BitStreamerTraits<BIT_STREAM>::canUseWithPrefixCodeDecoder,
  177|  12.4M|        "This BitStreamer specialization is not marked as usable here");
  178|  12.4M|    invariant(FULL_DECODE == Base::isFullDecode());
  ------------------
  |  |   27|  12.4M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (178:5): [True: 12.4M, False: 0]
  ------------------
  179|  12.4M|    bs.fill(32);
  180|       |
  181|  12.4M|    typename Base::CodeSymbol partial;
  182|  12.4M|    partial.code_len = LookupDepth;
  183|  12.4M|    partial.code = implicit_cast<typename Traits::CodeTy>(
  184|  12.4M|        bs.peekBitsNoFill(partial.code_len));
  185|       |
  186|  12.4M|    assert(partial.code < decodeLookup.size());
  ------------------
  |  Branch (186:5): [True: 12.4M, False: 0]
  ------------------
  187|  12.4M|    auto lutEntry = static_cast<unsigned>(decodeLookup[partial.code]);
  188|  12.4M|    int payload = static_cast<int>(lutEntry) >> PayloadShift;
  189|  12.4M|    int len = lutEntry & LenMask;
  190|       |
  191|       |    // How far did reading of those LookupDepth bits *actually* move us forward?
  192|  12.4M|    bs.skipBitsNoFill(len);
  193|       |
  194|       |    // If the flag bit is set, then we have already skipped all the len bits
  195|       |    // we needed to skip, and payload is the answer we were looking for.
  196|  12.4M|    if (lutEntry & FlagMask)
  ------------------
  |  Branch (196:9): [True: 12.4M, False: 1.08k]
  ------------------
  197|  12.4M|      return payload;
  198|       |
  199|  1.08k|    typename Traits::CodeValueTy codeValue;
  200|  1.08k|    if (lutEntry) {
  ------------------
  |  Branch (200:9): [True: 0, False: 1.08k]
  ------------------
  201|       |      // If the flag is not set, but the entry is not empty,
  202|       |      // the payload is the code value for this symbol.
  203|      0|      partial.code_len = implicit_cast<uint8_t>(len);
  204|      0|      codeValue = implicit_cast<typename Traits::CodeValueTy>(payload);
  205|      0|      invariant(!FULL_DECODE || codeValue /*aka diff_l*/ > 0);
  ------------------
  |  |   27|      0|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (205:7): [True: 0, Folded]
  |  Branch (205:7): [True: 0, False: 0]
  |  Branch (205:7): [True: 0, Folded]
  ------------------
  206|  1.08k|    } else {
  207|       |      // No match in the lookup table, because either the code is longer
  208|       |      // than LookupDepth or the input is corrupt. Need to read more bits...
  209|  1.08k|      invariant(len == 0);
  ------------------
  |  |   27|  1.08k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (209:7): [True: 1.08k, False: 0]
  ------------------
  210|  1.08k|      bs.skipBitsNoFill(partial.code_len);
  211|  1.08k|      std::tie(partial, codeValue) =
  212|  1.08k|          Base::finishReadingPartialSymbol(bs, partial);
  213|  1.08k|    }
  214|       |
  215|  1.08k|    return Base::template processSymbol<BIT_STREAM, FULL_DECODE>(bs, partial,
  216|  1.08k|                                                                 codeValue);
  217|  1.08k|  }
_ZN8rawspeed20PrefixCodeLUTDecoderINS_10VC5CodeTagENS_23PrefixCodeLookupDecoderIS1_EEE5setupEbb:
   95|    871|  void setup(bool fullDecode_, bool fixDNGBug16_) {
   96|    871|    Base::setup(fullDecode_, fixDNGBug16_);
   97|       |
   98|       |    // Generate lookup table for fast decoding lookup.
   99|       |    // See definition of decodeLookup above
  100|    871|    decodeLookup.resize(1 << LookupDepth);
  101|  3.20k|    for (size_t i = 0; i < Base::code.symbols.size(); i++) {
  ------------------
  |  Branch (101:24): [True: 2.97k, False: 229]
  ------------------
  102|  2.97k|      uint8_t code_l = Base::code.symbols[i].code_len;
  103|  2.97k|      if (code_l > static_cast<int>(LookupDepth))
  ------------------
  |  Branch (103:11): [True: 642, False: 2.33k]
  ------------------
  104|    642|        break;
  105|       |
  106|  2.33k|      auto ll = implicit_cast<uint16_t>(Base::code.symbols[i].code
  107|  2.33k|                                        << (LookupDepth - code_l));
  108|  2.33k|      auto ul =
  109|  2.33k|          implicit_cast<uint16_t>(ll | ((1 << (LookupDepth - code_l)) - 1));
  110|  2.33k|      static_assert(Traits::MaxCodeValueLenghtBits <=
  111|  2.33k|                    bitwidth<LUTEntryTy>() - PayloadShift);
  112|  2.33k|      LUTUnsignedEntryTy diff_l = Base::code.codeValues[i];
  113|   270k|      for (uint16_t c = ll; c <= ul; c++) {
  ------------------
  |  Branch (113:29): [True: 268k, False: 2.33k]
  ------------------
  114|   268k|        if (!(c < decodeLookup.size()))
  ------------------
  |  Branch (114:13): [True: 0, False: 268k]
  ------------------
  115|   268k|          ThrowRDE("Corrupt Huffman");
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  116|       |
  117|   268k|        if (!FlagMask || !Base::isFullDecode() || code_l > LookupDepth ||
  ------------------
  |  Branch (117:13): [Folded, False: 268k]
  |  Branch (117:26): [True: 268k, False: 0]
  |  Branch (117:51): [True: 0, False: 0]
  ------------------
  118|   268k|            (code_l + diff_l > LookupDepth && diff_l != 16)) {
  ------------------
  |  Branch (118:14): [True: 0, False: 0]
  |  Branch (118:47): [True: 0, False: 0]
  ------------------
  119|       |          // lookup bit depth is too small to fit both the encoded length
  120|       |          // and the final difference value.
  121|       |          // -> store only the length and do a normal sign extension later
  122|   268k|          invariant(!Base::isFullDecode() || diff_l > 0);
  ------------------
  |  |   27|   268k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (122:11): [True: 268k, False: 0]
  |  Branch (122:11): [True: 0, False: 0]
  |  Branch (122:11): [True: 268k, False: 0]
  ------------------
  123|   268k|          decodeLookup[c] = diff_l << PayloadShift | code_l;
  124|       |
  125|   268k|          if (!Base::isFullDecode())
  ------------------
  |  Branch (125:15): [True: 268k, False: 0]
  ------------------
  126|   268k|            decodeLookup[c] |= FlagMask;
  127|   268k|        } else {
  128|       |          // Lookup bit depth is sufficient to encode the final value.
  129|      0|          decodeLookup[c] = FlagMask | code_l;
  130|      0|          if (diff_l != 16 || Base::handleDNGBug16())
  ------------------
  |  Branch (130:15): [True: 0, False: 0]
  |  Branch (130:31): [True: 0, False: 0]
  ------------------
  131|      0|            decodeLookup[c] += diff_l;
  132|       |
  133|      0|          if (diff_l) {
  ------------------
  |  Branch (133:15): [True: 0, False: 0]
  ------------------
  134|      0|            LUTUnsignedEntryTy diff;
  135|      0|            if (diff_l != 16) {
  ------------------
  |  Branch (135:17): [True: 0, False: 0]
  ------------------
  136|      0|              diff = extractHighBits(c, code_l + diff_l,
  137|      0|                                     /*effectiveBitwidth=*/LookupDepth);
  138|      0|              diff &= ((1 << diff_l) - 1);
  139|      0|            } else {
  140|      0|              diff = LUTUnsignedEntryTy(-32768);
  141|      0|            }
  142|      0|            decodeLookup[c] |= static_cast<LUTEntryTy>(
  143|      0|                static_cast<LUTUnsignedEntryTy>(Base::extend(diff, diff_l))
  144|      0|                << PayloadShift);
  145|      0|          }
  146|      0|        }
  147|   268k|      }
  148|  2.33k|    }
  149|    871|  }
_ZNK8rawspeed20PrefixCodeLUTDecoderINS_10VC5CodeTagENS_23PrefixCodeLookupDecoderIS1_EEE6decodeINS_14BitStreamerMSBELb0EEEiRT_:
  174|  29.7M|  __attribute__((always_inline)) int decode(BIT_STREAM& bs) const {
  175|  29.7M|    static_assert(
  176|  29.7M|        BitStreamerTraits<BIT_STREAM>::canUseWithPrefixCodeDecoder,
  177|  29.7M|        "This BitStreamer specialization is not marked as usable here");
  178|  29.7M|    invariant(FULL_DECODE == Base::isFullDecode());
  ------------------
  |  |   27|  29.7M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (178:5): [True: 29.7M, False: 0]
  ------------------
  179|  29.7M|    bs.fill(32);
  180|       |
  181|  29.7M|    typename Base::CodeSymbol partial;
  182|  29.7M|    partial.code_len = LookupDepth;
  183|  29.7M|    partial.code = implicit_cast<typename Traits::CodeTy>(
  184|  29.7M|        bs.peekBitsNoFill(partial.code_len));
  185|       |
  186|  29.7M|    assert(partial.code < decodeLookup.size());
  ------------------
  |  Branch (186:5): [True: 29.7M, False: 0]
  ------------------
  187|  29.7M|    auto lutEntry = static_cast<unsigned>(decodeLookup[partial.code]);
  188|  29.7M|    int payload = static_cast<int>(lutEntry) >> PayloadShift;
  189|  29.7M|    int len = lutEntry & LenMask;
  190|       |
  191|       |    // How far did reading of those LookupDepth bits *actually* move us forward?
  192|  29.7M|    bs.skipBitsNoFill(len);
  193|       |
  194|       |    // If the flag bit is set, then we have already skipped all the len bits
  195|       |    // we needed to skip, and payload is the answer we were looking for.
  196|  29.7M|    if (lutEntry & FlagMask)
  ------------------
  |  Branch (196:9): [True: 29.7M, False: 9.20k]
  ------------------
  197|  29.7M|      return payload;
  198|       |
  199|  9.20k|    typename Traits::CodeValueTy codeValue;
  200|  9.20k|    if (lutEntry) {
  ------------------
  |  Branch (200:9): [True: 0, False: 9.20k]
  ------------------
  201|       |      // If the flag is not set, but the entry is not empty,
  202|       |      // the payload is the code value for this symbol.
  203|      0|      partial.code_len = implicit_cast<uint8_t>(len);
  204|      0|      codeValue = implicit_cast<typename Traits::CodeValueTy>(payload);
  205|      0|      invariant(!FULL_DECODE || codeValue /*aka diff_l*/ > 0);
  ------------------
  |  |   27|      0|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (205:7): [True: 0, Folded]
  |  Branch (205:7): [True: 0, False: 0]
  |  Branch (205:7): [True: 0, Folded]
  ------------------
  206|  9.20k|    } else {
  207|       |      // No match in the lookup table, because either the code is longer
  208|       |      // than LookupDepth or the input is corrupt. Need to read more bits...
  209|  9.20k|      invariant(len == 0);
  ------------------
  |  |   27|  9.20k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (209:7): [True: 9.20k, False: 0]
  ------------------
  210|  9.20k|      bs.skipBitsNoFill(partial.code_len);
  211|  9.20k|      std::tie(partial, codeValue) =
  212|  9.20k|          Base::finishReadingPartialSymbol(bs, partial);
  213|  9.20k|    }
  214|       |
  215|  9.20k|    return Base::template processSymbol<BIT_STREAM, FULL_DECODE>(bs, partial,
  216|  9.20k|                                                                 codeValue);
  217|  9.20k|  }
_ZNK8rawspeed20PrefixCodeLUTDecoderINS_10VC5CodeTagENS_23PrefixCodeLookupDecoderIS1_EEE6decodeINS_16BitStreamerMSB32ELb0EEEiRT_:
  174|  36.5M|  __attribute__((always_inline)) int decode(BIT_STREAM& bs) const {
  175|  36.5M|    static_assert(
  176|  36.5M|        BitStreamerTraits<BIT_STREAM>::canUseWithPrefixCodeDecoder,
  177|  36.5M|        "This BitStreamer specialization is not marked as usable here");
  178|  36.5M|    invariant(FULL_DECODE == Base::isFullDecode());
  ------------------
  |  |   27|  36.5M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (178:5): [True: 36.5M, False: 0]
  ------------------
  179|  36.5M|    bs.fill(32);
  180|       |
  181|  36.5M|    typename Base::CodeSymbol partial;
  182|  36.5M|    partial.code_len = LookupDepth;
  183|  36.5M|    partial.code = implicit_cast<typename Traits::CodeTy>(
  184|  36.5M|        bs.peekBitsNoFill(partial.code_len));
  185|       |
  186|  36.5M|    assert(partial.code < decodeLookup.size());
  ------------------
  |  Branch (186:5): [True: 36.5M, False: 0]
  ------------------
  187|  36.5M|    auto lutEntry = static_cast<unsigned>(decodeLookup[partial.code]);
  188|  36.5M|    int payload = static_cast<int>(lutEntry) >> PayloadShift;
  189|  36.5M|    int len = lutEntry & LenMask;
  190|       |
  191|       |    // How far did reading of those LookupDepth bits *actually* move us forward?
  192|  36.5M|    bs.skipBitsNoFill(len);
  193|       |
  194|       |    // If the flag bit is set, then we have already skipped all the len bits
  195|       |    // we needed to skip, and payload is the answer we were looking for.
  196|  36.5M|    if (lutEntry & FlagMask)
  ------------------
  |  Branch (196:9): [True: 36.5M, False: 6.03k]
  ------------------
  197|  36.5M|      return payload;
  198|       |
  199|  6.03k|    typename Traits::CodeValueTy codeValue;
  200|  6.03k|    if (lutEntry) {
  ------------------
  |  Branch (200:9): [True: 0, False: 6.03k]
  ------------------
  201|       |      // If the flag is not set, but the entry is not empty,
  202|       |      // the payload is the code value for this symbol.
  203|      0|      partial.code_len = implicit_cast<uint8_t>(len);
  204|      0|      codeValue = implicit_cast<typename Traits::CodeValueTy>(payload);
  205|      0|      invariant(!FULL_DECODE || codeValue /*aka diff_l*/ > 0);
  ------------------
  |  |   27|      0|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (205:7): [True: 0, Folded]
  |  Branch (205:7): [True: 0, False: 0]
  |  Branch (205:7): [True: 0, Folded]
  ------------------
  206|  6.03k|    } else {
  207|       |      // No match in the lookup table, because either the code is longer
  208|       |      // than LookupDepth or the input is corrupt. Need to read more bits...
  209|  6.03k|      invariant(len == 0);
  ------------------
  |  |   27|  6.03k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (209:7): [True: 6.03k, False: 0]
  ------------------
  210|  6.03k|      bs.skipBitsNoFill(partial.code_len);
  211|  6.03k|      std::tie(partial, codeValue) =
  212|  6.03k|          Base::finishReadingPartialSymbol(bs, partial);
  213|  6.03k|    }
  214|       |
  215|  6.03k|    return Base::template processSymbol<BIT_STREAM, FULL_DECODE>(bs, partial,
  216|  6.03k|                                                                 codeValue);
  217|  6.03k|  }
_ZNK8rawspeed20PrefixCodeLUTDecoderINS_10VC5CodeTagENS_23PrefixCodeLookupDecoderIS1_EEE6decodeINS_15BitStreamerJPEGELb0EEEiRT_:
  174|  41.5k|  __attribute__((always_inline)) int decode(BIT_STREAM& bs) const {
  175|  41.5k|    static_assert(
  176|  41.5k|        BitStreamerTraits<BIT_STREAM>::canUseWithPrefixCodeDecoder,
  177|  41.5k|        "This BitStreamer specialization is not marked as usable here");
  178|  41.5k|    invariant(FULL_DECODE == Base::isFullDecode());
  ------------------
  |  |   27|  41.5k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (178:5): [True: 41.5k, False: 0]
  ------------------
  179|  41.5k|    bs.fill(32);
  180|       |
  181|  41.5k|    typename Base::CodeSymbol partial;
  182|  41.5k|    partial.code_len = LookupDepth;
  183|  41.5k|    partial.code = implicit_cast<typename Traits::CodeTy>(
  184|  41.5k|        bs.peekBitsNoFill(partial.code_len));
  185|       |
  186|  41.5k|    assert(partial.code < decodeLookup.size());
  ------------------
  |  Branch (186:5): [True: 41.5k, False: 0]
  ------------------
  187|  41.5k|    auto lutEntry = static_cast<unsigned>(decodeLookup[partial.code]);
  188|  41.5k|    int payload = static_cast<int>(lutEntry) >> PayloadShift;
  189|  41.5k|    int len = lutEntry & LenMask;
  190|       |
  191|       |    // How far did reading of those LookupDepth bits *actually* move us forward?
  192|  41.5k|    bs.skipBitsNoFill(len);
  193|       |
  194|       |    // If the flag bit is set, then we have already skipped all the len bits
  195|       |    // we needed to skip, and payload is the answer we were looking for.
  196|  41.5k|    if (lutEntry & FlagMask)
  ------------------
  |  Branch (196:9): [True: 38.7k, False: 2.77k]
  ------------------
  197|  38.7k|      return payload;
  198|       |
  199|  2.77k|    typename Traits::CodeValueTy codeValue;
  200|  2.77k|    if (lutEntry) {
  ------------------
  |  Branch (200:9): [True: 0, False: 2.77k]
  ------------------
  201|       |      // If the flag is not set, but the entry is not empty,
  202|       |      // the payload is the code value for this symbol.
  203|      0|      partial.code_len = implicit_cast<uint8_t>(len);
  204|      0|      codeValue = implicit_cast<typename Traits::CodeValueTy>(payload);
  205|      0|      invariant(!FULL_DECODE || codeValue /*aka diff_l*/ > 0);
  ------------------
  |  |   27|      0|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (205:7): [True: 0, Folded]
  |  Branch (205:7): [True: 0, False: 0]
  |  Branch (205:7): [True: 0, Folded]
  ------------------
  206|  2.77k|    } else {
  207|       |      // No match in the lookup table, because either the code is longer
  208|       |      // than LookupDepth or the input is corrupt. Need to read more bits...
  209|  2.77k|      invariant(len == 0);
  ------------------
  |  |   27|  2.77k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (209:7): [True: 2.77k, False: 0]
  ------------------
  210|  2.77k|      bs.skipBitsNoFill(partial.code_len);
  211|  2.77k|      std::tie(partial, codeValue) =
  212|  2.77k|          Base::finishReadingPartialSymbol(bs, partial);
  213|  2.77k|    }
  214|       |
  215|  2.77k|    return Base::template processSymbol<BIT_STREAM, FULL_DECODE>(bs, partial,
  216|  2.77k|                                                                 codeValue);
  217|  2.77k|  }

_ZN8rawspeed23PrefixCodeLookupDecoderINS_15BaselineCodeTagEEC2EONS_11HuffmanCodeIS1_EE:
   80|  1.95k|      : Base(std::move(hc).operator rawspeed::PrefixCode<CodeTag>()) {}
_ZN8rawspeed23PrefixCodeLookupDecoderINS_15BaselineCodeTagEE5setupEbb:
   97|  1.87k|  void setup(bool fullDecode_, bool fixDNGBug16_) {
   98|  1.87k|    AbstractPrefixCodeDecoder<CodeTag>::setup(fullDecode_, fixDNGBug16_);
   99|       |
  100|       |    // Figure F.15: generate decoding tables
  101|  1.87k|    codeOffsetOL.resize(Base::maxCodeLength() + 1UL, MaxCodeValue);
  102|  1.87k|    maxCodeOL.resize(Base::maxCodeLength() + 1UL, MaxCodeValue);
  103|  1.87k|    for (unsigned int numCodesSoFar = 0, codeLen = 1;
  104|  15.9k|         codeLen <= Base::maxCodeLength(); codeLen++) {
  ------------------
  |  Branch (104:10): [True: 14.1k, False: 1.87k]
  ------------------
  105|  14.1k|      if (!Base::code.nCodesPerLength[codeLen])
  ------------------
  |  Branch (105:11): [True: 11.0k, False: 3.03k]
  ------------------
  106|  11.0k|        continue;
  107|  3.03k|      codeOffsetOL[codeLen] = implicit_cast<typename Traits::CodeTy>(
  108|  3.03k|          Base::code.symbols[numCodesSoFar].code - numCodesSoFar);
  109|  3.03k|      assert(codeOffsetOL[codeLen] != MaxCodeValue);
  ------------------
  |  Branch (109:7): [True: 3.03k, False: 0]
  ------------------
  110|  3.03k|      numCodesSoFar += Base::code.nCodesPerLength[codeLen];
  111|  3.03k|      maxCodeOL[codeLen] = Base::code.symbols[numCodesSoFar - 1].code;
  112|  3.03k|    }
  113|  1.87k|  }
_ZNK8rawspeed23PrefixCodeLookupDecoderINS_15BaselineCodeTagEE26finishReadingPartialSymbolINS_14BitStreamerMSBEEENSt3__14pairINS_18AbstractPrefixCodeIS1_E10CodeSymbolEiEERT_S9_:
  136|  2.02M|                             typename Base::CodeSymbol partial) const {
  137|  2.02M|    static_assert(
  138|  2.02M|        BitStreamerTraits<BIT_STREAM>::canUseWithPrefixCodeDecoder,
  139|  2.02M|        "This BitStreamer specialization is not marked as usable here");
  140|  12.1M|    while (partial.code_len < Base::maxCodeLength() &&
  ------------------
  |  Branch (140:12): [True: 10.0M, False: 2.02M]
  ------------------
  141|  10.0M|           (MaxCodeValue == maxCodeOL[partial.code_len] ||
  ------------------
  |  Branch (141:13): [True: 10.0M, False: 534]
  ------------------
  142|  10.0M|            partial.code > maxCodeOL[partial.code_len])) {
  ------------------
  |  Branch (142:13): [True: 252, False: 282]
  ------------------
  143|  10.0M|      uint32_t temp = bs.getBitsNoFill(1);
  144|  10.0M|      partial.code =
  145|  10.0M|          implicit_cast<typename Traits::CodeTy>((partial.code << 1) | temp);
  146|  10.0M|      partial.code_len++;
  147|  10.0M|    }
  148|       |
  149|       |    // NOTE: when we are called from PrefixCodeLUTDecoder, the partial.code_len
  150|       |    // *could* be larger than the largest code lenght for this huffman table,
  151|       |    // which is a symptom of a corrupt code.
  152|  2.02M|    if (partial.code_len > Base::maxCodeLength() ||
  ------------------
  |  Branch (152:9): [True: 122, False: 2.02M]
  ------------------
  153|  2.02M|        partial.code > maxCodeOL[partial.code_len])
  ------------------
  |  Branch (153:9): [True: 107, False: 2.02M]
  ------------------
  154|  2.02M|      ThrowRDE("bad Huffman code: %u (len: %u)", partial.code,
  ------------------
  |  |   38|    229|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|    229|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|    229|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|    229|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  155|  2.02M|               partial.code_len);
  156|       |
  157|  2.02M|    assert(MaxCodeValue != codeOffsetOL[partial.code_len]);
  ------------------
  |  Branch (157:5): [True: 2.02M, False: 0]
  ------------------
  158|  2.02M|    assert(partial.code >= codeOffsetOL[partial.code_len]);
  ------------------
  |  Branch (158:5): [True: 2.02M, False: 0]
  ------------------
  159|  2.02M|    unsigned codeIndex = partial.code - codeOffsetOL[partial.code_len];
  160|  2.02M|    assert(codeIndex < Base::code.codeValues.size());
  ------------------
  |  Branch (160:5): [True: 2.02M, False: 0]
  ------------------
  161|       |
  162|  2.02M|    typename Traits::CodeValueTy codeValue = Base::code.codeValues[codeIndex];
  163|  2.02M|    return {partial, codeValue};
  164|  2.02M|  }
_ZNK8rawspeed23PrefixCodeLookupDecoderINS_15BaselineCodeTagEE26finishReadingPartialSymbolINS_16BitStreamerMSB32EEENSt3__14pairINS_18AbstractPrefixCodeIS1_E10CodeSymbolEiEERT_S9_:
  136|   981k|                             typename Base::CodeSymbol partial) const {
  137|   981k|    static_assert(
  138|   981k|        BitStreamerTraits<BIT_STREAM>::canUseWithPrefixCodeDecoder,
  139|   981k|        "This BitStreamer specialization is not marked as usable here");
  140|  4.50M|    while (partial.code_len < Base::maxCodeLength() &&
  ------------------
  |  Branch (140:12): [True: 3.52M, False: 981k]
  ------------------
  141|  3.52M|           (MaxCodeValue == maxCodeOL[partial.code_len] ||
  ------------------
  |  Branch (141:13): [True: 3.52M, False: 725]
  ------------------
  142|  3.52M|            partial.code > maxCodeOL[partial.code_len])) {
  ------------------
  |  Branch (142:13): [True: 300, False: 425]
  ------------------
  143|  3.52M|      uint32_t temp = bs.getBitsNoFill(1);
  144|  3.52M|      partial.code =
  145|  3.52M|          implicit_cast<typename Traits::CodeTy>((partial.code << 1) | temp);
  146|  3.52M|      partial.code_len++;
  147|  3.52M|    }
  148|       |
  149|       |    // NOTE: when we are called from PrefixCodeLUTDecoder, the partial.code_len
  150|       |    // *could* be larger than the largest code lenght for this huffman table,
  151|       |    // which is a symptom of a corrupt code.
  152|   981k|    if (partial.code_len > Base::maxCodeLength() ||
  ------------------
  |  Branch (152:9): [True: 85, False: 981k]
  ------------------
  153|   981k|        partial.code > maxCodeOL[partial.code_len])
  ------------------
  |  Branch (153:9): [True: 121, False: 981k]
  ------------------
  154|   981k|      ThrowRDE("bad Huffman code: %u (len: %u)", partial.code,
  ------------------
  |  |   38|    206|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|    206|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|    206|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|    206|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  155|   981k|               partial.code_len);
  156|       |
  157|   981k|    assert(MaxCodeValue != codeOffsetOL[partial.code_len]);
  ------------------
  |  Branch (157:5): [True: 981k, False: 0]
  ------------------
  158|   981k|    assert(partial.code >= codeOffsetOL[partial.code_len]);
  ------------------
  |  Branch (158:5): [True: 981k, False: 0]
  ------------------
  159|   981k|    unsigned codeIndex = partial.code - codeOffsetOL[partial.code_len];
  160|   981k|    assert(codeIndex < Base::code.codeValues.size());
  ------------------
  |  Branch (160:5): [True: 981k, False: 0]
  ------------------
  161|       |
  162|   981k|    typename Traits::CodeValueTy codeValue = Base::code.codeValues[codeIndex];
  163|   981k|    return {partial, codeValue};
  164|   981k|  }
_ZNK8rawspeed23PrefixCodeLookupDecoderINS_15BaselineCodeTagEE26finishReadingPartialSymbolINS_15BitStreamerJPEGEEENSt3__14pairINS_18AbstractPrefixCodeIS1_E10CodeSymbolEiEERT_S9_:
  136|  3.72k|                             typename Base::CodeSymbol partial) const {
  137|  3.72k|    static_assert(
  138|  3.72k|        BitStreamerTraits<BIT_STREAM>::canUseWithPrefixCodeDecoder,
  139|  3.72k|        "This BitStreamer specialization is not marked as usable here");
  140|  13.3k|    while (partial.code_len < Base::maxCodeLength() &&
  ------------------
  |  Branch (140:12): [True: 9.96k, False: 3.40k]
  ------------------
  141|  9.96k|           (MaxCodeValue == maxCodeOL[partial.code_len] ||
  ------------------
  |  Branch (141:13): [True: 9.40k, False: 565]
  ------------------
  142|  9.65k|            partial.code > maxCodeOL[partial.code_len])) {
  ------------------
  |  Branch (142:13): [True: 252, False: 313]
  ------------------
  143|  9.65k|      uint32_t temp = bs.getBitsNoFill(1);
  144|  9.65k|      partial.code =
  145|  9.65k|          implicit_cast<typename Traits::CodeTy>((partial.code << 1) | temp);
  146|  9.65k|      partial.code_len++;
  147|  9.65k|    }
  148|       |
  149|       |    // NOTE: when we are called from PrefixCodeLUTDecoder, the partial.code_len
  150|       |    // *could* be larger than the largest code lenght for this huffman table,
  151|       |    // which is a symptom of a corrupt code.
  152|  3.72k|    if (partial.code_len > Base::maxCodeLength() ||
  ------------------
  |  Branch (152:9): [True: 117, False: 3.60k]
  ------------------
  153|  3.60k|        partial.code > maxCodeOL[partial.code_len])
  ------------------
  |  Branch (153:9): [True: 101, False: 3.50k]
  ------------------
  154|  3.72k|      ThrowRDE("bad Huffman code: %u (len: %u)", partial.code,
  ------------------
  |  |   38|    218|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|    218|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|    218|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|    218|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  155|  3.50k|               partial.code_len);
  156|       |
  157|  3.72k|    assert(MaxCodeValue != codeOffsetOL[partial.code_len]);
  ------------------
  |  Branch (157:5): [True: 3.50k, False: 0]
  ------------------
  158|  3.50k|    assert(partial.code >= codeOffsetOL[partial.code_len]);
  ------------------
  |  Branch (158:5): [True: 3.50k, False: 0]
  ------------------
  159|  3.50k|    unsigned codeIndex = partial.code - codeOffsetOL[partial.code_len];
  160|  3.50k|    assert(codeIndex < Base::code.codeValues.size());
  ------------------
  |  Branch (160:5): [True: 3.50k, False: 0]
  ------------------
  161|       |
  162|  3.50k|    typename Traits::CodeValueTy codeValue = Base::code.codeValues[codeIndex];
  163|  3.50k|    return {partial, codeValue};
  164|  3.50k|  }
_ZN8rawspeed23PrefixCodeLookupDecoderINS_10VC5CodeTagEEC2EONS_11HuffmanCodeIS1_EE:
   80|    954|      : Base(std::move(hc).operator rawspeed::PrefixCode<CodeTag>()) {}
_ZN8rawspeed23PrefixCodeLookupDecoderINS_10VC5CodeTagEE5setupEbb:
   97|    871|  void setup(bool fullDecode_, bool fixDNGBug16_) {
   98|    871|    AbstractPrefixCodeDecoder<CodeTag>::setup(fullDecode_, fixDNGBug16_);
   99|       |
  100|       |    // Figure F.15: generate decoding tables
  101|    871|    codeOffsetOL.resize(Base::maxCodeLength() + 1UL, MaxCodeValue);
  102|    871|    maxCodeOL.resize(Base::maxCodeLength() + 1UL, MaxCodeValue);
  103|    871|    for (unsigned int numCodesSoFar = 0, codeLen = 1;
  104|  14.4k|         codeLen <= Base::maxCodeLength(); codeLen++) {
  ------------------
  |  Branch (104:10): [True: 13.5k, False: 871]
  ------------------
  105|  13.5k|      if (!Base::code.nCodesPerLength[codeLen])
  ------------------
  |  Branch (105:11): [True: 11.3k, False: 2.20k]
  ------------------
  106|  11.3k|        continue;
  107|  2.20k|      codeOffsetOL[codeLen] = implicit_cast<typename Traits::CodeTy>(
  108|  2.20k|          Base::code.symbols[numCodesSoFar].code - numCodesSoFar);
  109|  2.20k|      assert(codeOffsetOL[codeLen] != MaxCodeValue);
  ------------------
  |  Branch (109:7): [True: 2.20k, False: 0]
  ------------------
  110|  2.20k|      numCodesSoFar += Base::code.nCodesPerLength[codeLen];
  111|  2.20k|      maxCodeOL[codeLen] = Base::code.symbols[numCodesSoFar - 1].code;
  112|  2.20k|    }
  113|    871|  }
_ZNK8rawspeed23PrefixCodeLookupDecoderINS_10VC5CodeTagEE26finishReadingPartialSymbolINS_14BitStreamerMSBEEENSt3__14pairINS_18AbstractPrefixCodeIS1_E10CodeSymbolEiEERT_S9_:
  136|  9.20k|                             typename Base::CodeSymbol partial) const {
  137|  9.20k|    static_assert(
  138|  9.20k|        BitStreamerTraits<BIT_STREAM>::canUseWithPrefixCodeDecoder,
  139|  9.20k|        "This BitStreamer specialization is not marked as usable here");
  140|  45.6k|    while (partial.code_len < Base::maxCodeLength() &&
  ------------------
  |  Branch (140:12): [True: 37.5k, False: 8.08k]
  ------------------
  141|  37.5k|           (MaxCodeValue == maxCodeOL[partial.code_len] ||
  ------------------
  |  Branch (141:13): [True: 36.1k, False: 1.39k]
  ------------------
  142|  36.4k|            partial.code > maxCodeOL[partial.code_len])) {
  ------------------
  |  Branch (142:13): [True: 273, False: 1.12k]
  ------------------
  143|  36.4k|      uint32_t temp = bs.getBitsNoFill(1);
  144|  36.4k|      partial.code =
  145|  36.4k|          implicit_cast<typename Traits::CodeTy>((partial.code << 1) | temp);
  146|  36.4k|      partial.code_len++;
  147|  36.4k|    }
  148|       |
  149|       |    // NOTE: when we are called from PrefixCodeLUTDecoder, the partial.code_len
  150|       |    // *could* be larger than the largest code lenght for this huffman table,
  151|       |    // which is a symptom of a corrupt code.
  152|  9.20k|    if (partial.code_len > Base::maxCodeLength() ||
  ------------------
  |  Branch (152:9): [True: 30, False: 9.17k]
  ------------------
  153|  9.17k|        partial.code > maxCodeOL[partial.code_len])
  ------------------
  |  Branch (153:9): [True: 128, False: 9.05k]
  ------------------
  154|  9.20k|      ThrowRDE("bad Huffman code: %u (len: %u)", partial.code,
  ------------------
  |  |   38|    158|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|    158|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|    158|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|    158|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  155|  9.05k|               partial.code_len);
  156|       |
  157|  9.20k|    assert(MaxCodeValue != codeOffsetOL[partial.code_len]);
  ------------------
  |  Branch (157:5): [True: 9.05k, False: 0]
  ------------------
  158|  9.05k|    assert(partial.code >= codeOffsetOL[partial.code_len]);
  ------------------
  |  Branch (158:5): [True: 9.05k, False: 0]
  ------------------
  159|  9.05k|    unsigned codeIndex = partial.code - codeOffsetOL[partial.code_len];
  160|  9.05k|    assert(codeIndex < Base::code.codeValues.size());
  ------------------
  |  Branch (160:5): [True: 9.05k, False: 0]
  ------------------
  161|       |
  162|  9.05k|    typename Traits::CodeValueTy codeValue = Base::code.codeValues[codeIndex];
  163|  9.05k|    return {partial, codeValue};
  164|  9.05k|  }
_ZNK8rawspeed23PrefixCodeLookupDecoderINS_10VC5CodeTagEE26finishReadingPartialSymbolINS_16BitStreamerMSB32EEENSt3__14pairINS_18AbstractPrefixCodeIS1_E10CodeSymbolEiEERT_S9_:
  136|  6.03k|                             typename Base::CodeSymbol partial) const {
  137|  6.03k|    static_assert(
  138|  6.03k|        BitStreamerTraits<BIT_STREAM>::canUseWithPrefixCodeDecoder,
  139|  6.03k|        "This BitStreamer specialization is not marked as usable here");
  140|  37.3k|    while (partial.code_len < Base::maxCodeLength() &&
  ------------------
  |  Branch (140:12): [True: 31.5k, False: 5.77k]
  ------------------
  141|  31.5k|           (MaxCodeValue == maxCodeOL[partial.code_len] ||
  ------------------
  |  Branch (141:13): [True: 30.8k, False: 700]
  ------------------
  142|  31.3k|            partial.code > maxCodeOL[partial.code_len])) {
  ------------------
  |  Branch (142:13): [True: 438, False: 262]
  ------------------
  143|  31.3k|      uint32_t temp = bs.getBitsNoFill(1);
  144|  31.3k|      partial.code =
  145|  31.3k|          implicit_cast<typename Traits::CodeTy>((partial.code << 1) | temp);
  146|  31.3k|      partial.code_len++;
  147|  31.3k|    }
  148|       |
  149|       |    // NOTE: when we are called from PrefixCodeLUTDecoder, the partial.code_len
  150|       |    // *could* be larger than the largest code lenght for this huffman table,
  151|       |    // which is a symptom of a corrupt code.
  152|  6.03k|    if (partial.code_len > Base::maxCodeLength() ||
  ------------------
  |  Branch (152:9): [True: 10, False: 6.02k]
  ------------------
  153|  6.02k|        partial.code > maxCodeOL[partial.code_len])
  ------------------
  |  Branch (153:9): [True: 137, False: 5.88k]
  ------------------
  154|  6.03k|      ThrowRDE("bad Huffman code: %u (len: %u)", partial.code,
  ------------------
  |  |   38|    147|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|    147|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|    147|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|    147|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  155|  5.88k|               partial.code_len);
  156|       |
  157|  6.03k|    assert(MaxCodeValue != codeOffsetOL[partial.code_len]);
  ------------------
  |  Branch (157:5): [True: 5.88k, False: 0]
  ------------------
  158|  5.88k|    assert(partial.code >= codeOffsetOL[partial.code_len]);
  ------------------
  |  Branch (158:5): [True: 5.88k, False: 0]
  ------------------
  159|  5.88k|    unsigned codeIndex = partial.code - codeOffsetOL[partial.code_len];
  160|  5.88k|    assert(codeIndex < Base::code.codeValues.size());
  ------------------
  |  Branch (160:5): [True: 5.88k, False: 0]
  ------------------
  161|       |
  162|  5.88k|    typename Traits::CodeValueTy codeValue = Base::code.codeValues[codeIndex];
  163|  5.88k|    return {partial, codeValue};
  164|  5.88k|  }
_ZNK8rawspeed23PrefixCodeLookupDecoderINS_10VC5CodeTagEE26finishReadingPartialSymbolINS_15BitStreamerJPEGEEENSt3__14pairINS_18AbstractPrefixCodeIS1_E10CodeSymbolEiEERT_S9_:
  136|  2.77k|                             typename Base::CodeSymbol partial) const {
  137|  2.77k|    static_assert(
  138|  2.77k|        BitStreamerTraits<BIT_STREAM>::canUseWithPrefixCodeDecoder,
  139|  2.77k|        "This BitStreamer specialization is not marked as usable here");
  140|  22.7k|    while (partial.code_len < Base::maxCodeLength() &&
  ------------------
  |  Branch (140:12): [True: 20.4k, False: 2.35k]
  ------------------
  141|  20.4k|           (MaxCodeValue == maxCodeOL[partial.code_len] ||
  ------------------
  |  Branch (141:13): [True: 19.5k, False: 859]
  ------------------
  142|  20.0k|            partial.code > maxCodeOL[partial.code_len])) {
  ------------------
  |  Branch (142:13): [True: 439, False: 420]
  ------------------
  143|  20.0k|      uint32_t temp = bs.getBitsNoFill(1);
  144|  20.0k|      partial.code =
  145|  20.0k|          implicit_cast<typename Traits::CodeTy>((partial.code << 1) | temp);
  146|  20.0k|      partial.code_len++;
  147|  20.0k|    }
  148|       |
  149|       |    // NOTE: when we are called from PrefixCodeLUTDecoder, the partial.code_len
  150|       |    // *could* be larger than the largest code lenght for this huffman table,
  151|       |    // which is a symptom of a corrupt code.
  152|  2.77k|    if (partial.code_len > Base::maxCodeLength() ||
  ------------------
  |  Branch (152:9): [True: 9, False: 2.76k]
  ------------------
  153|  2.76k|        partial.code > maxCodeOL[partial.code_len])
  ------------------
  |  Branch (153:9): [True: 135, False: 2.62k]
  ------------------
  154|  2.77k|      ThrowRDE("bad Huffman code: %u (len: %u)", partial.code,
  ------------------
  |  |   38|    144|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|    144|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|    144|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|    144|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  155|  2.62k|               partial.code_len);
  156|       |
  157|  2.77k|    assert(MaxCodeValue != codeOffsetOL[partial.code_len]);
  ------------------
  |  Branch (157:5): [True: 2.62k, False: 0]
  ------------------
  158|  2.62k|    assert(partial.code >= codeOffsetOL[partial.code_len]);
  ------------------
  |  Branch (158:5): [True: 2.62k, False: 0]
  ------------------
  159|  2.62k|    unsigned codeIndex = partial.code - codeOffsetOL[partial.code_len];
  160|  2.62k|    assert(codeIndex < Base::code.codeValues.size());
  ------------------
  |  Branch (160:5): [True: 2.62k, False: 0]
  ------------------
  161|       |
  162|  2.62k|    typename Traits::CodeValueTy codeValue = Base::code.codeValues[codeIndex];
  163|  2.62k|    return {partial, codeValue};
  164|  2.62k|  }

_ZN8rawspeed21PrefixCodeTreeDecoderINS_15BaselineCodeTagEE5setupEbb:
  122|  1.87k|  void setup(bool fullDecode_, bool fixDNGBug16_) {
  123|  1.87k|    AbstractPrefixCodeDecoder<CodeTag>::setup(fullDecode_, fixDNGBug16_);
  124|       |
  125|  1.87k|    assert(Base::code.symbols.size() == Base::code.codeValues.size());
  ------------------
  |  Branch (125:5): [True: 1.87k, False: 0]
  ------------------
  126|  10.2k|    for (unsigned codeIndex = 0; codeIndex != Base::code.symbols.size();
  ------------------
  |  Branch (126:34): [True: 8.35k, False: 1.87k]
  ------------------
  127|  8.35k|         ++codeIndex)
  128|  8.35k|      tree.add(Base::code.symbols[codeIndex], Base::code.codeValues[codeIndex]);
  129|  1.87k|  }
_ZNK8rawspeed21PrefixCodeTreeDecoderINS_15BaselineCodeTagEE6decodeINS_14BitStreamerMSBELb1EEEiRT_:
  153|  10.3M|  int decode(BIT_STREAM& bs) const {
  154|  10.3M|    static_assert(
  155|  10.3M|        BitStreamerTraits<BIT_STREAM>::canUseWithPrefixCodeDecoder,
  156|  10.3M|        "This BitStreamer specialization is not marked as usable here");
  157|  10.3M|    invariant(FULL_DECODE == Base::isFullDecode());
  ------------------
  |  |   27|  10.3M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (157:5): [True: 10.3M, False: 0]
  ------------------
  158|       |
  159|  10.3M|    bs.fill(32);
  160|       |
  161|  10.3M|    typename Base::CodeSymbol symbol;
  162|  10.3M|    typename Traits::CodeValueTy codeValue;
  163|  10.3M|    std::tie(symbol, codeValue) = readSymbol(bs);
  164|       |
  165|  10.3M|    return Base::template processSymbol<BIT_STREAM, FULL_DECODE>(bs, symbol,
  166|  10.3M|                                                                 codeValue);
  167|  10.3M|  }
_ZNK8rawspeed21PrefixCodeTreeDecoderINS_15BaselineCodeTagEE10readSymbolINS_14BitStreamerMSBEEENSt3__14pairINS_18AbstractPrefixCodeIS1_E10CodeSymbolEiEERT_:
  108|  45.3M|  readSymbol(BIT_STREAM& bs) const {
  109|  45.3M|    static_assert(
  110|  45.3M|        BitStreamerTraits<BIT_STREAM>::canUseWithPrefixCodeDecoder,
  111|  45.3M|        "This BitStreamer specialization is not marked as usable here");
  112|       |
  113|       |    // Start from completely unknown symbol.
  114|  45.3M|    typename Base::CodeSymbol partial;
  115|  45.3M|    partial.code_len = 0;
  116|  45.3M|    partial.code = 0;
  117|       |
  118|  45.3M|    return finishReadingPartialSymbol(bs, partial);
  119|  45.3M|  }
_ZNK8rawspeed21PrefixCodeTreeDecoderINS_15BaselineCodeTagEE26finishReadingPartialSymbolINS_14BitStreamerMSBEEENSt3__14pairINS_18AbstractPrefixCodeIS1_E10CodeSymbolEiEERT_S9_:
   52|  45.3M|                             typename Base::CodeSymbol initialPartial) const {
   53|  45.3M|    typename Base::CodeSymbol partial;
   54|  45.3M|    partial.code = 0;
   55|  45.3M|    partial.code_len = 0;
   56|       |
   57|  45.3M|    const auto* top = &(tree.root->getAsBranch());
   58|       |
   59|  45.3M|    auto walkBinaryTree = [&partial, &top](bool bit)
   60|  45.3M|        -> Optional<std::pair<typename Base::CodeSymbol, int /*codeValue*/>> {
   61|  45.3M|      partial.code <<= 1;
   62|  45.3M|      partial.code |= bit;
   63|  45.3M|      partial.code_len++;
   64|       |
   65|       |      // NOTE: The order *IS* important! Left to right, zero to one!
   66|  45.3M|      const auto& newNode = top->buds[bit];
   67|       |
   68|  45.3M|      if (!newNode) {
   69|       |        // Got nothing in this direction.
   70|  45.3M|        ThrowRDE("bad Huffman code: %u (len: %u)", partial.code,
   71|  45.3M|                 partial.code_len);
   72|  45.3M|      }
   73|       |
   74|  45.3M|      if (static_cast<typename decltype(tree)::Node::Type>(*newNode) ==
   75|  45.3M|          decltype(tree)::Node::Type::Leaf) {
   76|       |        // Ok, great, hit a Leaf. This is it.
   77|  45.3M|        return {{partial, newNode->getAsLeaf().value}};
   78|  45.3M|      }
   79|       |
   80|       |      // Else, this is a branch, continue looking.
   81|  45.3M|      top = &(newNode->getAsBranch());
   82|  45.3M|      return std::nullopt;
   83|  45.3M|    };
   84|       |
   85|       |    // First, translate pre-existing code bits.
   86|  45.3M|    for (unsigned bit : initialPartial.getBitsMSB()) {
  ------------------
  |  Branch (86:23): [True: 0, False: 45.3M]
  ------------------
   87|      0|      if (auto sym = walkBinaryTree(bit))
  ------------------
  |  Branch (87:16): [True: 0, False: 0]
  ------------------
   88|      0|        return *sym;
   89|      0|    }
   90|       |
   91|       |    // Read bits until either find the code or detect the incorrect code
   92|  82.8M|    while (true) {
  ------------------
  |  Branch (92:12): [True: 82.8M, Folded]
  ------------------
   93|  82.8M|      invariant(partial.code_len <= Traits::MaxCodeLenghtBits);
  ------------------
  |  |   27|  82.8M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (93:7): [True: 82.8M, False: 0]
  ------------------
   94|       |
   95|       |      // Read one more bit
   96|  82.8M|      const bool bit = bs.getBitsNoFill(1);
   97|       |
   98|  82.8M|      if (auto sym = walkBinaryTree(bit))
  ------------------
  |  Branch (98:16): [True: 45.3M, False: 37.5M]
  ------------------
   99|  45.3M|        return *sym;
  100|  82.8M|    }
  101|       |
  102|       |    // We have either returned the found symbol, or thrown on incorrect symbol.
  103|    229|    __builtin_unreachable();
  104|  45.3M|  }
_ZZNK8rawspeed21PrefixCodeTreeDecoderINS_15BaselineCodeTagEE26finishReadingPartialSymbolINS_14BitStreamerMSBEEENSt3__14pairINS_18AbstractPrefixCodeIS1_E10CodeSymbolEiEERT_S9_ENKUlbE_clEb:
   60|  82.8M|        -> Optional<std::pair<typename Base::CodeSymbol, int /*codeValue*/>> {
   61|  82.8M|      partial.code <<= 1;
   62|  82.8M|      partial.code |= bit;
   63|  82.8M|      partial.code_len++;
   64|       |
   65|       |      // NOTE: The order *IS* important! Left to right, zero to one!
   66|  82.8M|      const auto& newNode = top->buds[bit];
   67|       |
   68|  82.8M|      if (!newNode) {
  ------------------
  |  Branch (68:11): [True: 229, False: 82.8M]
  ------------------
   69|       |        // Got nothing in this direction.
   70|    229|        ThrowRDE("bad Huffman code: %u (len: %u)", partial.code,
  ------------------
  |  |   38|    229|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|    229|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|    229|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|    229|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   71|    229|                 partial.code_len);
   72|    229|      }
   73|       |
   74|  82.8M|      if (static_cast<typename decltype(tree)::Node::Type>(*newNode) ==
  ------------------
  |  Branch (74:11): [True: 45.3M, False: 37.5M]
  ------------------
   75|  82.8M|          decltype(tree)::Node::Type::Leaf) {
   76|       |        // Ok, great, hit a Leaf. This is it.
   77|  45.3M|        return {{partial, newNode->getAsLeaf().value}};
   78|  45.3M|      }
   79|       |
   80|       |      // Else, this is a branch, continue looking.
   81|  37.5M|      top = &(newNode->getAsBranch());
   82|  37.5M|      return std::nullopt;
   83|  82.8M|    };
_ZNK8rawspeed21PrefixCodeTreeDecoderINS_15BaselineCodeTagEE6decodeINS_14BitStreamerMSBELb0EEEiRT_:
  153|  35.0M|  int decode(BIT_STREAM& bs) const {
  154|  35.0M|    static_assert(
  155|  35.0M|        BitStreamerTraits<BIT_STREAM>::canUseWithPrefixCodeDecoder,
  156|  35.0M|        "This BitStreamer specialization is not marked as usable here");
  157|  35.0M|    invariant(FULL_DECODE == Base::isFullDecode());
  ------------------
  |  |   27|  35.0M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (157:5): [True: 35.0M, False: 0]
  ------------------
  158|       |
  159|  35.0M|    bs.fill(32);
  160|       |
  161|  35.0M|    typename Base::CodeSymbol symbol;
  162|  35.0M|    typename Traits::CodeValueTy codeValue;
  163|  35.0M|    std::tie(symbol, codeValue) = readSymbol(bs);
  164|       |
  165|  35.0M|    return Base::template processSymbol<BIT_STREAM, FULL_DECODE>(bs, symbol,
  166|  35.0M|                                                                 codeValue);
  167|  35.0M|  }
_ZNK8rawspeed21PrefixCodeTreeDecoderINS_15BaselineCodeTagEE6decodeINS_16BitStreamerMSB32ELb1EEEiRT_:
  153|  4.76M|  int decode(BIT_STREAM& bs) const {
  154|  4.76M|    static_assert(
  155|  4.76M|        BitStreamerTraits<BIT_STREAM>::canUseWithPrefixCodeDecoder,
  156|  4.76M|        "This BitStreamer specialization is not marked as usable here");
  157|  4.76M|    invariant(FULL_DECODE == Base::isFullDecode());
  ------------------
  |  |   27|  4.76M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (157:5): [True: 4.76M, False: 0]
  ------------------
  158|       |
  159|  4.76M|    bs.fill(32);
  160|       |
  161|  4.76M|    typename Base::CodeSymbol symbol;
  162|  4.76M|    typename Traits::CodeValueTy codeValue;
  163|  4.76M|    std::tie(symbol, codeValue) = readSymbol(bs);
  164|       |
  165|  4.76M|    return Base::template processSymbol<BIT_STREAM, FULL_DECODE>(bs, symbol,
  166|  4.76M|                                                                 codeValue);
  167|  4.76M|  }
_ZNK8rawspeed21PrefixCodeTreeDecoderINS_15BaselineCodeTagEE10readSymbolINS_16BitStreamerMSB32EEENSt3__14pairINS_18AbstractPrefixCodeIS1_E10CodeSymbolEiEERT_:
  108|  41.7M|  readSymbol(BIT_STREAM& bs) const {
  109|  41.7M|    static_assert(
  110|  41.7M|        BitStreamerTraits<BIT_STREAM>::canUseWithPrefixCodeDecoder,
  111|  41.7M|        "This BitStreamer specialization is not marked as usable here");
  112|       |
  113|       |    // Start from completely unknown symbol.
  114|  41.7M|    typename Base::CodeSymbol partial;
  115|  41.7M|    partial.code_len = 0;
  116|  41.7M|    partial.code = 0;
  117|       |
  118|  41.7M|    return finishReadingPartialSymbol(bs, partial);
  119|  41.7M|  }
_ZNK8rawspeed21PrefixCodeTreeDecoderINS_15BaselineCodeTagEE26finishReadingPartialSymbolINS_16BitStreamerMSB32EEENSt3__14pairINS_18AbstractPrefixCodeIS1_E10CodeSymbolEiEERT_S9_:
   52|  41.7M|                             typename Base::CodeSymbol initialPartial) const {
   53|  41.7M|    typename Base::CodeSymbol partial;
   54|  41.7M|    partial.code = 0;
   55|  41.7M|    partial.code_len = 0;
   56|       |
   57|  41.7M|    const auto* top = &(tree.root->getAsBranch());
   58|       |
   59|  41.7M|    auto walkBinaryTree = [&partial, &top](bool bit)
   60|  41.7M|        -> Optional<std::pair<typename Base::CodeSymbol, int /*codeValue*/>> {
   61|  41.7M|      partial.code <<= 1;
   62|  41.7M|      partial.code |= bit;
   63|  41.7M|      partial.code_len++;
   64|       |
   65|       |      // NOTE: The order *IS* important! Left to right, zero to one!
   66|  41.7M|      const auto& newNode = top->buds[bit];
   67|       |
   68|  41.7M|      if (!newNode) {
   69|       |        // Got nothing in this direction.
   70|  41.7M|        ThrowRDE("bad Huffman code: %u (len: %u)", partial.code,
   71|  41.7M|                 partial.code_len);
   72|  41.7M|      }
   73|       |
   74|  41.7M|      if (static_cast<typename decltype(tree)::Node::Type>(*newNode) ==
   75|  41.7M|          decltype(tree)::Node::Type::Leaf) {
   76|       |        // Ok, great, hit a Leaf. This is it.
   77|  41.7M|        return {{partial, newNode->getAsLeaf().value}};
   78|  41.7M|      }
   79|       |
   80|       |      // Else, this is a branch, continue looking.
   81|  41.7M|      top = &(newNode->getAsBranch());
   82|  41.7M|      return std::nullopt;
   83|  41.7M|    };
   84|       |
   85|       |    // First, translate pre-existing code bits.
   86|  41.7M|    for (unsigned bit : initialPartial.getBitsMSB()) {
  ------------------
  |  Branch (86:23): [True: 0, False: 41.7M]
  ------------------
   87|      0|      if (auto sym = walkBinaryTree(bit))
  ------------------
  |  Branch (87:16): [True: 0, False: 0]
  ------------------
   88|      0|        return *sym;
   89|      0|    }
   90|       |
   91|       |    // Read bits until either find the code or detect the incorrect code
   92|  55.0M|    while (true) {
  ------------------
  |  Branch (92:12): [True: 55.0M, Folded]
  ------------------
   93|  55.0M|      invariant(partial.code_len <= Traits::MaxCodeLenghtBits);
  ------------------
  |  |   27|  55.0M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (93:7): [True: 55.0M, False: 0]
  ------------------
   94|       |
   95|       |      // Read one more bit
   96|  55.0M|      const bool bit = bs.getBitsNoFill(1);
   97|       |
   98|  55.0M|      if (auto sym = walkBinaryTree(bit))
  ------------------
  |  Branch (98:16): [True: 41.7M, False: 13.3M]
  ------------------
   99|  41.7M|        return *sym;
  100|  55.0M|    }
  101|       |
  102|       |    // We have either returned the found symbol, or thrown on incorrect symbol.
  103|    206|    __builtin_unreachable();
  104|  41.7M|  }
_ZZNK8rawspeed21PrefixCodeTreeDecoderINS_15BaselineCodeTagEE26finishReadingPartialSymbolINS_16BitStreamerMSB32EEENSt3__14pairINS_18AbstractPrefixCodeIS1_E10CodeSymbolEiEERT_S9_ENKUlbE_clEb:
   60|  55.0M|        -> Optional<std::pair<typename Base::CodeSymbol, int /*codeValue*/>> {
   61|  55.0M|      partial.code <<= 1;
   62|  55.0M|      partial.code |= bit;
   63|  55.0M|      partial.code_len++;
   64|       |
   65|       |      // NOTE: The order *IS* important! Left to right, zero to one!
   66|  55.0M|      const auto& newNode = top->buds[bit];
   67|       |
   68|  55.0M|      if (!newNode) {
  ------------------
  |  Branch (68:11): [True: 206, False: 55.0M]
  ------------------
   69|       |        // Got nothing in this direction.
   70|    206|        ThrowRDE("bad Huffman code: %u (len: %u)", partial.code,
  ------------------
  |  |   38|    206|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|    206|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|    206|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|    206|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   71|    206|                 partial.code_len);
   72|    206|      }
   73|       |
   74|  55.0M|      if (static_cast<typename decltype(tree)::Node::Type>(*newNode) ==
  ------------------
  |  Branch (74:11): [True: 41.7M, False: 13.3M]
  ------------------
   75|  55.0M|          decltype(tree)::Node::Type::Leaf) {
   76|       |        // Ok, great, hit a Leaf. This is it.
   77|  41.7M|        return {{partial, newNode->getAsLeaf().value}};
   78|  41.7M|      }
   79|       |
   80|       |      // Else, this is a branch, continue looking.
   81|  13.3M|      top = &(newNode->getAsBranch());
   82|  13.3M|      return std::nullopt;
   83|  55.0M|    };
_ZNK8rawspeed21PrefixCodeTreeDecoderINS_15BaselineCodeTagEE6decodeINS_16BitStreamerMSB32ELb0EEEiRT_:
  153|  36.9M|  int decode(BIT_STREAM& bs) const {
  154|  36.9M|    static_assert(
  155|  36.9M|        BitStreamerTraits<BIT_STREAM>::canUseWithPrefixCodeDecoder,
  156|  36.9M|        "This BitStreamer specialization is not marked as usable here");
  157|  36.9M|    invariant(FULL_DECODE == Base::isFullDecode());
  ------------------
  |  |   27|  36.9M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (157:5): [True: 36.9M, False: 0]
  ------------------
  158|       |
  159|  36.9M|    bs.fill(32);
  160|       |
  161|  36.9M|    typename Base::CodeSymbol symbol;
  162|  36.9M|    typename Traits::CodeValueTy codeValue;
  163|  36.9M|    std::tie(symbol, codeValue) = readSymbol(bs);
  164|       |
  165|  36.9M|    return Base::template processSymbol<BIT_STREAM, FULL_DECODE>(bs, symbol,
  166|  36.9M|                                                                 codeValue);
  167|  36.9M|  }
_ZNK8rawspeed21PrefixCodeTreeDecoderINS_15BaselineCodeTagEE6decodeINS_15BitStreamerJPEGELb1EEEiRT_:
  153|  4.66M|  int decode(BIT_STREAM& bs) const {
  154|  4.66M|    static_assert(
  155|  4.66M|        BitStreamerTraits<BIT_STREAM>::canUseWithPrefixCodeDecoder,
  156|  4.66M|        "This BitStreamer specialization is not marked as usable here");
  157|  4.66M|    invariant(FULL_DECODE == Base::isFullDecode());
  ------------------
  |  |   27|  4.66M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (157:5): [True: 4.66M, False: 0]
  ------------------
  158|       |
  159|  4.66M|    bs.fill(32);
  160|       |
  161|  4.66M|    typename Base::CodeSymbol symbol;
  162|  4.66M|    typename Traits::CodeValueTy codeValue;
  163|  4.66M|    std::tie(symbol, codeValue) = readSymbol(bs);
  164|       |
  165|  4.66M|    return Base::template processSymbol<BIT_STREAM, FULL_DECODE>(bs, symbol,
  166|  4.66M|                                                                 codeValue);
  167|  4.66M|  }
_ZNK8rawspeed21PrefixCodeTreeDecoderINS_15BaselineCodeTagEE10readSymbolINS_15BitStreamerJPEGEEENSt3__14pairINS_18AbstractPrefixCodeIS1_E10CodeSymbolEiEERT_:
  108|  17.0M|  readSymbol(BIT_STREAM& bs) const {
  109|  17.0M|    static_assert(
  110|  17.0M|        BitStreamerTraits<BIT_STREAM>::canUseWithPrefixCodeDecoder,
  111|  17.0M|        "This BitStreamer specialization is not marked as usable here");
  112|       |
  113|       |    // Start from completely unknown symbol.
  114|  17.0M|    typename Base::CodeSymbol partial;
  115|  17.0M|    partial.code_len = 0;
  116|  17.0M|    partial.code = 0;
  117|       |
  118|  17.0M|    return finishReadingPartialSymbol(bs, partial);
  119|  17.0M|  }
_ZNK8rawspeed21PrefixCodeTreeDecoderINS_15BaselineCodeTagEE26finishReadingPartialSymbolINS_15BitStreamerJPEGEEENSt3__14pairINS_18AbstractPrefixCodeIS1_E10CodeSymbolEiEERT_S9_:
   52|  17.0M|                             typename Base::CodeSymbol initialPartial) const {
   53|  17.0M|    typename Base::CodeSymbol partial;
   54|  17.0M|    partial.code = 0;
   55|  17.0M|    partial.code_len = 0;
   56|       |
   57|  17.0M|    const auto* top = &(tree.root->getAsBranch());
   58|       |
   59|  17.0M|    auto walkBinaryTree = [&partial, &top](bool bit)
   60|  17.0M|        -> Optional<std::pair<typename Base::CodeSymbol, int /*codeValue*/>> {
   61|  17.0M|      partial.code <<= 1;
   62|  17.0M|      partial.code |= bit;
   63|  17.0M|      partial.code_len++;
   64|       |
   65|       |      // NOTE: The order *IS* important! Left to right, zero to one!
   66|  17.0M|      const auto& newNode = top->buds[bit];
   67|       |
   68|  17.0M|      if (!newNode) {
   69|       |        // Got nothing in this direction.
   70|  17.0M|        ThrowRDE("bad Huffman code: %u (len: %u)", partial.code,
   71|  17.0M|                 partial.code_len);
   72|  17.0M|      }
   73|       |
   74|  17.0M|      if (static_cast<typename decltype(tree)::Node::Type>(*newNode) ==
   75|  17.0M|          decltype(tree)::Node::Type::Leaf) {
   76|       |        // Ok, great, hit a Leaf. This is it.
   77|  17.0M|        return {{partial, newNode->getAsLeaf().value}};
   78|  17.0M|      }
   79|       |
   80|       |      // Else, this is a branch, continue looking.
   81|  17.0M|      top = &(newNode->getAsBranch());
   82|  17.0M|      return std::nullopt;
   83|  17.0M|    };
   84|       |
   85|       |    // First, translate pre-existing code bits.
   86|  17.0M|    for (unsigned bit : initialPartial.getBitsMSB()) {
  ------------------
  |  Branch (86:23): [True: 0, False: 17.0M]
  ------------------
   87|      0|      if (auto sym = walkBinaryTree(bit))
  ------------------
  |  Branch (87:16): [True: 0, False: 0]
  ------------------
   88|      0|        return *sym;
   89|      0|    }
   90|       |
   91|       |    // Read bits until either find the code or detect the incorrect code
   92|  17.1M|    while (true) {
  ------------------
  |  Branch (92:12): [True: 17.1M, Folded]
  ------------------
   93|  17.1M|      invariant(partial.code_len <= Traits::MaxCodeLenghtBits);
  ------------------
  |  |   27|  17.1M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (93:7): [True: 17.1M, False: 0]
  ------------------
   94|       |
   95|       |      // Read one more bit
   96|  17.1M|      const bool bit = bs.getBitsNoFill(1);
   97|       |
   98|  17.1M|      if (auto sym = walkBinaryTree(bit))
  ------------------
  |  Branch (98:16): [True: 17.0M, False: 53.1k]
  ------------------
   99|  17.0M|        return *sym;
  100|  17.1M|    }
  101|       |
  102|       |    // We have either returned the found symbol, or thrown on incorrect symbol.
  103|    218|    __builtin_unreachable();
  104|  17.0M|  }
_ZZNK8rawspeed21PrefixCodeTreeDecoderINS_15BaselineCodeTagEE26finishReadingPartialSymbolINS_15BitStreamerJPEGEEENSt3__14pairINS_18AbstractPrefixCodeIS1_E10CodeSymbolEiEERT_S9_ENKUlbE_clEb:
   60|  17.1M|        -> Optional<std::pair<typename Base::CodeSymbol, int /*codeValue*/>> {
   61|  17.1M|      partial.code <<= 1;
   62|  17.1M|      partial.code |= bit;
   63|  17.1M|      partial.code_len++;
   64|       |
   65|       |      // NOTE: The order *IS* important! Left to right, zero to one!
   66|  17.1M|      const auto& newNode = top->buds[bit];
   67|       |
   68|  17.1M|      if (!newNode) {
  ------------------
  |  Branch (68:11): [True: 218, False: 17.1M]
  ------------------
   69|       |        // Got nothing in this direction.
   70|    218|        ThrowRDE("bad Huffman code: %u (len: %u)", partial.code,
  ------------------
  |  |   38|    218|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|    218|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|    218|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|    218|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   71|    218|                 partial.code_len);
   72|    218|      }
   73|       |
   74|  17.1M|      if (static_cast<typename decltype(tree)::Node::Type>(*newNode) ==
  ------------------
  |  Branch (74:11): [True: 17.0M, False: 52.9k]
  ------------------
   75|  17.1M|          decltype(tree)::Node::Type::Leaf) {
   76|       |        // Ok, great, hit a Leaf. This is it.
   77|  17.0M|        return {{partial, newNode->getAsLeaf().value}};
   78|  17.0M|      }
   79|       |
   80|       |      // Else, this is a branch, continue looking.
   81|  52.9k|      top = &(newNode->getAsBranch());
   82|  52.9k|      return std::nullopt;
   83|  17.1M|    };
_ZNK8rawspeed21PrefixCodeTreeDecoderINS_15BaselineCodeTagEE6decodeINS_15BitStreamerJPEGELb0EEEiRT_:
  153|  12.4M|  int decode(BIT_STREAM& bs) const {
  154|  12.4M|    static_assert(
  155|  12.4M|        BitStreamerTraits<BIT_STREAM>::canUseWithPrefixCodeDecoder,
  156|  12.4M|        "This BitStreamer specialization is not marked as usable here");
  157|  12.4M|    invariant(FULL_DECODE == Base::isFullDecode());
  ------------------
  |  |   27|  12.4M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (157:5): [True: 12.4M, False: 0]
  ------------------
  158|       |
  159|  12.4M|    bs.fill(32);
  160|       |
  161|  12.4M|    typename Base::CodeSymbol symbol;
  162|  12.4M|    typename Traits::CodeValueTy codeValue;
  163|  12.4M|    std::tie(symbol, codeValue) = readSymbol(bs);
  164|       |
  165|  12.4M|    return Base::template processSymbol<BIT_STREAM, FULL_DECODE>(bs, symbol,
  166|  12.4M|                                                                 codeValue);
  167|  12.4M|  }
_ZN8rawspeed21PrefixCodeTreeDecoderINS_10VC5CodeTagEE5setupEbb:
  122|    871|  void setup(bool fullDecode_, bool fixDNGBug16_) {
  123|    871|    AbstractPrefixCodeDecoder<CodeTag>::setup(fullDecode_, fixDNGBug16_);
  124|       |
  125|    871|    assert(Base::code.symbols.size() == Base::code.codeValues.size());
  ------------------
  |  Branch (125:5): [True: 871, False: 0]
  ------------------
  126|  11.3k|    for (unsigned codeIndex = 0; codeIndex != Base::code.symbols.size();
  ------------------
  |  Branch (126:34): [True: 10.4k, False: 871]
  ------------------
  127|  10.4k|         ++codeIndex)
  128|  10.4k|      tree.add(Base::code.symbols[codeIndex], Base::code.codeValues[codeIndex]);
  129|    871|  }
_ZNK8rawspeed21PrefixCodeTreeDecoderINS_10VC5CodeTagEE10readSymbolINS_14BitStreamerMSBEEENSt3__14pairINS_18AbstractPrefixCodeIS1_E10CodeSymbolEiEERT_:
  108|  29.7M|  readSymbol(BIT_STREAM& bs) const {
  109|  29.7M|    static_assert(
  110|  29.7M|        BitStreamerTraits<BIT_STREAM>::canUseWithPrefixCodeDecoder,
  111|  29.7M|        "This BitStreamer specialization is not marked as usable here");
  112|       |
  113|       |    // Start from completely unknown symbol.
  114|  29.7M|    typename Base::CodeSymbol partial;
  115|  29.7M|    partial.code_len = 0;
  116|  29.7M|    partial.code = 0;
  117|       |
  118|  29.7M|    return finishReadingPartialSymbol(bs, partial);
  119|  29.7M|  }
_ZNK8rawspeed21PrefixCodeTreeDecoderINS_10VC5CodeTagEE26finishReadingPartialSymbolINS_14BitStreamerMSBEEENSt3__14pairINS_18AbstractPrefixCodeIS1_E10CodeSymbolEiEERT_S9_:
   52|  29.7M|                             typename Base::CodeSymbol initialPartial) const {
   53|  29.7M|    typename Base::CodeSymbol partial;
   54|  29.7M|    partial.code = 0;
   55|  29.7M|    partial.code_len = 0;
   56|       |
   57|  29.7M|    const auto* top = &(tree.root->getAsBranch());
   58|       |
   59|  29.7M|    auto walkBinaryTree = [&partial, &top](bool bit)
   60|  29.7M|        -> Optional<std::pair<typename Base::CodeSymbol, int /*codeValue*/>> {
   61|  29.7M|      partial.code <<= 1;
   62|  29.7M|      partial.code |= bit;
   63|  29.7M|      partial.code_len++;
   64|       |
   65|       |      // NOTE: The order *IS* important! Left to right, zero to one!
   66|  29.7M|      const auto& newNode = top->buds[bit];
   67|       |
   68|  29.7M|      if (!newNode) {
   69|       |        // Got nothing in this direction.
   70|  29.7M|        ThrowRDE("bad Huffman code: %u (len: %u)", partial.code,
   71|  29.7M|                 partial.code_len);
   72|  29.7M|      }
   73|       |
   74|  29.7M|      if (static_cast<typename decltype(tree)::Node::Type>(*newNode) ==
   75|  29.7M|          decltype(tree)::Node::Type::Leaf) {
   76|       |        // Ok, great, hit a Leaf. This is it.
   77|  29.7M|        return {{partial, newNode->getAsLeaf().value}};
   78|  29.7M|      }
   79|       |
   80|       |      // Else, this is a branch, continue looking.
   81|  29.7M|      top = &(newNode->getAsBranch());
   82|  29.7M|      return std::nullopt;
   83|  29.7M|    };
   84|       |
   85|       |    // First, translate pre-existing code bits.
   86|  29.7M|    for (unsigned bit : initialPartial.getBitsMSB()) {
  ------------------
  |  Branch (86:23): [True: 0, False: 29.7M]
  ------------------
   87|      0|      if (auto sym = walkBinaryTree(bit))
  ------------------
  |  Branch (87:16): [True: 0, False: 0]
  ------------------
   88|      0|        return *sym;
   89|      0|    }
   90|       |
   91|       |    // Read bits until either find the code or detect the incorrect code
   92|  43.3M|    while (true) {
  ------------------
  |  Branch (92:12): [True: 43.3M, Folded]
  ------------------
   93|  43.3M|      invariant(partial.code_len <= Traits::MaxCodeLenghtBits);
  ------------------
  |  |   27|  43.3M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (93:7): [True: 43.3M, False: 0]
  ------------------
   94|       |
   95|       |      // Read one more bit
   96|  43.3M|      const bool bit = bs.getBitsNoFill(1);
   97|       |
   98|  43.3M|      if (auto sym = walkBinaryTree(bit))
  ------------------
  |  Branch (98:16): [True: 29.7M, False: 13.5M]
  ------------------
   99|  29.7M|        return *sym;
  100|  43.3M|    }
  101|       |
  102|       |    // We have either returned the found symbol, or thrown on incorrect symbol.
  103|    158|    __builtin_unreachable();
  104|  29.7M|  }
_ZZNK8rawspeed21PrefixCodeTreeDecoderINS_10VC5CodeTagEE26finishReadingPartialSymbolINS_14BitStreamerMSBEEENSt3__14pairINS_18AbstractPrefixCodeIS1_E10CodeSymbolEiEERT_S9_ENKUlbE_clEb:
   60|  43.3M|        -> Optional<std::pair<typename Base::CodeSymbol, int /*codeValue*/>> {
   61|  43.3M|      partial.code <<= 1;
   62|  43.3M|      partial.code |= bit;
   63|  43.3M|      partial.code_len++;
   64|       |
   65|       |      // NOTE: The order *IS* important! Left to right, zero to one!
   66|  43.3M|      const auto& newNode = top->buds[bit];
   67|       |
   68|  43.3M|      if (!newNode) {
  ------------------
  |  Branch (68:11): [True: 158, False: 43.3M]
  ------------------
   69|       |        // Got nothing in this direction.
   70|    158|        ThrowRDE("bad Huffman code: %u (len: %u)", partial.code,
  ------------------
  |  |   38|    158|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|    158|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|    158|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|    158|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   71|    158|                 partial.code_len);
   72|    158|      }
   73|       |
   74|  43.3M|      if (static_cast<typename decltype(tree)::Node::Type>(*newNode) ==
  ------------------
  |  Branch (74:11): [True: 29.7M, False: 13.5M]
  ------------------
   75|  43.3M|          decltype(tree)::Node::Type::Leaf) {
   76|       |        // Ok, great, hit a Leaf. This is it.
   77|  29.7M|        return {{partial, newNode->getAsLeaf().value}};
   78|  29.7M|      }
   79|       |
   80|       |      // Else, this is a branch, continue looking.
   81|  13.5M|      top = &(newNode->getAsBranch());
   82|  13.5M|      return std::nullopt;
   83|  43.3M|    };
_ZNK8rawspeed21PrefixCodeTreeDecoderINS_10VC5CodeTagEE6decodeINS_14BitStreamerMSBELb0EEEiRT_:
  153|  29.7M|  int decode(BIT_STREAM& bs) const {
  154|  29.7M|    static_assert(
  155|  29.7M|        BitStreamerTraits<BIT_STREAM>::canUseWithPrefixCodeDecoder,
  156|  29.7M|        "This BitStreamer specialization is not marked as usable here");
  157|  29.7M|    invariant(FULL_DECODE == Base::isFullDecode());
  ------------------
  |  |   27|  29.7M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (157:5): [True: 29.7M, False: 0]
  ------------------
  158|       |
  159|  29.7M|    bs.fill(32);
  160|       |
  161|  29.7M|    typename Base::CodeSymbol symbol;
  162|  29.7M|    typename Traits::CodeValueTy codeValue;
  163|  29.7M|    std::tie(symbol, codeValue) = readSymbol(bs);
  164|       |
  165|  29.7M|    return Base::template processSymbol<BIT_STREAM, FULL_DECODE>(bs, symbol,
  166|  29.7M|                                                                 codeValue);
  167|  29.7M|  }
_ZNK8rawspeed21PrefixCodeTreeDecoderINS_10VC5CodeTagEE10readSymbolINS_16BitStreamerMSB32EEENSt3__14pairINS_18AbstractPrefixCodeIS1_E10CodeSymbolEiEERT_:
  108|  36.5M|  readSymbol(BIT_STREAM& bs) const {
  109|  36.5M|    static_assert(
  110|  36.5M|        BitStreamerTraits<BIT_STREAM>::canUseWithPrefixCodeDecoder,
  111|  36.5M|        "This BitStreamer specialization is not marked as usable here");
  112|       |
  113|       |    // Start from completely unknown symbol.
  114|  36.5M|    typename Base::CodeSymbol partial;
  115|  36.5M|    partial.code_len = 0;
  116|  36.5M|    partial.code = 0;
  117|       |
  118|  36.5M|    return finishReadingPartialSymbol(bs, partial);
  119|  36.5M|  }
_ZNK8rawspeed21PrefixCodeTreeDecoderINS_10VC5CodeTagEE26finishReadingPartialSymbolINS_16BitStreamerMSB32EEENSt3__14pairINS_18AbstractPrefixCodeIS1_E10CodeSymbolEiEERT_S9_:
   52|  36.5M|                             typename Base::CodeSymbol initialPartial) const {
   53|  36.5M|    typename Base::CodeSymbol partial;
   54|  36.5M|    partial.code = 0;
   55|  36.5M|    partial.code_len = 0;
   56|       |
   57|  36.5M|    const auto* top = &(tree.root->getAsBranch());
   58|       |
   59|  36.5M|    auto walkBinaryTree = [&partial, &top](bool bit)
   60|  36.5M|        -> Optional<std::pair<typename Base::CodeSymbol, int /*codeValue*/>> {
   61|  36.5M|      partial.code <<= 1;
   62|  36.5M|      partial.code |= bit;
   63|  36.5M|      partial.code_len++;
   64|       |
   65|       |      // NOTE: The order *IS* important! Left to right, zero to one!
   66|  36.5M|      const auto& newNode = top->buds[bit];
   67|       |
   68|  36.5M|      if (!newNode) {
   69|       |        // Got nothing in this direction.
   70|  36.5M|        ThrowRDE("bad Huffman code: %u (len: %u)", partial.code,
   71|  36.5M|                 partial.code_len);
   72|  36.5M|      }
   73|       |
   74|  36.5M|      if (static_cast<typename decltype(tree)::Node::Type>(*newNode) ==
   75|  36.5M|          decltype(tree)::Node::Type::Leaf) {
   76|       |        // Ok, great, hit a Leaf. This is it.
   77|  36.5M|        return {{partial, newNode->getAsLeaf().value}};
   78|  36.5M|      }
   79|       |
   80|       |      // Else, this is a branch, continue looking.
   81|  36.5M|      top = &(newNode->getAsBranch());
   82|  36.5M|      return std::nullopt;
   83|  36.5M|    };
   84|       |
   85|       |    // First, translate pre-existing code bits.
   86|  36.5M|    for (unsigned bit : initialPartial.getBitsMSB()) {
  ------------------
  |  Branch (86:23): [True: 0, False: 36.5M]
  ------------------
   87|      0|      if (auto sym = walkBinaryTree(bit))
  ------------------
  |  Branch (87:16): [True: 0, False: 0]
  ------------------
   88|      0|        return *sym;
   89|      0|    }
   90|       |
   91|       |    // Read bits until either find the code or detect the incorrect code
   92|  36.6M|    while (true) {
  ------------------
  |  Branch (92:12): [True: 36.6M, Folded]
  ------------------
   93|  36.6M|      invariant(partial.code_len <= Traits::MaxCodeLenghtBits);
  ------------------
  |  |   27|  36.6M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (93:7): [True: 36.6M, False: 0]
  ------------------
   94|       |
   95|       |      // Read one more bit
   96|  36.6M|      const bool bit = bs.getBitsNoFill(1);
   97|       |
   98|  36.6M|      if (auto sym = walkBinaryTree(bit))
  ------------------
  |  Branch (98:16): [True: 36.5M, False: 93.0k]
  ------------------
   99|  36.5M|        return *sym;
  100|  36.6M|    }
  101|       |
  102|       |    // We have either returned the found symbol, or thrown on incorrect symbol.
  103|    147|    __builtin_unreachable();
  104|  36.5M|  }
_ZZNK8rawspeed21PrefixCodeTreeDecoderINS_10VC5CodeTagEE26finishReadingPartialSymbolINS_16BitStreamerMSB32EEENSt3__14pairINS_18AbstractPrefixCodeIS1_E10CodeSymbolEiEERT_S9_ENKUlbE_clEb:
   60|  36.6M|        -> Optional<std::pair<typename Base::CodeSymbol, int /*codeValue*/>> {
   61|  36.6M|      partial.code <<= 1;
   62|  36.6M|      partial.code |= bit;
   63|  36.6M|      partial.code_len++;
   64|       |
   65|       |      // NOTE: The order *IS* important! Left to right, zero to one!
   66|  36.6M|      const auto& newNode = top->buds[bit];
   67|       |
   68|  36.6M|      if (!newNode) {
  ------------------
  |  Branch (68:11): [True: 147, False: 36.6M]
  ------------------
   69|       |        // Got nothing in this direction.
   70|    147|        ThrowRDE("bad Huffman code: %u (len: %u)", partial.code,
  ------------------
  |  |   38|    147|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|    147|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|    147|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|    147|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   71|    147|                 partial.code_len);
   72|    147|      }
   73|       |
   74|  36.6M|      if (static_cast<typename decltype(tree)::Node::Type>(*newNode) ==
  ------------------
  |  Branch (74:11): [True: 36.5M, False: 92.8k]
  ------------------
   75|  36.6M|          decltype(tree)::Node::Type::Leaf) {
   76|       |        // Ok, great, hit a Leaf. This is it.
   77|  36.5M|        return {{partial, newNode->getAsLeaf().value}};
   78|  36.5M|      }
   79|       |
   80|       |      // Else, this is a branch, continue looking.
   81|  92.8k|      top = &(newNode->getAsBranch());
   82|  92.8k|      return std::nullopt;
   83|  36.6M|    };
_ZNK8rawspeed21PrefixCodeTreeDecoderINS_10VC5CodeTagEE6decodeINS_16BitStreamerMSB32ELb0EEEiRT_:
  153|  36.5M|  int decode(BIT_STREAM& bs) const {
  154|  36.5M|    static_assert(
  155|  36.5M|        BitStreamerTraits<BIT_STREAM>::canUseWithPrefixCodeDecoder,
  156|  36.5M|        "This BitStreamer specialization is not marked as usable here");
  157|  36.5M|    invariant(FULL_DECODE == Base::isFullDecode());
  ------------------
  |  |   27|  36.5M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (157:5): [True: 36.5M, False: 0]
  ------------------
  158|       |
  159|  36.5M|    bs.fill(32);
  160|       |
  161|  36.5M|    typename Base::CodeSymbol symbol;
  162|  36.5M|    typename Traits::CodeValueTy codeValue;
  163|  36.5M|    std::tie(symbol, codeValue) = readSymbol(bs);
  164|       |
  165|  36.5M|    return Base::template processSymbol<BIT_STREAM, FULL_DECODE>(bs, symbol,
  166|  36.5M|                                                                 codeValue);
  167|  36.5M|  }
_ZNK8rawspeed21PrefixCodeTreeDecoderINS_10VC5CodeTagEE10readSymbolINS_15BitStreamerJPEGEEENSt3__14pairINS_18AbstractPrefixCodeIS1_E10CodeSymbolEiEERT_:
  108|  41.5k|  readSymbol(BIT_STREAM& bs) const {
  109|  41.5k|    static_assert(
  110|  41.5k|        BitStreamerTraits<BIT_STREAM>::canUseWithPrefixCodeDecoder,
  111|  41.5k|        "This BitStreamer specialization is not marked as usable here");
  112|       |
  113|       |    // Start from completely unknown symbol.
  114|  41.5k|    typename Base::CodeSymbol partial;
  115|  41.5k|    partial.code_len = 0;
  116|  41.5k|    partial.code = 0;
  117|       |
  118|  41.5k|    return finishReadingPartialSymbol(bs, partial);
  119|  41.5k|  }
_ZNK8rawspeed21PrefixCodeTreeDecoderINS_10VC5CodeTagEE26finishReadingPartialSymbolINS_15BitStreamerJPEGEEENSt3__14pairINS_18AbstractPrefixCodeIS1_E10CodeSymbolEiEERT_S9_:
   52|  41.5k|                             typename Base::CodeSymbol initialPartial) const {
   53|  41.5k|    typename Base::CodeSymbol partial;
   54|  41.5k|    partial.code = 0;
   55|  41.5k|    partial.code_len = 0;
   56|       |
   57|  41.5k|    const auto* top = &(tree.root->getAsBranch());
   58|       |
   59|  41.5k|    auto walkBinaryTree = [&partial, &top](bool bit)
   60|  41.5k|        -> Optional<std::pair<typename Base::CodeSymbol, int /*codeValue*/>> {
   61|  41.5k|      partial.code <<= 1;
   62|  41.5k|      partial.code |= bit;
   63|  41.5k|      partial.code_len++;
   64|       |
   65|       |      // NOTE: The order *IS* important! Left to right, zero to one!
   66|  41.5k|      const auto& newNode = top->buds[bit];
   67|       |
   68|  41.5k|      if (!newNode) {
   69|       |        // Got nothing in this direction.
   70|  41.5k|        ThrowRDE("bad Huffman code: %u (len: %u)", partial.code,
   71|  41.5k|                 partial.code_len);
   72|  41.5k|      }
   73|       |
   74|  41.5k|      if (static_cast<typename decltype(tree)::Node::Type>(*newNode) ==
   75|  41.5k|          decltype(tree)::Node::Type::Leaf) {
   76|       |        // Ok, great, hit a Leaf. This is it.
   77|  41.5k|        return {{partial, newNode->getAsLeaf().value}};
   78|  41.5k|      }
   79|       |
   80|       |      // Else, this is a branch, continue looking.
   81|  41.5k|      top = &(newNode->getAsBranch());
   82|  41.5k|      return std::nullopt;
   83|  41.5k|    };
   84|       |
   85|       |    // First, translate pre-existing code bits.
   86|  41.5k|    for (unsigned bit : initialPartial.getBitsMSB()) {
  ------------------
  |  Branch (86:23): [True: 0, False: 41.5k]
  ------------------
   87|      0|      if (auto sym = walkBinaryTree(bit))
  ------------------
  |  Branch (87:16): [True: 0, False: 0]
  ------------------
   88|      0|        return *sym;
   89|      0|    }
   90|       |
   91|       |    // Read bits until either find the code or detect the incorrect code
   92|   126k|    while (true) {
  ------------------
  |  Branch (92:12): [True: 126k, Folded]
  ------------------
   93|   126k|      invariant(partial.code_len <= Traits::MaxCodeLenghtBits);
  ------------------
  |  |   27|   126k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (93:7): [True: 126k, False: 0]
  ------------------
   94|       |
   95|       |      // Read one more bit
   96|   126k|      const bool bit = bs.getBitsNoFill(1);
   97|       |
   98|   126k|      if (auto sym = walkBinaryTree(bit))
  ------------------
  |  Branch (98:16): [True: 41.3k, False: 84.7k]
  ------------------
   99|  41.3k|        return *sym;
  100|   126k|    }
  101|       |
  102|       |    // We have either returned the found symbol, or thrown on incorrect symbol.
  103|    144|    __builtin_unreachable();
  104|  41.5k|  }
_ZZNK8rawspeed21PrefixCodeTreeDecoderINS_10VC5CodeTagEE26finishReadingPartialSymbolINS_15BitStreamerJPEGEEENSt3__14pairINS_18AbstractPrefixCodeIS1_E10CodeSymbolEiEERT_S9_ENKUlbE_clEb:
   60|   126k|        -> Optional<std::pair<typename Base::CodeSymbol, int /*codeValue*/>> {
   61|   126k|      partial.code <<= 1;
   62|   126k|      partial.code |= bit;
   63|   126k|      partial.code_len++;
   64|       |
   65|       |      // NOTE: The order *IS* important! Left to right, zero to one!
   66|   126k|      const auto& newNode = top->buds[bit];
   67|       |
   68|   126k|      if (!newNode) {
  ------------------
  |  Branch (68:11): [True: 144, False: 125k]
  ------------------
   69|       |        // Got nothing in this direction.
   70|    144|        ThrowRDE("bad Huffman code: %u (len: %u)", partial.code,
  ------------------
  |  |   38|    144|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|    144|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|    144|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|    144|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   71|    144|                 partial.code_len);
   72|    144|      }
   73|       |
   74|   125k|      if (static_cast<typename decltype(tree)::Node::Type>(*newNode) ==
  ------------------
  |  Branch (74:11): [True: 41.3k, False: 84.5k]
  ------------------
   75|   125k|          decltype(tree)::Node::Type::Leaf) {
   76|       |        // Ok, great, hit a Leaf. This is it.
   77|  41.3k|        return {{partial, newNode->getAsLeaf().value}};
   78|  41.3k|      }
   79|       |
   80|       |      // Else, this is a branch, continue looking.
   81|  84.5k|      top = &(newNode->getAsBranch());
   82|  84.5k|      return std::nullopt;
   83|   125k|    };
_ZNK8rawspeed21PrefixCodeTreeDecoderINS_10VC5CodeTagEE6decodeINS_15BitStreamerJPEGELb0EEEiRT_:
  153|  41.6k|  int decode(BIT_STREAM& bs) const {
  154|  41.6k|    static_assert(
  155|  41.6k|        BitStreamerTraits<BIT_STREAM>::canUseWithPrefixCodeDecoder,
  156|  41.6k|        "This BitStreamer specialization is not marked as usable here");
  157|  41.6k|    invariant(FULL_DECODE == Base::isFullDecode());
  ------------------
  |  |   27|  41.6k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (157:5): [True: 41.6k, False: 0]
  ------------------
  158|       |
  159|  41.6k|    bs.fill(32);
  160|       |
  161|  41.6k|    typename Base::CodeSymbol symbol;
  162|  41.6k|    typename Traits::CodeValueTy codeValue;
  163|  41.6k|    std::tie(symbol, codeValue) = readSymbol(bs);
  164|       |
  165|  41.6k|    return Base::template processSymbol<BIT_STREAM, FULL_DECODE>(bs, symbol,
  166|  41.6k|                                                                 codeValue);
  167|  41.6k|  }

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

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

_ZN8rawspeed6BufferC2EPKhj:
   68|  3.04k|      : Buffer(Array1DRef(data_, implicit_cast<int>(size_))) {}
_ZN8rawspeed6BufferC2ENS_10Array1DRefIKhEE:
   62|  89.2k|      : data(data_.begin()), size(data_.size()) {
   63|  89.2k|    assert(data);
  ------------------
  |  Branch (63:5): [True: 89.2k, False: 0]
  ------------------
   64|  89.2k|    assert(!ASan::RegionIsPoisoned(data, size));
  ------------------
  |  Branch (64:5): [True: 89.2k, False: 0]
  ------------------
   65|  89.2k|  }
_ZN8rawspeed10DataBufferC2ENS_6BufferENS_10EndiannessE:
  142|  8.71k|      : Buffer(data_), endianness(endianness_) {}
_ZNK8rawspeed10DataBuffer3getIhEET_jj:
  147|  42.0k|  [[nodiscard]] T get(size_type offset, size_type index = 0) const {
  148|  42.0k|    assert(Endianness::unknown != endianness);
  ------------------
  |  Branch (148:5): [True: 42.0k, False: 0]
  ------------------
  149|  42.0k|    assert(Endianness::little == endianness || Endianness::big == endianness);
  ------------------
  |  Branch (149:5): [True: 42.0k, False: 0]
  |  Branch (149:5): [True: 0, False: 0]
  |  Branch (149:5): [True: 42.0k, False: 0]
  ------------------
  150|       |
  151|  42.0k|    return Buffer::get<T>(getHostEndianness() == endianness, offset, index);
  152|  42.0k|  }
_ZNK8rawspeed6Buffer3getIhEET_bjj:
  108|  42.0k|                      size_type index = 0) const {
  109|  42.0k|    const Buffer buf =
  110|  42.0k|        getSubView(offset + (index * static_cast<size_type>(sizeof(T))),
  111|  42.0k|                   static_cast<size_type>(sizeof(T)));
  112|  42.0k|    return getByteSwapped<T>(buf.begin(), !inNativeByteOrder);
  113|  42.0k|  }
_ZNK8rawspeed6Buffer10getSubViewEjj:
   78|  86.7k|  [[nodiscard]] Buffer getSubView(size_type offset, size_type size_) const {
   79|  86.7k|    if (!isValid(offset, size_))
  ------------------
  |  Branch (79:9): [True: 539, False: 86.1k]
  ------------------
   80|  86.7k|      ThrowIOE("Buffer overflow: image file may be truncated");
  ------------------
  |  |   37|    539|#define ThrowIOE(...) ThrowExceptionHelper(rawspeed::IOException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|    539|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|    539|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|    539|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   81|       |
   82|  86.1k|    return getAsArray1DRef().getCrop(offset, size_).getAsArray1DRef();
   83|  86.7k|  }
_ZNK8rawspeed6Buffer7isValidEjj:
  117|  93.9k|  [[nodiscard]] bool isValid(size_type offset, size_type count = 1) const {
  118|  93.9k|    return static_cast<uint64_t>(offset) + count <=
  119|  93.9k|           static_cast<uint64_t>(getSize());
  120|  93.9k|  }
_ZNK8rawspeed6Buffer7getSizeEv:
  115|   124k|  [[nodiscard]] size_type RAWSPEED_READONLY getSize() const { return size; }
_ZNK8rawspeed6Buffer15getAsArray1DRefEv:
   70|   172k|  [[nodiscard]] Array1DRef<const uint8_t> getAsArray1DRef() const {
   71|   172k|    return {data, implicit_cast<int>(size)};
   72|   172k|  }
_ZNK8rawspeed6Buffer5beginEv:
   99|  78.0k|  [[nodiscard]] const uint8_t* begin() const {
  100|  78.0k|    return getAsArray1DRef().begin();
  101|  78.0k|  }
_ZNK8rawspeed6Buffer3endEv:
  102|  5.75k|  [[nodiscard]] const uint8_t* end() const { return getAsArray1DRef().end(); }
_ZNK8rawspeed10DataBuffer12getByteOrderEv:
  154|  5.67k|  [[nodiscard]] Endianness getByteOrder() const { return endianness; }
_ZNK8rawspeed10DataBuffer3getIjEET_jj:
  147|  23.5k|  [[nodiscard]] T get(size_type offset, size_type index = 0) const {
  148|  23.5k|    assert(Endianness::unknown != endianness);
  ------------------
  |  Branch (148:5): [True: 23.5k, False: 0]
  ------------------
  149|  23.5k|    assert(Endianness::little == endianness || Endianness::big == endianness);
  ------------------
  |  Branch (149:5): [True: 23.5k, False: 0]
  |  Branch (149:5): [True: 0, False: 0]
  |  Branch (149:5): [True: 23.5k, False: 0]
  ------------------
  150|       |
  151|  23.5k|    return Buffer::get<T>(getHostEndianness() == endianness, offset, index);
  152|  23.5k|  }
_ZNK8rawspeed6Buffer3getIjEET_bjj:
  108|  23.5k|                      size_type index = 0) const {
  109|  23.5k|    const Buffer buf =
  110|  23.5k|        getSubView(offset + (index * static_cast<size_type>(sizeof(T))),
  111|  23.5k|                   static_cast<size_type>(sizeof(T)));
  112|  23.5k|    return getByteSwapped<T>(buf.begin(), !inNativeByteOrder);
  113|  23.5k|  }

_ZN8rawspeed10ByteStreamC2ENS_10DataBufferE:
   50|  8.71k|  explicit ByteStream(DataBuffer buffer) : DataBuffer(buffer) {}
_ZN8rawspeed10ByteStream7getByteEv:
  186|  23.4k|  uint8_t getByte() { return get<uint8_t>(); }
_ZN8rawspeed10ByteStream3getIhEET_v:
  159|  42.0k|  template <typename T> T get() {
  160|  42.0k|    auto ret = peek<T>();
  161|  42.0k|    pos += sizeof(T);
  162|  42.0k|    return ret;
  163|  42.0k|  }
_ZNK8rawspeed10ByteStream4peekIhEET_j:
  156|  42.0k|  template <typename T> [[nodiscard]] T peek(size_type i = 0) const {
  157|  42.0k|    return DataBuffer::get<T>(pos, i);
  158|  42.0k|  }
_ZN8rawspeed10ByteStream9getBufferEj:
  103|  5.77k|  Buffer getBuffer(size_type size_) {
  104|  5.77k|    Buffer ret = peekBuffer(size_);
  105|  5.77k|    pos += size_;
  106|  5.77k|    return ret;
  107|  5.77k|  }
_ZNK8rawspeed10ByteStream10peekBufferEj:
  100|  5.77k|  [[nodiscard]] Buffer peekBuffer(size_type size_) const {
  101|  5.77k|    return getSubView(pos, size_);
  102|  5.77k|  }
_ZN8rawspeed10ByteStream9getStreamEjj:
  124|  5.70k|  ByteStream getStream(size_type nmemb, size_type size_) {
  125|  5.70k|    if (size_ && nmemb > std::numeric_limits<size_type>::max() / size_)
  ------------------
  |  Branch (125:9): [True: 5.70k, False: 0]
  |  Branch (125:18): [True: 0, False: 5.70k]
  ------------------
  126|  5.70k|      ThrowIOE("Integer overflow when calculating stream length");
  ------------------
  |  |   37|      0|#define ThrowIOE(...) ThrowExceptionHelper(rawspeed::IOException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  127|  5.70k|    return getStream(nmemb * size_);
  128|  5.70k|  }
_ZN8rawspeed10ByteStream9getStreamEj:
  119|  5.70k|  ByteStream getStream(size_type size_) {
  120|  5.70k|    ByteStream ret = peekStream(size_);
  121|  5.70k|    pos += size_;
  122|  5.70k|    return ret;
  123|  5.70k|  }
_ZNK8rawspeed10ByteStream10peekStreamEj:
  111|  5.70k|  [[nodiscard]] ByteStream peekStream(size_type size_) const {
  112|  5.70k|    return getSubStream(pos, size_);
  113|  5.70k|  }
_ZNK8rawspeed10ByteStream12getSubStreamEjj:
   55|  5.70k|                                        size_type size_) const {
   56|  5.70k|    return ByteStream(DataBuffer(getSubView(offset, size_), getByteOrder()));
   57|  5.70k|  }
_ZN8rawspeed10ByteStream3getIjEET_v:
  159|  23.5k|  template <typename T> T get() {
  160|  23.5k|    auto ret = peek<T>();
  161|  23.5k|    pos += sizeof(T);
  162|  23.5k|    return ret;
  163|  23.5k|  }
_ZNK8rawspeed10ByteStream4peekIjEET_j:
  156|  23.5k|  template <typename T> [[nodiscard]] T peek(size_type i = 0) const {
  157|  23.5k|    return DataBuffer::get<T>(pos, i);
  158|  23.5k|  }
_ZNK8rawspeed10ByteStream11getPositionEv:
   78|  4.85k|  [[nodiscard]] size_type getPosition() const {
   79|  4.85k|    invariant(getSize() >= pos);
  ------------------
  |  |   27|  4.85k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (79:5): [True: 4.85k, False: 0]
  ------------------
   80|  4.85k|    (void)check(0);
   81|  4.85k|    return pos;
   82|  4.85k|  }
_ZNK8rawspeed10ByteStream5checkEj:
   63|  7.27k|  [[nodiscard]] size_type check(size_type bytes) const {
   64|  7.27k|    if (!isValid(pos, bytes))
  ------------------
  |  Branch (64:9): [True: 0, False: 7.27k]
  ------------------
   65|  7.27k|      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|  7.27k|    [[maybe_unused]] Buffer tmp = getSubView(pos, bytes);
   67|  7.27k|    assert(tmp.getSize() == bytes);
  ------------------
  |  Branch (67:5): [True: 7.27k, False: 0]
  ------------------
   68|  7.27k|    assert(!ASan::RegionIsPoisoned(tmp.begin(), tmp.getSize()));
  ------------------
  |  Branch (68:5): [True: 7.27k, False: 0]
  ------------------
   69|  7.27k|    return bytes;
   70|  7.27k|  }
_ZNK8rawspeed10ByteStream19peekRemainingBufferEv:
  108|  2.42k|  [[nodiscard]] Buffer peekRemainingBuffer() const {
  109|  2.42k|    return getSubView(pos, getRemainSize());
  110|  2.42k|  }
_ZNK8rawspeed10ByteStream13getRemainSizeEv:
   87|  2.42k|  [[nodiscard]] size_type RAWSPEED_READONLY getRemainSize() const {
   88|  2.42k|    invariant(getSize() >= pos);
  ------------------
  |  |   27|  2.42k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (88:5): [True: 2.42k, False: 0]
  ------------------
   89|  2.42k|    (void)check(0);
   90|  2.42k|    return getSize() - pos;
   91|  2.42k|  }

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

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

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

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

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

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

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

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

_ZN10__cxxabiv119__setExceptionClassEP17_Unwind_Exceptionm:
   81|  5.24k|void __setExceptionClass(_Unwind_Exception* unwind_exception, uint64_t newValue) {
   82|  5.24k|    ::memcpy(&unwind_exception->exception_class, &newValue, sizeof(newValue));
   83|  5.24k|}
_ZN10__cxxabiv119__getExceptionClassEPK17_Unwind_Exception:
   95|  28.2k|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|  28.2k|    uint64_t exClass;
  101|  28.2k|    ::memcpy(&exClass, &unwind_exception->exception_class, sizeof(exClass));
  102|  28.2k|    return exClass;
  103|  28.2k|}
_ZN10__cxxabiv121__isOurExceptionClassEPK17_Unwind_Exception:
  105|  14.3k|bool __isOurExceptionClass(const _Unwind_Exception* unwind_exception) {
  106|  14.3k|    return (__getExceptionClass(unwind_exception) & get_vendor_and_language) ==
  107|  14.3k|           (kOurExceptionClass                    & get_vendor_and_language);
  108|  14.3k|}
__cxa_allocate_exception:
  183|  5.24k|void *__cxa_allocate_exception(size_t thrown_size) throw() {
  184|  5.24k|    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|  5.24k|    size_t header_offset = get_cxa_exception_offset();
  189|  5.24k|    char *raw_buffer =
  190|  5.24k|        (char *)__aligned_malloc_with_fallback(header_offset + actual_size);
  191|  5.24k|    if (NULL == raw_buffer)
  ------------------
  |  Branch (191:9): [True: 0, False: 5.24k]
  ------------------
  192|      0|        std::terminate();
  193|  5.24k|    __cxa_exception *exception_header =
  194|  5.24k|        static_cast<__cxa_exception *>((void *)(raw_buffer + header_offset));
  195|  5.24k|    ::memset(exception_header, 0, actual_size);
  196|  5.24k|    return thrown_object_from_cxa_exception(exception_header);
  197|  5.24k|}
__cxa_free_exception:
  201|  5.24k|void __cxa_free_exception(void *thrown_object) throw() {
  202|       |    // Compute the size of the padding before the header.
  203|  5.24k|    size_t header_offset = get_cxa_exception_offset();
  204|  5.24k|    char *raw_buffer =
  205|  5.24k|        ((char *)cxa_exception_from_thrown_object(thrown_object)) - header_offset;
  206|  5.24k|    __aligned_free_with_fallback((void *)raw_buffer);
  207|  5.24k|}
__cxa_init_primary_exception:
  210|  5.24k|                                              void(_LIBCXXABI_DTOR_FUNC* dest)(void*)) throw() {
  211|  5.24k|  __cxa_exception* exception_header = cxa_exception_from_thrown_object(object);
  212|  5.24k|  exception_header->referenceCount = 0;
  213|  5.24k|  exception_header->unexpectedHandler = std::get_unexpected();
  214|  5.24k|  exception_header->terminateHandler = std::get_terminate();
  215|  5.24k|  exception_header->exceptionType = tinfo;
  216|  5.24k|  exception_header->exceptionDestructor = dest;
  217|  5.24k|  setOurExceptionClass(&exception_header->unwindHeader);
  218|  5.24k|  exception_header->unwindHeader.exception_cleanup = exception_cleanup_func;
  219|       |
  220|  5.24k|  return exception_header;
  221|  5.24k|}
__cxa_throw:
  274|  5.24k|__cxa_throw(void *thrown_object, std::type_info *tinfo, void (_LIBCXXABI_DTOR_FUNC *dest)(void *)) {
  275|  5.24k|#endif
  276|  5.24k|  __cxa_eh_globals* globals = __cxa_get_globals();
  277|  5.24k|  globals->uncaughtExceptions += 1; // Not atomically, since globals are thread-local
  278|       |
  279|  5.24k|  __cxa_exception* exception_header = __cxa_init_primary_exception(thrown_object, tinfo, dest);
  280|  5.24k|  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|  5.24k|    _Unwind_RaiseException(&exception_header->unwindHeader);
  291|  5.24k|#endif
  292|       |    //  This only happens when there is no handler, or some unexpected unwinding
  293|       |    //     error happens.
  294|  5.24k|    failed_throw(exception_header);
  295|  5.24k|}
__cxa_begin_catch:
  446|  6.52k|{
  447|  6.52k|    _Unwind_Exception* unwind_exception = static_cast<_Unwind_Exception*>(unwind_arg);
  448|  6.52k|    bool native_exception = __isOurExceptionClass(unwind_exception);
  449|  6.52k|    __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|  6.52k|    __cxa_exception* exception_header =
  454|  6.52k|            cxa_exception_from_exception_unwind_exception
  455|  6.52k|            (
  456|  6.52k|                static_cast<_Unwind_Exception*>(unwind_exception)
  457|  6.52k|            );
  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|  6.52k|    if (native_exception)
  ------------------
  |  Branch (466:9): [True: 6.52k, False: 0]
  ------------------
  467|  6.52k|    {
  468|       |        // Increment the handler count, removing the flag about being rethrown
  469|  6.52k|        exception_header->handlerCount = exception_header->handlerCount < 0 ?
  ------------------
  |  Branch (469:42): [True: 0, False: 6.52k]
  ------------------
  470|  6.52k|            -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|  6.52k|        if (exception_header != globals->caughtExceptions)
  ------------------
  |  Branch (473:13): [True: 6.52k, False: 0]
  ------------------
  474|  6.52k|        {
  475|  6.52k|            exception_header->nextException = globals->caughtExceptions;
  476|  6.52k|            globals->caughtExceptions = exception_header;
  477|  6.52k|        }
  478|  6.52k|        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|  6.52k|        return exception_header->adjustedPtr;
  483|  6.52k|#endif
  484|  6.52k|    }
  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|  6.52k|}
__cxa_end_catch:
  513|  6.52k|void __cxa_end_catch() {
  514|  6.52k|  static_assert(sizeof(__cxa_exception) == sizeof(__cxa_dependent_exception),
  515|  6.52k|                "sizeof(__cxa_exception) must be equal to "
  516|  6.52k|                "sizeof(__cxa_dependent_exception)");
  517|  6.52k|  static_assert(__builtin_offsetof(__cxa_exception, referenceCount) ==
  518|  6.52k|                    __builtin_offsetof(__cxa_dependent_exception,
  519|  6.52k|                                       primaryException),
  520|  6.52k|                "the layout of __cxa_exception must match the layout of "
  521|  6.52k|                "__cxa_dependent_exception");
  522|  6.52k|  static_assert(__builtin_offsetof(__cxa_exception, handlerCount) ==
  523|  6.52k|                    __builtin_offsetof(__cxa_dependent_exception, handlerCount),
  524|  6.52k|                "the layout of __cxa_exception must match the layout of "
  525|  6.52k|                "__cxa_dependent_exception");
  526|  6.52k|    __cxa_eh_globals* globals = __cxa_get_globals_fast(); // __cxa_get_globals called in __cxa_begin_catch
  527|  6.52k|    __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|  6.52k|    if (NULL != exception_header)
  ------------------
  |  Branch (531:9): [True: 6.52k, False: 0]
  ------------------
  532|  6.52k|    {
  533|  6.52k|        bool native_exception = __isOurExceptionClass(&exception_header->unwindHeader);
  534|  6.52k|        if (native_exception)
  ------------------
  |  Branch (534:13): [True: 6.52k, False: 0]
  ------------------
  535|  6.52k|        {
  536|       |            // This is a native exception
  537|  6.52k|            if (exception_header->handlerCount < 0)
  ------------------
  |  Branch (537:17): [True: 1.27k, False: 5.24k]
  ------------------
  538|  1.27k|            {
  539|       |                //  The exception has been rethrown by __cxa_rethrow, so don't delete it
  540|  1.27k|                if (0 == incrementHandlerCount(exception_header))
  ------------------
  |  Branch (540:21): [True: 1.27k, False: 0]
  ------------------
  541|  1.27k|                {
  542|       |                    //  Remove from the chain of uncaught exceptions
  543|  1.27k|                    globals->caughtExceptions = exception_header->nextException;
  544|       |                    // but don't destroy
  545|  1.27k|                }
  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|  1.27k|            }
  550|  5.24k|            else
  551|  5.24k|            {
  552|       |                // The native exception has not been rethrown
  553|  5.24k|                if (0 == decrementHandlerCount(exception_header))
  ------------------
  |  Branch (553:21): [True: 5.24k, False: 0]
  ------------------
  554|  5.24k|                {
  555|       |                    //  Remove from the chain of uncaught exceptions
  556|  5.24k|                    globals->caughtExceptions = exception_header->nextException;
  557|       |                    // Destroy this exception, being careful to distinguish
  558|       |                    //    between dependent and primary exceptions
  559|  5.24k|                    if (isDependentException(&exception_header->unwindHeader))
  ------------------
  |  Branch (559:25): [True: 0, False: 5.24k]
  ------------------
  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|  5.24k|                    __cxa_decrement_exception_refcount(thrown_object_from_cxa_exception(exception_header));
  571|  5.24k|                }
  572|  5.24k|            }
  573|  6.52k|        }
  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|  6.52k|    }
  585|  6.52k|}
__cxa_rethrow:
  615|  1.27k|void __cxa_rethrow() {
  616|  1.27k|    __cxa_eh_globals* globals = __cxa_get_globals();
  617|  1.27k|    __cxa_exception* exception_header = globals->caughtExceptions;
  618|  1.27k|    if (NULL == exception_header)
  ------------------
  |  Branch (618:9): [True: 0, False: 1.27k]
  ------------------
  619|      0|        std::terminate();      // throw; called outside of a exception handler
  620|  1.27k|    bool native_exception = __isOurExceptionClass(&exception_header->unwindHeader);
  621|  1.27k|    if (native_exception)
  ------------------
  |  Branch (621:9): [True: 1.27k, False: 0]
  ------------------
  622|  1.27k|    {
  623|       |        //  Mark the exception as being rethrown (reverse the effects of __cxa_begin_catch)
  624|  1.27k|        exception_header->handlerCount = -exception_header->handlerCount;
  625|  1.27k|        globals->uncaughtExceptions += 1;
  626|       |        //  __cxa_end_catch will remove this exception from the caughtExceptions stack if necessary
  627|  1.27k|    }
  628|      0|    else  // this is a foreign exception
  629|      0|    {
  630|       |        // The only way to communicate to __cxa_end_catch that we've rethrown
  631|       |        //   a foreign exception, so don't delete us, is to pop the stack here
  632|       |        //   which must be empty afterwards.  Then __cxa_end_catch will do
  633|       |        //   nothing
  634|      0|        globals->caughtExceptions = 0;
  635|      0|    }
  636|       |#ifdef __USING_SJLJ_EXCEPTIONS__
  637|       |    _Unwind_SjLj_RaiseException(&exception_header->unwindHeader);
  638|       |#else
  639|  1.27k|    _Unwind_RaiseException(&exception_header->unwindHeader);
  640|  1.27k|#endif
  641|       |
  642|       |    //  If we get here, some kind of unwinding error has occurred.
  643|       |    //  There is some weird code generation bug happening with
  644|       |    //     Apple clang version 4.0 (tags/Apple/clang-418.0.2) (based on LLVM 3.1svn)
  645|       |    //     If we call failed_throw here.  Turns up with -O2 or higher, and -Os.
  646|  1.27k|    __cxa_begin_catch(&exception_header->unwindHeader);
  647|  1.27k|    if (native_exception)
  ------------------
  |  Branch (647:9): [True: 0, False: 1.27k]
  ------------------
  648|      0|        std::__terminate(exception_header->terminateHandler);
  649|       |    // Foreign exception: can't get exception_header->terminateHandler
  650|  1.27k|    std::terminate();
  651|  1.27k|}
__cxa_decrement_exception_refcount:
  678|  5.24k|void __cxa_decrement_exception_refcount(void *thrown_object) throw() {
  679|  5.24k|    if (thrown_object != NULL )
  ------------------
  |  Branch (679:9): [True: 5.24k, False: 0]
  ------------------
  680|  5.24k|    {
  681|  5.24k|        __cxa_exception* exception_header = cxa_exception_from_thrown_object(thrown_object);
  682|  5.24k|        if (std::__libcpp_atomic_add(&exception_header->referenceCount, size_t(-1)) == 0)
  ------------------
  |  Branch (682:13): [True: 5.24k, False: 0]
  ------------------
  683|  5.24k|        {
  684|  5.24k|            if (NULL != exception_header->exceptionDestructor)
  ------------------
  |  Branch (684:17): [True: 5.24k, False: 0]
  ------------------
  685|  5.24k|                exception_header->exceptionDestructor(thrown_object);
  686|  5.24k|            __cxa_free_exception(thrown_object);
  687|  5.24k|        }
  688|  5.24k|    }
  689|  5.24k|}
cxa_exception.cpp:_ZN10__cxxabiv1L45cxa_exception_size_from_exception_thrown_sizeEm:
   76|  5.24k|size_t cxa_exception_size_from_exception_thrown_size(size_t size) {
   77|  5.24k|    return aligned_allocation_size(size + sizeof (__cxa_exception),
   78|  5.24k|                                   alignof(__cxa_exception));
   79|  5.24k|}
cxa_exception.cpp:_ZN10__cxxabiv1L23aligned_allocation_sizeEmm:
   71|  5.24k|size_t aligned_allocation_size(size_t s, size_t a) {
   72|  5.24k|    return (s + a - 1) & ~(a - 1);
   73|  5.24k|}
cxa_exception.cpp:_ZN10__cxxabiv1L24get_cxa_exception_offsetEv:
  161|  10.4k|static size_t get_cxa_exception_offset() {
  162|  10.4k|  struct S {
  163|  10.4k|  } __attribute__((aligned));
  164|       |
  165|       |  // Compute the maximum alignment for the target machine.
  166|  10.4k|  constexpr size_t alignment = alignof(S);
  167|  10.4k|  constexpr size_t excp_size = sizeof(__cxa_exception);
  168|  10.4k|  constexpr size_t aligned_size =
  169|  10.4k|      (excp_size + alignment - 1) / alignment * alignment;
  170|  10.4k|  constexpr size_t offset = aligned_size - excp_size;
  171|  10.4k|  static_assert((offset == 0 || alignof(_Unwind_Exception) < alignment),
  172|  10.4k|                "offset is non-zero only if _Unwind_Exception isn't aligned");
  173|  10.4k|  return offset;
  174|  10.4k|}
cxa_exception.cpp:_ZN10__cxxabiv1L32thrown_object_from_cxa_exceptionEPNS_15__cxa_exceptionE:
   54|  10.4k|{
   55|  10.4k|    return static_cast<void*>(exception_header + 1);
   56|  10.4k|}
cxa_exception.cpp:_ZN10__cxxabiv1L32cxa_exception_from_thrown_objectEPv:
   44|  22.2k|{
   45|  22.2k|    return static_cast<__cxa_exception*>(thrown_object) - 1;
   46|  22.2k|}
cxa_exception.cpp:_ZN10__cxxabiv1L20setOurExceptionClassEP17_Unwind_Exception:
   86|  5.24k|static void setOurExceptionClass(_Unwind_Exception* unwind_exception) {
   87|  5.24k|    __setExceptionClass(unwind_exception, kOurExceptionClass);
   88|  5.24k|}
cxa_exception.cpp:_ZN10__cxxabiv1L45cxa_exception_from_exception_unwind_exceptionEP17_Unwind_Exception:
   65|  6.52k|{
   66|  6.52k|    return cxa_exception_from_thrown_object(unwind_exception + 1 );
   67|  6.52k|}
cxa_exception.cpp:_ZN10__cxxabiv1L21incrementHandlerCountEPNS_15__cxa_exceptionE:
  115|  1.27k|static inline int incrementHandlerCount(__cxa_exception *exception) {
  116|  1.27k|    return ++exception->handlerCount;
  117|  1.27k|}
cxa_exception.cpp:_ZN10__cxxabiv1L21decrementHandlerCountEPNS_15__cxa_exceptionE:
  120|  5.24k|static inline  int decrementHandlerCount(__cxa_exception *exception) {
  121|  5.24k|    return --exception->handlerCount;
  122|  5.24k|}
cxa_exception.cpp:_ZN10__cxxabiv1L20isDependentExceptionEP17_Unwind_Exception:
  110|  5.24k|static bool isDependentException(_Unwind_Exception* unwind_exception) {
  111|  5.24k|    return (__getExceptionClass(unwind_exception) & 0xFF) == 0x01;
  112|  5.24k|}

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

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

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

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

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

_Znwm:
   66|   101k|_LIBCPP_MAKE_OVERRIDABLE_FUNCTION_DETECTABLE _LIBCPP_WEAK void* operator new(std::size_t size) _THROW_BAD_ALLOC {
   67|   101k|  void* p = operator_new_impl(size);
   68|   101k|  if (p == nullptr)
  ------------------
  |  Branch (68:7): [True: 0, False: 101k]
  ------------------
   69|      0|    __throw_bad_alloc_shim();
   70|   101k|  return p;
   71|   101k|}
_ZdlPv:
  125|   101k|_LIBCPP_WEAK void operator delete(void* ptr) noexcept { std::free(ptr); }
_ZdlPvm:
  129|  96.1k|_LIBCPP_WEAK void operator delete(void* ptr, size_t) noexcept { ::operator delete(ptr); }
stdlib_new_delete.cpp:_ZL17operator_new_implm:
   50|   101k|static void* operator_new_impl(std::size_t size) {
   51|   101k|  if (size == 0)
  ------------------
  |  Branch (51:7): [True: 0, False: 101k]
  ------------------
   52|      0|    size = 1;
   53|   101k|  void* p;
   54|   101k|  while ((p = std::malloc(size)) == nullptr) {
  ------------------
  |  Branch (54:10): [True: 0, False: 101k]
  ------------------
   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|   101k|  return p;
   64|   101k|}

_ZNSt13runtime_errorD2Ev:
   30|  5.24k|runtime_error::~runtime_error() noexcept {}

