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

LLVMFuzzerTestOneInput:
  161|  3.17k|extern "C" int LLVMFuzzerTestOneInput(const uint8_t* Data, size_t Size) {
  162|  3.17k|  assert(Data);
  ------------------
  |  Branch (162:3): [True: 3.17k, False: 0]
  ------------------
  163|       |
  164|  3.17k|  try {
  165|  3.17k|    const rawspeed::Buffer b(
  166|  3.17k|        Data, rawspeed::implicit_cast<rawspeed::Buffer::size_type>(Size));
  167|  3.17k|    const rawspeed::DataBuffer db(b, rawspeed::Endianness::little);
  168|  3.17k|    rawspeed::ByteStream bs(db);
  169|       |
  170|       |    // Which flavor?
  171|  3.17k|    switch (bs.getByte()) {
  172|  2.11k|    case 0:
  ------------------
  |  Branch (172:5): [True: 2.11k, False: 1.05k]
  ------------------
  173|  2.11k|      checkFlavour<rawspeed::BaselineCodeTag>(bs);
  174|  2.11k|      break;
  175|  1.05k|    case 1:
  ------------------
  |  Branch (175:5): [True: 1.05k, False: 2.12k]
  ------------------
  176|  1.05k|      checkFlavour<rawspeed::VC5CodeTag>(bs);
  177|  1.05k|      break;
  178|      4|    default:
  ------------------
  |  Branch (178:5): [True: 4, False: 3.16k]
  ------------------
  179|      4|      ThrowRSE("Unknown flavor");
  ------------------
  |  |   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__)
  |  |  ------------------
  ------------------
  180|  3.17k|    }
  181|  3.17k|  } catch (const rawspeed::RawspeedException&) {
  182|  3.17k|    return 0;
  183|  3.17k|  }
  184|       |
  185|      0|  __builtin_unreachable();
  186|  3.17k|}
Dual.cpp:_ZN12_GLOBAL__N_112checkFlavourIN8rawspeed15BaselineCodeTagEEEvNS1_10ByteStreamE:
  110|  2.11k|template <typename CodeTag> void checkFlavour(rawspeed::ByteStream bs) {
  111|  2.11k|  rawspeed::ByteStream bs0 = bs;
  112|  2.11k|  rawspeed::ByteStream bs1 = bs;
  113|       |
  114|       |#ifndef BACKIMPL0
  115|       |  const auto ht0 = createPrefixCodeDecoder<rawspeed::IMPL0<CodeTag>>(bs0);
  116|       |#else
  117|  2.11k|  const auto ht0 = createPrefixCodeDecoder<
  118|  2.11k|      rawspeed::IMPL0<CodeTag, rawspeed::BACKIMPL0<CodeTag>>>(bs0);
  119|  2.11k|#endif
  120|       |
  121|  2.11k|#ifndef BACKIMPL1
  122|  2.11k|  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.11k|  const int format0 = bs0.getByte();
  130|  2.11k|  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.11k|  assert(bs0.getPosition() == bs1.getPosition());
  ------------------
  |  Branch (134:3): [True: 1.75k, False: 359]
  ------------------
  135|       |
  136|  2.11k|  assert(format0 == format1);
  ------------------
  |  Branch (136:3): [True: 1.75k, False: 0]
  ------------------
  137|  1.75k|  (void)format1;
  138|       |
  139|  1.75k|  const auto input = bs0.peekRemainingBuffer().getAsArray1DRef();
  140|       |
  141|  1.75k|  assert(format0 == format1);
  ------------------
  |  Branch (141:3): [True: 1.75k, False: 0]
  ------------------
  142|  1.75k|  switch (format0) {
  143|    552|  case 0:
  ------------------
  |  Branch (143:3): [True: 552, False: 1.20k]
  ------------------
  144|    552|    checkPump<rawspeed::BitStreamerMSB>(input, ht0, ht1);
  145|    552|    break;
  146|    516|  case 1:
  ------------------
  |  Branch (146:3): [True: 516, False: 1.24k]
  ------------------
  147|    516|    checkPump<rawspeed::BitStreamerMSB32>(input, ht0, ht1);
  148|    516|    break;
  149|    683|  case 2:
  ------------------
  |  Branch (149:3): [True: 683, False: 1.07k]
  ------------------
  150|    683|    checkPump<rawspeed::BitStreamerJPEG>(input, ht0, ht1);
  151|    683|    break;
  152|      6|  default:
  ------------------
  |  Branch (152:3): [True: 6, False: 1.75k]
  ------------------
  153|      6|    ThrowRSE("Unknown bit pump");
  ------------------
  |  |   95|      6|  ThrowExceptionHelper(rawspeed::RawspeedException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      6|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      6|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      6|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  154|  1.75k|  }
  155|  1.75k|}
Dual.cpp:_ZN12_GLOBAL__N_19checkPumpIN8rawspeed14BitStreamerMSBENS1_20PrefixCodeLUTDecoderINS1_15BaselineCodeTagENS1_23PrefixCodeLookupDecoderIS4_EEEENS1_21PrefixCodeTreeDecoderIS4_EEEEvNS1_10Array1DRefIKhEERKT0_RKT1_:
  102|    552|               const HT1& ht1) {
  103|    552|  assert(ht0.isFullDecode() == ht1.isFullDecode());
  ------------------
  |  Branch (103:3): [True: 552, False: 0]
  ------------------
  104|    552|  if (ht0.isFullDecode())
  ------------------
  |  Branch (104:7): [True: 368, False: 184]
  ------------------
  105|    368|    workloop<Pump, /*IsFullDecode=*/true>(input, ht0, ht1);
  106|    184|  else
  107|    184|    workloop<Pump, /*IsFullDecode=*/false>(input, ht0, ht1);
  108|    552|}
Dual.cpp:_ZN12_GLOBAL__N_18workloopIN8rawspeed14BitStreamerMSBELb1ENS1_20PrefixCodeLUTDecoderINS1_15BaselineCodeTagENS1_23PrefixCodeLookupDecoderIS4_EEEENS1_21PrefixCodeTreeDecoderIS4_EEEEvNS1_10Array1DRefIKhEERKT1_RKT2_:
   56|    368|              const HT1& ht1) {
   57|    368|  Pump bits0(input);
   58|    368|  Pump bits1(input);
   59|       |
   60|  10.5M|  while (true) {
  ------------------
  |  Branch (60:10): [True: 10.5M, Folded]
  ------------------
   61|  10.5M|    int decoded0;
   62|  10.5M|    int decoded1;
   63|       |
   64|  10.5M|    bool failure0 = false;
   65|  10.5M|    bool failure1 = false;
   66|       |
   67|  10.5M|    try {
   68|  10.5M|      decoded1 = ht1.template decode<decltype(bits1), IsFullDecode>(bits1);
   69|  10.5M|    } catch (const rawspeed::IOException&) {
   70|       |      // For now, let's ignore stream depleteon issues.
   71|    220|      throw;
   72|    220|    } catch (const rawspeed::RawspeedException&) {
   73|    142|      failure1 = true;
   74|    142|    }
   75|       |
   76|  10.5M|    try {
   77|  10.5M|      decoded0 = ht0.template decode<decltype(bits0), IsFullDecode>(bits0);
   78|  10.5M|    } catch (const rawspeed::IOException&) {
   79|       |      // For now, let's ignore stream depleteon issues.
   80|      0|      throw;
   81|    142|    } catch (const rawspeed::RawspeedException&) {
   82|    142|      failure0 = true;
   83|    142|    }
   84|       |
   85|       |    // They both should either fail or succeed, else there is a bug.
   86|  10.5M|    assert(failure0 == failure1);
  ------------------
  |  Branch (86:5): [True: 10.5M, False: 0]
  ------------------
   87|       |
   88|       |    // If any failed, we can't continue.
   89|  10.5M|    if (failure0 || failure1)
  ------------------
  |  Branch (89:9): [True: 142, False: 10.5M]
  |  Branch (89:21): [True: 0, False: 10.5M]
  ------------------
   90|  10.5M|      ThrowRSE("Failure detected");
  ------------------
  |  |   95|    142|  ThrowExceptionHelper(rawspeed::RawspeedException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|    142|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|    142|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|    142|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   91|       |
   92|  10.5M|    (void)decoded0;
   93|  10.5M|    (void)decoded1;
   94|       |
   95|       |    // They both should have decoded the same value.
   96|       |    assert(decoded0 == decoded1);
  ------------------
  |  Branch (96:5): [True: 10.5M, False: 0]
  ------------------
   97|  10.5M|  }
   98|    368|}
Dual.cpp:_ZN12_GLOBAL__N_18workloopIN8rawspeed14BitStreamerMSBELb0ENS1_20PrefixCodeLUTDecoderINS1_15BaselineCodeTagENS1_23PrefixCodeLookupDecoderIS4_EEEENS1_21PrefixCodeTreeDecoderIS4_EEEEvNS1_10Array1DRefIKhEERKT1_RKT2_:
   56|    184|              const HT1& ht1) {
   57|    184|  Pump bits0(input);
   58|    184|  Pump bits1(input);
   59|       |
   60|  39.2M|  while (true) {
  ------------------
  |  Branch (60:10): [True: 39.2M, Folded]
  ------------------
   61|  39.2M|    int decoded0;
   62|  39.2M|    int decoded1;
   63|       |
   64|  39.2M|    bool failure0 = false;
   65|  39.2M|    bool failure1 = false;
   66|       |
   67|  39.2M|    try {
   68|  39.2M|      decoded1 = ht1.template decode<decltype(bits1), IsFullDecode>(bits1);
   69|  39.2M|    } catch (const rawspeed::IOException&) {
   70|       |      // For now, let's ignore stream depleteon issues.
   71|     75|      throw;
   72|    102|    } catch (const rawspeed::RawspeedException&) {
   73|    102|      failure1 = true;
   74|    102|    }
   75|       |
   76|  39.2M|    try {
   77|  39.2M|      decoded0 = ht0.template decode<decltype(bits0), IsFullDecode>(bits0);
   78|  39.2M|    } catch (const rawspeed::IOException&) {
   79|       |      // For now, let's ignore stream depleteon issues.
   80|      0|      throw;
   81|    102|    } catch (const rawspeed::RawspeedException&) {
   82|    102|      failure0 = true;
   83|    102|    }
   84|       |
   85|       |    // They both should either fail or succeed, else there is a bug.
   86|  39.2M|    assert(failure0 == failure1);
  ------------------
  |  Branch (86:5): [True: 39.2M, False: 0]
  ------------------
   87|       |
   88|       |    // If any failed, we can't continue.
   89|  39.2M|    if (failure0 || failure1)
  ------------------
  |  Branch (89:9): [True: 102, False: 39.2M]
  |  Branch (89:21): [True: 0, False: 39.2M]
  ------------------
   90|  39.2M|      ThrowRSE("Failure detected");
  ------------------
  |  |   95|    102|  ThrowExceptionHelper(rawspeed::RawspeedException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|    102|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|    102|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|    102|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   91|       |
   92|  39.2M|    (void)decoded0;
   93|  39.2M|    (void)decoded1;
   94|       |
   95|       |    // They both should have decoded the same value.
   96|       |    assert(decoded0 == decoded1);
  ------------------
  |  Branch (96:5): [True: 39.2M, False: 0]
  ------------------
   97|  39.2M|  }
   98|    184|}
Dual.cpp:_ZN12_GLOBAL__N_19checkPumpIN8rawspeed16BitStreamerMSB32ENS1_20PrefixCodeLUTDecoderINS1_15BaselineCodeTagENS1_23PrefixCodeLookupDecoderIS4_EEEENS1_21PrefixCodeTreeDecoderIS4_EEEEvNS1_10Array1DRefIKhEERKT0_RKT1_:
  102|    516|               const HT1& ht1) {
  103|    516|  assert(ht0.isFullDecode() == ht1.isFullDecode());
  ------------------
  |  Branch (103:3): [True: 516, False: 0]
  ------------------
  104|    516|  if (ht0.isFullDecode())
  ------------------
  |  Branch (104:7): [True: 354, False: 162]
  ------------------
  105|    354|    workloop<Pump, /*IsFullDecode=*/true>(input, ht0, ht1);
  106|    162|  else
  107|    162|    workloop<Pump, /*IsFullDecode=*/false>(input, ht0, ht1);
  108|    516|}
Dual.cpp:_ZN12_GLOBAL__N_18workloopIN8rawspeed16BitStreamerMSB32ELb1ENS1_20PrefixCodeLUTDecoderINS1_15BaselineCodeTagENS1_23PrefixCodeLookupDecoderIS4_EEEENS1_21PrefixCodeTreeDecoderIS4_EEEEvNS1_10Array1DRefIKhEERKT1_RKT2_:
   56|    354|              const HT1& ht1) {
   57|    354|  Pump bits0(input);
   58|    354|  Pump bits1(input);
   59|       |
   60|  3.99M|  while (true) {
  ------------------
  |  Branch (60:10): [True: 3.99M, Folded]
  ------------------
   61|  3.99M|    int decoded0;
   62|  3.99M|    int decoded1;
   63|       |
   64|  3.99M|    bool failure0 = false;
   65|  3.99M|    bool failure1 = false;
   66|       |
   67|  3.99M|    try {
   68|  3.99M|      decoded1 = ht1.template decode<decltype(bits1), IsFullDecode>(bits1);
   69|  3.99M|    } catch (const rawspeed::IOException&) {
   70|       |      // For now, let's ignore stream depleteon issues.
   71|    202|      throw;
   72|    202|    } catch (const rawspeed::RawspeedException&) {
   73|    149|      failure1 = true;
   74|    149|    }
   75|       |
   76|  3.99M|    try {
   77|  3.99M|      decoded0 = ht0.template decode<decltype(bits0), IsFullDecode>(bits0);
   78|  3.99M|    } catch (const rawspeed::IOException&) {
   79|       |      // For now, let's ignore stream depleteon issues.
   80|      0|      throw;
   81|    149|    } catch (const rawspeed::RawspeedException&) {
   82|    149|      failure0 = true;
   83|    149|    }
   84|       |
   85|       |    // They both should either fail or succeed, else there is a bug.
   86|  3.99M|    assert(failure0 == failure1);
  ------------------
  |  Branch (86:5): [True: 3.99M, False: 0]
  ------------------
   87|       |
   88|       |    // If any failed, we can't continue.
   89|  3.99M|    if (failure0 || failure1)
  ------------------
  |  Branch (89:9): [True: 149, False: 3.99M]
  |  Branch (89:21): [True: 0, False: 3.99M]
  ------------------
   90|  3.99M|      ThrowRSE("Failure detected");
  ------------------
  |  |   95|    149|  ThrowExceptionHelper(rawspeed::RawspeedException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|    149|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|    149|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|    149|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   91|       |
   92|  3.99M|    (void)decoded0;
   93|  3.99M|    (void)decoded1;
   94|       |
   95|       |    // They both should have decoded the same value.
   96|       |    assert(decoded0 == decoded1);
  ------------------
  |  Branch (96:5): [True: 3.99M, False: 0]
  ------------------
   97|  3.99M|  }
   98|    354|}
Dual.cpp:_ZN12_GLOBAL__N_18workloopIN8rawspeed16BitStreamerMSB32ELb0ENS1_20PrefixCodeLUTDecoderINS1_15BaselineCodeTagENS1_23PrefixCodeLookupDecoderIS4_EEEENS1_21PrefixCodeTreeDecoderIS4_EEEEvNS1_10Array1DRefIKhEERKT1_RKT2_:
   56|    162|              const HT1& ht1) {
   57|    162|  Pump bits0(input);
   58|    162|  Pump bits1(input);
   59|       |
   60|  38.8M|  while (true) {
  ------------------
  |  Branch (60:10): [True: 38.8M, Folded]
  ------------------
   61|  38.8M|    int decoded0;
   62|  38.8M|    int decoded1;
   63|       |
   64|  38.8M|    bool failure0 = false;
   65|  38.8M|    bool failure1 = false;
   66|       |
   67|  38.8M|    try {
   68|  38.8M|      decoded1 = ht1.template decode<decltype(bits1), IsFullDecode>(bits1);
   69|  38.8M|    } catch (const rawspeed::IOException&) {
   70|       |      // For now, let's ignore stream depleteon issues.
   71|     69|      throw;
   72|     89|    } catch (const rawspeed::RawspeedException&) {
   73|     89|      failure1 = true;
   74|     89|    }
   75|       |
   76|  38.8M|    try {
   77|  38.8M|      decoded0 = ht0.template decode<decltype(bits0), IsFullDecode>(bits0);
   78|  38.8M|    } catch (const rawspeed::IOException&) {
   79|       |      // For now, let's ignore stream depleteon issues.
   80|      0|      throw;
   81|     89|    } catch (const rawspeed::RawspeedException&) {
   82|     89|      failure0 = true;
   83|     89|    }
   84|       |
   85|       |    // They both should either fail or succeed, else there is a bug.
   86|  38.8M|    assert(failure0 == failure1);
  ------------------
  |  Branch (86:5): [True: 38.8M, False: 0]
  ------------------
   87|       |
   88|       |    // If any failed, we can't continue.
   89|  38.8M|    if (failure0 || failure1)
  ------------------
  |  Branch (89:9): [True: 89, False: 38.8M]
  |  Branch (89:21): [True: 0, False: 38.8M]
  ------------------
   90|  38.8M|      ThrowRSE("Failure detected");
  ------------------
  |  |   95|     89|  ThrowExceptionHelper(rawspeed::RawspeedException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     89|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     89|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     89|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   91|       |
   92|  38.8M|    (void)decoded0;
   93|  38.8M|    (void)decoded1;
   94|       |
   95|       |    // They both should have decoded the same value.
   96|       |    assert(decoded0 == decoded1);
  ------------------
  |  Branch (96:5): [True: 38.8M, False: 0]
  ------------------
   97|  38.8M|  }
   98|    162|}
Dual.cpp:_ZN12_GLOBAL__N_19checkPumpIN8rawspeed15BitStreamerJPEGENS1_20PrefixCodeLUTDecoderINS1_15BaselineCodeTagENS1_23PrefixCodeLookupDecoderIS4_EEEENS1_21PrefixCodeTreeDecoderIS4_EEEEvNS1_10Array1DRefIKhEERKT0_RKT1_:
  102|    683|               const HT1& ht1) {
  103|    683|  assert(ht0.isFullDecode() == ht1.isFullDecode());
  ------------------
  |  Branch (103:3): [True: 683, False: 0]
  ------------------
  104|    683|  if (ht0.isFullDecode())
  ------------------
  |  Branch (104:7): [True: 462, False: 221]
  ------------------
  105|    462|    workloop<Pump, /*IsFullDecode=*/true>(input, ht0, ht1);
  106|    221|  else
  107|    221|    workloop<Pump, /*IsFullDecode=*/false>(input, ht0, ht1);
  108|    683|}
Dual.cpp:_ZN12_GLOBAL__N_18workloopIN8rawspeed15BitStreamerJPEGELb1ENS1_20PrefixCodeLUTDecoderINS1_15BaselineCodeTagENS1_23PrefixCodeLookupDecoderIS4_EEEENS1_21PrefixCodeTreeDecoderIS4_EEEEvNS1_10Array1DRefIKhEERKT1_RKT2_:
   56|    462|              const HT1& ht1) {
   57|    462|  Pump bits0(input);
   58|    462|  Pump bits1(input);
   59|       |
   60|  4.61M|  while (true) {
  ------------------
  |  Branch (60:10): [True: 4.60M, Folded]
  ------------------
   61|  4.60M|    int decoded0;
   62|  4.60M|    int decoded1;
   63|       |
   64|  4.60M|    bool failure0 = false;
   65|  4.60M|    bool failure1 = false;
   66|       |
   67|  4.60M|    try {
   68|  4.60M|      decoded1 = ht1.template decode<decltype(bits1), IsFullDecode>(bits1);
   69|  4.60M|    } catch (const rawspeed::IOException&) {
   70|       |      // For now, let's ignore stream depleteon issues.
   71|    289|      throw;
   72|    289|    } catch (const rawspeed::RawspeedException&) {
   73|    168|      failure1 = true;
   74|    168|    }
   75|       |
   76|  4.60M|    try {
   77|  4.60M|      decoded0 = ht0.template decode<decltype(bits0), IsFullDecode>(bits0);
   78|  4.60M|    } catch (const rawspeed::IOException&) {
   79|       |      // For now, let's ignore stream depleteon issues.
   80|      0|      throw;
   81|    168|    } catch (const rawspeed::RawspeedException&) {
   82|    168|      failure0 = true;
   83|    168|    }
   84|       |
   85|       |    // They both should either fail or succeed, else there is a bug.
   86|  4.60M|    assert(failure0 == failure1);
  ------------------
  |  Branch (86:5): [True: 4.60M, False: 0]
  ------------------
   87|       |
   88|       |    // If any failed, we can't continue.
   89|  4.60M|    if (failure0 || failure1)
  ------------------
  |  Branch (89:9): [True: 168, False: 4.60M]
  |  Branch (89:21): [True: 0, False: 4.60M]
  ------------------
   90|  4.60M|      ThrowRSE("Failure detected");
  ------------------
  |  |   95|    168|  ThrowExceptionHelper(rawspeed::RawspeedException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|    168|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|    168|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|    168|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   91|       |
   92|  4.60M|    (void)decoded0;
   93|  4.60M|    (void)decoded1;
   94|       |
   95|       |    // They both should have decoded the same value.
   96|       |    assert(decoded0 == decoded1);
  ------------------
  |  Branch (96:5): [True: 4.60M, False: 0]
  ------------------
   97|  4.60M|  }
   98|    462|}
Dual.cpp:_ZN12_GLOBAL__N_18workloopIN8rawspeed15BitStreamerJPEGELb0ENS1_20PrefixCodeLUTDecoderINS1_15BaselineCodeTagENS1_23PrefixCodeLookupDecoderIS4_EEEENS1_21PrefixCodeTreeDecoderIS4_EEEEvNS1_10Array1DRefIKhEERKT1_RKT2_:
   56|    221|              const HT1& ht1) {
   57|    221|  Pump bits0(input);
   58|    221|  Pump bits1(input);
   59|       |
   60|  11.0M|  while (true) {
  ------------------
  |  Branch (60:10): [True: 11.0M, Folded]
  ------------------
   61|  11.0M|    int decoded0;
   62|  11.0M|    int decoded1;
   63|       |
   64|  11.0M|    bool failure0 = false;
   65|  11.0M|    bool failure1 = false;
   66|       |
   67|  11.0M|    try {
   68|  11.0M|      decoded1 = ht1.template decode<decltype(bits1), IsFullDecode>(bits1);
   69|  11.0M|    } catch (const rawspeed::IOException&) {
   70|       |      // For now, let's ignore stream depleteon issues.
   71|    156|      throw;
   72|    156|    } catch (const rawspeed::RawspeedException&) {
   73|     64|      failure1 = true;
   74|     64|    }
   75|       |
   76|  11.0M|    try {
   77|  11.0M|      decoded0 = ht0.template decode<decltype(bits0), IsFullDecode>(bits0);
   78|  11.0M|    } 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|  11.0M|    assert(failure0 == failure1);
  ------------------
  |  Branch (86:5): [True: 11.0M, False: 0]
  ------------------
   87|       |
   88|       |    // If any failed, we can't continue.
   89|  11.0M|    if (failure0 || failure1)
  ------------------
  |  Branch (89:9): [True: 64, False: 11.0M]
  |  Branch (89:21): [True: 0, False: 11.0M]
  ------------------
   90|  11.0M|      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|  11.0M|    (void)decoded0;
   93|  11.0M|    (void)decoded1;
   94|       |
   95|       |    // They both should have decoded the same value.
   96|       |    assert(decoded0 == decoded1);
  ------------------
  |  Branch (96:5): [True: 11.0M, False: 0]
  ------------------
   97|  11.0M|  }
   98|    221|}
Dual.cpp:_ZN12_GLOBAL__N_112checkFlavourIN8rawspeed10VC5CodeTagEEEvNS1_10ByteStreamE:
  110|  1.05k|template <typename CodeTag> void checkFlavour(rawspeed::ByteStream bs) {
  111|  1.05k|  rawspeed::ByteStream bs0 = bs;
  112|  1.05k|  rawspeed::ByteStream bs1 = bs;
  113|       |
  114|       |#ifndef BACKIMPL0
  115|       |  const auto ht0 = createPrefixCodeDecoder<rawspeed::IMPL0<CodeTag>>(bs0);
  116|       |#else
  117|  1.05k|  const auto ht0 = createPrefixCodeDecoder<
  118|  1.05k|      rawspeed::IMPL0<CodeTag, rawspeed::BACKIMPL0<CodeTag>>>(bs0);
  119|  1.05k|#endif
  120|       |
  121|  1.05k|#ifndef BACKIMPL1
  122|  1.05k|  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.05k|  const int format0 = bs0.getByte();
  130|  1.05k|  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.05k|  assert(bs0.getPosition() == bs1.getPosition());
  ------------------
  |  Branch (134:3): [True: 755, False: 297]
  ------------------
  135|       |
  136|  1.05k|  assert(format0 == format1);
  ------------------
  |  Branch (136:3): [True: 755, False: 0]
  ------------------
  137|    755|  (void)format1;
  138|       |
  139|    755|  const auto input = bs0.peekRemainingBuffer().getAsArray1DRef();
  140|       |
  141|    755|  assert(format0 == format1);
  ------------------
  |  Branch (141:3): [True: 755, False: 0]
  ------------------
  142|    755|  switch (format0) {
  143|    267|  case 0:
  ------------------
  |  Branch (143:3): [True: 267, False: 488]
  ------------------
  144|    267|    checkPump<rawspeed::BitStreamerMSB>(input, ht0, ht1);
  145|    267|    break;
  146|    225|  case 1:
  ------------------
  |  Branch (146:3): [True: 225, False: 530]
  ------------------
  147|    225|    checkPump<rawspeed::BitStreamerMSB32>(input, ht0, ht1);
  148|    225|    break;
  149|    257|  case 2:
  ------------------
  |  Branch (149:3): [True: 257, False: 498]
  ------------------
  150|    257|    checkPump<rawspeed::BitStreamerJPEG>(input, ht0, ht1);
  151|    257|    break;
  152|      6|  default:
  ------------------
  |  Branch (152:3): [True: 6, False: 749]
  ------------------
  153|      6|    ThrowRSE("Unknown bit pump");
  ------------------
  |  |   95|      6|  ThrowExceptionHelper(rawspeed::RawspeedException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      6|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      6|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      6|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  154|    755|  }
  155|    755|}
Dual.cpp:_ZN12_GLOBAL__N_19checkPumpIN8rawspeed14BitStreamerMSBENS1_20PrefixCodeLUTDecoderINS1_10VC5CodeTagENS1_23PrefixCodeLookupDecoderIS4_EEEENS1_21PrefixCodeTreeDecoderIS4_EEEEvNS1_10Array1DRefIKhEERKT0_RKT1_:
  102|    267|               const HT1& ht1) {
  103|    267|  assert(ht0.isFullDecode() == ht1.isFullDecode());
  ------------------
  |  Branch (103:3): [True: 267, False: 0]
  ------------------
  104|    267|  if (ht0.isFullDecode())
  ------------------
  |  Branch (104:7): [True: 0, False: 267]
  ------------------
  105|      0|    workloop<Pump, /*IsFullDecode=*/true>(input, ht0, ht1);
  106|    267|  else
  107|    267|    workloop<Pump, /*IsFullDecode=*/false>(input, ht0, ht1);
  108|    267|}
Dual.cpp:_ZN12_GLOBAL__N_18workloopIN8rawspeed14BitStreamerMSBELb0ENS1_20PrefixCodeLUTDecoderINS1_10VC5CodeTagENS1_23PrefixCodeLookupDecoderIS4_EEEENS1_21PrefixCodeTreeDecoderIS4_EEEEvNS1_10Array1DRefIKhEERKT1_RKT2_:
   56|    267|              const HT1& ht1) {
   57|    267|  Pump bits0(input);
   58|    267|  Pump bits1(input);
   59|       |
   60|  27.4M|  while (true) {
  ------------------
  |  Branch (60:10): [True: 27.4M, Folded]
  ------------------
   61|  27.4M|    int decoded0;
   62|  27.4M|    int decoded1;
   63|       |
   64|  27.4M|    bool failure0 = false;
   65|  27.4M|    bool failure1 = false;
   66|       |
   67|  27.4M|    try {
   68|  27.4M|      decoded1 = ht1.template decode<decltype(bits1), IsFullDecode>(bits1);
   69|  27.4M|    } catch (const rawspeed::IOException&) {
   70|       |      // For now, let's ignore stream depleteon issues.
   71|     88|      throw;
   72|    167|    } catch (const rawspeed::RawspeedException&) {
   73|    167|      failure1 = true;
   74|    167|    }
   75|       |
   76|  27.4M|    try {
   77|  27.4M|      decoded0 = ht0.template decode<decltype(bits0), IsFullDecode>(bits0);
   78|  27.4M|    } catch (const rawspeed::IOException&) {
   79|       |      // For now, let's ignore stream depleteon issues.
   80|      0|      throw;
   81|    167|    } catch (const rawspeed::RawspeedException&) {
   82|    167|      failure0 = true;
   83|    167|    }
   84|       |
   85|       |    // They both should either fail or succeed, else there is a bug.
   86|  27.4M|    assert(failure0 == failure1);
  ------------------
  |  Branch (86:5): [True: 27.4M, False: 0]
  ------------------
   87|       |
   88|       |    // If any failed, we can't continue.
   89|  27.4M|    if (failure0 || failure1)
  ------------------
  |  Branch (89:9): [True: 167, False: 27.4M]
  |  Branch (89:21): [True: 0, False: 27.4M]
  ------------------
   90|  27.4M|      ThrowRSE("Failure detected");
  ------------------
  |  |   95|    167|  ThrowExceptionHelper(rawspeed::RawspeedException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|    167|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|    167|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|    167|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   91|       |
   92|  27.4M|    (void)decoded0;
   93|  27.4M|    (void)decoded1;
   94|       |
   95|       |    // They both should have decoded the same value.
   96|       |    assert(decoded0 == decoded1);
  ------------------
  |  Branch (96:5): [True: 27.4M, False: 0]
  ------------------
   97|  27.4M|  }
   98|    267|}
Dual.cpp:_ZN12_GLOBAL__N_19checkPumpIN8rawspeed16BitStreamerMSB32ENS1_20PrefixCodeLUTDecoderINS1_10VC5CodeTagENS1_23PrefixCodeLookupDecoderIS4_EEEENS1_21PrefixCodeTreeDecoderIS4_EEEEvNS1_10Array1DRefIKhEERKT0_RKT1_:
  102|    225|               const HT1& ht1) {
  103|    225|  assert(ht0.isFullDecode() == ht1.isFullDecode());
  ------------------
  |  Branch (103:3): [True: 225, False: 0]
  ------------------
  104|    225|  if (ht0.isFullDecode())
  ------------------
  |  Branch (104:7): [True: 0, False: 225]
  ------------------
  105|      0|    workloop<Pump, /*IsFullDecode=*/true>(input, ht0, ht1);
  106|    225|  else
  107|    225|    workloop<Pump, /*IsFullDecode=*/false>(input, ht0, ht1);
  108|    225|}
Dual.cpp:_ZN12_GLOBAL__N_18workloopIN8rawspeed16BitStreamerMSB32ELb0ENS1_20PrefixCodeLUTDecoderINS1_10VC5CodeTagENS1_23PrefixCodeLookupDecoderIS4_EEEENS1_21PrefixCodeTreeDecoderIS4_EEEEvNS1_10Array1DRefIKhEERKT1_RKT2_:
   56|    225|              const HT1& ht1) {
   57|    225|  Pump bits0(input);
   58|    225|  Pump bits1(input);
   59|       |
   60|  26.2M|  while (true) {
  ------------------
  |  Branch (60:10): [True: 26.2M, Folded]
  ------------------
   61|  26.2M|    int decoded0;
   62|  26.2M|    int decoded1;
   63|       |
   64|  26.2M|    bool failure0 = false;
   65|  26.2M|    bool failure1 = false;
   66|       |
   67|  26.2M|    try {
   68|  26.2M|      decoded1 = ht1.template decode<decltype(bits1), IsFullDecode>(bits1);
   69|  26.2M|    } catch (const rawspeed::IOException&) {
   70|       |      // For now, let's ignore stream depleteon issues.
   71|     79|      throw;
   72|    144|    } catch (const rawspeed::RawspeedException&) {
   73|    144|      failure1 = true;
   74|    144|    }
   75|       |
   76|  26.2M|    try {
   77|  26.2M|      decoded0 = ht0.template decode<decltype(bits0), IsFullDecode>(bits0);
   78|  26.2M|    } 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|  26.2M|    assert(failure0 == failure1);
  ------------------
  |  Branch (86:5): [True: 26.2M, False: 0]
  ------------------
   87|       |
   88|       |    // If any failed, we can't continue.
   89|  26.2M|    if (failure0 || failure1)
  ------------------
  |  Branch (89:9): [True: 144, False: 26.2M]
  |  Branch (89:21): [True: 0, False: 26.2M]
  ------------------
   90|  26.2M|      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|  26.2M|    (void)decoded0;
   93|  26.2M|    (void)decoded1;
   94|       |
   95|       |    // They both should have decoded the same value.
   96|       |    assert(decoded0 == decoded1);
  ------------------
  |  Branch (96:5): [True: 26.2M, False: 0]
  ------------------
   97|  26.2M|  }
   98|    225|}
Dual.cpp:_ZN12_GLOBAL__N_19checkPumpIN8rawspeed15BitStreamerJPEGENS1_20PrefixCodeLUTDecoderINS1_10VC5CodeTagENS1_23PrefixCodeLookupDecoderIS4_EEEENS1_21PrefixCodeTreeDecoderIS4_EEEEvNS1_10Array1DRefIKhEERKT0_RKT1_:
  102|    257|               const HT1& ht1) {
  103|    257|  assert(ht0.isFullDecode() == ht1.isFullDecode());
  ------------------
  |  Branch (103:3): [True: 257, False: 0]
  ------------------
  104|    257|  if (ht0.isFullDecode())
  ------------------
  |  Branch (104:7): [True: 0, False: 257]
  ------------------
  105|      0|    workloop<Pump, /*IsFullDecode=*/true>(input, ht0, ht1);
  106|    257|  else
  107|    257|    workloop<Pump, /*IsFullDecode=*/false>(input, ht0, ht1);
  108|    257|}
Dual.cpp:_ZN12_GLOBAL__N_18workloopIN8rawspeed15BitStreamerJPEGELb0ENS1_20PrefixCodeLUTDecoderINS1_10VC5CodeTagENS1_23PrefixCodeLookupDecoderIS4_EEEENS1_21PrefixCodeTreeDecoderIS4_EEEEvNS1_10Array1DRefIKhEERKT1_RKT2_:
   56|    257|              const HT1& ht1) {
   57|    257|  Pump bits0(input);
   58|    257|  Pump bits1(input);
   59|       |
   60|  7.51k|  while (true) {
  ------------------
  |  Branch (60:10): [True: 7.51k, Folded]
  ------------------
   61|  7.51k|    int decoded0;
   62|  7.51k|    int decoded1;
   63|       |
   64|  7.51k|    bool failure0 = false;
   65|  7.51k|    bool failure1 = false;
   66|       |
   67|  7.51k|    try {
   68|  7.51k|      decoded1 = ht1.template decode<decltype(bits1), IsFullDecode>(bits1);
   69|  7.51k|    } catch (const rawspeed::IOException&) {
   70|       |      // For now, let's ignore stream depleteon issues.
   71|    118|      throw;
   72|    136|    } catch (const rawspeed::RawspeedException&) {
   73|    136|      failure1 = true;
   74|    136|    }
   75|       |
   76|  7.39k|    try {
   77|  7.39k|      decoded0 = ht0.template decode<decltype(bits0), IsFullDecode>(bits0);
   78|  7.39k|    } catch (const rawspeed::IOException&) {
   79|       |      // For now, let's ignore stream depleteon issues.
   80|      0|      throw;
   81|    136|    } catch (const rawspeed::RawspeedException&) {
   82|    136|      failure0 = true;
   83|    136|    }
   84|       |
   85|       |    // They both should either fail or succeed, else there is a bug.
   86|  7.39k|    assert(failure0 == failure1);
  ------------------
  |  Branch (86:5): [True: 7.39k, False: 0]
  ------------------
   87|       |
   88|       |    // If any failed, we can't continue.
   89|  7.39k|    if (failure0 || failure1)
  ------------------
  |  Branch (89:9): [True: 136, False: 7.25k]
  |  Branch (89:21): [True: 0, False: 7.25k]
  ------------------
   90|  7.39k|      ThrowRSE("Failure detected");
  ------------------
  |  |   95|    136|  ThrowExceptionHelper(rawspeed::RawspeedException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|    136|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|    136|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|    136|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   91|       |
   92|  7.25k|    (void)decoded0;
   93|  7.25k|    (void)decoded1;
   94|       |
   95|       |    // They both should have decoded the same value.
   96|       |    assert(decoded0 == decoded1);
  ------------------
  |  Branch (96:5): [True: 7.25k, False: 0]
  ------------------
   97|  7.25k|  }
   98|    257|}

_ZN8rawspeed10Array1DRefIKhEC2EPS1_i:
  104|   275k|    : data(data_), numElts(numElts_) {
  105|   275k|  establishClassInvariants();
  106|   275k|}
_ZNK8rawspeed10Array1DRefIKhE24establishClassInvariantsEv:
   97|  2.36M|Array1DRef<T>::establishClassInvariants() const noexcept {
   98|  2.36M|  invariant(data);
  ------------------
  |  |   27|  2.36M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (98:3): [True: 2.36M, False: 0]
  ------------------
   99|  2.36M|  invariant(numElts >= 0);
  ------------------
  |  |   27|  2.36M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (99:3): [True: 2.36M, False: 0]
  ------------------
  100|  2.36M|}
_ZNK8rawspeed10Array1DRefIKhE5beginEv:
  159|   177k|template <class T> inline T* Array1DRef<T>::begin() const {
  160|   177k|  establishClassInvariants();
  161|   177k|  return addressOf(/*eltIdx=*/0);
  162|   177k|}
_ZNK8rawspeed10Array1DRefIKhE9addressOfEi:
  133|   277k|Array1DRef<T>::addressOf(const int eltIdx) const {
  134|   277k|  establishClassInvariants();
  135|   277k|  invariant(eltIdx >= 0);
  ------------------
  |  |   27|   277k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (135:3): [True: 277k, False: 0]
  ------------------
  136|   277k|  invariant(eltIdx <= numElts);
  ------------------
  |  |   27|   277k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (136:3): [True: 277k, False: 0]
  ------------------
  137|   277k|#pragma GCC diagnostic push
  138|   277k|#pragma GCC diagnostic ignored "-Wpragmas"
  139|   277k|#pragma GCC diagnostic ignored "-Wunknown-warning-option"
  140|   277k|#pragma GCC diagnostic ignored "-Wunsafe-buffer-usage"
  141|   277k|  return data + eltIdx;
  142|   277k|#pragma GCC diagnostic pop
  143|   277k|}
_ZNK8rawspeed10Array1DRefIKhE4sizeEv:
  154|  1.17M|template <class T> inline int Array1DRef<T>::size() const {
  155|  1.17M|  establishClassInvariants();
  156|  1.17M|  return numElts;
  157|  1.17M|}
_ZNK8rawspeed10Array1DRefIKhE7getCropEii:
  110|  89.5k|Array1DRef<T>::getCrop(int offset, int size) const {
  111|  89.5k|  establishClassInvariants();
  112|  89.5k|  invariant(offset >= 0);
  ------------------
  |  |   27|  89.5k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (112:3): [True: 89.5k, False: 0]
  ------------------
  113|  89.5k|  invariant(size >= 0);
  ------------------
  |  |   27|  89.5k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (113:3): [True: 89.5k, False: 0]
  ------------------
  114|  89.5k|  invariant(offset <= numElts);
  ------------------
  |  |   27|  89.5k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (114:3): [True: 89.5k, False: 0]
  ------------------
  115|  89.5k|  invariant(size <= numElts);
  ------------------
  |  |   27|  89.5k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (115:3): [True: 89.5k, False: 0]
  ------------------
  116|  89.5k|  invariant(offset + size <= numElts);
  ------------------
  |  |   27|  89.5k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (116:3): [True: 89.5k, False: 0]
  ------------------
  117|  89.5k|  return {*this, offset, size};
  118|  89.5k|}
_ZNK8rawspeed10Array1DRefIKhE3endEv:
  163|  9.98k|template <class T> inline T* Array1DRef<T>::end() const {
  164|  9.98k|  establishClassInvariants();
  165|  9.98k|  return addressOf(/*eltIdx=*/numElts);
  166|  9.98k|}
_ZN8rawspeed10Array1DRefIKSt4byteEC2IKhQaaaantaasr3stdE10is_const_vITL0__Entsr3stdE10is_const_vIT_Entsr3stdE9is_same_vIu14__remove_constIS7_Eu14__remove_constIS6_EEsr3stdE9is_same_vIS8_S1_EEENS0_IS7_EE:
   78|  4.95k|      : Array1DRef(reinterpret_cast<T*>(RHS.data), sizeof(T2) * RHS.numElts) {}
_ZN8rawspeed10Array1DRefIKSt4byteEC2EPS2_i:
  104|  22.8M|    : data(data_), numElts(numElts_) {
  105|  22.8M|  establishClassInvariants();
  106|  22.8M|}
_ZNK8rawspeed10Array1DRefIKSt4byteE24establishClassInvariantsEv:
   97|  3.51G|Array1DRef<T>::establishClassInvariants() const noexcept {
   98|  3.51G|  invariant(data);
  ------------------
  |  |   27|  3.51G|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (98:3): [True: 3.51G, False: 0]
  ------------------
   99|  3.51G|  invariant(numElts >= 0);
  ------------------
  |  |   27|  3.51G|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (99:3): [True: 3.51G, False: 0]
  ------------------
  100|  3.51G|}
_ZNK8rawspeed10Array1DRefIKSt4byteE4sizeEv:
  154|  1.81G|template <class T> inline int Array1DRef<T>::size() const {
  155|  1.81G|  establishClassInvariants();
  156|  1.81G|  return numElts;
  157|  1.81G|}
_ZN8rawspeed10Array1DRefISt4byteEC2EPS1_i:
  104|  45.7M|    : data(data_), numElts(numElts_) {
  105|  45.7M|  establishClassInvariants();
  106|  45.7M|}
_ZNK8rawspeed10Array1DRefISt4byteE24establishClassInvariantsEv:
   97|   467M|Array1DRef<T>::establishClassInvariants() const noexcept {
   98|   467M|  invariant(data);
  ------------------
  |  |   27|   467M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (98:3): [True: 467M, False: 0]
  ------------------
   99|   467M|  invariant(numElts >= 0);
  ------------------
  |  |   27|   467M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (99:3): [True: 467M, False: 0]
  ------------------
  100|   467M|}
_ZNK8rawspeed10Array1DRefIKSt4byteE7getCropEii:
  110|  22.8M|Array1DRef<T>::getCrop(int offset, int size) const {
  111|  22.8M|  establishClassInvariants();
  112|  22.8M|  invariant(offset >= 0);
  ------------------
  |  |   27|  22.8M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (112:3): [True: 22.8M, False: 0]
  ------------------
  113|  22.8M|  invariant(size >= 0);
  ------------------
  |  |   27|  22.8M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (113:3): [True: 22.8M, False: 0]
  ------------------
  114|  22.8M|  invariant(offset <= numElts);
  ------------------
  |  |   27|  22.8M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (114:3): [True: 22.8M, False: 0]
  ------------------
  115|  22.8M|  invariant(size <= numElts);
  ------------------
  |  |   27|  22.8M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (115:3): [True: 22.8M, False: 0]
  ------------------
  116|  22.8M|  invariant(offset + size <= numElts);
  ------------------
  |  |   27|  22.8M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (116:3): [True: 22.8M, False: 0]
  ------------------
  117|  22.8M|  return {*this, offset, size};
  118|  22.8M|}
_ZNK8rawspeed10Array1DRefIKSt4byteE9addressOfEi:
  133|  45.7M|Array1DRef<T>::addressOf(const int eltIdx) const {
  134|  45.7M|  establishClassInvariants();
  135|  45.7M|  invariant(eltIdx >= 0);
  ------------------
  |  |   27|  45.7M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (135:3): [True: 45.7M, False: 0]
  ------------------
  136|  45.7M|  invariant(eltIdx <= numElts);
  ------------------
  |  |   27|  45.7M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (136:3): [True: 45.7M, False: 0]
  ------------------
  137|  45.7M|#pragma GCC diagnostic push
  138|  45.7M|#pragma GCC diagnostic ignored "-Wpragmas"
  139|  45.7M|#pragma GCC diagnostic ignored "-Wunknown-warning-option"
  140|  45.7M|#pragma GCC diagnostic ignored "-Wunsafe-buffer-usage"
  141|  45.7M|  return data + eltIdx;
  142|  45.7M|#pragma GCC diagnostic pop
  143|  45.7M|}
_ZNK8rawspeed10Array1DRefISt4byteE4sizeEv:
  154|   239M|template <class T> inline int Array1DRef<T>::size() const {
  155|   239M|  establishClassInvariants();
  156|   239M|  return numElts;
  157|   239M|}
_ZNK8rawspeed10Array1DRefISt4byteE5beginEv:
  159|  24.2M|template <class T> inline T* Array1DRef<T>::begin() const {
  160|  24.2M|  establishClassInvariants();
  161|  24.2M|  return addressOf(/*eltIdx=*/0);
  162|  24.2M|}
_ZNK8rawspeed10Array1DRefISt4byteE9addressOfEi:
  133|  48.5M|Array1DRef<T>::addressOf(const int eltIdx) const {
  134|  48.5M|  establishClassInvariants();
  135|  48.5M|  invariant(eltIdx >= 0);
  ------------------
  |  |   27|  48.5M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (135:3): [True: 48.5M, False: 0]
  ------------------
  136|  48.5M|  invariant(eltIdx <= numElts);
  ------------------
  |  |   27|  48.5M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (136:3): [True: 48.5M, False: 0]
  ------------------
  137|  48.5M|#pragma GCC diagnostic push
  138|  48.5M|#pragma GCC diagnostic ignored "-Wpragmas"
  139|  48.5M|#pragma GCC diagnostic ignored "-Wunknown-warning-option"
  140|  48.5M|#pragma GCC diagnostic ignored "-Wunsafe-buffer-usage"
  141|  48.5M|  return data + eltIdx;
  142|  48.5M|#pragma GCC diagnostic pop
  143|  48.5M|}
_ZNK8rawspeed10Array1DRefIKSt4byteE5beginEv:
  159|  22.8M|template <class T> inline T* Array1DRef<T>::begin() const {
  160|  22.8M|  establishClassInvariants();
  161|  22.8M|  return addressOf(/*eltIdx=*/0);
  162|  22.8M|}
_ZNK8rawspeed10Array1DRefISt4byteE3endEv:
  163|  11.1k|template <class T> inline T* Array1DRef<T>::end() const {
  164|  11.1k|  establishClassInvariants();
  165|  11.1k|  return addressOf(/*eltIdx=*/numElts);
  166|  11.1k|}
_ZNK8rawspeed10Array1DRefISt4byteE7getCropEii:
  110|  21.4M|Array1DRef<T>::getCrop(int offset, int size) const {
  111|  21.4M|  establishClassInvariants();
  112|  21.4M|  invariant(offset >= 0);
  ------------------
  |  |   27|  21.4M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (112:3): [True: 21.4M, False: 0]
  ------------------
  113|  21.4M|  invariant(size >= 0);
  ------------------
  |  |   27|  21.4M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (113:3): [True: 21.4M, False: 0]
  ------------------
  114|  21.4M|  invariant(offset <= numElts);
  ------------------
  |  |   27|  21.4M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (114:3): [True: 21.4M, False: 0]
  ------------------
  115|  21.4M|  invariant(size <= numElts);
  ------------------
  |  |   27|  21.4M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (115:3): [True: 21.4M, False: 0]
  ------------------
  116|  21.4M|  invariant(offset + size <= numElts);
  ------------------
  |  |   27|  21.4M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (116:3): [True: 21.4M, False: 0]
  ------------------
  117|  21.4M|  return {*this, offset, size};
  118|  21.4M|}
_ZNK8rawspeed10Array1DRefISt4byteE8getBlockEii:
  122|  21.4M|Array1DRef<T>::getBlock(int size, int index) const {
  123|  21.4M|  establishClassInvariants();
  124|  21.4M|  invariant(index >= 0);
  ------------------
  |  |   27|  21.4M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (124:3): [True: 21.4M, False: 0]
  ------------------
  125|  21.4M|  invariant(size >= 0);
  ------------------
  |  |   27|  21.4M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (125:3): [True: 21.4M, False: 0]
  ------------------
  126|  21.4M|  invariant(index <= numElts);
  ------------------
  |  |   27|  21.4M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (126:3): [True: 21.4M, False: 0]
  ------------------
  127|  21.4M|  invariant(size <= numElts);
  ------------------
  |  |   27|  21.4M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (127:3): [True: 21.4M, False: 0]
  ------------------
  128|  21.4M|  return getCrop(size * index, size);
  129|  21.4M|}
_ZNK8rawspeed10Array1DRefISt4byteEclEi:
  147|  2.82M|Array1DRef<T>::operator()(const int eltIdx) const {
  148|  2.82M|  establishClassInvariants();
  149|  2.82M|  invariant(eltIdx >= 0);
  ------------------
  |  |   27|  2.82M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (149:3): [True: 2.82M, False: 0]
  ------------------
  150|  2.82M|  invariant(eltIdx < numElts);
  ------------------
  |  |   27|  2.82M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (150:3): [True: 2.82M, False: 0]
  ------------------
  151|  2.82M|  return *addressOf(eltIdx);
  152|  2.82M|}
_ZNK8rawspeed10Array1DRefIKjE4sizeEv:
  154|  3.71k|template <class T> inline int Array1DRef<T>::size() const {
  155|  3.71k|  establishClassInvariants();
  156|  3.71k|  return numElts;
  157|  3.71k|}
_ZNK8rawspeed10Array1DRefIKjE24establishClassInvariantsEv:
   97|  13.0k|Array1DRef<T>::establishClassInvariants() const noexcept {
   98|  13.0k|  invariant(data);
  ------------------
  |  |   27|  13.0k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (98:3): [True: 13.0k, False: 0]
  ------------------
   99|  13.0k|  invariant(numElts >= 0);
  ------------------
  |  |   27|  13.0k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (99:3): [True: 13.0k, False: 0]
  ------------------
  100|  13.0k|}
_ZNK8rawspeed10Array1DRefIKjE5beginEv:
  159|  1.85k|template <class T> inline T* Array1DRef<T>::begin() const {
  160|  1.85k|  establishClassInvariants();
  161|  1.85k|  return addressOf(/*eltIdx=*/0);
  162|  1.85k|}
_ZNK8rawspeed10Array1DRefIKjE9addressOfEi:
  133|  3.71k|Array1DRef<T>::addressOf(const int eltIdx) const {
  134|  3.71k|  establishClassInvariants();
  135|  3.71k|  invariant(eltIdx >= 0);
  ------------------
  |  |   27|  3.71k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (135:3): [True: 3.71k, False: 0]
  ------------------
  136|  3.71k|  invariant(eltIdx <= numElts);
  ------------------
  |  |   27|  3.71k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (136:3): [True: 3.71k, False: 0]
  ------------------
  137|  3.71k|#pragma GCC diagnostic push
  138|  3.71k|#pragma GCC diagnostic ignored "-Wpragmas"
  139|  3.71k|#pragma GCC diagnostic ignored "-Wunknown-warning-option"
  140|  3.71k|#pragma GCC diagnostic ignored "-Wunsafe-buffer-usage"
  141|  3.71k|  return data + eltIdx;
  142|  3.71k|#pragma GCC diagnostic pop
  143|  3.71k|}
_ZNK8rawspeed10Array1DRefIKjE3endEv:
  163|  1.85k|template <class T> inline T* Array1DRef<T>::end() const {
  164|  1.85k|  establishClassInvariants();
  165|  1.85k|  return addressOf(/*eltIdx=*/numElts);
  166|  1.85k|}
_ZN8rawspeed10Array1DRefIKjEC2EPS1_i:
  104|  1.85k|    : data(data_), numElts(numElts_) {
  105|  1.85k|  establishClassInvariants();
  106|  1.85k|}

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

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

_ZN8rawspeed13implicit_castIjmQaaaaoosr3stdE13is_integral_vIT0_Esr3stdE19is_floating_point_vIS1_Eoosr3stdE13is_integral_vIT_Esr3stdE19is_floating_point_vIS2_Entsr3stdE9is_same_vIS1_S2_EEES2_S1_:
   32|   403M|constexpr RAWSPEED_READNONE Ttgt implicit_cast(Tsrc value) {
   33|   403M|#pragma GCC diagnostic push
   34|   403M|#pragma GCC diagnostic ignored "-Wconversion"
   35|   403M|#pragma GCC diagnostic ignored "-Wdouble-promotion"
   36|   403M|  return value;
   37|   403M|#pragma GCC diagnostic pop
   38|   403M|}
_ZN8rawspeed13implicit_castIijQaaaaoosr3stdE13is_integral_vIT0_Esr3stdE19is_floating_point_vIS1_Eoosr3stdE13is_integral_vIT_Esr3stdE19is_floating_point_vIS2_Entsr3stdE9is_same_vIS1_S2_EEES2_S1_:
   32|   182k|constexpr RAWSPEED_READNONE Ttgt implicit_cast(Tsrc value) {
   33|   182k|#pragma GCC diagnostic push
   34|   182k|#pragma GCC diagnostic ignored "-Wconversion"
   35|   182k|#pragma GCC diagnostic ignored "-Wdouble-promotion"
   36|   182k|  return value;
   37|   182k|#pragma GCC diagnostic pop
   38|   182k|}
_ZN8rawspeed13implicit_castItjQaaaaoosr3stdE13is_integral_vIT0_Esr3stdE19is_floating_point_vIS1_Eoosr3stdE13is_integral_vIT_Esr3stdE19is_floating_point_vIS2_Entsr3stdE9is_same_vIS1_S2_EEES2_S1_:
   32|   119M|constexpr RAWSPEED_READNONE Ttgt implicit_cast(Tsrc value) {
   33|   119M|#pragma GCC diagnostic push
   34|   119M|#pragma GCC diagnostic ignored "-Wconversion"
   35|   119M|#pragma GCC diagnostic ignored "-Wdouble-promotion"
   36|   119M|  return value;
   37|   119M|#pragma GCC diagnostic pop
   38|   119M|}
_ZN8rawspeed13implicit_castItiQaaaaoosr3stdE13is_integral_vIT0_Esr3stdE19is_floating_point_vIS1_Eoosr3stdE13is_integral_vIT_Esr3stdE19is_floating_point_vIS2_Entsr3stdE9is_same_vIS1_S2_EEES2_S1_:
   32|  12.1k|constexpr RAWSPEED_READNONE Ttgt implicit_cast(Tsrc value) {
   33|  12.1k|#pragma GCC diagnostic push
   34|  12.1k|#pragma GCC diagnostic ignored "-Wconversion"
   35|  12.1k|#pragma GCC diagnostic ignored "-Wdouble-promotion"
   36|  12.1k|  return value;
   37|  12.1k|#pragma GCC diagnostic pop
   38|  12.1k|}
_ZN8rawspeed13implicit_castIimQaaaaoosr3stdE13is_integral_vIT0_Esr3stdE19is_floating_point_vIS1_Eoosr3stdE13is_integral_vIT_Esr3stdE19is_floating_point_vIS2_Entsr3stdE9is_same_vIS1_S2_EEES2_S1_:
   32|  45.7M|constexpr RAWSPEED_READNONE Ttgt implicit_cast(Tsrc value) {
   33|  45.7M|#pragma GCC diagnostic push
   34|  45.7M|#pragma GCC diagnostic ignored "-Wconversion"
   35|  45.7M|#pragma GCC diagnostic ignored "-Wdouble-promotion"
   36|  45.7M|  return value;
   37|  45.7M|#pragma GCC diagnostic pop
   38|  45.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|  53.9M|constexpr RAWSPEED_READNONE Ttgt implicit_cast(Tsrc value) {
   47|  53.9M|  return value;
   48|  53.9M|}

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

_ZN8rawspeed8OptionalINS_20PrefixCodeLUTDecoderINS_15BaselineCodeTagENS_23PrefixCodeLookupDecoderIS2_EEEEEC2Ev:
   35|  2.11k|  Optional() = default;
_ZN8rawspeed8OptionalINS_20PrefixCodeLUTDecoderINS_15BaselineCodeTagENS_23PrefixCodeLookupDecoderIS2_EEEEEaSIS5_Qsr3stdE7same_asITL0__T_EEERS6_OS9_:
   46|  2.04k|  Optional<T>& operator=(U&& value) {
   47|  2.04k|    impl = std::forward<U>(value);
   48|  2.04k|    return *this;
   49|  2.04k|  }
_ZN8rawspeed8OptionalINS_20PrefixCodeLUTDecoderINS_15BaselineCodeTagENS_23PrefixCodeLookupDecoderIS2_EEEEEptEv:
   60|  1.96k|  T* operator->() {
   61|  1.96k|    invariant(has_value());
  ------------------
  |  |   27|  1.96k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (61:5): [True: 1.96k, False: 0]
  ------------------
   62|  1.96k|    return &impl.value();
   63|  1.96k|  }
_ZNK8rawspeed8OptionalINS_20PrefixCodeLUTDecoderINS_15BaselineCodeTagENS_23PrefixCodeLookupDecoderIS2_EEEEE9has_valueEv:
   85|  3.92k|  [[nodiscard]] bool has_value() const RAWSPEED_READNONE {
   86|  3.92k|    return impl.has_value();
   87|  3.92k|  }
_ZNR8rawspeed8OptionalINS_20PrefixCodeLUTDecoderINS_15BaselineCodeTagENS_23PrefixCodeLookupDecoderIS2_EEEEEdeEv:
   70|  1.95k|  T& operator*() & {
   71|  1.95k|    invariant(has_value());
  ------------------
  |  |   27|  1.95k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (71:5): [True: 1.95k, False: 0]
  ------------------
   72|  1.95k|    return impl.value();
   73|  1.95k|  }
_ZN8rawspeed8OptionalINS_21PrefixCodeTreeDecoderINS_15BaselineCodeTagEEEEC2Ev:
   35|  1.95k|  Optional() = default;
_ZN8rawspeed8OptionalINS_21PrefixCodeTreeDecoderINS_15BaselineCodeTagEEEEaSIS3_Qsr3stdE7same_asITL0__T_EEERS4_OS7_:
   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_21PrefixCodeTreeDecoderINS_15BaselineCodeTagEEEEptEv:
   60|  1.95k|  T* operator->() {
   61|  1.95k|    invariant(has_value());
  ------------------
  |  |   27|  1.95k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (61:5): [True: 1.95k, False: 0]
  ------------------
   62|  1.95k|    return &impl.value();
   63|  1.95k|  }
_ZNK8rawspeed8OptionalINS_21PrefixCodeTreeDecoderINS_15BaselineCodeTagEEEE9has_valueEv:
   85|  3.91k|  [[nodiscard]] bool has_value() const RAWSPEED_READNONE {
   86|  3.91k|    return impl.has_value();
   87|  3.91k|  }
_ZNR8rawspeed8OptionalINS_21PrefixCodeTreeDecoderINS_15BaselineCodeTagEEEEdeEv:
   70|  1.95k|  T& operator*() & {
   71|  1.95k|    invariant(has_value());
  ------------------
  |  |   27|  1.95k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (71:5): [True: 1.95k, False: 0]
  ------------------
   72|  1.95k|    return impl.value();
   73|  1.95k|  }
_ZN8rawspeed8OptionalINSt3__14pairINS_18AbstractPrefixCodeINS_15BaselineCodeTagEE10CodeSymbolEiEEEC2IS7_Qaaaaaantsr3stdE7same_asITL0__NS0_IT_EEEntsr3stdE7same_asISA_RSD_Entsr3stdE7same_asISA_OSD_Entsr3stdE7same_asISA_NS1_8optionalISB_EEEEEOSB_:
   42|   108M|  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|  42.1M|  Optional(U&& value) : impl(std::forward<U>(value)) {}
_ZNK8rawspeed8OptionalINSt3__14pairINS_18AbstractPrefixCodeINS_15BaselineCodeTagEE10CodeSymbolEiEEEcvbEv:
   89|   150M|  explicit operator bool() const { return has_value(); }
_ZNK8rawspeed8OptionalINSt3__14pairINS_18AbstractPrefixCodeINS_15BaselineCodeTagEE10CodeSymbolEiEEE9has_valueEv:
   85|   258M|  [[nodiscard]] bool has_value() const RAWSPEED_READNONE {
   86|   258M|    return impl.has_value();
   87|   258M|  }
_ZNR8rawspeed8OptionalINSt3__14pairINS_18AbstractPrefixCodeINS_15BaselineCodeTagEE10CodeSymbolEiEEEdeEv:
   70|   108M|  T& operator*() & {
   71|   108M|    invariant(has_value());
  ------------------
  |  |   27|   108M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (71:5): [True: 108M, False: 0]
  ------------------
   72|   108M|    return impl.value();
   73|   108M|  }
_ZN8rawspeed8OptionalINS_20PrefixCodeLUTDecoderINS_10VC5CodeTagENS_23PrefixCodeLookupDecoderIS2_EEEEEC2Ev:
   35|  1.05k|  Optional() = default;
_ZN8rawspeed8OptionalINS_20PrefixCodeLUTDecoderINS_10VC5CodeTagENS_23PrefixCodeLookupDecoderIS2_EEEEEaSIS5_Qsr3stdE7same_asITL0__T_EEERS6_OS9_:
   46|    974|  Optional<T>& operator=(U&& value) {
   47|    974|    impl = std::forward<U>(value);
   48|    974|    return *this;
   49|    974|  }
_ZN8rawspeed8OptionalINS_20PrefixCodeLUTDecoderINS_10VC5CodeTagENS_23PrefixCodeLookupDecoderIS2_EEEEEptEv:
   60|    884|  T* operator->() {
   61|    884|    invariant(has_value());
  ------------------
  |  |   27|    884|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (61:5): [True: 884, False: 0]
  ------------------
   62|    884|    return &impl.value();
   63|    884|  }
_ZNK8rawspeed8OptionalINS_20PrefixCodeLUTDecoderINS_10VC5CodeTagENS_23PrefixCodeLookupDecoderIS2_EEEEE9has_valueEv:
   85|  1.76k|  [[nodiscard]] bool has_value() const RAWSPEED_READNONE {
   86|  1.76k|    return impl.has_value();
   87|  1.76k|  }
_ZNR8rawspeed8OptionalINS_20PrefixCodeLUTDecoderINS_10VC5CodeTagENS_23PrefixCodeLookupDecoderIS2_EEEEEdeEv:
   70|    884|  T& operator*() & {
   71|    884|    invariant(has_value());
  ------------------
  |  |   27|    884|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (71:5): [True: 884, False: 0]
  ------------------
   72|    884|    return impl.value();
   73|    884|  }
_ZN8rawspeed8OptionalINS_21PrefixCodeTreeDecoderINS_10VC5CodeTagEEEEC2Ev:
   35|    884|  Optional() = default;
_ZN8rawspeed8OptionalINS_21PrefixCodeTreeDecoderINS_10VC5CodeTagEEEEaSIS3_Qsr3stdE7same_asITL0__T_EEERS4_OS7_:
   46|    884|  Optional<T>& operator=(U&& value) {
   47|    884|    impl = std::forward<U>(value);
   48|    884|    return *this;
   49|    884|  }
_ZN8rawspeed8OptionalINS_21PrefixCodeTreeDecoderINS_10VC5CodeTagEEEEptEv:
   60|    884|  T* operator->() {
   61|    884|    invariant(has_value());
  ------------------
  |  |   27|    884|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (61:5): [True: 884, False: 0]
  ------------------
   62|    884|    return &impl.value();
   63|    884|  }
_ZNK8rawspeed8OptionalINS_21PrefixCodeTreeDecoderINS_10VC5CodeTagEEEE9has_valueEv:
   85|  1.76k|  [[nodiscard]] bool has_value() const RAWSPEED_READNONE {
   86|  1.76k|    return impl.has_value();
   87|  1.76k|  }
_ZNR8rawspeed8OptionalINS_21PrefixCodeTreeDecoderINS_10VC5CodeTagEEEEdeEv:
   70|    884|  T& operator*() & {
   71|    884|    invariant(has_value());
  ------------------
  |  |   27|    884|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (71:5): [True: 884, False: 0]
  ------------------
   72|    884|    return impl.value();
   73|    884|  }
_ZN8rawspeed8OptionalINSt3__14pairINS_18AbstractPrefixCodeINS_10VC5CodeTagEE10CodeSymbolEiEEEC2IS7_Qaaaaaantsr3stdE7same_asITL0__NS0_IT_EEEntsr3stdE7same_asISA_RSD_Entsr3stdE7same_asISA_OSD_Entsr3stdE7same_asISA_NS1_8optionalISB_EEEEEOSB_:
   42|  53.7M|  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|  7.03M|  Optional(U&& value) : impl(std::forward<U>(value)) {}
_ZNK8rawspeed8OptionalINSt3__14pairINS_18AbstractPrefixCodeINS_10VC5CodeTagEE10CodeSymbolEiEEEcvbEv:
   89|  60.7M|  explicit operator bool() const { return has_value(); }
_ZNK8rawspeed8OptionalINSt3__14pairINS_18AbstractPrefixCodeINS_10VC5CodeTagEE10CodeSymbolEiEEE9has_valueEv:
   85|   114M|  [[nodiscard]] bool has_value() const RAWSPEED_READNONE {
   86|   114M|    return impl.has_value();
   87|   114M|  }
_ZNR8rawspeed8OptionalINSt3__14pairINS_18AbstractPrefixCodeINS_10VC5CodeTagEE10CodeSymbolEiEEEdeEv:
   70|  53.7M|  T& operator*() & {
   71|  53.7M|    invariant(has_value());
  ------------------
  |  |   27|  53.7M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (71:5): [True: 53.7M, False: 0]
  ------------------
   72|  53.7M|    return impl.value();
   73|  53.7M|  }

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

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

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

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

_ZN8rawspeed12PosOrUnknownIiEC2Ev:
   46|  1.86k|  PosOrUnknown() = default;
_ZN8rawspeed15BitStreamerJPEG9fillCacheENSt3__15arrayISt4byteLm8EEE:
  108|  1.37M|        inputStorage) {
  109|  1.37M|  static_assert(BitStreamCacheBase::MaxGetBits >= 32, "check implementation");
  110|  1.37M|  establishClassInvariants();
  111|  1.37M|  auto input = Array1DRef<std::byte>(inputStorage.data(),
  112|  1.37M|                                     implicit_cast<int>(inputStorage.size()));
  113|  1.37M|  invariant(input.size() == Traits::MaxProcessBytes);
  ------------------
  |  |   27|  1.37M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (113:3): [True: 1.37M, False: 0]
  ------------------
  114|       |
  115|  1.37M|  constexpr int StreamChunkBitwidth =
  116|  1.37M|      bitwidth<typename StreamTraits::ChunkType>();
  117|       |
  118|  1.37M|  auto speculativeOptimisticCache = cache;
  119|  1.37M|  auto speculativeOptimisticChunk =
  120|  1.37M|      getByteSwapped<typename StreamTraits::ChunkType>(
  121|  1.37M|          input.begin(), StreamTraits::ChunkEndianness != getHostEndianness());
  122|  1.37M|  speculativeOptimisticCache.push(speculativeOptimisticChunk,
  123|  1.37M|                                  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.37M|  if (std::accumulate(&input(0), &input(4), true, [](bool b, std::byte byte) {
  ------------------
  |  Branch (127:7): [True: 1.36M, False: 13.7k]
  ------------------
  128|  1.37M|        return b && (byte != std::byte{0xFF});
  129|  1.37M|      })) {
  130|  1.36M|    cache = speculativeOptimisticCache;
  131|  1.36M|    return 4;
  132|  1.36M|  }
  133|       |
  134|  13.7k|  size_type p = 0;
  135|  65.6k|  for (size_type i = 0; i < 4; ++i) {
  ------------------
  |  Branch (135:25): [True: 52.8k, False: 12.8k]
  ------------------
  136|  52.8k|    const int numBytesNeeded = 4 - i;
  137|       |
  138|       |    // Pre-execute most common case, where next byte is 'normal'/non-FF
  139|  52.8k|    const std::byte c0 = input(p + 0);
  140|  52.8k|    cache.push(std::to_integer<uint8_t>(c0), 8);
  141|  52.8k|    if (c0 != std::byte{0xFF}) {
  ------------------
  |  Branch (141:9): [True: 37.5k, False: 15.2k]
  ------------------
  142|  37.5k|      p += 1;
  143|  37.5k|      continue; // Got normal byte.
  144|  37.5k|    }
  145|       |
  146|       |    // Found FF -> pre-execute case of FF/00, which represents an FF data byte
  147|  15.2k|    const std::byte c1 = input(p + 1);
  148|  15.2k|    if (c1 == std::byte{0x00}) {
  ------------------
  |  Branch (148:9): [True: 14.4k, False: 832]
  ------------------
  149|       |      // Got FF/00, where 0x00 is a stuffing byte (that should be ignored),
  150|       |      // so 0xFF is a normal byte. All good.
  151|  14.4k|      p += 2;
  152|  14.4k|      continue;
  153|  14.4k|    }
  154|       |
  155|       |    // Found FF/xx with xx != 00. This is the end of stream marker.
  156|    832|    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|    832|    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|    832|    cache.cache &= ~((~0ULL) >> cache.fillLevel);
  172|    832|    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|    832|    p = getRemainingSize() + numBytesNeeded;
  178|    832|    invariant(p >= 6);
  ------------------
  |  |   27|    832|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (178:5): [True: 832, False: 0]
  ------------------
  179|    832|    break;
  180|    832|  }
  181|  13.7k|  invariant(p >= 5);
  ------------------
  |  |   27|  13.7k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (181:3): [True: 13.7k, False: 0]
  ------------------
  182|  13.7k|  return p;
  183|  13.7k|}
_ZZN8rawspeed15BitStreamerJPEG9fillCacheENSt3__15arrayISt4byteLm8EEEENKUlbS3_E_clEbS3_:
  127|  5.50M|  if (std::accumulate(&input(0), &input(4), true, [](bool b, std::byte byte) {
  128|  5.50M|        return b && (byte != std::byte{0xFF});
  ------------------
  |  Branch (128:16): [True: 5.48M, False: 22.8k]
  |  Branch (128:21): [True: 5.47M, False: 13.7k]
  ------------------
  129|  5.50M|      })) {
_ZN8rawspeed12PosOrUnknownIiEaSIiQsr3stdE7same_asITL0__T_EEERS1_S4_:
   52|    832|  PosOrUnknown& operator=(U newValue) {
   53|    832|    invariant(!has_value());
  ------------------
  |  |   27|    832|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (53:5): [True: 832, False: 0]
  ------------------
   54|    832|    val = newValue;
   55|    832|    invariant(has_value());
  ------------------
  |  |   27|    832|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (55:5): [True: 832, False: 0]
  ------------------
   56|    832|    return *this;
   57|    832|  }
_ZNK8rawspeed12PosOrUnknownIiE9has_valueEv:
   48|  1.66k|  [[nodiscard]] bool has_value() const RAWSPEED_READONLY { return val >= 0; }

_ZN8rawspeed18AbstractPrefixCodeINS_15BaselineCodeTagEEC2Ev:
  178|  4.07k|  AbstractPrefixCode() = default;
_ZN8rawspeed18AbstractPrefixCodeINS_15BaselineCodeTagEE10CodeSymbolC2Eth:
  151|  20.2k|        : code(code_), code_len(code_len_) {
  152|  20.2k|      assert(code_len > 0);
  ------------------
  |  Branch (152:7): [True: 20.2k, False: 0]
  ------------------
  153|  20.2k|      assert(code_len <= Traits::MaxCodeLenghtBits);
  ------------------
  |  Branch (153:7): [True: 20.2k, False: 0]
  ------------------
  154|  20.2k|      assert(code <= ((1U << code_len) - 1U));
  ------------------
  |  Branch (154:7): [True: 20.2k, False: 0]
  ------------------
  155|  20.2k|    }
_ZN8rawspeed18AbstractPrefixCodeINS_15BaselineCodeTagEEC2ENSt3__16vectorIhNS3_9allocatorIhEEEE:
  181|  4.00k|      : codeValues(std::move(codeValues_)) {
  182|  4.00k|    if (codeValues.empty())
  ------------------
  |  Branch (182:9): [True: 0, False: 4.00k]
  ------------------
  183|  4.00k|      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|  4.00k|    assert(
  ------------------
  |  Branch (184:5): [True: 4.00k, False: 0]
  ------------------
  185|  4.00k|        all_of(codeValues.begin(), codeValues.end(),
  186|  4.00k|               [](const CodeValueTy& v) { return v <= Traits::MaxCodeValue; }));
  187|  4.00k|  }
_ZN8rawspeed18AbstractPrefixCodeINS_15BaselineCodeTagEE10CodeSymbol16HaveCommonPrefixERKS3_S5_:
  163|   701k|                                 const CodeSymbol& partial) {
  164|   701k|      assert(partial.code_len <= symbol.code_len);
  ------------------
  |  Branch (164:7): [True: 701k, False: 0]
  ------------------
  165|       |
  166|   701k|      const auto s0 = extractHighBits(symbol.code, partial.code_len,
  167|   701k|                                      /*effectiveBitwidth=*/symbol.code_len);
  168|   701k|      const auto s1 = partial.code;
  169|       |
  170|   701k|      return s0 == s1;
  171|   701k|    }
_ZNK8rawspeed18AbstractPrefixCodeINS_15BaselineCodeTagEE10CodeSymbol10getBitsMSBEv:
  158|   108M|    getBitsMSB() const {
  159|   108M|      return {{code, code_len - 1}, {code, -1}};
  160|   108M|    }
_ZNK8rawspeed18AbstractPrefixCodeINS_15BaselineCodeTagEE10CodeSymboleqERKS3_:
  173|  8.96k|    bool RAWSPEED_READONLY operator==(const CodeSymbol& other) const {
  174|  8.96k|      return code == other.code && code_len == other.code_len;
  ------------------
  |  Branch (174:14): [True: 8.96k, False: 0]
  |  Branch (174:36): [True: 8.96k, False: 0]
  ------------------
  175|  8.96k|    }
_ZN8rawspeed18AbstractPrefixCodeINS_10VC5CodeTagEEC2Ev:
  178|  1.93k|  AbstractPrefixCode() = default;
_ZN8rawspeed18AbstractPrefixCodeINS_10VC5CodeTagEE10CodeSymbolC2Ejh:
  151|  23.5k|        : code(code_), code_len(code_len_) {
  152|  23.5k|      assert(code_len > 0);
  ------------------
  |  Branch (152:7): [True: 23.5k, False: 0]
  ------------------
  153|  23.5k|      assert(code_len <= Traits::MaxCodeLenghtBits);
  ------------------
  |  Branch (153:7): [True: 23.5k, False: 0]
  ------------------
  154|  23.5k|      assert(code <= ((1U << code_len) - 1U));
  ------------------
  |  Branch (154:7): [True: 23.5k, False: 0]
  ------------------
  155|  23.5k|    }
_ZN8rawspeed18AbstractPrefixCodeINS_10VC5CodeTagEEC2ENSt3__16vectorIjNS3_9allocatorIjEEEE:
  181|  1.85k|      : codeValues(std::move(codeValues_)) {
  182|  1.85k|    if (codeValues.empty())
  ------------------
  |  Branch (182:9): [True: 0, False: 1.85k]
  ------------------
  183|  1.85k|      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.85k|    assert(
  ------------------
  |  Branch (184:5): [True: 1.85k, False: 0]
  ------------------
  185|  1.85k|        all_of(codeValues.begin(), codeValues.end(),
  186|  1.85k|               [](const CodeValueTy& v) { return v <= Traits::MaxCodeValue; }));
  187|  1.85k|  }
_ZN8rawspeed18AbstractPrefixCodeINS_10VC5CodeTagEE10CodeSymbol16HaveCommonPrefixERKS3_S5_:
  163|  1.80M|                                 const CodeSymbol& partial) {
  164|  1.80M|      assert(partial.code_len <= symbol.code_len);
  ------------------
  |  Branch (164:7): [True: 1.80M, False: 0]
  ------------------
  165|       |
  166|  1.80M|      const auto s0 = extractHighBits(symbol.code, partial.code_len,
  167|  1.80M|                                      /*effectiveBitwidth=*/symbol.code_len);
  168|  1.80M|      const auto s1 = partial.code;
  169|       |
  170|  1.80M|      return s0 == s1;
  171|  1.80M|    }
_ZNK8rawspeed18AbstractPrefixCodeINS_10VC5CodeTagEE10CodeSymbol10getBitsMSBEv:
  158|  53.7M|    getBitsMSB() const {
  159|  53.7M|      return {{code, code_len - 1}, {code, -1}};
  160|  53.7M|    }
_ZNK8rawspeed18AbstractPrefixCodeINS_10VC5CodeTagEE10CodeSymboleqERKS3_:
  173|  10.2k|    bool RAWSPEED_READONLY operator==(const CodeSymbol& other) const {
  174|  10.2k|      return code == other.code && code_len == other.code_len;
  ------------------
  |  Branch (174:14): [True: 10.2k, False: 0]
  |  Branch (174:36): [True: 10.2k, False: 0]
  ------------------
  175|  10.2k|    }

_ZN8rawspeed25AbstractPrefixCodeDecoderINS_15BaselineCodeTagEE6extendEjj:
   70|  20.2M|  static int RAWSPEED_READNONE extend(uint32_t diff, uint32_t len) {
   71|  20.2M|    invariant(len > 0);
  ------------------
  |  |   27|  20.2M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (71:5): [True: 20.2M, False: 0]
  ------------------
   72|  20.2M|    auto ret = static_cast<int32_t>(diff);
   73|  20.2M|    if ((diff & (1 << (len - 1))) == 0)
  ------------------
  |  Branch (73:9): [True: 19.3M, False: 980k]
  ------------------
   74|  19.3M|      ret -= (1 << len) - 1;
   75|  20.2M|    return ret;
   76|  20.2M|  }
_ZNK8rawspeed25AbstractPrefixCodeDecoderINS_15BaselineCodeTagEE13processSymbolINS_14BitStreamerMSBELb1EEEiRT_NS_18AbstractPrefixCodeIS1_E10CodeSymbolEh:
   45|  16.5M|                    typename Traits::CodeValueTy codeValue) const {
   46|  16.5M|    invariant(symbol.code_len >= 0 &&
  ------------------
  |  |   27|  16.5M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (46:5): [True: 16.5M, False: 0]
  |  Branch (46:5): [True: 16.5M, False: 0]
  |  Branch (46:5): [True: 16.5M, False: 0]
  ------------------
   47|  16.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|       |      return codeValue;
   52|       |
   53|       |    // Else, treat it as the length of following difference
   54|       |    // that we need to read and extend.
   55|  16.5M|    int diff_l = codeValue;
   56|  16.5M|    invariant(diff_l >= 0 && diff_l <= 16);
  ------------------
  |  |   27|  16.5M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (56:5): [True: 16.5M, False: 0]
  |  Branch (56:5): [True: 16.5M, False: 0]
  |  Branch (56:5): [True: 16.5M, False: 0]
  ------------------
   57|       |
   58|  16.5M|    if (diff_l == 16) {
  ------------------
  |  Branch (58:9): [True: 3.77M, False: 12.7M]
  ------------------
   59|  3.77M|      if (Base::handleDNGBug16())
  ------------------
  |  Branch (59:11): [True: 3.77M, False: 1.32k]
  ------------------
   60|  3.77M|        bs.skipBitsNoFill(16);
   61|  3.77M|      return -32768;
   62|  3.77M|    }
   63|       |
   64|  12.7M|    invariant(symbol.code_len + diff_l <= 32);
  ------------------
  |  |   27|  12.7M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (64:5): [True: 12.7M, False: 0]
  ------------------
   65|  12.7M|    return diff_l ? extend(bs.getBitsNoFill(diff_l), diff_l) : 0;
  ------------------
  |  Branch (65:12): [True: 12.7M, False: 21.2k]
  ------------------
   66|  12.7M|  }
_ZNK8rawspeed25AbstractPrefixCodeDecoderINS_15BaselineCodeTagEE13processSymbolINS_14BitStreamerMSBELb0EEEiRT_NS_18AbstractPrefixCodeIS1_E10CodeSymbolEh:
   45|  39.2M|                    typename Traits::CodeValueTy codeValue) const {
   46|  39.2M|    invariant(symbol.code_len >= 0 &&
  ------------------
  |  |   27|  39.2M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (46:5): [True: 39.2M, False: 0]
  |  Branch (46:5): [True: 39.2M, False: 0]
  |  Branch (46:5): [True: 39.2M, False: 0]
  ------------------
   47|  39.2M|              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|  39.2M|      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|  39.2M|    invariant(diff_l >= 0 && diff_l <= 16);
  ------------------
  |  |   27|  39.2M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (56:5): [True: 0, False: 39.2M]
  |  Branch (56:5): [True: 0, False: 0]
  |  Branch (56:5): [True: 0, False: 39.2M]
  ------------------
   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|  7.74M|                    typename Traits::CodeValueTy codeValue) const {
   46|  7.74M|    invariant(symbol.code_len >= 0 &&
  ------------------
  |  |   27|  7.74M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (46:5): [True: 7.74M, False: 0]
  |  Branch (46:5): [True: 7.74M, False: 0]
  |  Branch (46:5): [True: 7.74M, False: 0]
  ------------------
   47|  7.74M|              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|  7.74M|    int diff_l = codeValue;
   56|  7.74M|    invariant(diff_l >= 0 && diff_l <= 16);
  ------------------
  |  |   27|  7.74M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (56:5): [True: 7.74M, False: 0]
  |  Branch (56:5): [True: 7.74M, False: 0]
  |  Branch (56:5): [True: 7.74M, False: 0]
  ------------------
   57|       |
   58|  7.74M|    if (diff_l == 16) {
  ------------------
  |  Branch (58:9): [True: 1.31M, False: 6.42M]
  ------------------
   59|  1.31M|      if (Base::handleDNGBug16())
  ------------------
  |  Branch (59:11): [True: 1.31M, False: 1.08k]
  ------------------
   60|  1.31M|        bs.skipBitsNoFill(16);
   61|  1.31M|      return -32768;
   62|  1.31M|    }
   63|       |
   64|  6.42M|    invariant(symbol.code_len + diff_l <= 32);
  ------------------
  |  |   27|  6.42M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (64:5): [True: 6.42M, False: 0]
  ------------------
   65|  6.42M|    return diff_l ? extend(bs.getBitsNoFill(diff_l), diff_l) : 0;
  ------------------
  |  Branch (65:12): [True: 6.24M, False: 176k]
  ------------------
   66|  6.42M|  }
_ZNK8rawspeed25AbstractPrefixCodeDecoderINS_15BaselineCodeTagEE13processSymbolINS_16BitStreamerMSB32ELb0EEEiRT_NS_18AbstractPrefixCodeIS1_E10CodeSymbolEh:
   45|  38.8M|                    typename Traits::CodeValueTy codeValue) const {
   46|  38.8M|    invariant(symbol.code_len >= 0 &&
  ------------------
  |  |   27|  38.8M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (46:5): [True: 38.8M, False: 0]
  |  Branch (46:5): [True: 38.8M, False: 0]
  |  Branch (46:5): [True: 38.8M, False: 0]
  ------------------
   47|  38.8M|              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|  38.8M|      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|  38.8M|    invariant(diff_l >= 0 && diff_l <= 16);
  ------------------
  |  |   27|  38.8M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (56:5): [True: 0, False: 38.8M]
  |  Branch (56:5): [True: 0, False: 0]
  |  Branch (56:5): [True: 0, False: 38.8M]
  ------------------
   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.89M|                    typename Traits::CodeValueTy codeValue) const {
   46|  4.89M|    invariant(symbol.code_len >= 0 &&
  ------------------
  |  |   27|  4.89M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (46:5): [True: 4.89M, False: 0]
  |  Branch (46:5): [True: 4.89M, False: 0]
  |  Branch (46:5): [True: 4.89M, False: 0]
  ------------------
   47|  4.89M|              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.89M|    int diff_l = codeValue;
   56|  4.89M|    invariant(diff_l >= 0 && diff_l <= 16);
  ------------------
  |  |   27|  4.89M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (56:5): [True: 4.89M, False: 0]
  |  Branch (56:5): [True: 4.89M, False: 0]
  |  Branch (56:5): [True: 4.89M, False: 0]
  ------------------
   57|       |
   58|  4.89M|    if (diff_l == 16) {
  ------------------
  |  Branch (58:9): [True: 67.4k, False: 4.82M]
  ------------------
   59|  67.4k|      if (Base::handleDNGBug16())
  ------------------
  |  Branch (59:11): [True: 66.4k, False: 933]
  ------------------
   60|  66.4k|        bs.skipBitsNoFill(16);
   61|  67.4k|      return -32768;
   62|  67.4k|    }
   63|       |
   64|  4.82M|    invariant(symbol.code_len + diff_l <= 32);
  ------------------
  |  |   27|  4.82M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (64:5): [True: 4.82M, False: 0]
  ------------------
   65|  4.82M|    return diff_l ? extend(bs.getBitsNoFill(diff_l), diff_l) : 0;
  ------------------
  |  Branch (65:12): [True: 1.03M, False: 3.78M]
  ------------------
   66|  4.82M|  }
_ZNK8rawspeed25AbstractPrefixCodeDecoderINS_15BaselineCodeTagEE13processSymbolINS_15BitStreamerJPEGELb0EEEiRT_NS_18AbstractPrefixCodeIS1_E10CodeSymbolEh:
   45|  11.0M|                    typename Traits::CodeValueTy codeValue) const {
   46|  11.0M|    invariant(symbol.code_len >= 0 &&
  ------------------
  |  |   27|  11.0M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (46:5): [True: 11.0M, False: 0]
  |  Branch (46:5): [True: 11.0M, False: 0]
  |  Branch (46:5): [True: 11.0M, False: 0]
  ------------------
   47|  11.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|  11.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|  11.0M|    invariant(diff_l >= 0 && diff_l <= 16);
  ------------------
  |  |   27|  11.0M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (56:5): [True: 0, False: 11.0M]
  |  Branch (56:5): [True: 0, False: 0]
  |  Branch (56:5): [True: 0, False: 11.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_10VC5CodeTagEE13processSymbolINS_14BitStreamerMSBELb0EEEiRT_NS_18AbstractPrefixCodeIS1_E10CodeSymbolEj:
   45|  27.4M|                    typename Traits::CodeValueTy codeValue) const {
   46|  27.4M|    invariant(symbol.code_len >= 0 &&
  ------------------
  |  |   27|  27.4M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (46:5): [True: 27.4M, False: 0]
  |  Branch (46:5): [True: 27.4M, False: 0]
  |  Branch (46:5): [True: 27.4M, False: 0]
  ------------------
   47|  27.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|  27.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|  27.4M|    invariant(diff_l >= 0 && diff_l <= 16);
  ------------------
  |  |   27|  27.4M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (56:5): [True: 0, False: 27.4M]
  |  Branch (56:5): [True: 0, False: 0]
  |  Branch (56:5): [True: 0, False: 27.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_16BitStreamerMSB32ELb0EEEiRT_NS_18AbstractPrefixCodeIS1_E10CodeSymbolEj:
   45|  26.2M|                    typename Traits::CodeValueTy codeValue) const {
   46|  26.2M|    invariant(symbol.code_len >= 0 &&
  ------------------
  |  |   27|  26.2M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (46:5): [True: 26.2M, False: 0]
  |  Branch (46:5): [True: 26.2M, False: 0]
  |  Branch (46:5): [True: 26.2M, False: 0]
  ------------------
   47|  26.2M|              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|  26.2M|      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|  26.2M|    invariant(diff_l >= 0 && diff_l <= 16);
  ------------------
  |  |   27|  26.2M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (56:5): [True: 0, False: 26.2M]
  |  Branch (56:5): [True: 0, False: 0]
  |  Branch (56:5): [True: 0, False: 26.2M]
  ------------------
   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|  9.04k|                    typename Traits::CodeValueTy codeValue) const {
   46|  9.04k|    invariant(symbol.code_len >= 0 &&
  ------------------
  |  |   27|  9.04k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (46:5): [True: 9.04k, False: 0]
  |  Branch (46:5): [True: 9.04k, False: 0]
  |  Branch (46:5): [True: 9.04k, False: 0]
  ------------------
   47|  9.04k|              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|  9.04k|      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|  9.04k|    invariant(diff_l >= 0 && diff_l <= 16);
  ------------------
  |  |   27|  9.04k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (56:5): [True: 0, False: 9.04k]
  |  Branch (56:5): [True: 0, False: 0]
  |  Branch (56:5): [True: 0, False: 9.04k]
  ------------------
   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|  4.00k|      : code(std::move(code_)) {}
_ZN8rawspeed28AbstractPrefixCodeTranscoderINS_15BaselineCodeTagEE5setupEbb:
   71|  3.92k|  void setup(bool fullDecode_, bool fixDNGBug16_) {
   72|  3.92k|    invariant(!fullDecode_ || Traits::SupportsFullDecode);
  ------------------
  |  |   27|  3.92k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (72:5): [True: 1.25k, False: 2.66k]
  |  Branch (72:5): [True: 2.66k, Folded]
  |  Branch (72:5): [True: 3.92k, False: 0]
  ------------------
   73|       |
   74|  3.92k|    this->fullDecode = fullDecode_;
   75|  3.92k|    this->fixDNGBug16 = fixDNGBug16_;
   76|       |
   77|  3.92k|    if (fullDecode) {
  ------------------
  |  Branch (77:9): [True: 2.66k, False: 1.25k]
  ------------------
   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.66k|      verifyCodeValuesAsDiffLengths();
   83|  2.66k|    }
   84|  3.92k|  }
_ZNK8rawspeed28AbstractPrefixCodeTranscoderINS_15BaselineCodeTagEE29verifyCodeValuesAsDiffLengthsEv:
   50|  2.66k|  void verifyCodeValuesAsDiffLengths() const {
   51|  8.23k|    for (const auto cValue : code.Base::codeValues) {
  ------------------
  |  Branch (51:28): [True: 8.23k, False: 2.66k]
  ------------------
   52|  8.23k|      if (cValue <= Traits::MaxDiffLength)
  ------------------
  |  Branch (52:11): [True: 8.22k, False: 7]
  ------------------
   53|  8.22k|        continue;
   54|  8.23k|      ThrowRDE("Corrupt Huffman code: difference length %u longer than %u",
  ------------------
  |  |   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__)
  |  |  ------------------
  ------------------
   55|  8.23k|               cValue, Traits::MaxDiffLength);
   56|  8.23k|    }
   57|  2.66k|    assert(maxCodePlusDiffLength() <= 32U);
  ------------------
  |  Branch (57:5): [True: 2.66k, False: 0]
  ------------------
   58|  2.66k|  }
_ZNK8rawspeed28AbstractPrefixCodeTranscoderINS_15BaselineCodeTagEE21maxCodePlusDiffLengthEv:
   66|  2.66k|  maxCodePlusDiffLength() const {
   67|  2.66k|    return maxCodeLength() + *(std::max_element(code.Base::codeValues.cbegin(),
   68|  2.66k|                                                code.Base::codeValues.cend()));
   69|  2.66k|  }
_ZNK8rawspeed28AbstractPrefixCodeTranscoderINS_15BaselineCodeTagEE13maxCodeLengthEv:
   61|  15.5M|  [[nodiscard]] size_t RAWSPEED_READONLY maxCodeLength() const {
   62|  15.5M|    return code.nCodesPerLength.size() - 1;
   63|  15.5M|  }
_ZNK8rawspeed28AbstractPrefixCodeTranscoderINS_15BaselineCodeTagEE12isFullDecodeEv:
   87|   219M|  [[nodiscard]] bool RAWSPEED_READONLY isFullDecode() const {
   88|   219M|    return fullDecode;
   89|   219M|  }
_ZNK8rawspeed28AbstractPrefixCodeTranscoderINS_15BaselineCodeTagEE14handleDNGBug16Ev:
   90|  5.23M|  [[nodiscard]] bool RAWSPEED_READONLY handleDNGBug16() const {
   91|  5.23M|    return fixDNGBug16;
   92|  5.23M|  }
_ZN8rawspeed28AbstractPrefixCodeTranscoderINS_10VC5CodeTagEEC2ENS_10PrefixCodeIS1_EE:
   48|  1.85k|      : code(std::move(code_)) {}
_ZN8rawspeed28AbstractPrefixCodeTranscoderINS_10VC5CodeTagEE5setupEbb:
   71|  1.76k|  void setup(bool fullDecode_, bool fixDNGBug16_) {
   72|  1.76k|    invariant(!fullDecode_ || Traits::SupportsFullDecode);
  ------------------
  |  |   27|  1.76k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (72:5): [True: 1.76k, False: 0]
  |  Branch (72:5): [Folded, False: 0]
  |  Branch (72:5): [True: 1.76k, False: 0]
  ------------------
   73|       |
   74|  1.76k|    this->fullDecode = fullDecode_;
   75|  1.76k|    this->fixDNGBug16 = fixDNGBug16_;
   76|       |
   77|  1.76k|    if (fullDecode) {
  ------------------
  |  Branch (77:9): [True: 0, False: 1.76k]
  ------------------
   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.76k|  }
_ZNK8rawspeed28AbstractPrefixCodeTranscoderINS_10VC5CodeTagEE13maxCodeLengthEv:
   61|   132k|  [[nodiscard]] size_t RAWSPEED_READONLY maxCodeLength() const {
   62|   132k|    return code.nCodesPerLength.size() - 1;
   63|   132k|  }
_ZNK8rawspeed28AbstractPrefixCodeTranscoderINS_10VC5CodeTagEE12isFullDecodeEv:
   87|   108M|  [[nodiscard]] bool RAWSPEED_READONLY isFullDecode() const {
   88|   108M|    return fullDecode;
   89|   108M|  }

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

_ZN8rawspeed11HuffmanCodeINS_15BaselineCodeTagEEC2Ev:
   48|  4.07k|  HuffmanCode() = default;
_ZN8rawspeed11HuffmanCodeINS_15BaselineCodeTagEE18setNCodesPerLengthENS_6BufferE:
   99|  4.05k|  uint32_t setNCodesPerLength(Buffer data) {
  100|  4.05k|    invariant(data.getSize() == Traits::MaxCodeLenghtBits);
  ------------------
  |  |   27|  4.05k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (100:5): [True: 4.05k, False: 0]
  ------------------
  101|       |
  102|  4.05k|    nCodesPerLength.resize((1 + Traits::MaxCodeLenghtBits), 0);
  103|  4.05k|    std::copy(data.begin(), data.end(), &nCodesPerLength[1]);
  104|  4.05k|    assert(nCodesPerLength[0] == 0);
  ------------------
  |  Branch (104:5): [True: 4.05k, False: 0]
  ------------------
  105|       |
  106|       |    // trim empty entries from the codes per length table on the right
  107|  37.3k|    while (!nCodesPerLength.empty() && nCodesPerLength.back() == 0)
  ------------------
  |  Branch (107:12): [True: 37.3k, False: 1]
  |  Branch (107:40): [True: 33.3k, False: 4.05k]
  ------------------
  108|  33.3k|      nCodesPerLength.pop_back();
  109|       |
  110|  4.05k|    if (nCodesPerLength.empty())
  ------------------
  |  Branch (110:9): [True: 1, False: 4.05k]
  ------------------
  111|  4.05k|      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|  4.05k|    assert(nCodesPerLength.back() > 0);
  ------------------
  |  Branch (113:5): [True: 4.05k, False: 0]
  ------------------
  114|       |
  115|  4.05k|    const auto count = maxCodesCount();
  116|  4.05k|    invariant(count > 0);
  ------------------
  |  |   27|  4.05k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (116:5): [True: 4.05k, False: 0]
  ------------------
  117|       |
  118|  4.05k|    if (count > Traits::MaxNumCodeValues)
  ------------------
  |  Branch (118:9): [True: 14, False: 4.04k]
  ------------------
  119|  4.05k|      ThrowRDE("Too big code-values table");
  ------------------
  |  |   38|     14|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     14|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     14|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     14|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  120|       |
  121|       |    // We are at the Root node, len is 1, there are two possible child Nodes
  122|  4.04k|    unsigned maxCodes = 2;
  123|       |
  124|  35.2k|    for (auto codeLen = 1UL; codeLen < nCodesPerLength.size(); codeLen++) {
  ------------------
  |  Branch (124:30): [True: 31.2k, False: 4.01k]
  ------------------
  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|  31.2k|      const auto maxCodesInCurrLen = (1U << codeLen);
  129|  31.2k|      const auto nCodes = nCodesPerLength[codeLen];
  130|  31.2k|      if (nCodes > maxCodesInCurrLen) {
  ------------------
  |  Branch (130:11): [True: 13, False: 31.2k]
  ------------------
  131|     13|        ThrowRDE("Corrupt Huffman. Can never have %u codes in %lu-bit len",
  ------------------
  |  |   38|     13|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     13|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     13|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     13|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  132|     13|                 nCodes, codeLen);
  133|     13|      }
  134|       |
  135|       |      // Also, check that we actually can have this much leafs for this length
  136|  31.2k|      if (nCodes > maxCodes) {
  ------------------
  |  Branch (136:11): [True: 9, False: 31.2k]
  ------------------
  137|      9|        ThrowRDE(
  ------------------
  |  |   38|      9|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      9|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      9|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      9|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  138|      9|            "Corrupt Huffman. Can only fit %u out of %u codes in %lu-bit len",
  139|      9|            maxCodes, nCodes, codeLen);
  140|      9|      }
  141|       |
  142|       |      // There are nCodes leafs on this level, and those can not be branches
  143|  31.2k|      maxCodes -= nCodes;
  144|       |      // On the next level, rest can be branches, and can have two child Nodes
  145|  31.2k|      maxCodes *= 2;
  146|  31.2k|    }
  147|       |
  148|  4.01k|    return count;
  149|  4.04k|  }
_ZNK8rawspeed11HuffmanCodeINS_15BaselineCodeTagEE13maxCodesCountEv:
   61|  32.0k|  [[nodiscard]] unsigned int RAWSPEED_READONLY maxCodesCount() const {
   62|  32.0k|    return std::accumulate(nCodesPerLength.begin(), nCodesPerLength.end(), 0U);
   63|  32.0k|  }
_ZN8rawspeed11HuffmanCodeINS_15BaselineCodeTagEE13setCodeValuesENS_10Array1DRefIKhEE:
  151|  4.00k|  void setCodeValues(Array1DRef<const typename Traits::CodeValueTy> data) {
  152|  4.00k|    invariant(data.size() <= Traits::MaxNumCodeValues);
  ------------------
  |  |   27|  4.00k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (152:5): [True: 4.00k, False: 0]
  ------------------
  153|  4.00k|    invariant(static_cast<unsigned>(data.size()) == maxCodesCount());
  ------------------
  |  |   27|  4.00k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (153:5): [True: 4.00k, False: 0]
  ------------------
  154|       |
  155|  4.00k|    this->codeValues.clear();
  156|  4.00k|    this->codeValues.reserve(maxCodesCount());
  157|  4.00k|    std::copy(data.begin(), data.end(), std::back_inserter(this->codeValues));
  158|  4.00k|    assert(this->codeValues.size() == maxCodesCount());
  ------------------
  |  Branch (158:5): [True: 4.00k, False: 0]
  ------------------
  159|       |
  160|  20.2k|    for (const auto& cValue : this->codeValues) {
  ------------------
  |  Branch (160:29): [True: 20.2k, False: 4.00k]
  ------------------
  161|  20.2k|      if (cValue <= Traits::MaxCodeValue)
  ------------------
  |  Branch (161:11): [True: 20.2k, False: 0]
  ------------------
  162|  20.2k|        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|  20.2k|               cValue, Traits::MaxCodeValue);
  165|  20.2k|    }
  166|  4.00k|  }
_ZN8rawspeed11HuffmanCodeINS_15BaselineCodeTagEEcvNS_10PrefixCodeIS1_EEEv:
  168|  4.00k|  explicit operator PrefixCode<CodeTag>() {
  169|  4.00k|    std::vector<CodeSymbol> symbols = generateCodeSymbols();
  170|  4.00k|    return {std::move(symbols), std::move(Parent::codeValues)};
  171|  4.00k|  }
_ZNK8rawspeed11HuffmanCodeINS_15BaselineCodeTagEE19generateCodeSymbolsEv:
   66|  4.00k|  [[nodiscard]] std::vector<CodeSymbol> generateCodeSymbols() const {
   67|  4.00k|    std::vector<CodeSymbol> symbols;
   68|       |
   69|  4.00k|    assert(!nCodesPerLength.empty());
  ------------------
  |  Branch (69:5): [True: 4.00k, False: 0]
  ------------------
   70|  4.00k|    assert(maxCodesCount() > 0);
  ------------------
  |  Branch (70:5): [True: 4.00k, False: 0]
  ------------------
   71|       |
   72|  4.00k|    assert(this->codeValues.size() == maxCodesCount());
  ------------------
  |  Branch (72:5): [True: 4.00k, False: 0]
  ------------------
   73|       |
   74|       |    // reserve all the memory. avoids lots of small allocs
   75|  4.00k|    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|  4.00k|    uint32_t code = 0;
   80|  34.9k|    for (unsigned int l = 1; l <= maxCodeLength(); ++l) {
  ------------------
  |  Branch (80:30): [True: 30.9k, False: 4.00k]
  ------------------
   81|  51.1k|      for (unsigned int i = 0; i < nCodesPerLength[l]; ++i) {
  ------------------
  |  Branch (81:32): [True: 20.2k, False: 30.9k]
  ------------------
   82|  20.2k|        symbols.emplace_back(code, l);
   83|  20.2k|        code++;
   84|  20.2k|      }
   85|       |
   86|  30.9k|      code <<= 1;
   87|  30.9k|    }
   88|       |
   89|  4.00k|    assert(symbols.size() == maxCodesCount());
  ------------------
  |  Branch (89:5): [True: 4.00k, False: 0]
  ------------------
   90|       |
   91|  4.00k|    return symbols;
   92|  4.00k|  }
_ZNK8rawspeed11HuffmanCodeINS_15BaselineCodeTagEE13maxCodeLengthEv:
   51|  34.9k|  [[nodiscard]] size_t RAWSPEED_READONLY maxCodeLength() const {
   52|  34.9k|    return nCodesPerLength.size() - 1;
   53|  34.9k|  }
_ZN8rawspeed11HuffmanCodeINS_10VC5CodeTagEEC2Ev:
   48|  1.93k|  HuffmanCode() = default;
_ZN8rawspeed11HuffmanCodeINS_10VC5CodeTagEE18setNCodesPerLengthENS_6BufferE:
   99|  1.92k|  uint32_t setNCodesPerLength(Buffer data) {
  100|  1.92k|    invariant(data.getSize() == Traits::MaxCodeLenghtBits);
  ------------------
  |  |   27|  1.92k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (100:5): [True: 1.92k, False: 0]
  ------------------
  101|       |
  102|  1.92k|    nCodesPerLength.resize((1 + Traits::MaxCodeLenghtBits), 0);
  103|  1.92k|    std::copy(data.begin(), data.end(), &nCodesPerLength[1]);
  104|  1.92k|    assert(nCodesPerLength[0] == 0);
  ------------------
  |  Branch (104:5): [True: 1.92k, False: 0]
  ------------------
  105|       |
  106|       |    // trim empty entries from the codes per length table on the right
  107|  21.9k|    while (!nCodesPerLength.empty() && nCodesPerLength.back() == 0)
  ------------------
  |  Branch (107:12): [True: 21.9k, False: 1]
  |  Branch (107:40): [True: 20.0k, False: 1.92k]
  ------------------
  108|  20.0k|      nCodesPerLength.pop_back();
  109|       |
  110|  1.92k|    if (nCodesPerLength.empty())
  ------------------
  |  Branch (110:9): [True: 1, False: 1.92k]
  ------------------
  111|  1.92k|      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.92k|    assert(nCodesPerLength.back() > 0);
  ------------------
  |  Branch (113:5): [True: 1.92k, False: 0]
  ------------------
  114|       |
  115|  1.92k|    const auto count = maxCodesCount();
  116|  1.92k|    invariant(count > 0);
  ------------------
  |  |   27|  1.92k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (116:5): [True: 1.92k, False: 0]
  ------------------
  117|       |
  118|  1.92k|    if (count > Traits::MaxNumCodeValues)
  ------------------
  |  Branch (118:9): [True: 7, False: 1.91k]
  ------------------
  119|  1.92k|      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|  1.91k|    unsigned maxCodes = 2;
  123|       |
  124|  31.3k|    for (auto codeLen = 1UL; codeLen < nCodesPerLength.size(); codeLen++) {
  ------------------
  |  Branch (124:30): [True: 29.4k, False: 1.89k]
  ------------------
  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.4k|      const auto maxCodesInCurrLen = (1U << codeLen);
  129|  29.4k|      const auto nCodes = nCodesPerLength[codeLen];
  130|  29.4k|      if (nCodes > maxCodesInCurrLen) {
  ------------------
  |  Branch (130:11): [True: 9, False: 29.4k]
  ------------------
  131|      9|        ThrowRDE("Corrupt Huffman. Can never have %u codes in %lu-bit len",
  ------------------
  |  |   38|      9|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      9|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      9|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      9|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  132|      9|                 nCodes, codeLen);
  133|      9|      }
  134|       |
  135|       |      // Also, check that we actually can have this much leafs for this length
  136|  29.4k|      if (nCodes > maxCodes) {
  ------------------
  |  Branch (136:11): [True: 10, False: 29.4k]
  ------------------
  137|     10|        ThrowRDE(
  ------------------
  |  |   38|     10|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|     10|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|     10|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|     10|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  138|     10|            "Corrupt Huffman. Can only fit %u out of %u codes in %lu-bit len",
  139|     10|            maxCodes, nCodes, codeLen);
  140|     10|      }
  141|       |
  142|       |      // There are nCodes leafs on this level, and those can not be branches
  143|  29.4k|      maxCodes -= nCodes;
  144|       |      // On the next level, rest can be branches, and can have two child Nodes
  145|  29.4k|      maxCodes *= 2;
  146|  29.4k|    }
  147|       |
  148|  1.89k|    return count;
  149|  1.91k|  }
_ZNK8rawspeed11HuffmanCodeINS_10VC5CodeTagEE13maxCodesCountEv:
   61|  14.9k|  [[nodiscard]] unsigned int RAWSPEED_READONLY maxCodesCount() const {
   62|  14.9k|    return std::accumulate(nCodesPerLength.begin(), nCodesPerLength.end(), 0U);
   63|  14.9k|  }
_ZN8rawspeed11HuffmanCodeINS_10VC5CodeTagEE13setCodeValuesENS_10Array1DRefIKjEE:
  151|  1.85k|  void setCodeValues(Array1DRef<const typename Traits::CodeValueTy> data) {
  152|  1.85k|    invariant(data.size() <= Traits::MaxNumCodeValues);
  ------------------
  |  |   27|  1.85k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (152:5): [True: 1.85k, False: 0]
  ------------------
  153|  1.85k|    invariant(static_cast<unsigned>(data.size()) == maxCodesCount());
  ------------------
  |  |   27|  1.85k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (153:5): [True: 1.85k, False: 0]
  ------------------
  154|       |
  155|  1.85k|    this->codeValues.clear();
  156|  1.85k|    this->codeValues.reserve(maxCodesCount());
  157|  1.85k|    std::copy(data.begin(), data.end(), std::back_inserter(this->codeValues));
  158|  1.85k|    assert(this->codeValues.size() == maxCodesCount());
  ------------------
  |  Branch (158:5): [True: 1.85k, False: 0]
  ------------------
  159|       |
  160|  23.5k|    for (const auto& cValue : this->codeValues) {
  ------------------
  |  Branch (160:29): [True: 23.5k, False: 1.85k]
  ------------------
  161|  23.5k|      if (cValue <= Traits::MaxCodeValue)
  ------------------
  |  Branch (161:11): [True: 23.5k, False: 0]
  ------------------
  162|  23.5k|        continue;
  163|      0|      ThrowRDE("Corrupt Huffman code: code value %u is larger than maximum %u",
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  164|  23.5k|               cValue, Traits::MaxCodeValue);
  165|  23.5k|    }
  166|  1.85k|  }
_ZN8rawspeed11HuffmanCodeINS_10VC5CodeTagEEcvNS_10PrefixCodeIS1_EEEv:
  168|  1.85k|  explicit operator PrefixCode<CodeTag>() {
  169|  1.85k|    std::vector<CodeSymbol> symbols = generateCodeSymbols();
  170|  1.85k|    return {std::move(symbols), std::move(Parent::codeValues)};
  171|  1.85k|  }
_ZNK8rawspeed11HuffmanCodeINS_10VC5CodeTagEE19generateCodeSymbolsEv:
   66|  1.85k|  [[nodiscard]] std::vector<CodeSymbol> generateCodeSymbols() const {
   67|  1.85k|    std::vector<CodeSymbol> symbols;
   68|       |
   69|  1.85k|    assert(!nCodesPerLength.empty());
  ------------------
  |  Branch (69:5): [True: 1.85k, False: 0]
  ------------------
   70|  1.85k|    assert(maxCodesCount() > 0);
  ------------------
  |  Branch (70:5): [True: 1.85k, False: 0]
  ------------------
   71|       |
   72|  1.85k|    assert(this->codeValues.size() == maxCodesCount());
  ------------------
  |  Branch (72:5): [True: 1.85k, False: 0]
  ------------------
   73|       |
   74|       |    // reserve all the memory. avoids lots of small allocs
   75|  1.85k|    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.85k|    uint32_t code = 0;
   80|  30.5k|    for (unsigned int l = 1; l <= maxCodeLength(); ++l) {
  ------------------
  |  Branch (80:30): [True: 28.6k, False: 1.85k]
  ------------------
   81|  52.2k|      for (unsigned int i = 0; i < nCodesPerLength[l]; ++i) {
  ------------------
  |  Branch (81:32): [True: 23.5k, False: 28.6k]
  ------------------
   82|  23.5k|        symbols.emplace_back(code, l);
   83|  23.5k|        code++;
   84|  23.5k|      }
   85|       |
   86|  28.6k|      code <<= 1;
   87|  28.6k|    }
   88|       |
   89|  1.85k|    assert(symbols.size() == maxCodesCount());
  ------------------
  |  Branch (89:5): [True: 1.85k, False: 0]
  ------------------
   90|       |
   91|  1.85k|    return symbols;
   92|  1.85k|  }
_ZNK8rawspeed11HuffmanCodeINS_10VC5CodeTagEE13maxCodeLengthEv:
   51|  30.5k|  [[nodiscard]] size_t RAWSPEED_READONLY maxCodeLength() const {
   52|  30.5k|    return nCodesPerLength.size() - 1;
   53|  30.5k|  }

_ZN8rawspeed10PrefixCodeINS_15BaselineCodeTagEEC2ENSt3__16vectorINS_18AbstractPrefixCodeIS1_E10CodeSymbolENS3_9allocatorIS7_EEEENS4_IhNS8_IhEEEE:
   52|  4.00k|      : Base(std::move(codeValues_)), symbols(std::move(symbols_)) {
   53|  4.00k|    if (symbols.empty() || Base::codeValues.empty() ||
  ------------------
  |  Branch (53:9): [True: 0, False: 4.00k]
  |  Branch (53:28): [True: 0, False: 4.00k]
  ------------------
   54|  4.00k|        symbols.size() != Base::codeValues.size())
  ------------------
  |  Branch (54:9): [True: 0, False: 4.00k]
  ------------------
   55|  4.00k|      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|  4.00k|    nCodesPerLength.resize(1 + Traits::MaxCodeLenghtBits);
   58|  20.2k|    for (const CodeSymbol& s : symbols) {
  ------------------
  |  Branch (58:30): [True: 20.2k, False: 4.00k]
  ------------------
   59|  20.2k|      assert(s.code_len > 0 && s.code_len <= Traits::MaxCodeLenghtBits);
  ------------------
  |  Branch (59:7): [True: 20.2k, False: 0]
  |  Branch (59:7): [True: 20.2k, False: 0]
  |  Branch (59:7): [True: 20.2k, False: 0]
  ------------------
   60|  20.2k|      ++nCodesPerLength[s.code_len];
   61|  20.2k|    }
   62|  37.1k|    while (nCodesPerLength.back() == 0)
  ------------------
  |  Branch (62:12): [True: 33.1k, False: 4.00k]
  ------------------
   63|  33.1k|      nCodesPerLength.pop_back();
   64|  4.00k|    assert(nCodesPerLength.size() > 1);
  ------------------
  |  Branch (64:5): [True: 4.00k, False: 0]
  ------------------
   65|       |
   66|  4.00k|    verifyCodeSymbols();
   67|  4.00k|  }
_ZN8rawspeed10PrefixCodeINS_15BaselineCodeTagEE17verifyCodeSymbolsEv:
   70|  4.00k|  void verifyCodeSymbols() {
   71|       |    // We are at the Root node, len is 1, there are two possible child Nodes
   72|  4.00k|    unsigned maxCodes = 2;
   73|  34.9k|    for (auto codeLen = 1UL; codeLen < nCodesPerLength.size(); codeLen++) {
  ------------------
  |  Branch (73:30): [True: 30.9k, False: 4.00k]
  ------------------
   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|  30.9k|      const unsigned nCodes = nCodesPerLength[codeLen];
   78|  30.9k|      if (nCodes > maxCodes)
  ------------------
  |  Branch (78:11): [True: 0, False: 30.9k]
  ------------------
   79|  30.9k|        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|  30.9k|      maxCodes -= nCodes;
   82|       |      // On the next level, rest can be branches, and can have two child Nodes
   83|  30.9k|      maxCodes *= 2;
   84|  30.9k|    }
   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|  4.00k|    if (std::adjacent_find(
  ------------------
  |  Branch (88:9): [True: 0, False: 4.00k]
  ------------------
   89|  4.00k|            symbols.cbegin(), symbols.cend(),
   90|  4.00k|            [](const CodeSymbol& lhs, const CodeSymbol& rhs) -> bool {
   91|  4.00k|              return !std::less_equal<>()(lhs.code_len, rhs.code_len);
   92|  4.00k|            }) != symbols.cend())
   93|  4.00k|      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|  24.2k|    for (auto sId = 0UL; sId < symbols.size(); sId++) {
  ------------------
  |  Branch (97:26): [True: 20.2k, False: 4.00k]
  ------------------
   98|   721k|      for (auto pId = 0UL; pId < sId; pId++)
  ------------------
  |  Branch (98:28): [True: 701k, False: 20.2k]
  ------------------
   99|   701k|        if (CodeSymbol::HaveCommonPrefix(symbols[sId], symbols[pId]))
  ------------------
  |  Branch (99:13): [True: 0, False: 701k]
  ------------------
  100|  20.2k|          ThrowRDE("Not prefix codes!");
  ------------------
  |  |   38|      0|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|      0|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|      0|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|      0|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  101|  20.2k|    }
  102|  4.00k|  }
_ZZN8rawspeed10PrefixCodeINS_15BaselineCodeTagEE17verifyCodeSymbolsEvENKUlRKNS_18AbstractPrefixCodeIS1_E10CodeSymbolES7_E_clES7_S7_:
   90|  16.2k|            [](const CodeSymbol& lhs, const CodeSymbol& rhs) -> bool {
   91|  16.2k|              return !std::less_equal<>()(lhs.code_len, rhs.code_len);
   92|  16.2k|            }) != symbols.cend())
_ZN8rawspeed10PrefixCodeINS_10VC5CodeTagEEC2ENSt3__16vectorINS_18AbstractPrefixCodeIS1_E10CodeSymbolENS3_9allocatorIS7_EEEENS4_IjNS8_IjEEEE:
   52|  1.85k|      : Base(std::move(codeValues_)), symbols(std::move(symbols_)) {
   53|  1.85k|    if (symbols.empty() || Base::codeValues.empty() ||
  ------------------
  |  Branch (53:9): [True: 0, False: 1.85k]
  |  Branch (53:28): [True: 0, False: 1.85k]
  ------------------
   54|  1.85k|        symbols.size() != Base::codeValues.size())
  ------------------
  |  Branch (54:9): [True: 0, False: 1.85k]
  ------------------
   55|  1.85k|      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.85k|    nCodesPerLength.resize(1 + Traits::MaxCodeLenghtBits);
   58|  23.5k|    for (const CodeSymbol& s : symbols) {
  ------------------
  |  Branch (58:30): [True: 23.5k, False: 1.85k]
  ------------------
   59|  23.5k|      assert(s.code_len > 0 && s.code_len <= Traits::MaxCodeLenghtBits);
  ------------------
  |  Branch (59:7): [True: 23.5k, False: 0]
  |  Branch (59:7): [True: 23.5k, False: 0]
  |  Branch (59:7): [True: 23.5k, False: 0]
  ------------------
   60|  23.5k|      ++nCodesPerLength[s.code_len];
   61|  23.5k|    }
   62|  21.5k|    while (nCodesPerLength.back() == 0)
  ------------------
  |  Branch (62:12): [True: 19.6k, False: 1.85k]
  ------------------
   63|  19.6k|      nCodesPerLength.pop_back();
   64|  1.85k|    assert(nCodesPerLength.size() > 1);
  ------------------
  |  Branch (64:5): [True: 1.85k, False: 0]
  ------------------
   65|       |
   66|  1.85k|    verifyCodeSymbols();
   67|  1.85k|  }
_ZN8rawspeed10PrefixCodeINS_10VC5CodeTagEE17verifyCodeSymbolsEv:
   70|  1.85k|  void verifyCodeSymbols() {
   71|       |    // We are at the Root node, len is 1, there are two possible child Nodes
   72|  1.85k|    unsigned maxCodes = 2;
   73|  30.5k|    for (auto codeLen = 1UL; codeLen < nCodesPerLength.size(); codeLen++) {
  ------------------
  |  Branch (73:30): [True: 28.6k, False: 1.85k]
  ------------------
   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.85k|    if (std::adjacent_find(
  ------------------
  |  Branch (88:9): [True: 0, False: 1.85k]
  ------------------
   89|  1.85k|            symbols.cbegin(), symbols.cend(),
   90|  1.85k|            [](const CodeSymbol& lhs, const CodeSymbol& rhs) -> bool {
   91|  1.85k|              return !std::less_equal<>()(lhs.code_len, rhs.code_len);
   92|  1.85k|            }) != symbols.cend())
   93|  1.85k|      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.4k|    for (auto sId = 0UL; sId < symbols.size(); sId++) {
  ------------------
  |  Branch (97:26): [True: 23.5k, False: 1.85k]
  ------------------
   98|  1.82M|      for (auto pId = 0UL; pId < sId; pId++)
  ------------------
  |  Branch (98:28): [True: 1.80M, False: 23.5k]
  ------------------
   99|  1.80M|        if (CodeSymbol::HaveCommonPrefix(symbols[sId], symbols[pId]))
  ------------------
  |  Branch (99:13): [True: 0, False: 1.80M]
  ------------------
  100|  23.5k|          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.5k|    }
  102|  1.85k|  }
_ZZN8rawspeed10PrefixCodeINS_10VC5CodeTagEE17verifyCodeSymbolsEvENKUlRKNS_18AbstractPrefixCodeIS1_E10CodeSymbolES7_E_clES7_S7_:
   90|  21.7k|            [](const CodeSymbol& lhs, const CodeSymbol& rhs) -> bool {
   91|  21.7k|              return !std::less_equal<>()(lhs.code_len, rhs.code_len);
   92|  21.7k|            }) != symbols.cend())

_ZN8rawspeed20PrefixCodeLUTDecoderINS_15BaselineCodeTagENS_23PrefixCodeLookupDecoderIS1_EEE5setupEbb:
   95|  1.96k|  void setup(bool fullDecode_, bool fixDNGBug16_) {
   96|  1.96k|    Base::setup(fullDecode_, fixDNGBug16_);
   97|       |
   98|       |    // Generate lookup table for fast decoding lookup.
   99|       |    // See definition of decodeLookup above
  100|  1.96k|    decodeLookup.resize(1 << LookupDepth);
  101|  6.98k|    for (size_t i = 0; i < Base::code.symbols.size(); i++) {
  ------------------
  |  Branch (101:24): [True: 5.85k, False: 1.13k]
  ------------------
  102|  5.85k|      uint8_t code_l = Base::code.symbols[i].code_len;
  103|  5.85k|      if (code_l > static_cast<int>(LookupDepth))
  ------------------
  |  Branch (103:11): [True: 832, False: 5.02k]
  ------------------
  104|    832|        break;
  105|       |
  106|  5.02k|      auto ll = implicit_cast<uint16_t>(Base::code.symbols[i].code
  107|  5.02k|                                        << (LookupDepth - code_l));
  108|  5.02k|      auto ul =
  109|  5.02k|          implicit_cast<uint16_t>(ll | ((1 << (LookupDepth - code_l)) - 1));
  110|  5.02k|      static_assert(Traits::MaxCodeValueLenghtBits <=
  111|  5.02k|                    bitwidth<LUTEntryTy>() - PayloadShift);
  112|  5.02k|      LUTUnsignedEntryTy diff_l = Base::code.codeValues[i];
  113|  1.36M|      for (uint16_t c = ll; c <= ul; c++) {
  ------------------
  |  Branch (113:29): [True: 1.35M, False: 5.02k]
  ------------------
  114|  1.35M|        if (!(c < decodeLookup.size()))
  ------------------
  |  Branch (114:13): [True: 0, False: 1.35M]
  ------------------
  115|  1.35M|          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.35M|        if (!FlagMask || !Base::isFullDecode() || code_l > LookupDepth ||
  ------------------
  |  Branch (117:13): [Folded, False: 1.35M]
  |  Branch (117:26): [True: 414k, False: 944k]
  |  Branch (117:51): [True: 0, False: 944k]
  ------------------
  118|   944k|            (code_l + diff_l > LookupDepth && diff_l != 16)) {
  ------------------
  |  Branch (118:14): [True: 540k, False: 403k]
  |  Branch (118:47): [True: 469k, False: 71.1k]
  ------------------
  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|   884k|          invariant(!Base::isFullDecode() || diff_l > 0);
  ------------------
  |  |   27|   884k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (122:11): [True: 414k, False: 469k]
  |  Branch (122:11): [True: 469k, False: 0]
  |  Branch (122:11): [True: 884k, False: 0]
  ------------------
  123|   884k|          decodeLookup[c] = diff_l << PayloadShift | code_l;
  124|       |
  125|   884k|          if (!Base::isFullDecode())
  ------------------
  |  Branch (125:15): [True: 414k, False: 469k]
  ------------------
  126|   414k|            decodeLookup[c] |= FlagMask;
  127|   884k|        } else {
  128|       |          // Lookup bit depth is sufficient to encode the final value.
  129|   474k|          decodeLookup[c] = FlagMask | code_l;
  130|   474k|          if (diff_l != 16 || Base::handleDNGBug16())
  ------------------
  |  Branch (130:15): [True: 403k, False: 71.1k]
  |  Branch (130:31): [True: 51.2k, False: 19.8k]
  ------------------
  131|   454k|            decodeLookup[c] += diff_l;
  132|       |
  133|   474k|          if (diff_l) {
  ------------------
  |  Branch (133:15): [True: 254k, False: 219k]
  ------------------
  134|   254k|            LUTUnsignedEntryTy diff;
  135|   254k|            if (diff_l != 16) {
  ------------------
  |  Branch (135:17): [True: 183k, False: 71.1k]
  ------------------
  136|   183k|              diff = extractHighBits(c, code_l + diff_l,
  137|   183k|                                     /*effectiveBitwidth=*/LookupDepth);
  138|   183k|              diff &= ((1 << diff_l) - 1);
  139|   183k|            } else {
  140|  71.1k|              diff = LUTUnsignedEntryTy(-32768);
  141|  71.1k|            }
  142|   254k|            decodeLookup[c] |= static_cast<LUTEntryTy>(
  143|   254k|                static_cast<LUTUnsignedEntryTy>(Base::extend(diff, diff_l))
  144|   254k|                << PayloadShift);
  145|   254k|          }
  146|   474k|        }
  147|  1.35M|      }
  148|  5.02k|    }
  149|  1.96k|  }
_ZNK8rawspeed20PrefixCodeLUTDecoderINS_15BaselineCodeTagENS_23PrefixCodeLookupDecoderIS1_EEE6decodeINS_14BitStreamerMSBELb1EEEiRT_:
  174|  10.5M|  __attribute__((always_inline)) int decode(BIT_STREAM& bs) const {
  175|  10.5M|    static_assert(
  176|  10.5M|        BitStreamerTraits<BIT_STREAM>::canUseWithPrefixCodeDecoder,
  177|  10.5M|        "This BitStreamer specialization is not marked as usable here");
  178|  10.5M|    invariant(FULL_DECODE == Base::isFullDecode());
  ------------------
  |  |   27|  10.5M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (178:5): [True: 10.5M, False: 0]
  ------------------
  179|  10.5M|    bs.fill(32);
  180|       |
  181|  10.5M|    typename Base::CodeSymbol partial;
  182|  10.5M|    partial.code_len = LookupDepth;
  183|  10.5M|    partial.code = implicit_cast<typename Traits::CodeTy>(
  184|  10.5M|        bs.peekBitsNoFill(partial.code_len));
  185|       |
  186|  10.5M|    assert(partial.code < decodeLookup.size());
  ------------------
  |  Branch (186:5): [True: 10.5M, False: 0]
  ------------------
  187|  10.5M|    auto lutEntry = static_cast<unsigned>(decodeLookup[partial.code]);
  188|  10.5M|    int payload = static_cast<int>(lutEntry) >> PayloadShift;
  189|  10.5M|    int len = lutEntry & LenMask;
  190|       |
  191|       |    // How far did reading of those LookupDepth bits *actually* move us forward?
  192|  10.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|  10.5M|    if (lutEntry & FlagMask)
  ------------------
  |  Branch (196:9): [True: 4.47M, False: 6.04M]
  ------------------
  197|  4.47M|      return payload;
  198|       |
  199|  6.04M|    typename Traits::CodeValueTy codeValue;
  200|  6.04M|    if (lutEntry) {
  ------------------
  |  Branch (200:9): [True: 4.27M, False: 1.76M]
  ------------------
  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.27M|      partial.code_len = implicit_cast<uint8_t>(len);
  204|  4.27M|      codeValue = implicit_cast<typename Traits::CodeValueTy>(payload);
  205|  4.27M|      invariant(!FULL_DECODE || codeValue /*aka diff_l*/ > 0);
  ------------------
  |  |   27|  4.27M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (205:7): [Folded, False: 4.27M]
  |  Branch (205:7): [True: 4.27M, False: 0]
  |  Branch (205:7): [True: 4.27M, False: 0]
  ------------------
  206|  4.27M|    } 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.76M|      invariant(len == 0);
  ------------------
  |  |   27|  1.76M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (209:7): [True: 1.76M, False: 0]
  ------------------
  210|  1.76M|      bs.skipBitsNoFill(partial.code_len);
  211|  1.76M|      std::tie(partial, codeValue) =
  212|  1.76M|          Base::finishReadingPartialSymbol(bs, partial);
  213|  1.76M|    }
  214|       |
  215|  6.04M|    return Base::template processSymbol<BIT_STREAM, FULL_DECODE>(bs, partial,
  216|  6.04M|                                                                 codeValue);
  217|  6.04M|  }
_ZNK8rawspeed20PrefixCodeLUTDecoderINS_15BaselineCodeTagENS_23PrefixCodeLookupDecoderIS1_EEE6decodeINS_14BitStreamerMSBELb0EEEiRT_:
  174|  39.2M|  __attribute__((always_inline)) int decode(BIT_STREAM& bs) const {
  175|  39.2M|    static_assert(
  176|  39.2M|        BitStreamerTraits<BIT_STREAM>::canUseWithPrefixCodeDecoder,
  177|  39.2M|        "This BitStreamer specialization is not marked as usable here");
  178|  39.2M|    invariant(FULL_DECODE == Base::isFullDecode());
  ------------------
  |  |   27|  39.2M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (178:5): [True: 39.2M, False: 0]
  ------------------
  179|  39.2M|    bs.fill(32);
  180|       |
  181|  39.2M|    typename Base::CodeSymbol partial;
  182|  39.2M|    partial.code_len = LookupDepth;
  183|  39.2M|    partial.code = implicit_cast<typename Traits::CodeTy>(
  184|  39.2M|        bs.peekBitsNoFill(partial.code_len));
  185|       |
  186|  39.2M|    assert(partial.code < decodeLookup.size());
  ------------------
  |  Branch (186:5): [True: 39.2M, False: 0]
  ------------------
  187|  39.2M|    auto lutEntry = static_cast<unsigned>(decodeLookup[partial.code]);
  188|  39.2M|    int payload = static_cast<int>(lutEntry) >> PayloadShift;
  189|  39.2M|    int len = lutEntry & LenMask;
  190|       |
  191|       |    // How far did reading of those LookupDepth bits *actually* move us forward?
  192|  39.2M|    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|  39.2M|    if (lutEntry & FlagMask)
  ------------------
  |  Branch (196:9): [True: 39.2M, False: 4.71k]
  ------------------
  197|  39.2M|      return payload;
  198|       |
  199|  4.71k|    typename Traits::CodeValueTy codeValue;
  200|  4.71k|    if (lutEntry) {
  ------------------
  |  Branch (200:9): [True: 0, False: 4.71k]
  ------------------
  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|  4.71k|    } 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|  4.71k|      invariant(len == 0);
  ------------------
  |  |   27|  4.71k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (209:7): [True: 4.71k, False: 0]
  ------------------
  210|  4.71k|      bs.skipBitsNoFill(partial.code_len);
  211|  4.71k|      std::tie(partial, codeValue) =
  212|  4.71k|          Base::finishReadingPartialSymbol(bs, partial);
  213|  4.71k|    }
  214|       |
  215|  4.71k|    return Base::template processSymbol<BIT_STREAM, FULL_DECODE>(bs, partial,
  216|  4.71k|                                                                 codeValue);
  217|  4.71k|  }
_ZNK8rawspeed20PrefixCodeLUTDecoderINS_15BaselineCodeTagENS_23PrefixCodeLookupDecoderIS1_EEE6decodeINS_16BitStreamerMSB32ELb1EEEiRT_:
  174|  3.99M|  __attribute__((always_inline)) int decode(BIT_STREAM& bs) const {
  175|  3.99M|    static_assert(
  176|  3.99M|        BitStreamerTraits<BIT_STREAM>::canUseWithPrefixCodeDecoder,
  177|  3.99M|        "This BitStreamer specialization is not marked as usable here");
  178|  3.99M|    invariant(FULL_DECODE == Base::isFullDecode());
  ------------------
  |  |   27|  3.99M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (178:5): [True: 3.99M, False: 0]
  ------------------
  179|  3.99M|    bs.fill(32);
  180|       |
  181|  3.99M|    typename Base::CodeSymbol partial;
  182|  3.99M|    partial.code_len = LookupDepth;
  183|  3.99M|    partial.code = implicit_cast<typename Traits::CodeTy>(
  184|  3.99M|        bs.peekBitsNoFill(partial.code_len));
  185|       |
  186|  3.99M|    assert(partial.code < decodeLookup.size());
  ------------------
  |  Branch (186:5): [True: 3.99M, False: 0]
  ------------------
  187|  3.99M|    auto lutEntry = static_cast<unsigned>(decodeLookup[partial.code]);
  188|  3.99M|    int payload = static_cast<int>(lutEntry) >> PayloadShift;
  189|  3.99M|    int len = lutEntry & LenMask;
  190|       |
  191|       |    // How far did reading of those LookupDepth bits *actually* move us forward?
  192|  3.99M|    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|  3.99M|    if (lutEntry & FlagMask)
  ------------------
  |  Branch (196:9): [True: 245k, False: 3.74M]
  ------------------
  197|   245k|      return payload;
  198|       |
  199|  3.74M|    typename Traits::CodeValueTy codeValue;
  200|  3.74M|    if (lutEntry) {
  ------------------
  |  Branch (200:9): [True: 3.12M, False: 626k]
  ------------------
  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.12M|      partial.code_len = implicit_cast<uint8_t>(len);
  204|  3.12M|      codeValue = implicit_cast<typename Traits::CodeValueTy>(payload);
  205|  3.12M|      invariant(!FULL_DECODE || codeValue /*aka diff_l*/ > 0);
  ------------------
  |  |   27|  3.12M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (205:7): [Folded, False: 3.12M]
  |  Branch (205:7): [True: 3.12M, False: 0]
  |  Branch (205:7): [True: 3.12M, False: 0]
  ------------------
  206|  3.12M|    } 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|   626k|      invariant(len == 0);
  ------------------
  |  |   27|   626k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (209:7): [True: 626k, False: 0]
  ------------------
  210|   626k|      bs.skipBitsNoFill(partial.code_len);
  211|   626k|      std::tie(partial, codeValue) =
  212|   626k|          Base::finishReadingPartialSymbol(bs, partial);
  213|   626k|    }
  214|       |
  215|  3.74M|    return Base::template processSymbol<BIT_STREAM, FULL_DECODE>(bs, partial,
  216|  3.74M|                                                                 codeValue);
  217|  3.74M|  }
_ZNK8rawspeed20PrefixCodeLUTDecoderINS_15BaselineCodeTagENS_23PrefixCodeLookupDecoderIS1_EEE6decodeINS_16BitStreamerMSB32ELb0EEEiRT_:
  174|  38.8M|  __attribute__((always_inline)) int decode(BIT_STREAM& bs) const {
  175|  38.8M|    static_assert(
  176|  38.8M|        BitStreamerTraits<BIT_STREAM>::canUseWithPrefixCodeDecoder,
  177|  38.8M|        "This BitStreamer specialization is not marked as usable here");
  178|  38.8M|    invariant(FULL_DECODE == Base::isFullDecode());
  ------------------
  |  |   27|  38.8M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (178:5): [True: 38.8M, False: 0]
  ------------------
  179|  38.8M|    bs.fill(32);
  180|       |
  181|  38.8M|    typename Base::CodeSymbol partial;
  182|  38.8M|    partial.code_len = LookupDepth;
  183|  38.8M|    partial.code = implicit_cast<typename Traits::CodeTy>(
  184|  38.8M|        bs.peekBitsNoFill(partial.code_len));
  185|       |
  186|  38.8M|    assert(partial.code < decodeLookup.size());
  ------------------
  |  Branch (186:5): [True: 38.8M, False: 0]
  ------------------
  187|  38.8M|    auto lutEntry = static_cast<unsigned>(decodeLookup[partial.code]);
  188|  38.8M|    int payload = static_cast<int>(lutEntry) >> PayloadShift;
  189|  38.8M|    int len = lutEntry & LenMask;
  190|       |
  191|       |    // How far did reading of those LookupDepth bits *actually* move us forward?
  192|  38.8M|    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|  38.8M|    if (lutEntry & FlagMask)
  ------------------
  |  Branch (196:9): [True: 38.8M, False: 5.73k]
  ------------------
  197|  38.8M|      return payload;
  198|       |
  199|  5.73k|    typename Traits::CodeValueTy codeValue;
  200|  5.73k|    if (lutEntry) {
  ------------------
  |  Branch (200:9): [True: 0, False: 5.73k]
  ------------------
  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|  5.73k|    } 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|  5.73k|      invariant(len == 0);
  ------------------
  |  |   27|  5.73k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (209:7): [True: 5.73k, False: 0]
  ------------------
  210|  5.73k|      bs.skipBitsNoFill(partial.code_len);
  211|  5.73k|      std::tie(partial, codeValue) =
  212|  5.73k|          Base::finishReadingPartialSymbol(bs, partial);
  213|  5.73k|    }
  214|       |
  215|  5.73k|    return Base::template processSymbol<BIT_STREAM, FULL_DECODE>(bs, partial,
  216|  5.73k|                                                                 codeValue);
  217|  5.73k|  }
_ZNK8rawspeed20PrefixCodeLUTDecoderINS_15BaselineCodeTagENS_23PrefixCodeLookupDecoderIS1_EEE6decodeINS_15BitStreamerJPEGELb1EEEiRT_:
  174|  4.60M|  __attribute__((always_inline)) int decode(BIT_STREAM& bs) const {
  175|  4.60M|    static_assert(
  176|  4.60M|        BitStreamerTraits<BIT_STREAM>::canUseWithPrefixCodeDecoder,
  177|  4.60M|        "This BitStreamer specialization is not marked as usable here");
  178|  4.60M|    invariant(FULL_DECODE == Base::isFullDecode());
  ------------------
  |  |   27|  4.60M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (178:5): [True: 4.60M, False: 0]
  ------------------
  179|  4.60M|    bs.fill(32);
  180|       |
  181|  4.60M|    typename Base::CodeSymbol partial;
  182|  4.60M|    partial.code_len = LookupDepth;
  183|  4.60M|    partial.code = implicit_cast<typename Traits::CodeTy>(
  184|  4.60M|        bs.peekBitsNoFill(partial.code_len));
  185|       |
  186|  4.60M|    assert(partial.code < decodeLookup.size());
  ------------------
  |  Branch (186:5): [True: 4.60M, False: 0]
  ------------------
  187|  4.60M|    auto lutEntry = static_cast<unsigned>(decodeLookup[partial.code]);
  188|  4.60M|    int payload = static_cast<int>(lutEntry) >> PayloadShift;
  189|  4.60M|    int len = lutEntry & LenMask;
  190|       |
  191|       |    // How far did reading of those LookupDepth bits *actually* move us forward?
  192|  4.60M|    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.60M|    if (lutEntry & FlagMask)
  ------------------
  |  Branch (196:9): [True: 4.32M, False: 282k]
  ------------------
  197|  4.32M|      return payload;
  198|       |
  199|   282k|    typename Traits::CodeValueTy codeValue;
  200|   282k|    if (lutEntry) {
  ------------------
  |  Branch (200:9): [True: 280k, False: 2.58k]
  ------------------
  201|       |      // If the flag is not set, but the entry is not empty,
  202|       |      // the payload is the code value for this symbol.
  203|   280k|      partial.code_len = implicit_cast<uint8_t>(len);
  204|   280k|      codeValue = implicit_cast<typename Traits::CodeValueTy>(payload);
  205|   280k|      invariant(!FULL_DECODE || codeValue /*aka diff_l*/ > 0);
  ------------------
  |  |   27|   280k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (205:7): [Folded, False: 280k]
  |  Branch (205:7): [True: 280k, False: 0]
  |  Branch (205:7): [True: 280k, False: 0]
  ------------------
  206|   280k|    } 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.58k|      invariant(len == 0);
  ------------------
  |  |   27|  2.58k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (209:7): [True: 2.58k, False: 0]
  ------------------
  210|  2.58k|      bs.skipBitsNoFill(partial.code_len);
  211|  2.58k|      std::tie(partial, codeValue) =
  212|  2.58k|          Base::finishReadingPartialSymbol(bs, partial);
  213|  2.58k|    }
  214|       |
  215|   282k|    return Base::template processSymbol<BIT_STREAM, FULL_DECODE>(bs, partial,
  216|   282k|                                                                 codeValue);
  217|   282k|  }
_ZNK8rawspeed20PrefixCodeLUTDecoderINS_15BaselineCodeTagENS_23PrefixCodeLookupDecoderIS1_EEE6decodeINS_15BitStreamerJPEGELb0EEEiRT_:
  174|  11.0M|  __attribute__((always_inline)) int decode(BIT_STREAM& bs) const {
  175|  11.0M|    static_assert(
  176|  11.0M|        BitStreamerTraits<BIT_STREAM>::canUseWithPrefixCodeDecoder,
  177|  11.0M|        "This BitStreamer specialization is not marked as usable here");
  178|  11.0M|    invariant(FULL_DECODE == Base::isFullDecode());
  ------------------
  |  |   27|  11.0M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (178:5): [True: 11.0M, False: 0]
  ------------------
  179|  11.0M|    bs.fill(32);
  180|       |
  181|  11.0M|    typename Base::CodeSymbol partial;
  182|  11.0M|    partial.code_len = LookupDepth;
  183|  11.0M|    partial.code = implicit_cast<typename Traits::CodeTy>(
  184|  11.0M|        bs.peekBitsNoFill(partial.code_len));
  185|       |
  186|  11.0M|    assert(partial.code < decodeLookup.size());
  ------------------
  |  Branch (186:5): [True: 11.0M, False: 0]
  ------------------
  187|  11.0M|    auto lutEntry = static_cast<unsigned>(decodeLookup[partial.code]);
  188|  11.0M|    int payload = static_cast<int>(lutEntry) >> PayloadShift;
  189|  11.0M|    int len = lutEntry & LenMask;
  190|       |
  191|       |    // How far did reading of those LookupDepth bits *actually* move us forward?
  192|  11.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|  11.0M|    if (lutEntry & FlagMask)
  ------------------
  |  Branch (196:9): [True: 10.9M, False: 1.47k]
  ------------------
  197|  10.9M|      return payload;
  198|       |
  199|  1.47k|    typename Traits::CodeValueTy codeValue;
  200|  1.47k|    if (lutEntry) {
  ------------------
  |  Branch (200:9): [True: 0, False: 1.47k]
  ------------------
  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.47k|    } 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.47k|      invariant(len == 0);
  ------------------
  |  |   27|  1.47k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (209:7): [True: 1.47k, False: 0]
  ------------------
  210|  1.47k|      bs.skipBitsNoFill(partial.code_len);
  211|  1.47k|      std::tie(partial, codeValue) =
  212|  1.47k|          Base::finishReadingPartialSymbol(bs, partial);
  213|  1.47k|    }
  214|       |
  215|  1.47k|    return Base::template processSymbol<BIT_STREAM, FULL_DECODE>(bs, partial,
  216|  1.47k|                                                                 codeValue);
  217|  1.47k|  }
_ZN8rawspeed20PrefixCodeLUTDecoderINS_10VC5CodeTagENS_23PrefixCodeLookupDecoderIS1_EEE5setupEbb:
   95|    884|  void setup(bool fullDecode_, bool fixDNGBug16_) {
   96|    884|    Base::setup(fullDecode_, fixDNGBug16_);
   97|       |
   98|       |    // Generate lookup table for fast decoding lookup.
   99|       |    // See definition of decodeLookup above
  100|    884|    decodeLookup.resize(1 << LookupDepth);
  101|  2.95k|    for (size_t i = 0; i < Base::code.symbols.size(); i++) {
  ------------------
  |  Branch (101:24): [True: 2.69k, False: 254]
  ------------------
  102|  2.69k|      uint8_t code_l = Base::code.symbols[i].code_len;
  103|  2.69k|      if (code_l > static_cast<int>(LookupDepth))
  ------------------
  |  Branch (103:11): [True: 630, False: 2.06k]
  ------------------
  104|    630|        break;
  105|       |
  106|  2.06k|      auto ll = implicit_cast<uint16_t>(Base::code.symbols[i].code
  107|  2.06k|                                        << (LookupDepth - code_l));
  108|  2.06k|      auto ul =
  109|  2.06k|          implicit_cast<uint16_t>(ll | ((1 << (LookupDepth - code_l)) - 1));
  110|  2.06k|      static_assert(Traits::MaxCodeValueLenghtBits <=
  111|  2.06k|                    bitwidth<LUTEntryTy>() - PayloadShift);
  112|  2.06k|      LUTUnsignedEntryTy diff_l = Base::code.codeValues[i];
  113|   260k|      for (uint16_t c = ll; c <= ul; c++) {
  ------------------
  |  Branch (113:29): [True: 258k, False: 2.06k]
  ------------------
  114|   258k|        if (!(c < decodeLookup.size()))
  ------------------
  |  Branch (114:13): [True: 0, False: 258k]
  ------------------
  115|   258k|          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|   258k|        if (!FlagMask || !Base::isFullDecode() || code_l > LookupDepth ||
  ------------------
  |  Branch (117:13): [Folded, False: 258k]
  |  Branch (117:26): [True: 258k, False: 0]
  |  Branch (117:51): [True: 0, False: 0]
  ------------------
  118|   258k|            (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|   258k|          invariant(!Base::isFullDecode() || diff_l > 0);
  ------------------
  |  |   27|   258k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (122:11): [True: 258k, False: 0]
  |  Branch (122:11): [True: 0, False: 0]
  |  Branch (122:11): [True: 258k, False: 0]
  ------------------
  123|   258k|          decodeLookup[c] = diff_l << PayloadShift | code_l;
  124|       |
  125|   258k|          if (!Base::isFullDecode())
  ------------------
  |  Branch (125:15): [True: 258k, False: 0]
  ------------------
  126|   258k|            decodeLookup[c] |= FlagMask;
  127|   258k|        } 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|   258k|      }
  148|  2.06k|    }
  149|    884|  }
_ZNK8rawspeed20PrefixCodeLUTDecoderINS_10VC5CodeTagENS_23PrefixCodeLookupDecoderIS1_EEE6decodeINS_14BitStreamerMSBELb0EEEiRT_:
  174|  27.4M|  __attribute__((always_inline)) int decode(BIT_STREAM& bs) const {
  175|  27.4M|    static_assert(
  176|  27.4M|        BitStreamerTraits<BIT_STREAM>::canUseWithPrefixCodeDecoder,
  177|  27.4M|        "This BitStreamer specialization is not marked as usable here");
  178|  27.4M|    invariant(FULL_DECODE == Base::isFullDecode());
  ------------------
  |  |   27|  27.4M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (178:5): [True: 27.4M, False: 0]
  ------------------
  179|  27.4M|    bs.fill(32);
  180|       |
  181|  27.4M|    typename Base::CodeSymbol partial;
  182|  27.4M|    partial.code_len = LookupDepth;
  183|  27.4M|    partial.code = implicit_cast<typename Traits::CodeTy>(
  184|  27.4M|        bs.peekBitsNoFill(partial.code_len));
  185|       |
  186|  27.4M|    assert(partial.code < decodeLookup.size());
  ------------------
  |  Branch (186:5): [True: 27.4M, False: 0]
  ------------------
  187|  27.4M|    auto lutEntry = static_cast<unsigned>(decodeLookup[partial.code]);
  188|  27.4M|    int payload = static_cast<int>(lutEntry) >> PayloadShift;
  189|  27.4M|    int len = lutEntry & LenMask;
  190|       |
  191|       |    // How far did reading of those LookupDepth bits *actually* move us forward?
  192|  27.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|  27.4M|    if (lutEntry & FlagMask)
  ------------------
  |  Branch (196:9): [True: 27.4M, False: 12.1k]
  ------------------
  197|  27.4M|      return payload;
  198|       |
  199|  12.1k|    typename Traits::CodeValueTy codeValue;
  200|  12.1k|    if (lutEntry) {
  ------------------
  |  Branch (200:9): [True: 0, False: 12.1k]
  ------------------
  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|  12.1k|    } 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|  12.1k|      invariant(len == 0);
  ------------------
  |  |   27|  12.1k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (209:7): [True: 12.1k, False: 0]
  ------------------
  210|  12.1k|      bs.skipBitsNoFill(partial.code_len);
  211|  12.1k|      std::tie(partial, codeValue) =
  212|  12.1k|          Base::finishReadingPartialSymbol(bs, partial);
  213|  12.1k|    }
  214|       |
  215|  12.1k|    return Base::template processSymbol<BIT_STREAM, FULL_DECODE>(bs, partial,
  216|  12.1k|                                                                 codeValue);
  217|  12.1k|  }
_ZNK8rawspeed20PrefixCodeLUTDecoderINS_10VC5CodeTagENS_23PrefixCodeLookupDecoderIS1_EEE6decodeINS_16BitStreamerMSB32ELb0EEEiRT_:
  174|  26.2M|  __attribute__((always_inline)) int decode(BIT_STREAM& bs) const {
  175|  26.2M|    static_assert(
  176|  26.2M|        BitStreamerTraits<BIT_STREAM>::canUseWithPrefixCodeDecoder,
  177|  26.2M|        "This BitStreamer specialization is not marked as usable here");
  178|  26.2M|    invariant(FULL_DECODE == Base::isFullDecode());
  ------------------
  |  |   27|  26.2M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (178:5): [True: 26.2M, False: 0]
  ------------------
  179|  26.2M|    bs.fill(32);
  180|       |
  181|  26.2M|    typename Base::CodeSymbol partial;
  182|  26.2M|    partial.code_len = LookupDepth;
  183|  26.2M|    partial.code = implicit_cast<typename Traits::CodeTy>(
  184|  26.2M|        bs.peekBitsNoFill(partial.code_len));
  185|       |
  186|  26.2M|    assert(partial.code < decodeLookup.size());
  ------------------
  |  Branch (186:5): [True: 26.2M, False: 0]
  ------------------
  187|  26.2M|    auto lutEntry = static_cast<unsigned>(decodeLookup[partial.code]);
  188|  26.2M|    int payload = static_cast<int>(lutEntry) >> PayloadShift;
  189|  26.2M|    int len = lutEntry & LenMask;
  190|       |
  191|       |    // How far did reading of those LookupDepth bits *actually* move us forward?
  192|  26.2M|    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|  26.2M|    if (lutEntry & FlagMask)
  ------------------
  |  Branch (196:9): [True: 26.2M, False: 4.51k]
  ------------------
  197|  26.2M|      return payload;
  198|       |
  199|  4.51k|    typename Traits::CodeValueTy codeValue;
  200|  4.51k|    if (lutEntry) {
  ------------------
  |  Branch (200:9): [True: 0, False: 4.51k]
  ------------------
  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|  4.51k|    } 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|  4.51k|      invariant(len == 0);
  ------------------
  |  |   27|  4.51k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (209:7): [True: 4.51k, False: 0]
  ------------------
  210|  4.51k|      bs.skipBitsNoFill(partial.code_len);
  211|  4.51k|      std::tie(partial, codeValue) =
  212|  4.51k|          Base::finishReadingPartialSymbol(bs, partial);
  213|  4.51k|    }
  214|       |
  215|  4.51k|    return Base::template processSymbol<BIT_STREAM, FULL_DECODE>(bs, partial,
  216|  4.51k|                                                                 codeValue);
  217|  4.51k|  }
_ZNK8rawspeed20PrefixCodeLUTDecoderINS_10VC5CodeTagENS_23PrefixCodeLookupDecoderIS1_EEE6decodeINS_15BitStreamerJPEGELb0EEEiRT_:
  174|  7.39k|  __attribute__((always_inline)) int decode(BIT_STREAM& bs) const {
  175|  7.39k|    static_assert(
  176|  7.39k|        BitStreamerTraits<BIT_STREAM>::canUseWithPrefixCodeDecoder,
  177|  7.39k|        "This BitStreamer specialization is not marked as usable here");
  178|  7.39k|    invariant(FULL_DECODE == Base::isFullDecode());
  ------------------
  |  |   27|  7.39k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (178:5): [True: 7.39k, False: 0]
  ------------------
  179|  7.39k|    bs.fill(32);
  180|       |
  181|  7.39k|    typename Base::CodeSymbol partial;
  182|  7.39k|    partial.code_len = LookupDepth;
  183|  7.39k|    partial.code = implicit_cast<typename Traits::CodeTy>(
  184|  7.39k|        bs.peekBitsNoFill(partial.code_len));
  185|       |
  186|  7.39k|    assert(partial.code < decodeLookup.size());
  ------------------
  |  Branch (186:5): [True: 7.39k, False: 0]
  ------------------
  187|  7.39k|    auto lutEntry = static_cast<unsigned>(decodeLookup[partial.code]);
  188|  7.39k|    int payload = static_cast<int>(lutEntry) >> PayloadShift;
  189|  7.39k|    int len = lutEntry & LenMask;
  190|       |
  191|       |    // How far did reading of those LookupDepth bits *actually* move us forward?
  192|  7.39k|    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|  7.39k|    if (lutEntry & FlagMask)
  ------------------
  |  Branch (196:9): [True: 5.47k, False: 1.92k]
  ------------------
  197|  5.47k|      return payload;
  198|       |
  199|  1.92k|    typename Traits::CodeValueTy codeValue;
  200|  1.92k|    if (lutEntry) {
  ------------------
  |  Branch (200:9): [True: 0, False: 1.92k]
  ------------------
  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.92k|    } 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.92k|      invariant(len == 0);
  ------------------
  |  |   27|  1.92k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (209:7): [True: 1.92k, False: 0]
  ------------------
  210|  1.92k|      bs.skipBitsNoFill(partial.code_len);
  211|  1.92k|      std::tie(partial, codeValue) =
  212|  1.92k|          Base::finishReadingPartialSymbol(bs, partial);
  213|  1.92k|    }
  214|       |
  215|  1.92k|    return Base::template processSymbol<BIT_STREAM, FULL_DECODE>(bs, partial,
  216|  1.92k|                                                                 codeValue);
  217|  1.92k|  }

_ZN8rawspeed23PrefixCodeLookupDecoderINS_15BaselineCodeTagEEC2EONS_11HuffmanCodeIS1_EE:
   80|  2.04k|      : Base(std::move(hc).operator rawspeed::PrefixCode<CodeTag>()) {}
_ZN8rawspeed23PrefixCodeLookupDecoderINS_15BaselineCodeTagEE5setupEbb:
   97|  1.96k|  void setup(bool fullDecode_, bool fixDNGBug16_) {
   98|  1.96k|    AbstractPrefixCodeDecoder<CodeTag>::setup(fullDecode_, fixDNGBug16_);
   99|       |
  100|       |    // Figure F.15: generate decoding tables
  101|  1.96k|    codeOffsetOL.resize(Base::maxCodeLength() + 1UL, MaxCodeValue);
  102|  1.96k|    maxCodeOL.resize(Base::maxCodeLength() + 1UL, MaxCodeValue);
  103|  1.96k|    for (unsigned int numCodesSoFar = 0, codeLen = 1;
  104|  16.9k|         codeLen <= Base::maxCodeLength(); codeLen++) {
  ------------------
  |  Branch (104:10): [True: 14.9k, False: 1.96k]
  ------------------
  105|  14.9k|      if (!Base::code.nCodesPerLength[codeLen])
  ------------------
  |  Branch (105:11): [True: 11.7k, False: 3.19k]
  ------------------
  106|  11.7k|        continue;
  107|  3.19k|      codeOffsetOL[codeLen] = implicit_cast<typename Traits::CodeTy>(
  108|  3.19k|          Base::code.symbols[numCodesSoFar].code - numCodesSoFar);
  109|  3.19k|      assert(codeOffsetOL[codeLen] != MaxCodeValue);
  ------------------
  |  Branch (109:7): [True: 3.19k, False: 0]
  ------------------
  110|  3.19k|      numCodesSoFar += Base::code.nCodesPerLength[codeLen];
  111|  3.19k|      maxCodeOL[codeLen] = Base::code.symbols[numCodesSoFar - 1].code;
  112|  3.19k|    }
  113|  1.96k|  }
_ZNK8rawspeed23PrefixCodeLookupDecoderINS_15BaselineCodeTagEE26finishReadingPartialSymbolINS_14BitStreamerMSBEEENSt3__14pairINS_18AbstractPrefixCodeIS1_E10CodeSymbolEiEERT_S9_:
  136|  1.77M|                             typename Base::CodeSymbol partial) const {
  137|  1.77M|    static_assert(
  138|  1.77M|        BitStreamerTraits<BIT_STREAM>::canUseWithPrefixCodeDecoder,
  139|  1.77M|        "This BitStreamer specialization is not marked as usable here");
  140|  10.6M|    while (partial.code_len < Base::maxCodeLength() &&
  ------------------
  |  Branch (140:12): [True: 8.83M, False: 1.77M]
  ------------------
  141|  8.83M|           (MaxCodeValue == maxCodeOL[partial.code_len] ||
  ------------------
  |  Branch (141:13): [True: 8.83M, False: 555]
  ------------------
  142|  8.83M|            partial.code > maxCodeOL[partial.code_len])) {
  ------------------
  |  Branch (142:13): [True: 266, False: 289]
  ------------------
  143|  8.83M|      uint32_t temp = bs.getBitsNoFill(1);
  144|  8.83M|      partial.code =
  145|  8.83M|          implicit_cast<typename Traits::CodeTy>((partial.code << 1) | temp);
  146|  8.83M|      partial.code_len++;
  147|  8.83M|    }
  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|  1.77M|    if (partial.code_len > Base::maxCodeLength() ||
  ------------------
  |  Branch (152:9): [True: 123, False: 1.77M]
  ------------------
  153|  1.77M|        partial.code > maxCodeOL[partial.code_len])
  ------------------
  |  Branch (153:9): [True: 121, False: 1.77M]
  ------------------
  154|  1.77M|      ThrowRDE("bad Huffman code: %u (len: %u)", partial.code,
  ------------------
  |  |   38|    244|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|    244|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|    244|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|    244|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  155|  1.77M|               partial.code_len);
  156|       |
  157|  1.77M|    assert(MaxCodeValue != codeOffsetOL[partial.code_len]);
  ------------------
  |  Branch (157:5): [True: 1.77M, False: 0]
  ------------------
  158|  1.77M|    assert(partial.code >= codeOffsetOL[partial.code_len]);
  ------------------
  |  Branch (158:5): [True: 1.77M, False: 0]
  ------------------
  159|  1.77M|    unsigned codeIndex = partial.code - codeOffsetOL[partial.code_len];
  160|  1.77M|    assert(codeIndex < Base::code.codeValues.size());
  ------------------
  |  Branch (160:5): [True: 1.77M, False: 0]
  ------------------
  161|       |
  162|  1.77M|    typename Traits::CodeValueTy codeValue = Base::code.codeValues[codeIndex];
  163|  1.77M|    return {partial, codeValue};
  164|  1.77M|  }
_ZNK8rawspeed23PrefixCodeLookupDecoderINS_15BaselineCodeTagEE26finishReadingPartialSymbolINS_16BitStreamerMSB32EEENSt3__14pairINS_18AbstractPrefixCodeIS1_E10CodeSymbolEiEERT_S9_:
  136|   632k|                             typename Base::CodeSymbol partial) const {
  137|   632k|    static_assert(
  138|   632k|        BitStreamerTraits<BIT_STREAM>::canUseWithPrefixCodeDecoder,
  139|   632k|        "This BitStreamer specialization is not marked as usable here");
  140|  2.54M|    while (partial.code_len < Base::maxCodeLength() &&
  ------------------
  |  Branch (140:12): [True: 1.91M, False: 631k]
  ------------------
  141|  1.91M|           (MaxCodeValue == maxCodeOL[partial.code_len] ||
  ------------------
  |  Branch (141:13): [True: 1.91M, False: 602]
  ------------------
  142|  1.91M|            partial.code > maxCodeOL[partial.code_len])) {
  ------------------
  |  Branch (142:13): [True: 292, False: 310]
  ------------------
  143|  1.91M|      uint32_t temp = bs.getBitsNoFill(1);
  144|  1.91M|      partial.code =
  145|  1.91M|          implicit_cast<typename Traits::CodeTy>((partial.code << 1) | temp);
  146|  1.91M|      partial.code_len++;
  147|  1.91M|    }
  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|   632k|    if (partial.code_len > Base::maxCodeLength() ||
  ------------------
  |  Branch (152:9): [True: 98, False: 632k]
  ------------------
  153|   632k|        partial.code > maxCodeOL[partial.code_len])
  ------------------
  |  Branch (153:9): [True: 140, False: 631k]
  ------------------
  154|   632k|      ThrowRDE("bad Huffman code: %u (len: %u)", partial.code,
  ------------------
  |  |   38|    238|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|    238|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|    238|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|    238|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  155|   631k|               partial.code_len);
  156|       |
  157|   632k|    assert(MaxCodeValue != codeOffsetOL[partial.code_len]);
  ------------------
  |  Branch (157:5): [True: 631k, False: 0]
  ------------------
  158|   631k|    assert(partial.code >= codeOffsetOL[partial.code_len]);
  ------------------
  |  Branch (158:5): [True: 631k, False: 0]
  ------------------
  159|   631k|    unsigned codeIndex = partial.code - codeOffsetOL[partial.code_len];
  160|   631k|    assert(codeIndex < Base::code.codeValues.size());
  ------------------
  |  Branch (160:5): [True: 631k, False: 0]
  ------------------
  161|       |
  162|   631k|    typename Traits::CodeValueTy codeValue = Base::code.codeValues[codeIndex];
  163|   631k|    return {partial, codeValue};
  164|   631k|  }
_ZNK8rawspeed23PrefixCodeLookupDecoderINS_15BaselineCodeTagEE26finishReadingPartialSymbolINS_15BitStreamerJPEGEEENSt3__14pairINS_18AbstractPrefixCodeIS1_E10CodeSymbolEiEERT_S9_:
  136|  4.06k|                             typename Base::CodeSymbol partial) const {
  137|  4.06k|    static_assert(
  138|  4.06k|        BitStreamerTraits<BIT_STREAM>::canUseWithPrefixCodeDecoder,
  139|  4.06k|        "This BitStreamer specialization is not marked as usable here");
  140|  13.6k|    while (partial.code_len < Base::maxCodeLength() &&
  ------------------
  |  Branch (140:12): [True: 9.85k, False: 3.75k]
  ------------------
  141|  9.85k|           (MaxCodeValue == maxCodeOL[partial.code_len] ||
  ------------------
  |  Branch (141:13): [True: 9.28k, False: 567]
  ------------------
  142|  9.54k|            partial.code > maxCodeOL[partial.code_len])) {
  ------------------
  |  Branch (142:13): [True: 261, False: 306]
  ------------------
  143|  9.54k|      uint32_t temp = bs.getBitsNoFill(1);
  144|  9.54k|      partial.code =
  145|  9.54k|          implicit_cast<typename Traits::CodeTy>((partial.code << 1) | temp);
  146|  9.54k|      partial.code_len++;
  147|  9.54k|    }
  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|  4.06k|    if (partial.code_len > Base::maxCodeLength() ||
  ------------------
  |  Branch (152:9): [True: 131, False: 3.93k]
  ------------------
  153|  3.93k|        partial.code > maxCodeOL[partial.code_len])
  ------------------
  |  Branch (153:9): [True: 101, False: 3.83k]
  ------------------
  154|  4.06k|      ThrowRDE("bad Huffman code: %u (len: %u)", partial.code,
  ------------------
  |  |   38|    232|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|    232|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|    232|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|    232|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  155|  3.83k|               partial.code_len);
  156|       |
  157|  4.06k|    assert(MaxCodeValue != codeOffsetOL[partial.code_len]);
  ------------------
  |  Branch (157:5): [True: 3.83k, False: 0]
  ------------------
  158|  3.83k|    assert(partial.code >= codeOffsetOL[partial.code_len]);
  ------------------
  |  Branch (158:5): [True: 3.83k, False: 0]
  ------------------
  159|  3.83k|    unsigned codeIndex = partial.code - codeOffsetOL[partial.code_len];
  160|  3.83k|    assert(codeIndex < Base::code.codeValues.size());
  ------------------
  |  Branch (160:5): [True: 3.83k, False: 0]
  ------------------
  161|       |
  162|  3.83k|    typename Traits::CodeValueTy codeValue = Base::code.codeValues[codeIndex];
  163|  3.83k|    return {partial, codeValue};
  164|  3.83k|  }
_ZN8rawspeed23PrefixCodeLookupDecoderINS_10VC5CodeTagEEC2EONS_11HuffmanCodeIS1_EE:
   80|    974|      : Base(std::move(hc).operator rawspeed::PrefixCode<CodeTag>()) {}
_ZN8rawspeed23PrefixCodeLookupDecoderINS_10VC5CodeTagEE5setupEbb:
   97|    884|  void setup(bool fullDecode_, bool fixDNGBug16_) {
   98|    884|    AbstractPrefixCodeDecoder<CodeTag>::setup(fullDecode_, fixDNGBug16_);
   99|       |
  100|       |    // Figure F.15: generate decoding tables
  101|    884|    codeOffsetOL.resize(Base::maxCodeLength() + 1UL, MaxCodeValue);
  102|    884|    maxCodeOL.resize(Base::maxCodeLength() + 1UL, MaxCodeValue);
  103|    884|    for (unsigned int numCodesSoFar = 0, codeLen = 1;
  104|  14.4k|         codeLen <= Base::maxCodeLength(); codeLen++) {
  ------------------
  |  Branch (104:10): [True: 13.5k, False: 884]
  ------------------
  105|  13.5k|      if (!Base::code.nCodesPerLength[codeLen])
  ------------------
  |  Branch (105:11): [True: 11.3k, False: 2.22k]
  ------------------
  106|  11.3k|        continue;
  107|  2.22k|      codeOffsetOL[codeLen] = implicit_cast<typename Traits::CodeTy>(
  108|  2.22k|          Base::code.symbols[numCodesSoFar].code - numCodesSoFar);
  109|  2.22k|      assert(codeOffsetOL[codeLen] != MaxCodeValue);
  ------------------
  |  Branch (109:7): [True: 2.22k, False: 0]
  ------------------
  110|  2.22k|      numCodesSoFar += Base::code.nCodesPerLength[codeLen];
  111|  2.22k|      maxCodeOL[codeLen] = Base::code.symbols[numCodesSoFar - 1].code;
  112|  2.22k|    }
  113|    884|  }
_ZNK8rawspeed23PrefixCodeLookupDecoderINS_10VC5CodeTagEE26finishReadingPartialSymbolINS_14BitStreamerMSBEEENSt3__14pairINS_18AbstractPrefixCodeIS1_E10CodeSymbolEiEERT_S9_:
  136|  12.1k|                             typename Base::CodeSymbol partial) const {
  137|  12.1k|    static_assert(
  138|  12.1k|        BitStreamerTraits<BIT_STREAM>::canUseWithPrefixCodeDecoder,
  139|  12.1k|        "This BitStreamer specialization is not marked as usable here");
  140|  63.6k|    while (partial.code_len < Base::maxCodeLength() &&
  ------------------
  |  Branch (140:12): [True: 52.6k, False: 10.9k]
  ------------------
  141|  52.6k|           (MaxCodeValue == maxCodeOL[partial.code_len] ||
  ------------------
  |  Branch (141:13): [True: 51.0k, False: 1.64k]
  ------------------
  142|  51.4k|            partial.code > maxCodeOL[partial.code_len])) {
  ------------------
  |  Branch (142:13): [True: 425, False: 1.21k]
  ------------------
  143|  51.4k|      uint32_t temp = bs.getBitsNoFill(1);
  144|  51.4k|      partial.code =
  145|  51.4k|          implicit_cast<typename Traits::CodeTy>((partial.code << 1) | temp);
  146|  51.4k|      partial.code_len++;
  147|  51.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|  12.1k|    if (partial.code_len > Base::maxCodeLength() ||
  ------------------
  |  Branch (152:9): [True: 38, False: 12.1k]
  ------------------
  153|  12.1k|        partial.code > maxCodeOL[partial.code_len])
  ------------------
  |  Branch (153:9): [True: 129, False: 11.9k]
  ------------------
  154|  12.1k|      ThrowRDE("bad Huffman code: %u (len: %u)", partial.code,
  ------------------
  |  |   38|    167|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|    167|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|    167|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|    167|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  155|  11.9k|               partial.code_len);
  156|       |
  157|  12.1k|    assert(MaxCodeValue != codeOffsetOL[partial.code_len]);
  ------------------
  |  Branch (157:5): [True: 11.9k, False: 0]
  ------------------
  158|  11.9k|    assert(partial.code >= codeOffsetOL[partial.code_len]);
  ------------------
  |  Branch (158:5): [True: 11.9k, False: 0]
  ------------------
  159|  11.9k|    unsigned codeIndex = partial.code - codeOffsetOL[partial.code_len];
  160|  11.9k|    assert(codeIndex < Base::code.codeValues.size());
  ------------------
  |  Branch (160:5): [True: 11.9k, False: 0]
  ------------------
  161|       |
  162|  11.9k|    typename Traits::CodeValueTy codeValue = Base::code.codeValues[codeIndex];
  163|  11.9k|    return {partial, codeValue};
  164|  11.9k|  }
_ZNK8rawspeed23PrefixCodeLookupDecoderINS_10VC5CodeTagEE26finishReadingPartialSymbolINS_16BitStreamerMSB32EEENSt3__14pairINS_18AbstractPrefixCodeIS1_E10CodeSymbolEiEERT_S9_:
  136|  4.51k|                             typename Base::CodeSymbol partial) const {
  137|  4.51k|    static_assert(
  138|  4.51k|        BitStreamerTraits<BIT_STREAM>::canUseWithPrefixCodeDecoder,
  139|  4.51k|        "This BitStreamer specialization is not marked as usable here");
  140|  23.5k|    while (partial.code_len < Base::maxCodeLength() &&
  ------------------
  |  Branch (140:12): [True: 19.2k, False: 4.21k]
  ------------------
  141|  19.2k|           (MaxCodeValue == maxCodeOL[partial.code_len] ||
  ------------------
  |  Branch (141:13): [True: 18.5k, False: 740]
  ------------------
  142|  18.9k|            partial.code > maxCodeOL[partial.code_len])) {
  ------------------
  |  Branch (142:13): [True: 444, False: 296]
  ------------------
  143|  18.9k|      uint32_t temp = bs.getBitsNoFill(1);
  144|  18.9k|      partial.code =
  145|  18.9k|          implicit_cast<typename Traits::CodeTy>((partial.code << 1) | temp);
  146|  18.9k|      partial.code_len++;
  147|  18.9k|    }
  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|  4.51k|    if (partial.code_len > Base::maxCodeLength() ||
  ------------------
  |  Branch (152:9): [True: 10, False: 4.50k]
  ------------------
  153|  4.50k|        partial.code > maxCodeOL[partial.code_len])
  ------------------
  |  Branch (153:9): [True: 134, False: 4.37k]
  ------------------
  154|  4.51k|      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|  4.37k|               partial.code_len);
  156|       |
  157|  4.51k|    assert(MaxCodeValue != codeOffsetOL[partial.code_len]);
  ------------------
  |  Branch (157:5): [True: 4.37k, False: 0]
  ------------------
  158|  4.37k|    assert(partial.code >= codeOffsetOL[partial.code_len]);
  ------------------
  |  Branch (158:5): [True: 4.37k, False: 0]
  ------------------
  159|  4.37k|    unsigned codeIndex = partial.code - codeOffsetOL[partial.code_len];
  160|  4.37k|    assert(codeIndex < Base::code.codeValues.size());
  ------------------
  |  Branch (160:5): [True: 4.37k, False: 0]
  ------------------
  161|       |
  162|  4.37k|    typename Traits::CodeValueTy codeValue = Base::code.codeValues[codeIndex];
  163|  4.37k|    return {partial, codeValue};
  164|  4.37k|  }
_ZNK8rawspeed23PrefixCodeLookupDecoderINS_10VC5CodeTagEE26finishReadingPartialSymbolINS_15BitStreamerJPEGEEENSt3__14pairINS_18AbstractPrefixCodeIS1_E10CodeSymbolEiEERT_S9_:
  136|  1.92k|                             typename Base::CodeSymbol partial) const {
  137|  1.92k|    static_assert(
  138|  1.92k|        BitStreamerTraits<BIT_STREAM>::canUseWithPrefixCodeDecoder,
  139|  1.92k|        "This BitStreamer specialization is not marked as usable here");
  140|  10.8k|    while (partial.code_len < Base::maxCodeLength() &&
  ------------------
  |  Branch (140:12): [True: 9.21k, False: 1.62k]
  ------------------
  141|  9.21k|           (MaxCodeValue == maxCodeOL[partial.code_len] ||
  ------------------
  |  Branch (141:13): [True: 8.46k, False: 752]
  ------------------
  142|  8.91k|            partial.code > maxCodeOL[partial.code_len])) {
  ------------------
  |  Branch (142:13): [True: 451, False: 301]
  ------------------
  143|  8.91k|      uint32_t temp = bs.getBitsNoFill(1);
  144|  8.91k|      partial.code =
  145|  8.91k|          implicit_cast<typename Traits::CodeTy>((partial.code << 1) | temp);
  146|  8.91k|      partial.code_len++;
  147|  8.91k|    }
  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|  1.92k|    if (partial.code_len > Base::maxCodeLength() ||
  ------------------
  |  Branch (152:9): [True: 6, False: 1.91k]
  ------------------
  153|  1.91k|        partial.code > maxCodeOL[partial.code_len])
  ------------------
  |  Branch (153:9): [True: 130, False: 1.78k]
  ------------------
  154|  1.92k|      ThrowRDE("bad Huffman code: %u (len: %u)", partial.code,
  ------------------
  |  |   38|    136|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|    136|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|    136|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|    136|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
  155|  1.78k|               partial.code_len);
  156|       |
  157|  1.92k|    assert(MaxCodeValue != codeOffsetOL[partial.code_len]);
  ------------------
  |  Branch (157:5): [True: 1.78k, False: 0]
  ------------------
  158|  1.78k|    assert(partial.code >= codeOffsetOL[partial.code_len]);
  ------------------
  |  Branch (158:5): [True: 1.78k, False: 0]
  ------------------
  159|  1.78k|    unsigned codeIndex = partial.code - codeOffsetOL[partial.code_len];
  160|  1.78k|    assert(codeIndex < Base::code.codeValues.size());
  ------------------
  |  Branch (160:5): [True: 1.78k, False: 0]
  ------------------
  161|       |
  162|  1.78k|    typename Traits::CodeValueTy codeValue = Base::code.codeValues[codeIndex];
  163|  1.78k|    return {partial, codeValue};
  164|  1.78k|  }

_ZN8rawspeed21PrefixCodeTreeDecoderINS_15BaselineCodeTagEE5setupEbb:
  122|  1.95k|  void setup(bool fullDecode_, bool fixDNGBug16_) {
  123|  1.95k|    AbstractPrefixCodeDecoder<CodeTag>::setup(fullDecode_, fixDNGBug16_);
  124|       |
  125|  1.95k|    assert(Base::code.symbols.size() == Base::code.codeValues.size());
  ------------------
  |  Branch (125:5): [True: 1.95k, False: 0]
  ------------------
  126|  10.9k|    for (unsigned codeIndex = 0; codeIndex != Base::code.symbols.size();
  ------------------
  |  Branch (126:34): [True: 8.96k, False: 1.95k]
  ------------------
  127|  8.96k|         ++codeIndex)
  128|  8.96k|      tree.add(Base::code.symbols[codeIndex], Base::code.codeValues[codeIndex]);
  129|  1.95k|  }
_ZNK8rawspeed21PrefixCodeTreeDecoderINS_15BaselineCodeTagEE6decodeINS_14BitStreamerMSBELb1EEEiRT_:
  153|  10.5M|  int decode(BIT_STREAM& bs) const {
  154|  10.5M|    static_assert(
  155|  10.5M|        BitStreamerTraits<BIT_STREAM>::canUseWithPrefixCodeDecoder,
  156|  10.5M|        "This BitStreamer specialization is not marked as usable here");
  157|  10.5M|    invariant(FULL_DECODE == Base::isFullDecode());
  ------------------
  |  |   27|  10.5M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (157:5): [True: 10.5M, False: 0]
  ------------------
  158|       |
  159|  10.5M|    bs.fill(32);
  160|       |
  161|  10.5M|    typename Base::CodeSymbol symbol;
  162|  10.5M|    typename Traits::CodeValueTy codeValue;
  163|  10.5M|    std::tie(symbol, codeValue) = readSymbol(bs);
  164|       |
  165|  10.5M|    return Base::template processSymbol<BIT_STREAM, FULL_DECODE>(bs, symbol,
  166|  10.5M|                                                                 codeValue);
  167|  10.5M|  }
_ZNK8rawspeed21PrefixCodeTreeDecoderINS_15BaselineCodeTagEE10readSymbolINS_14BitStreamerMSBEEENSt3__14pairINS_18AbstractPrefixCodeIS1_E10CodeSymbolEiEERT_:
  108|  49.7M|  readSymbol(BIT_STREAM& bs) const {
  109|  49.7M|    static_assert(
  110|  49.7M|        BitStreamerTraits<BIT_STREAM>::canUseWithPrefixCodeDecoder,
  111|  49.7M|        "This BitStreamer specialization is not marked as usable here");
  112|       |
  113|       |    // Start from completely unknown symbol.
  114|  49.7M|    typename Base::CodeSymbol partial;
  115|  49.7M|    partial.code_len = 0;
  116|  49.7M|    partial.code = 0;
  117|       |
  118|  49.7M|    return finishReadingPartialSymbol(bs, partial);
  119|  49.7M|  }
_ZNK8rawspeed21PrefixCodeTreeDecoderINS_15BaselineCodeTagEE26finishReadingPartialSymbolINS_14BitStreamerMSBEEENSt3__14pairINS_18AbstractPrefixCodeIS1_E10CodeSymbolEiEERT_S9_:
   52|  49.7M|                             typename Base::CodeSymbol initialPartial) const {
   53|  49.7M|    typename Base::CodeSymbol partial;
   54|  49.7M|    partial.code = 0;
   55|  49.7M|    partial.code_len = 0;
   56|       |
   57|  49.7M|    const auto* top = &(tree.root->getAsBranch());
   58|       |
   59|  49.7M|    auto walkBinaryTree = [&partial, &top](bool bit)
   60|  49.7M|        -> Optional<std::pair<typename Base::CodeSymbol, int /*codeValue*/>> {
   61|  49.7M|      partial.code <<= 1;
   62|  49.7M|      partial.code |= bit;
   63|  49.7M|      partial.code_len++;
   64|       |
   65|       |      // NOTE: The order *IS* important! Left to right, zero to one!
   66|  49.7M|      const auto& newNode = top->buds[bit];
   67|       |
   68|  49.7M|      if (!newNode) {
   69|       |        // Got nothing in this direction.
   70|  49.7M|        ThrowRDE("bad Huffman code: %u (len: %u)", partial.code,
   71|  49.7M|                 partial.code_len);
   72|  49.7M|      }
   73|       |
   74|  49.7M|      if (static_cast<typename decltype(tree)::Node::Type>(*newNode) ==
   75|  49.7M|          decltype(tree)::Node::Type::Leaf) {
   76|       |        // Ok, great, hit a Leaf. This is it.
   77|  49.7M|        return {{partial, newNode->getAsLeaf().value}};
   78|  49.7M|      }
   79|       |
   80|       |      // Else, this is a branch, continue looking.
   81|  49.7M|      top = &(newNode->getAsBranch());
   82|  49.7M|      return std::nullopt;
   83|  49.7M|    };
   84|       |
   85|       |    // First, translate pre-existing code bits.
   86|  49.7M|    for (unsigned bit : initialPartial.getBitsMSB()) {
  ------------------
  |  Branch (86:23): [True: 0, False: 49.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|  83.5M|    while (true) {
  ------------------
  |  Branch (92:12): [True: 83.5M, Folded]
  ------------------
   93|  83.5M|      invariant(partial.code_len <= Traits::MaxCodeLenghtBits);
  ------------------
  |  |   27|  83.5M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (93:7): [True: 83.5M, False: 0]
  ------------------
   94|       |
   95|       |      // Read one more bit
   96|  83.5M|      const bool bit = bs.getBitsNoFill(1);
   97|       |
   98|  83.5M|      if (auto sym = walkBinaryTree(bit))
  ------------------
  |  Branch (98:16): [True: 49.7M, False: 33.8M]
  ------------------
   99|  49.7M|        return *sym;
  100|  83.5M|    }
  101|       |
  102|       |    // We have either returned the found symbol, or thrown on incorrect symbol.
  103|    244|    __builtin_unreachable();
  104|  49.7M|  }
_ZZNK8rawspeed21PrefixCodeTreeDecoderINS_15BaselineCodeTagEE26finishReadingPartialSymbolINS_14BitStreamerMSBEEENSt3__14pairINS_18AbstractPrefixCodeIS1_E10CodeSymbolEiEERT_S9_ENKUlbE_clEb:
   60|  83.5M|        -> Optional<std::pair<typename Base::CodeSymbol, int /*codeValue*/>> {
   61|  83.5M|      partial.code <<= 1;
   62|  83.5M|      partial.code |= bit;
   63|  83.5M|      partial.code_len++;
   64|       |
   65|       |      // NOTE: The order *IS* important! Left to right, zero to one!
   66|  83.5M|      const auto& newNode = top->buds[bit];
   67|       |
   68|  83.5M|      if (!newNode) {
  ------------------
  |  Branch (68:11): [True: 244, False: 83.5M]
  ------------------
   69|       |        // Got nothing in this direction.
   70|    244|        ThrowRDE("bad Huffman code: %u (len: %u)", partial.code,
  ------------------
  |  |   38|    244|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|    244|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|    244|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|    244|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   71|    244|                 partial.code_len);
   72|    244|      }
   73|       |
   74|  83.5M|      if (static_cast<typename decltype(tree)::Node::Type>(*newNode) ==
  ------------------
  |  Branch (74:11): [True: 49.7M, False: 33.8M]
  ------------------
   75|  83.5M|          decltype(tree)::Node::Type::Leaf) {
   76|       |        // Ok, great, hit a Leaf. This is it.
   77|  49.7M|        return {{partial, newNode->getAsLeaf().value}};
   78|  49.7M|      }
   79|       |
   80|       |      // Else, this is a branch, continue looking.
   81|  33.8M|      top = &(newNode->getAsBranch());
   82|  33.8M|      return std::nullopt;
   83|  83.5M|    };
_ZNK8rawspeed21PrefixCodeTreeDecoderINS_15BaselineCodeTagEE6decodeINS_14BitStreamerMSBELb0EEEiRT_:
  153|  39.2M|  int decode(BIT_STREAM& bs) const {
  154|  39.2M|    static_assert(
  155|  39.2M|        BitStreamerTraits<BIT_STREAM>::canUseWithPrefixCodeDecoder,
  156|  39.2M|        "This BitStreamer specialization is not marked as usable here");
  157|  39.2M|    invariant(FULL_DECODE == Base::isFullDecode());
  ------------------
  |  |   27|  39.2M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (157:5): [True: 39.2M, False: 0]
  ------------------
  158|       |
  159|  39.2M|    bs.fill(32);
  160|       |
  161|  39.2M|    typename Base::CodeSymbol symbol;
  162|  39.2M|    typename Traits::CodeValueTy codeValue;
  163|  39.2M|    std::tie(symbol, codeValue) = readSymbol(bs);
  164|       |
  165|  39.2M|    return Base::template processSymbol<BIT_STREAM, FULL_DECODE>(bs, symbol,
  166|  39.2M|                                                                 codeValue);
  167|  39.2M|  }
_ZNK8rawspeed21PrefixCodeTreeDecoderINS_15BaselineCodeTagEE6decodeINS_16BitStreamerMSB32ELb1EEEiRT_:
  153|  3.99M|  int decode(BIT_STREAM& bs) const {
  154|  3.99M|    static_assert(
  155|  3.99M|        BitStreamerTraits<BIT_STREAM>::canUseWithPrefixCodeDecoder,
  156|  3.99M|        "This BitStreamer specialization is not marked as usable here");
  157|  3.99M|    invariant(FULL_DECODE == Base::isFullDecode());
  ------------------
  |  |   27|  3.99M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (157:5): [True: 3.99M, False: 0]
  ------------------
  158|       |
  159|  3.99M|    bs.fill(32);
  160|       |
  161|  3.99M|    typename Base::CodeSymbol symbol;
  162|  3.99M|    typename Traits::CodeValueTy codeValue;
  163|  3.99M|    std::tie(symbol, codeValue) = readSymbol(bs);
  164|       |
  165|  3.99M|    return Base::template processSymbol<BIT_STREAM, FULL_DECODE>(bs, symbol,
  166|  3.99M|                                                                 codeValue);
  167|  3.99M|  }
_ZNK8rawspeed21PrefixCodeTreeDecoderINS_15BaselineCodeTagEE10readSymbolINS_16BitStreamerMSB32EEENSt3__14pairINS_18AbstractPrefixCodeIS1_E10CodeSymbolEiEERT_:
  108|  42.8M|  readSymbol(BIT_STREAM& bs) const {
  109|  42.8M|    static_assert(
  110|  42.8M|        BitStreamerTraits<BIT_STREAM>::canUseWithPrefixCodeDecoder,
  111|  42.8M|        "This BitStreamer specialization is not marked as usable here");
  112|       |
  113|       |    // Start from completely unknown symbol.
  114|  42.8M|    typename Base::CodeSymbol partial;
  115|  42.8M|    partial.code_len = 0;
  116|  42.8M|    partial.code = 0;
  117|       |
  118|  42.8M|    return finishReadingPartialSymbol(bs, partial);
  119|  42.8M|  }
_ZNK8rawspeed21PrefixCodeTreeDecoderINS_15BaselineCodeTagEE26finishReadingPartialSymbolINS_16BitStreamerMSB32EEENSt3__14pairINS_18AbstractPrefixCodeIS1_E10CodeSymbolEiEERT_S9_:
   52|  42.8M|                             typename Base::CodeSymbol initialPartial) const {
   53|  42.8M|    typename Base::CodeSymbol partial;
   54|  42.8M|    partial.code = 0;
   55|  42.8M|    partial.code_len = 0;
   56|       |
   57|  42.8M|    const auto* top = &(tree.root->getAsBranch());
   58|       |
   59|  42.8M|    auto walkBinaryTree = [&partial, &top](bool bit)
   60|  42.8M|        -> Optional<std::pair<typename Base::CodeSymbol, int /*codeValue*/>> {
   61|  42.8M|      partial.code <<= 1;
   62|  42.8M|      partial.code |= bit;
   63|  42.8M|      partial.code_len++;
   64|       |
   65|       |      // NOTE: The order *IS* important! Left to right, zero to one!
   66|  42.8M|      const auto& newNode = top->buds[bit];
   67|       |
   68|  42.8M|      if (!newNode) {
   69|       |        // Got nothing in this direction.
   70|  42.8M|        ThrowRDE("bad Huffman code: %u (len: %u)", partial.code,
   71|  42.8M|                 partial.code_len);
   72|  42.8M|      }
   73|       |
   74|  42.8M|      if (static_cast<typename decltype(tree)::Node::Type>(*newNode) ==
   75|  42.8M|          decltype(tree)::Node::Type::Leaf) {
   76|       |        // Ok, great, hit a Leaf. This is it.
   77|  42.8M|        return {{partial, newNode->getAsLeaf().value}};
   78|  42.8M|      }
   79|       |
   80|       |      // Else, this is a branch, continue looking.
   81|  42.8M|      top = &(newNode->getAsBranch());
   82|  42.8M|      return std::nullopt;
   83|  42.8M|    };
   84|       |
   85|       |    // First, translate pre-existing code bits.
   86|  42.8M|    for (unsigned bit : initialPartial.getBitsMSB()) {
  ------------------
  |  Branch (86:23): [True: 0, False: 42.8M]
  ------------------
   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|  51.1M|    while (true) {
  ------------------
  |  Branch (92:12): [True: 51.0M, Folded]
  ------------------
   93|  51.0M|      invariant(partial.code_len <= Traits::MaxCodeLenghtBits);
  ------------------
  |  |   27|  51.0M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (93:7): [True: 51.0M, False: 0]
  ------------------
   94|       |
   95|       |      // Read one more bit
   96|  51.0M|      const bool bit = bs.getBitsNoFill(1);
   97|       |
   98|  51.0M|      if (auto sym = walkBinaryTree(bit))
  ------------------
  |  Branch (98:16): [True: 42.8M, False: 8.24M]
  ------------------
   99|  42.8M|        return *sym;
  100|  51.0M|    }
  101|       |
  102|       |    // We have either returned the found symbol, or thrown on incorrect symbol.
  103|    238|    __builtin_unreachable();
  104|  42.8M|  }
_ZZNK8rawspeed21PrefixCodeTreeDecoderINS_15BaselineCodeTagEE26finishReadingPartialSymbolINS_16BitStreamerMSB32EEENSt3__14pairINS_18AbstractPrefixCodeIS1_E10CodeSymbolEiEERT_S9_ENKUlbE_clEb:
   60|  51.0M|        -> Optional<std::pair<typename Base::CodeSymbol, int /*codeValue*/>> {
   61|  51.0M|      partial.code <<= 1;
   62|  51.0M|      partial.code |= bit;
   63|  51.0M|      partial.code_len++;
   64|       |
   65|       |      // NOTE: The order *IS* important! Left to right, zero to one!
   66|  51.0M|      const auto& newNode = top->buds[bit];
   67|       |
   68|  51.0M|      if (!newNode) {
  ------------------
  |  Branch (68:11): [True: 238, False: 51.0M]
  ------------------
   69|       |        // Got nothing in this direction.
   70|    238|        ThrowRDE("bad Huffman code: %u (len: %u)", partial.code,
  ------------------
  |  |   38|    238|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|    238|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|    238|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|    238|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   71|    238|                 partial.code_len);
   72|    238|      }
   73|       |
   74|  51.0M|      if (static_cast<typename decltype(tree)::Node::Type>(*newNode) ==
  ------------------
  |  Branch (74:11): [True: 42.8M, False: 8.24M]
  ------------------
   75|  51.0M|          decltype(tree)::Node::Type::Leaf) {
   76|       |        // Ok, great, hit a Leaf. This is it.
   77|  42.8M|        return {{partial, newNode->getAsLeaf().value}};
   78|  42.8M|      }
   79|       |
   80|       |      // Else, this is a branch, continue looking.
   81|  8.24M|      top = &(newNode->getAsBranch());
   82|  8.24M|      return std::nullopt;
   83|  51.0M|    };
_ZNK8rawspeed21PrefixCodeTreeDecoderINS_15BaselineCodeTagEE6decodeINS_16BitStreamerMSB32ELb0EEEiRT_:
  153|  38.8M|  int decode(BIT_STREAM& bs) const {
  154|  38.8M|    static_assert(
  155|  38.8M|        BitStreamerTraits<BIT_STREAM>::canUseWithPrefixCodeDecoder,
  156|  38.8M|        "This BitStreamer specialization is not marked as usable here");
  157|  38.8M|    invariant(FULL_DECODE == Base::isFullDecode());
  ------------------
  |  |   27|  38.8M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (157:5): [True: 38.8M, False: 0]
  ------------------
  158|       |
  159|  38.8M|    bs.fill(32);
  160|       |
  161|  38.8M|    typename Base::CodeSymbol symbol;
  162|  38.8M|    typename Traits::CodeValueTy codeValue;
  163|  38.8M|    std::tie(symbol, codeValue) = readSymbol(bs);
  164|       |
  165|  38.8M|    return Base::template processSymbol<BIT_STREAM, FULL_DECODE>(bs, symbol,
  166|  38.8M|                                                                 codeValue);
  167|  38.8M|  }
_ZNK8rawspeed21PrefixCodeTreeDecoderINS_15BaselineCodeTagEE6decodeINS_15BitStreamerJPEGELb1EEEiRT_:
  153|  4.60M|  int decode(BIT_STREAM& bs) const {
  154|  4.60M|    static_assert(
  155|  4.60M|        BitStreamerTraits<BIT_STREAM>::canUseWithPrefixCodeDecoder,
  156|  4.60M|        "This BitStreamer specialization is not marked as usable here");
  157|  4.60M|    invariant(FULL_DECODE == Base::isFullDecode());
  ------------------
  |  |   27|  4.60M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (157:5): [True: 4.60M, False: 0]
  ------------------
  158|       |
  159|  4.60M|    bs.fill(32);
  160|       |
  161|  4.60M|    typename Base::CodeSymbol symbol;
  162|  4.60M|    typename Traits::CodeValueTy codeValue;
  163|  4.60M|    std::tie(symbol, codeValue) = readSymbol(bs);
  164|       |
  165|  4.60M|    return Base::template processSymbol<BIT_STREAM, FULL_DECODE>(bs, symbol,
  166|  4.60M|                                                                 codeValue);
  167|  4.60M|  }
_ZNK8rawspeed21PrefixCodeTreeDecoderINS_15BaselineCodeTagEE10readSymbolINS_15BitStreamerJPEGEEENSt3__14pairINS_18AbstractPrefixCodeIS1_E10CodeSymbolEiEERT_:
  108|  15.6M|  readSymbol(BIT_STREAM& bs) const {
  109|  15.6M|    static_assert(
  110|  15.6M|        BitStreamerTraits<BIT_STREAM>::canUseWithPrefixCodeDecoder,
  111|  15.6M|        "This BitStreamer specialization is not marked as usable here");
  112|       |
  113|       |    // Start from completely unknown symbol.
  114|  15.6M|    typename Base::CodeSymbol partial;
  115|  15.6M|    partial.code_len = 0;
  116|  15.6M|    partial.code = 0;
  117|       |
  118|  15.6M|    return finishReadingPartialSymbol(bs, partial);
  119|  15.6M|  }
_ZNK8rawspeed21PrefixCodeTreeDecoderINS_15BaselineCodeTagEE26finishReadingPartialSymbolINS_15BitStreamerJPEGEEENSt3__14pairINS_18AbstractPrefixCodeIS1_E10CodeSymbolEiEERT_S9_:
   52|  15.6M|                             typename Base::CodeSymbol initialPartial) const {
   53|  15.6M|    typename Base::CodeSymbol partial;
   54|  15.6M|    partial.code = 0;
   55|  15.6M|    partial.code_len = 0;
   56|       |
   57|  15.6M|    const auto* top = &(tree.root->getAsBranch());
   58|       |
   59|  15.6M|    auto walkBinaryTree = [&partial, &top](bool bit)
   60|  15.6M|        -> Optional<std::pair<typename Base::CodeSymbol, int /*codeValue*/>> {
   61|  15.6M|      partial.code <<= 1;
   62|  15.6M|      partial.code |= bit;
   63|  15.6M|      partial.code_len++;
   64|       |
   65|       |      // NOTE: The order *IS* important! Left to right, zero to one!
   66|  15.6M|      const auto& newNode = top->buds[bit];
   67|       |
   68|  15.6M|      if (!newNode) {
   69|       |        // Got nothing in this direction.
   70|  15.6M|        ThrowRDE("bad Huffman code: %u (len: %u)", partial.code,
   71|  15.6M|                 partial.code_len);
   72|  15.6M|      }
   73|       |
   74|  15.6M|      if (static_cast<typename decltype(tree)::Node::Type>(*newNode) ==
   75|  15.6M|          decltype(tree)::Node::Type::Leaf) {
   76|       |        // Ok, great, hit a Leaf. This is it.
   77|  15.6M|        return {{partial, newNode->getAsLeaf().value}};
   78|  15.6M|      }
   79|       |
   80|       |      // Else, this is a branch, continue looking.
   81|  15.6M|      top = &(newNode->getAsBranch());
   82|  15.6M|      return std::nullopt;
   83|  15.6M|    };
   84|       |
   85|       |    // First, translate pre-existing code bits.
   86|  15.6M|    for (unsigned bit : initialPartial.getBitsMSB()) {
  ------------------
  |  Branch (86:23): [True: 0, False: 15.6M]
  ------------------
   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|  15.6M|    while (true) {
  ------------------
  |  Branch (92:12): [True: 15.6M, Folded]
  ------------------
   93|  15.6M|      invariant(partial.code_len <= Traits::MaxCodeLenghtBits);
  ------------------
  |  |   27|  15.6M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (93:7): [True: 15.6M, False: 0]
  ------------------
   94|       |
   95|       |      // Read one more bit
   96|  15.6M|      const bool bit = bs.getBitsNoFill(1);
   97|       |
   98|  15.6M|      if (auto sym = walkBinaryTree(bit))
  ------------------
  |  Branch (98:16): [True: 15.6M, False: 55.0k]
  ------------------
   99|  15.6M|        return *sym;
  100|  15.6M|    }
  101|       |
  102|       |    // We have either returned the found symbol, or thrown on incorrect symbol.
  103|    232|    __builtin_unreachable();
  104|  15.6M|  }
_ZZNK8rawspeed21PrefixCodeTreeDecoderINS_15BaselineCodeTagEE26finishReadingPartialSymbolINS_15BitStreamerJPEGEEENSt3__14pairINS_18AbstractPrefixCodeIS1_E10CodeSymbolEiEERT_S9_ENKUlbE_clEb:
   60|  15.6M|        -> Optional<std::pair<typename Base::CodeSymbol, int /*codeValue*/>> {
   61|  15.6M|      partial.code <<= 1;
   62|  15.6M|      partial.code |= bit;
   63|  15.6M|      partial.code_len++;
   64|       |
   65|       |      // NOTE: The order *IS* important! Left to right, zero to one!
   66|  15.6M|      const auto& newNode = top->buds[bit];
   67|       |
   68|  15.6M|      if (!newNode) {
  ------------------
  |  Branch (68:11): [True: 232, False: 15.6M]
  ------------------
   69|       |        // Got nothing in this direction.
   70|    232|        ThrowRDE("bad Huffman code: %u (len: %u)", partial.code,
  ------------------
  |  |   38|    232|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|    232|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|    232|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|    232|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   71|    232|                 partial.code_len);
   72|    232|      }
   73|       |
   74|  15.6M|      if (static_cast<typename decltype(tree)::Node::Type>(*newNode) ==
  ------------------
  |  Branch (74:11): [True: 15.6M, False: 54.8k]
  ------------------
   75|  15.6M|          decltype(tree)::Node::Type::Leaf) {
   76|       |        // Ok, great, hit a Leaf. This is it.
   77|  15.6M|        return {{partial, newNode->getAsLeaf().value}};
   78|  15.6M|      }
   79|       |
   80|       |      // Else, this is a branch, continue looking.
   81|  54.8k|      top = &(newNode->getAsBranch());
   82|  54.8k|      return std::nullopt;
   83|  15.6M|    };
_ZNK8rawspeed21PrefixCodeTreeDecoderINS_15BaselineCodeTagEE6decodeINS_15BitStreamerJPEGELb0EEEiRT_:
  153|  11.0M|  int decode(BIT_STREAM& bs) const {
  154|  11.0M|    static_assert(
  155|  11.0M|        BitStreamerTraits<BIT_STREAM>::canUseWithPrefixCodeDecoder,
  156|  11.0M|        "This BitStreamer specialization is not marked as usable here");
  157|  11.0M|    invariant(FULL_DECODE == Base::isFullDecode());
  ------------------
  |  |   27|  11.0M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (157:5): [True: 11.0M, False: 0]
  ------------------
  158|       |
  159|  11.0M|    bs.fill(32);
  160|       |
  161|  11.0M|    typename Base::CodeSymbol symbol;
  162|  11.0M|    typename Traits::CodeValueTy codeValue;
  163|  11.0M|    std::tie(symbol, codeValue) = readSymbol(bs);
  164|       |
  165|  11.0M|    return Base::template processSymbol<BIT_STREAM, FULL_DECODE>(bs, symbol,
  166|  11.0M|                                                                 codeValue);
  167|  11.0M|  }
_ZN8rawspeed21PrefixCodeTreeDecoderINS_10VC5CodeTagEE5setupEbb:
  122|    884|  void setup(bool fullDecode_, bool fixDNGBug16_) {
  123|    884|    AbstractPrefixCodeDecoder<CodeTag>::setup(fullDecode_, fixDNGBug16_);
  124|       |
  125|    884|    assert(Base::code.symbols.size() == Base::code.codeValues.size());
  ------------------
  |  Branch (125:5): [True: 884, False: 0]
  ------------------
  126|  11.1k|    for (unsigned codeIndex = 0; codeIndex != Base::code.symbols.size();
  ------------------
  |  Branch (126:34): [True: 10.2k, False: 884]
  ------------------
  127|  10.2k|         ++codeIndex)
  128|  10.2k|      tree.add(Base::code.symbols[codeIndex], Base::code.codeValues[codeIndex]);
  129|    884|  }
_ZNK8rawspeed21PrefixCodeTreeDecoderINS_10VC5CodeTagEE10readSymbolINS_14BitStreamerMSBEEENSt3__14pairINS_18AbstractPrefixCodeIS1_E10CodeSymbolEiEERT_:
  108|  27.4M|  readSymbol(BIT_STREAM& bs) const {
  109|  27.4M|    static_assert(
  110|  27.4M|        BitStreamerTraits<BIT_STREAM>::canUseWithPrefixCodeDecoder,
  111|  27.4M|        "This BitStreamer specialization is not marked as usable here");
  112|       |
  113|       |    // Start from completely unknown symbol.
  114|  27.4M|    typename Base::CodeSymbol partial;
  115|  27.4M|    partial.code_len = 0;
  116|  27.4M|    partial.code = 0;
  117|       |
  118|  27.4M|    return finishReadingPartialSymbol(bs, partial);
  119|  27.4M|  }
_ZNK8rawspeed21PrefixCodeTreeDecoderINS_10VC5CodeTagEE26finishReadingPartialSymbolINS_14BitStreamerMSBEEENSt3__14pairINS_18AbstractPrefixCodeIS1_E10CodeSymbolEiEERT_S9_:
   52|  27.4M|                             typename Base::CodeSymbol initialPartial) const {
   53|  27.4M|    typename Base::CodeSymbol partial;
   54|  27.4M|    partial.code = 0;
   55|  27.4M|    partial.code_len = 0;
   56|       |
   57|  27.4M|    const auto* top = &(tree.root->getAsBranch());
   58|       |
   59|  27.4M|    auto walkBinaryTree = [&partial, &top](bool bit)
   60|  27.4M|        -> Optional<std::pair<typename Base::CodeSymbol, int /*codeValue*/>> {
   61|  27.4M|      partial.code <<= 1;
   62|  27.4M|      partial.code |= bit;
   63|  27.4M|      partial.code_len++;
   64|       |
   65|       |      // NOTE: The order *IS* important! Left to right, zero to one!
   66|  27.4M|      const auto& newNode = top->buds[bit];
   67|       |
   68|  27.4M|      if (!newNode) {
   69|       |        // Got nothing in this direction.
   70|  27.4M|        ThrowRDE("bad Huffman code: %u (len: %u)", partial.code,
   71|  27.4M|                 partial.code_len);
   72|  27.4M|      }
   73|       |
   74|  27.4M|      if (static_cast<typename decltype(tree)::Node::Type>(*newNode) ==
   75|  27.4M|          decltype(tree)::Node::Type::Leaf) {
   76|       |        // Ok, great, hit a Leaf. This is it.
   77|  27.4M|        return {{partial, newNode->getAsLeaf().value}};
   78|  27.4M|      }
   79|       |
   80|       |      // Else, this is a branch, continue looking.
   81|  27.4M|      top = &(newNode->getAsBranch());
   82|  27.4M|      return std::nullopt;
   83|  27.4M|    };
   84|       |
   85|       |    // First, translate pre-existing code bits.
   86|  27.4M|    for (unsigned bit : initialPartial.getBitsMSB()) {
  ------------------
  |  Branch (86:23): [True: 0, False: 27.4M]
  ------------------
   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|  34.3M|    while (true) {
  ------------------
  |  Branch (92:12): [True: 34.3M, Folded]
  ------------------
   93|  34.3M|      invariant(partial.code_len <= Traits::MaxCodeLenghtBits);
  ------------------
  |  |   27|  34.3M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (93:7): [True: 34.3M, False: 0]
  ------------------
   94|       |
   95|       |      // Read one more bit
   96|  34.3M|      const bool bit = bs.getBitsNoFill(1);
   97|       |
   98|  34.3M|      if (auto sym = walkBinaryTree(bit))
  ------------------
  |  Branch (98:16): [True: 27.4M, False: 6.92M]
  ------------------
   99|  27.4M|        return *sym;
  100|  34.3M|    }
  101|       |
  102|       |    // We have either returned the found symbol, or thrown on incorrect symbol.
  103|    167|    __builtin_unreachable();
  104|  27.4M|  }
_ZZNK8rawspeed21PrefixCodeTreeDecoderINS_10VC5CodeTagEE26finishReadingPartialSymbolINS_14BitStreamerMSBEEENSt3__14pairINS_18AbstractPrefixCodeIS1_E10CodeSymbolEiEERT_S9_ENKUlbE_clEb:
   60|  34.3M|        -> Optional<std::pair<typename Base::CodeSymbol, int /*codeValue*/>> {
   61|  34.3M|      partial.code <<= 1;
   62|  34.3M|      partial.code |= bit;
   63|  34.3M|      partial.code_len++;
   64|       |
   65|       |      // NOTE: The order *IS* important! Left to right, zero to one!
   66|  34.3M|      const auto& newNode = top->buds[bit];
   67|       |
   68|  34.3M|      if (!newNode) {
  ------------------
  |  Branch (68:11): [True: 167, False: 34.3M]
  ------------------
   69|       |        // Got nothing in this direction.
   70|    167|        ThrowRDE("bad Huffman code: %u (len: %u)", partial.code,
  ------------------
  |  |   38|    167|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|    167|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|    167|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|    167|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   71|    167|                 partial.code_len);
   72|    167|      }
   73|       |
   74|  34.3M|      if (static_cast<typename decltype(tree)::Node::Type>(*newNode) ==
  ------------------
  |  Branch (74:11): [True: 27.4M, False: 6.92M]
  ------------------
   75|  34.3M|          decltype(tree)::Node::Type::Leaf) {
   76|       |        // Ok, great, hit a Leaf. This is it.
   77|  27.4M|        return {{partial, newNode->getAsLeaf().value}};
   78|  27.4M|      }
   79|       |
   80|       |      // Else, this is a branch, continue looking.
   81|  6.92M|      top = &(newNode->getAsBranch());
   82|  6.92M|      return std::nullopt;
   83|  34.3M|    };
_ZNK8rawspeed21PrefixCodeTreeDecoderINS_10VC5CodeTagEE6decodeINS_14BitStreamerMSBELb0EEEiRT_:
  153|  27.4M|  int decode(BIT_STREAM& bs) const {
  154|  27.4M|    static_assert(
  155|  27.4M|        BitStreamerTraits<BIT_STREAM>::canUseWithPrefixCodeDecoder,
  156|  27.4M|        "This BitStreamer specialization is not marked as usable here");
  157|  27.4M|    invariant(FULL_DECODE == Base::isFullDecode());
  ------------------
  |  |   27|  27.4M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (157:5): [True: 27.4M, False: 0]
  ------------------
  158|       |
  159|  27.4M|    bs.fill(32);
  160|       |
  161|  27.4M|    typename Base::CodeSymbol symbol;
  162|  27.4M|    typename Traits::CodeValueTy codeValue;
  163|  27.4M|    std::tie(symbol, codeValue) = readSymbol(bs);
  164|       |
  165|  27.4M|    return Base::template processSymbol<BIT_STREAM, FULL_DECODE>(bs, symbol,
  166|  27.4M|                                                                 codeValue);
  167|  27.4M|  }
_ZNK8rawspeed21PrefixCodeTreeDecoderINS_10VC5CodeTagEE10readSymbolINS_16BitStreamerMSB32EEENSt3__14pairINS_18AbstractPrefixCodeIS1_E10CodeSymbolEiEERT_:
  108|  26.2M|  readSymbol(BIT_STREAM& bs) const {
  109|  26.2M|    static_assert(
  110|  26.2M|        BitStreamerTraits<BIT_STREAM>::canUseWithPrefixCodeDecoder,
  111|  26.2M|        "This BitStreamer specialization is not marked as usable here");
  112|       |
  113|       |    // Start from completely unknown symbol.
  114|  26.2M|    typename Base::CodeSymbol partial;
  115|  26.2M|    partial.code_len = 0;
  116|  26.2M|    partial.code = 0;
  117|       |
  118|  26.2M|    return finishReadingPartialSymbol(bs, partial);
  119|  26.2M|  }
_ZNK8rawspeed21PrefixCodeTreeDecoderINS_10VC5CodeTagEE26finishReadingPartialSymbolINS_16BitStreamerMSB32EEENSt3__14pairINS_18AbstractPrefixCodeIS1_E10CodeSymbolEiEERT_S9_:
   52|  26.2M|                             typename Base::CodeSymbol initialPartial) const {
   53|  26.2M|    typename Base::CodeSymbol partial;
   54|  26.2M|    partial.code = 0;
   55|  26.2M|    partial.code_len = 0;
   56|       |
   57|  26.2M|    const auto* top = &(tree.root->getAsBranch());
   58|       |
   59|  26.2M|    auto walkBinaryTree = [&partial, &top](bool bit)
   60|  26.2M|        -> Optional<std::pair<typename Base::CodeSymbol, int /*codeValue*/>> {
   61|  26.2M|      partial.code <<= 1;
   62|  26.2M|      partial.code |= bit;
   63|  26.2M|      partial.code_len++;
   64|       |
   65|       |      // NOTE: The order *IS* important! Left to right, zero to one!
   66|  26.2M|      const auto& newNode = top->buds[bit];
   67|       |
   68|  26.2M|      if (!newNode) {
   69|       |        // Got nothing in this direction.
   70|  26.2M|        ThrowRDE("bad Huffman code: %u (len: %u)", partial.code,
   71|  26.2M|                 partial.code_len);
   72|  26.2M|      }
   73|       |
   74|  26.2M|      if (static_cast<typename decltype(tree)::Node::Type>(*newNode) ==
   75|  26.2M|          decltype(tree)::Node::Type::Leaf) {
   76|       |        // Ok, great, hit a Leaf. This is it.
   77|  26.2M|        return {{partial, newNode->getAsLeaf().value}};
   78|  26.2M|      }
   79|       |
   80|       |      // Else, this is a branch, continue looking.
   81|  26.2M|      top = &(newNode->getAsBranch());
   82|  26.2M|      return std::nullopt;
   83|  26.2M|    };
   84|       |
   85|       |    // First, translate pre-existing code bits.
   86|  26.2M|    for (unsigned bit : initialPartial.getBitsMSB()) {
  ------------------
  |  Branch (86:23): [True: 0, False: 26.2M]
  ------------------
   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|  26.3M|    while (true) {
  ------------------
  |  Branch (92:12): [True: 26.3M, Folded]
  ------------------
   93|  26.3M|      invariant(partial.code_len <= Traits::MaxCodeLenghtBits);
  ------------------
  |  |   27|  26.3M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (93:7): [True: 26.3M, False: 0]
  ------------------
   94|       |
   95|       |      // Read one more bit
   96|  26.3M|      const bool bit = bs.getBitsNoFill(1);
   97|       |
   98|  26.3M|      if (auto sym = walkBinaryTree(bit))
  ------------------
  |  Branch (98:16): [True: 26.2M, False: 80.6k]
  ------------------
   99|  26.2M|        return *sym;
  100|  26.3M|    }
  101|       |
  102|       |    // We have either returned the found symbol, or thrown on incorrect symbol.
  103|    144|    __builtin_unreachable();
  104|  26.2M|  }
_ZZNK8rawspeed21PrefixCodeTreeDecoderINS_10VC5CodeTagEE26finishReadingPartialSymbolINS_16BitStreamerMSB32EEENSt3__14pairINS_18AbstractPrefixCodeIS1_E10CodeSymbolEiEERT_S9_ENKUlbE_clEb:
   60|  26.3M|        -> Optional<std::pair<typename Base::CodeSymbol, int /*codeValue*/>> {
   61|  26.3M|      partial.code <<= 1;
   62|  26.3M|      partial.code |= bit;
   63|  26.3M|      partial.code_len++;
   64|       |
   65|       |      // NOTE: The order *IS* important! Left to right, zero to one!
   66|  26.3M|      const auto& newNode = top->buds[bit];
   67|       |
   68|  26.3M|      if (!newNode) {
  ------------------
  |  Branch (68:11): [True: 144, False: 26.3M]
  ------------------
   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|  26.3M|      if (static_cast<typename decltype(tree)::Node::Type>(*newNode) ==
  ------------------
  |  Branch (74:11): [True: 26.2M, False: 80.4k]
  ------------------
   75|  26.3M|          decltype(tree)::Node::Type::Leaf) {
   76|       |        // Ok, great, hit a Leaf. This is it.
   77|  26.2M|        return {{partial, newNode->getAsLeaf().value}};
   78|  26.2M|      }
   79|       |
   80|       |      // Else, this is a branch, continue looking.
   81|  80.4k|      top = &(newNode->getAsBranch());
   82|  80.4k|      return std::nullopt;
   83|  26.3M|    };
_ZNK8rawspeed21PrefixCodeTreeDecoderINS_10VC5CodeTagEE6decodeINS_16BitStreamerMSB32ELb0EEEiRT_:
  153|  26.2M|  int decode(BIT_STREAM& bs) const {
  154|  26.2M|    static_assert(
  155|  26.2M|        BitStreamerTraits<BIT_STREAM>::canUseWithPrefixCodeDecoder,
  156|  26.2M|        "This BitStreamer specialization is not marked as usable here");
  157|  26.2M|    invariant(FULL_DECODE == Base::isFullDecode());
  ------------------
  |  |   27|  26.2M|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (157:5): [True: 26.2M, False: 0]
  ------------------
  158|       |
  159|  26.2M|    bs.fill(32);
  160|       |
  161|  26.2M|    typename Base::CodeSymbol symbol;
  162|  26.2M|    typename Traits::CodeValueTy codeValue;
  163|  26.2M|    std::tie(symbol, codeValue) = readSymbol(bs);
  164|       |
  165|  26.2M|    return Base::template processSymbol<BIT_STREAM, FULL_DECODE>(bs, symbol,
  166|  26.2M|                                                                 codeValue);
  167|  26.2M|  }
_ZNK8rawspeed21PrefixCodeTreeDecoderINS_10VC5CodeTagEE10readSymbolINS_15BitStreamerJPEGEEENSt3__14pairINS_18AbstractPrefixCodeIS1_E10CodeSymbolEiEERT_:
  108|  7.39k|  readSymbol(BIT_STREAM& bs) const {
  109|  7.39k|    static_assert(
  110|  7.39k|        BitStreamerTraits<BIT_STREAM>::canUseWithPrefixCodeDecoder,
  111|  7.39k|        "This BitStreamer specialization is not marked as usable here");
  112|       |
  113|       |    // Start from completely unknown symbol.
  114|  7.39k|    typename Base::CodeSymbol partial;
  115|  7.39k|    partial.code_len = 0;
  116|  7.39k|    partial.code = 0;
  117|       |
  118|  7.39k|    return finishReadingPartialSymbol(bs, partial);
  119|  7.39k|  }
_ZNK8rawspeed21PrefixCodeTreeDecoderINS_10VC5CodeTagEE26finishReadingPartialSymbolINS_15BitStreamerJPEGEEENSt3__14pairINS_18AbstractPrefixCodeIS1_E10CodeSymbolEiEERT_S9_:
   52|  7.39k|                             typename Base::CodeSymbol initialPartial) const {
   53|  7.39k|    typename Base::CodeSymbol partial;
   54|  7.39k|    partial.code = 0;
   55|  7.39k|    partial.code_len = 0;
   56|       |
   57|  7.39k|    const auto* top = &(tree.root->getAsBranch());
   58|       |
   59|  7.39k|    auto walkBinaryTree = [&partial, &top](bool bit)
   60|  7.39k|        -> Optional<std::pair<typename Base::CodeSymbol, int /*codeValue*/>> {
   61|  7.39k|      partial.code <<= 1;
   62|  7.39k|      partial.code |= bit;
   63|  7.39k|      partial.code_len++;
   64|       |
   65|       |      // NOTE: The order *IS* important! Left to right, zero to one!
   66|  7.39k|      const auto& newNode = top->buds[bit];
   67|       |
   68|  7.39k|      if (!newNode) {
   69|       |        // Got nothing in this direction.
   70|  7.39k|        ThrowRDE("bad Huffman code: %u (len: %u)", partial.code,
   71|  7.39k|                 partial.code_len);
   72|  7.39k|      }
   73|       |
   74|  7.39k|      if (static_cast<typename decltype(tree)::Node::Type>(*newNode) ==
   75|  7.39k|          decltype(tree)::Node::Type::Leaf) {
   76|       |        // Ok, great, hit a Leaf. This is it.
   77|  7.39k|        return {{partial, newNode->getAsLeaf().value}};
   78|  7.39k|      }
   79|       |
   80|       |      // Else, this is a branch, continue looking.
   81|  7.39k|      top = &(newNode->getAsBranch());
   82|  7.39k|      return std::nullopt;
   83|  7.39k|    };
   84|       |
   85|       |    // First, translate pre-existing code bits.
   86|  7.39k|    for (unsigned bit : initialPartial.getBitsMSB()) {
  ------------------
  |  Branch (86:23): [True: 0, False: 7.39k]
  ------------------
   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|  41.3k|    while (true) {
  ------------------
  |  Branch (92:12): [True: 41.1k, Folded]
  ------------------
   93|  41.1k|      invariant(partial.code_len <= Traits::MaxCodeLenghtBits);
  ------------------
  |  |   27|  41.1k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (93:7): [True: 41.1k, False: 0]
  ------------------
   94|       |
   95|       |      // Read one more bit
   96|  41.1k|      const bool bit = bs.getBitsNoFill(1);
   97|       |
   98|  41.1k|      if (auto sym = walkBinaryTree(bit))
  ------------------
  |  Branch (98:16): [True: 7.25k, False: 33.9k]
  ------------------
   99|  7.25k|        return *sym;
  100|  41.1k|    }
  101|       |
  102|       |    // We have either returned the found symbol, or thrown on incorrect symbol.
  103|    136|    __builtin_unreachable();
  104|  7.39k|  }
_ZZNK8rawspeed21PrefixCodeTreeDecoderINS_10VC5CodeTagEE26finishReadingPartialSymbolINS_15BitStreamerJPEGEEENSt3__14pairINS_18AbstractPrefixCodeIS1_E10CodeSymbolEiEERT_S9_ENKUlbE_clEb:
   60|  41.1k|        -> Optional<std::pair<typename Base::CodeSymbol, int /*codeValue*/>> {
   61|  41.1k|      partial.code <<= 1;
   62|  41.1k|      partial.code |= bit;
   63|  41.1k|      partial.code_len++;
   64|       |
   65|       |      // NOTE: The order *IS* important! Left to right, zero to one!
   66|  41.1k|      const auto& newNode = top->buds[bit];
   67|       |
   68|  41.1k|      if (!newNode) {
  ------------------
  |  Branch (68:11): [True: 136, False: 41.0k]
  ------------------
   69|       |        // Got nothing in this direction.
   70|    136|        ThrowRDE("bad Huffman code: %u (len: %u)", partial.code,
  ------------------
  |  |   38|    136|  ThrowExceptionHelper(rawspeed::RawDecoderException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|    136|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|    136|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|    136|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   71|    136|                 partial.code_len);
   72|    136|      }
   73|       |
   74|  41.0k|      if (static_cast<typename decltype(tree)::Node::Type>(*newNode) ==
  ------------------
  |  Branch (74:11): [True: 7.25k, False: 33.7k]
  ------------------
   75|  41.0k|          decltype(tree)::Node::Type::Leaf) {
   76|       |        // Ok, great, hit a Leaf. This is it.
   77|  7.25k|        return {{partial, newNode->getAsLeaf().value}};
   78|  7.25k|      }
   79|       |
   80|       |      // Else, this is a branch, continue looking.
   81|  33.7k|      top = &(newNode->getAsBranch());
   82|  33.7k|      return std::nullopt;
   83|  41.0k|    };
_ZNK8rawspeed21PrefixCodeTreeDecoderINS_10VC5CodeTagEE6decodeINS_15BitStreamerJPEGELb0EEEiRT_:
  153|  7.51k|  int decode(BIT_STREAM& bs) const {
  154|  7.51k|    static_assert(
  155|  7.51k|        BitStreamerTraits<BIT_STREAM>::canUseWithPrefixCodeDecoder,
  156|  7.51k|        "This BitStreamer specialization is not marked as usable here");
  157|  7.51k|    invariant(FULL_DECODE == Base::isFullDecode());
  ------------------
  |  |   27|  7.51k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (157:5): [True: 7.51k, False: 0]
  ------------------
  158|       |
  159|  7.51k|    bs.fill(32);
  160|       |
  161|  7.51k|    typename Base::CodeSymbol symbol;
  162|  7.51k|    typename Traits::CodeValueTy codeValue;
  163|  7.51k|    std::tie(symbol, codeValue) = readSymbol(bs);
  164|       |
  165|  7.51k|    return Base::template processSymbol<BIT_STREAM, FULL_DECODE>(bs, symbol,
  166|  7.51k|                                                                 codeValue);
  167|  7.51k|  }

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

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

_ZN8rawspeed6BufferC2EPKhj:
   68|  3.17k|      : Buffer(Array1DRef(data_, implicit_cast<int>(size_))) {}
_ZN8rawspeed6BufferC2ENS_10Array1DRefIKhEE:
   62|  92.7k|      : data(data_.begin()), size(data_.size()) {
   63|  92.7k|    assert(data);
  ------------------
  |  Branch (63:5): [True: 92.7k, False: 0]
  ------------------
   64|  92.7k|    assert(!ASan::RegionIsPoisoned(data, size));
  ------------------
  |  Branch (64:5): [True: 92.7k, False: 0]
  ------------------
   65|  92.7k|  }
_ZN8rawspeed10DataBufferC2ENS_6BufferENS_10EndiannessE:
  142|  9.05k|      : Buffer(data_), endianness(endianness_) {}
_ZNK8rawspeed10DataBuffer3getIhEET_jj:
  147|  44.5k|  [[nodiscard]] T get(size_type offset, size_type index = 0) const {
  148|  44.5k|    assert(Endianness::unknown != endianness);
  ------------------
  |  Branch (148:5): [True: 44.5k, False: 0]
  ------------------
  149|  44.5k|    assert(Endianness::little == endianness || Endianness::big == endianness);
  ------------------
  |  Branch (149:5): [True: 44.5k, False: 0]
  |  Branch (149:5): [True: 0, False: 0]
  |  Branch (149:5): [True: 44.5k, False: 0]
  ------------------
  150|       |
  151|  44.5k|    return Buffer::get<T>(getHostEndianness() == endianness, offset, index);
  152|  44.5k|  }
_ZNK8rawspeed6Buffer3getIhEET_bjj:
  108|  44.5k|                      size_type index = 0) const {
  109|  44.5k|    const Buffer buf =
  110|  44.5k|        getSubView(offset + (index * static_cast<size_type>(sizeof(T))),
  111|  44.5k|                   static_cast<size_type>(sizeof(T)));
  112|  44.5k|    return getByteSwapped<T>(buf.begin(), !inNativeByteOrder);
  113|  44.5k|  }
_ZNK8rawspeed6Buffer10getSubViewEjj:
   78|  90.1k|  [[nodiscard]] Buffer getSubView(size_type offset, size_type size_) const {
   79|  90.1k|    if (!isValid(offset, size_))
  ------------------
  |  Branch (79:9): [True: 561, False: 89.5k]
  ------------------
   80|  90.1k|      ThrowIOE("Buffer overflow: image file may be truncated");
  ------------------
  |  |   37|    561|#define ThrowIOE(...) ThrowExceptionHelper(rawspeed::IOException, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   84|    561|  rawspeed::ThrowException<CLASS>("%s, line " STR(__LINE__) ": " fmt,          \
  |  |  |  |   85|    561|                                  __PRETTY_FUNCTION__ __VA_OPT__(, )           \
  |  |  |  |   86|    561|                                      __VA_ARGS__)
  |  |  ------------------
  ------------------
   81|       |
   82|  89.5k|    return getAsArray1DRef().getCrop(offset, size_).getAsArray1DRef();
   83|  90.1k|  }
_ZNK8rawspeed6Buffer7isValidEjj:
  117|  97.6k|  [[nodiscard]] bool isValid(size_type offset, size_type count = 1) const {
  118|  97.6k|    return static_cast<uint64_t>(offset) + count <=
  119|  97.6k|           static_cast<uint64_t>(getSize());
  120|  97.6k|  }
_ZNK8rawspeed6Buffer7getSizeEv:
  115|   128k|  [[nodiscard]] size_type RAWSPEED_READONLY getSize() const { return size; }
_ZNK8rawspeed6Buffer15getAsArray1DRefEv:
   70|   179k|  [[nodiscard]] Array1DRef<const uint8_t> getAsArray1DRef() const {
   71|   179k|    return {data, implicit_cast<int>(size)};
   72|   179k|  }
_ZNK8rawspeed6Buffer5beginEv:
   99|  81.1k|  [[nodiscard]] const uint8_t* begin() const {
  100|  81.1k|    return getAsArray1DRef().begin();
  101|  81.1k|  }
_ZNK8rawspeed6Buffer3endEv:
  102|  5.97k|  [[nodiscard]] const uint8_t* end() const { return getAsArray1DRef().end(); }
_ZNK8rawspeed10DataBuffer12getByteOrderEv:
  154|  5.88k|  [[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|  9.05k|  explicit ByteStream(DataBuffer buffer) : DataBuffer(buffer) {}
_ZN8rawspeed10ByteStream7getByteEv:
  186|  24.3k|  uint8_t getByte() { return get<uint8_t>(); }
_ZN8rawspeed10ByteStream3getIhEET_v:
  159|  44.5k|  template <typename T> T get() {
  160|  44.5k|    auto ret = peek<T>();
  161|  44.5k|    pos += sizeof(T);
  162|  44.5k|    return ret;
  163|  44.5k|  }
_ZNK8rawspeed10ByteStream4peekIhEET_j:
  156|  44.5k|  template <typename T> [[nodiscard]] T peek(size_type i = 0) const {
  157|  44.5k|    return DataBuffer::get<T>(pos, i);
  158|  44.5k|  }
_ZN8rawspeed10ByteStream9getBufferEj:
  103|  6.00k|  Buffer getBuffer(size_type size_) {
  104|  6.00k|    Buffer ret = peekBuffer(size_);
  105|  6.00k|    pos += size_;
  106|  6.00k|    return ret;
  107|  6.00k|  }
_ZNK8rawspeed10ByteStream10peekBufferEj:
  100|  6.00k|  [[nodiscard]] Buffer peekBuffer(size_type size_) const {
  101|  6.00k|    return getSubView(pos, size_);
  102|  6.00k|  }
_ZN8rawspeed10ByteStream9getStreamEjj:
  124|  5.91k|  ByteStream getStream(size_type nmemb, size_type size_) {
  125|  5.91k|    if (size_ && nmemb > std::numeric_limits<size_type>::max() / size_)
  ------------------
  |  Branch (125:9): [True: 5.91k, False: 0]
  |  Branch (125:18): [True: 0, False: 5.91k]
  ------------------
  126|  5.91k|      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.91k|    return getStream(nmemb * size_);
  128|  5.91k|  }
_ZN8rawspeed10ByteStream9getStreamEj:
  119|  5.91k|  ByteStream getStream(size_type size_) {
  120|  5.91k|    ByteStream ret = peekStream(size_);
  121|  5.91k|    pos += size_;
  122|  5.91k|    return ret;
  123|  5.91k|  }
_ZNK8rawspeed10ByteStream10peekStreamEj:
  111|  5.91k|  [[nodiscard]] ByteStream peekStream(size_type size_) const {
  112|  5.91k|    return getSubStream(pos, size_);
  113|  5.91k|  }
_ZNK8rawspeed10ByteStream12getSubStreamEjj:
   55|  5.91k|                                        size_type size_) const {
   56|  5.91k|    return ByteStream(DataBuffer(getSubView(offset, size_), getByteOrder()));
   57|  5.91k|  }
_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|  5.02k|  [[nodiscard]] size_type getPosition() const {
   79|  5.02k|    invariant(getSize() >= pos);
  ------------------
  |  |   27|  5.02k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (79:5): [True: 5.02k, False: 0]
  ------------------
   80|  5.02k|    (void)check(0);
   81|  5.02k|    return pos;
   82|  5.02k|  }
_ZNK8rawspeed10ByteStream5checkEj:
   63|  7.53k|  [[nodiscard]] size_type check(size_type bytes) const {
   64|  7.53k|    if (!isValid(pos, bytes))
  ------------------
  |  Branch (64:9): [True: 0, False: 7.53k]
  ------------------
   65|  7.53k|      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.53k|    [[maybe_unused]] Buffer tmp = getSubView(pos, bytes);
   67|  7.53k|    assert(tmp.getSize() == bytes);
  ------------------
  |  Branch (67:5): [True: 7.53k, False: 0]
  ------------------
   68|  7.53k|    assert(!ASan::RegionIsPoisoned(tmp.begin(), tmp.getSize()));
  ------------------
  |  Branch (68:5): [True: 7.53k, False: 0]
  ------------------
   69|  7.53k|    return bytes;
   70|  7.53k|  }
_ZNK8rawspeed10ByteStream19peekRemainingBufferEv:
  108|  2.51k|  [[nodiscard]] Buffer peekRemainingBuffer() const {
  109|  2.51k|    return getSubView(pos, getRemainSize());
  110|  2.51k|  }
_ZNK8rawspeed10ByteStream13getRemainSizeEv:
   87|  2.51k|  [[nodiscard]] size_type RAWSPEED_READONLY getRemainSize() const {
   88|  2.51k|    invariant(getSize() >= pos);
  ------------------
  |  |   27|  2.51k|#define invariant(expr) assert(expr)
  ------------------
  |  Branch (88:5): [True: 2.51k, False: 0]
  ------------------
   89|  2.51k|    (void)check(0);
   90|  2.51k|    return getSize() - pos;
   91|  2.51k|  }

_ZN8rawspeed14getByteSwappedIhEET_PKvb:
  100|  44.0k|template <typename T> inline T getByteSwapped(const void* data, bool bswap) {
  101|  44.0k|  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|  44.0k|  memcpy(&ret, data, sizeof(T));
  106|  44.0k|  return bswap ? getByteSwapped(ret) : ret;
  ------------------
  |  Branch (106:10): [True: 0, False: 44.0k]
  ------------------
  107|  44.0k|}
_ZN8rawspeed17getHostEndiannessEv:
   63|  22.9M|inline Endianness getHostEndianness() {
   64|  22.9M|#if defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
   65|  22.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|  22.9M|}
_ZN8rawspeed14getByteSwappedIjEET_PKvb:
  100|  22.8M|template <typename T> inline T getByteSwapped(const void* data, bool bswap) {
  101|  22.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|  22.8M|  memcpy(&ret, data, sizeof(T));
  106|  22.8M|  return bswap ? getByteSwapped(ret) : ret;
  ------------------
  |  Branch (106:10): [True: 14.7M, False: 8.11M]
  ------------------
  107|  22.8M|}
_ZN8rawspeed14getByteSwappedEj:
   84|  14.7M|inline uint32_t getByteSwapped(uint32_t v) { return BSWAP32(v); }
  ------------------
  |  |   37|  14.7M|#define BSWAP32(A) __builtin_bswap32(A)
  ------------------

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

_ZNSt3__122__libcpp_aligned_allocB8ne180100Emm:
   30|  5.49k|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.49k|  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.49k|  return ::aligned_alloc(__alignment, __size > __rounded_size ? __size : __rounded_size);
  ------------------
  |  Branch (43:39): [True: 0, False: 5.49k]
  ------------------
   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.49k|}
_ZNSt3__121__libcpp_aligned_freeB8ne180100EPv:
   52|  5.49k|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.49k|  ::free(__ptr);
   57|  5.49k|#  endif
   58|  5.49k|}

_ZNSt3__121__libcpp_execute_onceB8ne180100EPiPFvvE:
  302|  20.3k|int __libcpp_execute_once(__libcpp_exec_once_flag* __flag, void (*__init_routine)()) {
  303|  20.3k|  return pthread_once(__flag, __init_routine);
  304|  20.3k|}
_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|  20.3k|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|  46.8k|    _LIBCPP_HIDE_FROM_ABI _LIBCPP_ALWAYS_INLINE static bool __eq(__type_name_t __lhs, __type_name_t __rhs) _NOEXCEPT {
  204|  46.8k|      return __lhs == __rhs;
  205|  46.8k|    }
_ZNKSt9type_infoeqB8ne180100ERKS_:
  302|  46.8k|  _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|  46.8k|    if (__libcpp_is_constant_evaluated()) {
  ------------------
  |  Branch (305:9): [Folded, False: 46.8k]
  ------------------
  306|      0|      return this == &__arg;
  307|      0|    }
  308|  46.8k|    return __impl::__eq(__type_name, __arg.__type_name);
  309|  46.8k|  }

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

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

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

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

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

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

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

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

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

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

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

